@@ -5,7 +5,7 @@ use crate::{HalBasicConfig, HalFlashConfig, HalPatchCfg};
5
5
all( feature = "bl808-mcu" , target_arch = "riscv32" ) ,
6
6
all( feature = "bl808-dsp" , target_arch = "riscv64" )
7
7
) ) ]
8
- use core:: arch:: asm ;
8
+ use core:: arch:: naked_asm ;
9
9
use core:: ops:: Deref ;
10
10
11
11
#[ cfg( all( feature = "bl808-mcu" , target_arch = "riscv32" ) ) ]
@@ -17,7 +17,7 @@ unsafe extern "C" fn start() -> ! {
17
17
const LEN_STACK_MCU : usize = 1 * 1024 ;
18
18
#[ link_section = ".bss.uninit" ]
19
19
static mut STACK : Stack < LEN_STACK_MCU > = Stack ( [ 0 ; LEN_STACK_MCU ] ) ;
20
- asm ! (
20
+ naked_asm ! (
21
21
" la sp, {stack}
22
22
li t0, {hart_stack_size}
23
23
add sp, sp, t0" ,
@@ -57,7 +57,6 @@ unsafe extern "C" fn start() -> ! {
57
57
stack_protect_pmp_address_end = const { 0x62030000 } ,
58
58
stack_protect_pmp_flags = const 0b00001000 , // -r, -w, -x, tor, not locked
59
59
main = sym main,
60
- options( noreturn)
61
60
)
62
61
}
63
62
@@ -70,7 +69,7 @@ unsafe extern "C" fn start() -> ! {
70
69
const LEN_STACK_DSP : usize = 4 * 1024 ;
71
70
#[ link_section = ".bss.uninit" ]
72
71
static mut STACK : Stack < LEN_STACK_DSP > = Stack ( [ 0 ; LEN_STACK_DSP ] ) ;
73
- asm ! (
72
+ naked_asm ! (
74
73
" la sp, {stack}
75
74
li t0, {hart_stack_size}
76
75
add sp, sp, t0" ,
@@ -106,7 +105,6 @@ unsafe extern "C" fn start() -> ! {
106
105
stack_protect_pmp_address = const { ( 0x3E000000 >> 2 ) + ( 16 * 1024 * 1024 >> 3 ) - 1 } ,
107
106
stack_protect_pmp_flags = const 0b00011000 , // -r, -w, -x, napot, not locked
108
107
main = sym main,
109
- options( noreturn)
110
108
)
111
109
}
112
110
@@ -127,7 +125,7 @@ extern "Rust" {
127
125
#[ link_section = ".trap.trap-entry" ]
128
126
#[ naked]
129
127
unsafe extern "C" fn trap_vectored ( ) -> ! {
130
- asm ! (
128
+ naked_asm ! (
131
129
".p2align 2" ,
132
130
"j {exceptions}" ,
133
131
"j {supervisor_software}" ,
@@ -156,7 +154,6 @@ unsafe extern "C" fn trap_vectored() -> ! {
156
154
supervisor_external = sym reserved,
157
155
thead_hpm_overflow = sym reserved,
158
156
reserved = sym reserved,
159
- options( noreturn)
160
157
)
161
158
}
162
159
@@ -166,7 +163,7 @@ unsafe extern "C" fn trap_vectored() -> ! {
166
163
) ) ]
167
164
#[ naked]
168
165
unsafe extern "C" fn reserved ( ) -> ! {
169
- asm ! ( "1: j 1b" , options ( noreturn ) )
166
+ naked_asm ! ( "1: j 1b" )
170
167
}
171
168
172
169
#[ cfg( any(
@@ -183,7 +180,7 @@ extern "C" {
183
180
) ) ]
184
181
#[ naked]
185
182
unsafe extern "C" fn exceptions_trampoline ( ) -> ! {
186
- asm ! (
183
+ naked_asm ! (
187
184
"addi sp, sp, -19*8" ,
188
185
"sd ra, 0*8(sp)" ,
189
186
"sd t0, 1*8(sp)" ,
@@ -235,7 +232,6 @@ unsafe extern "C" fn exceptions_trampoline() -> ! {
235
232
"addi sp, sp, 19*8" ,
236
233
"mret" ,
237
234
rust_exceptions = sym exceptions,
238
- options( noreturn)
239
235
)
240
236
}
241
237
@@ -245,7 +241,7 @@ unsafe extern "C" fn exceptions_trampoline() -> ! {
245
241
) ) ]
246
242
#[ naked]
247
243
unsafe extern "C" fn machine_external_trampoline ( ) -> ! {
248
- asm ! (
244
+ naked_asm ! (
249
245
"addi sp, sp, -19*8" ,
250
246
"sd ra, 0*8(sp)" ,
251
247
"sd t0, 1*8(sp)" ,
@@ -297,7 +293,6 @@ unsafe extern "C" fn machine_external_trampoline() -> ! {
297
293
"addi sp, sp, 19*8" ,
298
294
"mret" ,
299
295
rust_all_traps = sym rust_bl808_dsp_machine_external,
300
- options( noreturn)
301
296
)
302
297
}
303
298
0 commit comments