1- use  core:: hint; 
2- 
31/// Tock programs' entry point. Called by the kernel at program start. Sets up 
42/// the stack then calls rust_start() for the remainder of setup. 
53#[ doc( hidden) ]  
@@ -14,12 +12,12 @@ use core::hint;
1412// Due to Rust issue: https://github.com/rust-lang/rust/issues/42779 we can't have 
1513// args to the function 
1614pub  unsafe  extern  "C"  fn  _start ( )  -> ! { 
17-     llvm_asm ! ( 
18-     // Compute the stack top. 
19-     // 
20-     // struct hdr* myhdr = (struct hdr*) app_start; 
21-     // uint32_t stacktop = (((uint32_t) mem_start + myhdr->stack_size + 7) & 0xfffffff8); 
22-     "lw   t0, 36(a0)         // t0 = myhdr->stack_size 
15+     asm ! ( 
16+          // Compute the stack top. 
17+          // 
18+          // struct hdr* myhdr = (struct hdr*) app_start; 
19+          // uint32_t stacktop = (((uint32_t) mem_start + myhdr->stack_size + 7) & 0xfffffff8); 
20+          "lw   t0, 36(a0)         // t0 = myhdr->stack_size 
2321    addi t0, t0, 7          // t0 = myhdr->stack_size + 7 
2422    add  t0, t0, a1         // t0 = mem_start + myhdr->stack_size + 7 
2523    li   t1, 7              // t1 = 7 
@@ -89,14 +87,10 @@ pub unsafe extern "C" fn _start() -> ! {
8987    mv   s0, sp             // Set the frame pointer to sp. 
9088    mv   a1, s1             // second arg is stacktop 
9189    mv   a2, t1             // third arg is app_heap_break that we told the kernel 
92-     jal  rust_start" 
93-     :                                                               // No output operands 
94-     : 
95-     :  "memory" ,  "x10" ,  "x11" ,  "x12" ,  "x13" ,  "x14" ,  "x15" ,  "x16" ,  "x17" , 
96-       "x5" ,  "x6" ,  "x7" ,  "x28" ,  "x29" ,  "x30" ,  "x31" ,  "x1"            // Clobbers 
97-     :  "volatile"                                                    // Options 
98-     ) ; 
99-     hint:: unreachable_unchecked ( ) ; 
90+     jal  rust_start" , 
91+         // No clobbers needed for a noreturn asm! block. 
92+         options( noreturn) , 
93+     ) 
10094} 
10195
10296/// Ensure an abort symbol exists. 
0 commit comments