File tree Expand file tree Collapse file tree 2 files changed +20
-4
lines changed
src/constance_port_arm/src Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,18 @@ register::register_bitfields! {u32,
34
34
V OFFSET ( 13 ) NUMBITS ( 1 ) [
35
35
Low = 0 ,
36
36
High = 1
37
+ ] ,
38
+
39
+ /// Access flag enable
40
+ AFE OFFSET ( 29 ) NUMBITS ( 1 ) [
41
+ Disable = 0 ,
42
+ Enable = 1
43
+ ] ,
44
+
45
+ /// Thumb Exception Enable
46
+ TE OFFSET ( 30 ) NUMBITS ( 1 ) [
47
+ Arm = 0 ,
48
+ Thumb = 1
37
49
]
38
50
]
39
51
}
Original file line number Diff line number Diff line change @@ -170,7 +170,11 @@ extern "C" fn reset_handler1<System: EntryPoint + StartupOptions>() {
170
170
// Enable alignment fault checking
171
171
arm:: SCTLR :: A :: Enable +
172
172
// Enable branch prediction
173
- arm:: SCTLR :: Z :: Enable ,
173
+ arm:: SCTLR :: Z :: Enable +
174
+ // Disable access flags in a page table
175
+ arm:: SCTLR :: AFE :: Disable +
176
+ // Exceptions are taken in Arm state
177
+ arm:: SCTLR :: TE :: Arm ,
174
178
) ;
175
179
176
180
// Ensure the changes made to `SCTLR` here take effect immediately
@@ -365,8 +369,8 @@ impl FirstLevelPageEntry {
365
369
/// Construct a page table entry.
366
370
const fn page_table ( table : * const SecondLevelPageTable ) -> Self {
367
371
let domain = 0u32 ;
368
- let ns = true ; // Non- Secure access
369
- let pxn = false ; // not using Large Physical Address Extension
372
+ let ns = false ; // Secure access
373
+ let pxn = false ; // not enabling Privilege Execute Never
370
374
371
375
Self {
372
376
// Assuming physical address == virtual address for `table`
@@ -387,7 +391,7 @@ impl FirstLevelPageEntry {
387
391
xn,
388
392
} = attr;
389
393
let domain = 0u32 ;
390
- let ns = true ; // Non- Secure access
394
+ let ns = false ; // Secure access
391
395
let ng = false ; // global (not Not-Global)
392
396
let pxn = false ; // not using Large Physical Address Extension
393
397
You can’t perform that action at this time.
0 commit comments