Skip to content

Commit b508b92

Browse files
Fix broken attributes (#50)
* fix: sync attribute changes by toolchain updates See rust-lang/rust#134213 for details. --------- Co-authored-by: John Smith <johnsmith0x3f@gmail.com>
1 parent 255581d commit b508b92

File tree

4 files changed

+46
-52
lines changed

4 files changed

+46
-52
lines changed

docs/labs/0x03/tasks.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,18 @@
7979
macro_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
};

src/0x01/pkg/kernel/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![no_std]
2-
#![feature(naked_functions)]
32
#![feature(abi_x86_interrupt)]
43
#![feature(type_alias_impl_trait)]
54

src/0x02/pkg/kernel/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
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)]

src/0x03/pkg/kernel/src/utils/regs.rs

Lines changed: 35 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -46,44 +46,42 @@ impl fmt::Debug for RegistersValue {
4646
macro_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
};

0 commit comments

Comments
 (0)