File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -851,7 +851,7 @@ impl fmt::Debug for InterruptStackFrame {
851851}
852852
853853/// Represents the interrupt stack frame pushed by the CPU on interrupt or exception entry.
854- #[ derive( Clone ) ]
854+ #[ derive( Clone , Copy ) ]
855855#[ repr( C ) ]
856856pub struct InterruptStackFrameValue {
857857 /// This value points to the instruction that should be executed when the interrupt
@@ -1115,4 +1115,23 @@ mod test {
11151115 phantom : PhantomData ,
11161116 } )
11171117 }
1118+
1119+ #[ test]
1120+ fn isr_frame_manipulation ( ) {
1121+ let mut frame = InterruptStackFrame {
1122+ value : InterruptStackFrameValue {
1123+ instruction_pointer : VirtAddr :: new ( 0x1000 ) ,
1124+ code_segment : 0 ,
1125+ cpu_flags : 0 ,
1126+ stack_pointer : VirtAddr :: new ( 0x2000 ) ,
1127+ stack_segment : 0 ,
1128+ } ,
1129+ } ;
1130+
1131+ unsafe {
1132+ frame
1133+ . as_mut ( )
1134+ . update ( |f| f. instruction_pointer = f. instruction_pointer + 2u64 ) ;
1135+ }
1136+ }
11181137}
You can’t perform that action at this time.
0 commit comments