diff options
Diffstat (limited to 'translation_table_descriptors.h')
-rw-r--r-- | translation_table_descriptors.h | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/translation_table_descriptors.h b/translation_table_descriptors.h index 8f92473..975ab61 100644 --- a/translation_table_descriptors.h +++ b/translation_table_descriptors.h @@ -11,6 +11,27 @@ // meanings depending on settings in coprocessor registers... (yeah, ARM // looks a bit messy... all for backward compatibility, i guess) + +typedef struct +{ + uint32_t Bits_1_0 : 1; // bits 1:0 + uint32_t PXN : 1; // bit 2 + uint32_t NS : 1; // bit 3 + uint32_t SBZ : 1; // bit 4 + uint32_t Domain_3_0 : 4; // bits 8:5 + uint32_t Bit_9 : 1; // bit 9 + uint32_t Bits_31_10 : 22; // bits 31:10 +#define DESCRIPTOR_TYPE_1_0 Bits_1_0 +#define PRIVILEGED_EXECUTE_NEVER_BIT PXN +#define NON_SECURE_BIT NS + // me thinks SBZ means "should be zero", + // but me sees no point #defining it +#define DOMAIN_3_0 Domain_3_0 +#define IMPLEMENTATION_DEFINED_BIT Bit_9 +#define PAGE_TABLE_BASE_ADDRESS_31_10 Bits_31_10 +} short_page_table_descriptor_t; + + typedef struct { uint32_t PXN : 1; // bit 0 @@ -28,20 +49,21 @@ typedef struct uint32_t Bit_18 : 1; // bit 18 uint32_t NS : 1; // bit 19 uint32_t PA_31_20 : 12; // bits 31:20 -#define PRIVILEGED_EXECUTE_NEVER_BIT PXN -#define DESCRIPTOR_TYPE_2 Bit_1 + // some of these are already defined the same for page table + //#define PRIVILEGED_EXECUTE_NEVER_BIT PXN +#define DESCRIPTOR_TYPE_1 Bit_1 #define BUFFERABLE_BIT B #define CACHEABLE_BIT C #define EXECUTE_NEVER_BIT XN -#define DOMAIN_3_0 Domain_3_0 -#define IMPLEMENTATION_DEFINED_BIT Bit_9 + //#define DOMAIN_3_0 Domain_3_0 + //#define IMPLEMENTATION_DEFINED_BIT Bit_9 #define ACCESS_PERMISSIONS_1_0 AP_1_0 #define TYPE_EXTENSION_2_0 TEX_2_0 #define ACCESS_PERMISSIONS_2 AP_2 #define SHAREABLE_BIT S #define NON_GLOBAL_BIT nG #define SECTION_OR_SUPERSECTION_BIT Bit_18 -#define NON_SECURE_BIT NS + //#define NON_SECURE_BIT NS #define SECTION_BASE_ADDRESS_31_20 PA_31_20 } short_section_descriptor_t; @@ -79,6 +101,7 @@ typedef struct #define DESCRIBES_SECTION 0b0 #define DESCRIBES_SUPERSECTION 0b1 + typedef struct { uint32_t PXN : 1; // bit 0 @@ -99,7 +122,7 @@ typedef struct uint32_t PA_31_24 : 8; // bits 31:24 // most of these are already defined the same for section //#define PRIVILEGED_EXECUTE_NEVER_BIT PXN - //#define DESCRIPTOR_TYPE_2 Bit_1 + //#define DESCRIPTOR_TYPE_1 Bit_1 //#define BUFFERABLE_BIT B //#define CACHEABLE_BIT C //#define EXECUTE_NEVER_BIT XN |