File tree 4 files changed +46
-52
lines changed
0x03/pkg/kernel/src/utils 4 files changed +46
-52
lines changed Original file line number Diff line number Diff line change 79
79
macro_rules! as_handler {
80
80
($ fn : ident ) => {
81
81
paste :: item! {
82
- #[naked]
82
+ #[unsafe ( naked) ]
83
83
pub extern " x86-interrupt" fn [<$ fn _handler >](_sf : InterruptStackFrame ) {
84
- unsafe {
85
- core :: arch :: naked_asm! ("
86
- push rbp
87
- // ...
88
- push r15
89
- call {}
90
- pop r15
91
- // ...
92
- pop rbp
93
- iretq" ,
94
- sym $ fn );
95
- }
84
+ core :: arch :: naked_asm! ("
85
+ push rbp
86
+ // ...
87
+ push r15
88
+ call {}
89
+ pop r15
90
+ // ...
91
+ pop rbp
92
+ iretq" ,
93
+ sym $ fn );
96
94
}
97
95
}
98
96
};
Original file line number Diff line number Diff line change 1
1
#![ no_std]
2
- #![ feature( naked_functions) ]
3
2
#![ feature( abi_x86_interrupt) ]
4
3
#![ feature( type_alias_impl_trait) ]
5
4
Original file line number Diff line number Diff line change 1
1
#![ no_std]
2
2
#![ allow( dead_code) ]
3
- #![ feature( naked_functions) ]
4
3
#![ feature( abi_x86_interrupt) ]
5
4
#![ feature( alloc_error_handler) ]
6
5
#![ feature( type_alias_impl_trait) ]
Original file line number Diff line number Diff line change @@ -46,44 +46,42 @@ impl fmt::Debug for RegistersValue {
46
46
macro_rules! as_handler {
47
47
( $fn: ident) => {
48
48
paste:: item! {
49
- #[ naked]
49
+ #[ unsafe ( naked) ]
50
50
pub extern "x86-interrupt" fn [ <$fn _handler>] ( _sf: InterruptStackFrame ) {
51
- unsafe {
52
- core:: arch:: naked_asm!( "
53
- push rbp
54
- push rax
55
- push rbx
56
- push rcx
57
- push rdx
58
- push rsi
59
- push rdi
60
- push r8
61
- push r9
62
- push r10
63
- push r11
64
- push r12
65
- push r13
66
- push r14
67
- push r15
68
- call {}
69
- pop r15
70
- pop r14
71
- pop r13
72
- pop r12
73
- pop r11
74
- pop r10
75
- pop r9
76
- pop r8
77
- pop rdi
78
- pop rsi
79
- pop rdx
80
- pop rcx
81
- pop rbx
82
- pop rax
83
- pop rbp
84
- iretq" ,
85
- sym $fn) ;
86
- }
51
+ core:: arch:: naked_asm!( "
52
+ push rbp
53
+ push rax
54
+ push rbx
55
+ push rcx
56
+ push rdx
57
+ push rsi
58
+ push rdi
59
+ push r8
60
+ push r9
61
+ push r10
62
+ push r11
63
+ push r12
64
+ push r13
65
+ push r14
66
+ push r15
67
+ call {}
68
+ pop r15
69
+ pop r14
70
+ pop r13
71
+ pop r12
72
+ pop r11
73
+ pop r10
74
+ pop r9
75
+ pop r8
76
+ pop rdi
77
+ pop rsi
78
+ pop rdx
79
+ pop rcx
80
+ pop rbx
81
+ pop rax
82
+ pop rbp
83
+ iretq" ,
84
+ sym $fn) ;
87
85
}
88
86
}
89
87
} ;
You can’t perform that action at this time.
0 commit comments