File tree 1 file changed +20
-1
lines changed
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 {
851
851
}
852
852
853
853
/// Represents the interrupt stack frame pushed by the CPU on interrupt or exception entry.
854
- #[ derive( Clone ) ]
854
+ #[ derive( Clone , Copy ) ]
855
855
#[ repr( C ) ]
856
856
pub struct InterruptStackFrameValue {
857
857
/// This value points to the instruction that should be executed when the interrupt
@@ -1115,4 +1115,23 @@ mod test {
1115
1115
phantom : PhantomData ,
1116
1116
} )
1117
1117
}
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
+ }
1118
1137
}
You can’t perform that action at this time.
0 commit comments