Skip to content

Commit 2669a19

Browse files
committed
Wipe stack related changes
1 parent 3570253 commit 2669a19

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

riscv-rt/src/asm.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ cfg_global_asm!(
125125
);
126126

127127
// STORE A0..A2 IN THE STACK, AS THEY WILL BE NEEDED LATER BY main
128-
#[cfg(not(feature = "u-boot"))]
129128
cfg_global_asm!(
130129
#[cfg(riscv32)]
131130
"addi sp, sp, -4 * 3
@@ -214,12 +213,12 @@ riscv_rt_macros::loop_global_asm!(" fmv.w.x f{}, x0", 32);
214213
// SET UP INTERRUPTS, RESTORE a0..a2, AND JUMP TO MAIN RUST FUNCTION
215214
cfg_global_asm!(
216215
"call _setup_interrupts",
217-
#[cfg(all(riscv32, not(feature = "u-boot")))]
216+
#[cfg(riscv32)]
218217
"lw a0, 4 * 0(sp)
219218
lw a1, 4 * 1(sp)
220219
lw a2, 4 * 2(sp)
221220
addi sp, sp, 4 * 3",
222-
#[cfg(all(riscv64, not(feature = "u-boot")))]
221+
#[cfg(riscv64)]
223222
"ld a0, 8 * 0(sp)
224223
ld a1, 8 * 1(sp)
225224
ld a2, 8 * 2(sp)

riscv-rt/src/lib.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -452,20 +452,19 @@
452452
//! ```
453453
//!
454454
//! This will generate a function named `_start_MachineTimer_trap` that calls the interrupt handler `MachineTimer`.
455-
//!
455+
//!
456456
//! ## `u-boot`
457-
//!
457+
//!
458458
//! The u-boot support feature (`u-boot`) can be activated via [Cargo features](https://doc.rust-lang.org/cargo/reference/features.html).
459-
//!
459+
//!
460460
//! For example:
461461
//! ``` text
462462
//! [dependencies]
463463
//! riscv-rt = { features = ["u-boot"] }
464464
//! ```
465-
//! When the u-boot feature is enabled, some assembly code is disabled to leave stack untouched. This is required
466-
//! because when booting from elf, u-boot passes arguments as argc and argv through stack. Because the only way
467-
//! to get boot-hart is through fdt, this feature also implies `single-hart` so other harts initialization
468-
//! is up to you.
465+
//! When the u-boot feature is enabled, acceptable signature for `#[entry]` macros is changed. This is required
466+
//! because when booting from elf, u-boot passes `argc` and `argv`. This feature also implies `single-hart`.
467+
//! The only way to get boot-hart is through fdt, so other harts initialization is up to you.
469468
470469
// NOTE: Adapted from cortex-m/src/lib.rs
471470
#![no_std]

0 commit comments

Comments
 (0)