From ef07d172ff55e9fc0fec45b4d345949469d9096a Mon Sep 17 00:00:00 2001 From: gil Date: Thu, 16 May 2024 08:21:50 -0500 Subject: [PATCH] Regroup asm blocks --- src/main.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index cf4e06a..777816d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,6 +17,7 @@ unsafe extern "C" fn _enter() -> ! { // load hartid into t0; if t0 =/= 0, then jump to busy loop "csrr t0, mhartid", "bnez t0, 3f", + // before we use the `la` pseudo-instruction for the first time, // we need to set `gp` (look up linker relaxation) ".option push", // pushes the current option stack @@ -42,12 +43,13 @@ unsafe extern "C" fn _enter() -> ! { "2:", // BSS is clear! "j 4f", - // busy loop if hartid =/= 0 + + // busy loop if hartid =/= 0 "3:", - "wfi", + "wfi", // wait for interrupt (or nop) "j 3b", + "4:", - // "tail-call" to {start} (call without saving a return address) "tail {start}", start = sym start, // {start} refers to the function [start] below