restructure the aa64 isa related header files.
authorLunaixsky <lunaixsky@qq.com>
Sun, 29 Sep 2024 15:44:42 +0000 (16:44 +0100)
committerLunaixsky <lunaixsky@qq.com>
Sun, 29 Sep 2024 15:44:42 +0000 (16:44 +0100)
lunaix-os/arch/aarch64/includes/asm/aa64.h
lunaix-os/arch/aarch64/includes/asm/aa64_asm.h [new file with mode: 0644]
lunaix-os/arch/aarch64/includes/asm/aa64_mmu.h
lunaix-os/arch/aarch64/includes/asm/aa64_msrs.h
lunaix-os/arch/aarch64/includes/asm/aa64_sysinst.h

index 3452993c66740e4074dc8247b30b206e13d047ff..d9e8d9ac4153fb6c9e330a9bd3885d57cb110087 100644 (file)
@@ -1,7 +1,9 @@
 #ifndef __LUNAIX_AA64_H
 #define __LUNAIX_AA64_H
 
+#include "aa64_asm.h"
 #include "aa64_mmu.h"
 #include "aa64_msrs.h"
+#include "aa64_sysinst.h"
 
 #endif /* __LUNAIX_AA64_H */
diff --git a/lunaix-os/arch/aarch64/includes/asm/aa64_asm.h b/lunaix-os/arch/aarch64/includes/asm/aa64_asm.h
new file mode 100644 (file)
index 0000000..1682de7
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef __LUNAIX_AA64_ASM_H
+#define __LUNAIX_AA64_ASM_H
+
+#include <lunaix/compiler.h>
+
+#define __sr_encode(op0, op1, crn, crm, op2)    \
+            s##op0##_##op1##_c##crn##_c##crm##_##op2
+
+#endif /* __LUNAIX_AA64_ASM_H */
index 971c1b835f56744741eacc5871a963bc91cc9ce1..25885cf09193e1201c291e2624f45ab0b40d929d 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef __LUNAIX_AA64_MMU_H
 #define __LUNAIX_AA64_MMU_H
 
+#include "aa64_asm.h"
+
 #if    defined(CONFIG_AA64_PAGE_GRAN_4K)
 #define _MMU_TG    0b01
 #elif  defined(CONFIG_AA64_PAGE_GRAN_16K)
 #define _MMU_USE_OA52
 #endif
 
+
+#define TCR_DS              (1UL << 59)
+#define TCR_E0PD1           (1UL << 56)
+#define TCR_E0PD0           (1UL << 55)
+#define TCR_TBID1           (1UL << 52)
+#define TCR_TBID0           (1UL << 51)
+#define TCR_HPD1            (1UL << 42)
+#define TCR_HPD0            (1UL << 41)
+#define TCR_HD              (1UL << 40)
+#define TCR_HA              (1UL << 39)
+#define TCR_TBI1            (1UL << 38)
+#define TCR_TBI0            (1UL << 37)
+#define TCR_AS              (1UL << 36)
+
+#define TCR_G4K             (0b01)
+#define TCR_G16K            (0b10)
+#define TCR_G64K            (0b11)
+
+#define TCR_SHNS            (0b01)
+#define TCR_SHOS            (0b10)
+#define TCR_SHIS            (0b11)
+
+#define TCR_TG1(g)          (((g) & 0b11) << 30)
+#define TCR_TG0(g)          (((g) & 0b11) << 14)
+
+#define TCR_T1SZ(sz)        (((sz) & 0b111111) << 16)
+#define TCR_T0SZ(sz)        (((sz) & 0b111111))
+
+#define TCR_EPD1            (1UL << 23)
+#define TCR_EPD0            (1UL << 7)
+#define TCR_A1              (1UL << 22)
+
 #endif /* __LUNAIX_AA64_MMU_H */
index cd8978d71f1fe45f9453936633df0f4384761220..d15b11ebf4ccd776252b65e3a8d1bd7348664001 100644 (file)
@@ -1,10 +1,7 @@
 #ifndef __LUNAIX_AA64_MSRS_H
 #define __LUNAIX_AA64_MSRS_H
 
-#include <lunaix/compiler.h>
-
-#define __sr_encode(op0, op1, crn, crm, op2)    \
-            s##op0##_##op1##_c##crn##_c##crm##_##op2
+#include "aa64_asm.h"
 
 #define SCTLR_EL1       __sr_encode(3, 0,  1,  0, 0)
 #define TCR_EL1         __sr_encode(3, 0,  2,  0, 2)
 #define SCTRL_A             (1UL << 1)
 #define SCTRL_M             (1UL << 0)
 
-#define TCR_DS              (1UL << 59)
-#define TCR_E0PD1           (1UL << 56)
-#define TCR_E0PD0           (1UL << 55)
-#define TCR_TBID1           (1UL << 52)
-#define TCR_TBID0           (1UL << 51)
-#define TCR_HPD1            (1UL << 42)
-#define TCR_HPD0            (1UL << 41)
-#define TCR_HD              (1UL << 40)
-#define TCR_HA              (1UL << 39)
-#define TCR_TBI1            (1UL << 38)
-#define TCR_TBI0            (1UL << 37)
-#define TCR_AS              (1UL << 36)
-
-#define TCR_G4K             (0b01)
-#define TCR_G16K            (0b10)
-#define TCR_G64K            (0b11)
-
-#define TCR_SHNS            (0b01)
-#define TCR_SHOS            (0b10)
-#define TCR_SHIS            (0b11)
-
-#define TCR_TG1(g)          (((g) & 0b11) << 30)
-#define TCR_TG0(g)          (((g) & 0b11) << 14)
-
-#define TCR_T1SZ(sz)        (((sz) & 0b111111) << 16)
-#define TCR_T0SZ(sz)        (((sz) & 0b111111))
-
-#define TCR_EPD1            (1UL << 23)
-#define TCR_EPD0            (1UL << 7)
-#define TCR_A1              (1UL << 22)
 
 #endif /* __LUNAIX_AA64_MSRS_H */
index 96cb7ca7efac1fb7e57b32fb7fd64d6213d02e8d..eaea5416cb0043e88043a4eb1326d9af95d033b0 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __LUNAIX_AA64_SYSINST_H
 #define __LUNAIX_AA64_SYSINST_H
 
-#include "aa64_msrs.h"
+#include "aa64_asm.h"
 
 #define tlbi_alle1      __sr_encode(1, 4, 8, 7, 4)
 #define tlbi_aside1     __sr_encode(1, 0, 8, 7, 2)