File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ impl fmt::Debug for TrapFrame {
2525 }
2626 writeln ! ( f, " elr: {:#x}," , self . elr) ?;
2727 writeln ! ( f, " spsr: {:#x}," , self . spsr) ?;
28+ writeln ! ( f, " pad: {:#x}," , self . __pad) ?;
2829 write ! ( f, "}}" ) ?;
2930 Ok ( ( ) )
3031 }
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ use crate::{trap::PageFaultFlags, TrapFrame};
1212pub use crate :: uspace_common:: { ExceptionKind , ReturnReason } ;
1313
1414/// Context to enter user space.
15- #[ repr( C ) ]
15+ #[ repr( C , align ( 16 ) ) ]
1616#[ derive( Debug , Clone , Copy ) ]
1717pub struct UserContext {
1818 tf : TrapFrame ,
@@ -23,6 +23,7 @@ pub struct UserContext {
2323}
2424
2525impl UserContext {
26+ const PAD_MAGIC : u64 = 0x1234_5678_9abc_def0 ;
2627 /// Creates a new context with the given entry point, user stack pointer,
2728 /// and the argument.
2829 pub fn new ( entry : usize , ustack_top : VirtAddr , arg0 : usize ) -> Self {
@@ -39,7 +40,7 @@ impl UserContext {
3940 + SPSR_EL1 :: I :: Unmasked
4041 + SPSR_EL1 :: F :: Masked )
4142 . value ,
42- __pad : 0 ,
43+ __pad : Self :: PAD_MAGIC ,
4344 } ,
4445 sp : ustack_top. as_usize ( ) as _ ,
4546 tpidr : 0 ,
You can’t perform that action at this time.
0 commit comments