File tree Expand file tree Collapse file tree 4 files changed +46
-52
lines changed
0x03/pkg/kernel/src/utils Expand file tree Collapse file tree 4 files changed +46
-52
lines changed Original file line number Diff line number Diff line change 7979macro_rules! as_handler {
8080 ($ fn : ident ) => {
8181 paste :: item! {
82- #[naked]
82+ #[unsafe ( naked) ]
8383 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 );
9694 }
9795 }
9896 };
Original file line number Diff line number Diff line change 11#![ no_std]
2- #![ feature( naked_functions) ]
32#![ feature( abi_x86_interrupt) ]
43#![ feature( type_alias_impl_trait) ]
54
Original file line number Diff line number Diff line change 11#![ no_std]
22#![ allow( dead_code) ]
3- #![ feature( naked_functions) ]
43#![ feature( abi_x86_interrupt) ]
54#![ feature( alloc_error_handler) ]
65#![ feature( type_alias_impl_trait) ]
Original file line number Diff line number Diff line change @@ -46,44 +46,42 @@ impl fmt::Debug for RegistersValue {
4646macro_rules! as_handler {
4747 ( $fn: ident) => {
4848 paste:: item! {
49- #[ naked]
49+ #[ unsafe ( naked) ]
5050 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) ;
8785 }
8886 }
8987 } ;
You can’t perform that action at this time.
0 commit comments