Bump compiler version.

We have to remove the `#[naked]` attribute from `_start` for now, since it emits
a warning now when used with non-asm statements in the function body. For now,
just hope for the compiler's mercy to not emit code using the stack pointer
before we've actually set up a stack.
pull/88/head
Andre Richter 3 years ago
parent d2fd4913ae
commit d212348931
No known key found for this signature in database
GPG Key ID: 2116C1AB102F615E

@ -53,7 +53,7 @@ diff -uNr 03_hacky_hello_world/src/_arch/aarch64/cpu/smp.rs 04_zero_overhead_abs
diff -uNr 03_hacky_hello_world/src/_arch/aarch64/cpu.rs 04_zero_overhead_abstraction/src/_arch/aarch64/cpu.rs
--- 03_hacky_hello_world/src/_arch/aarch64/cpu.rs
+++ 04_zero_overhead_abstraction/src/_arch/aarch64/cpu.rs
@@ -4,8 +4,34 @@
@@ -4,8 +4,35 @@
//! Architectural processor code.
@ -72,8 +72,9 @@ diff -uNr 03_hacky_hello_world/src/_arch/aarch64/cpu.rs 04_zero_overhead_abstrac
+///
+/// # Safety
+///
+/// - Linker script must ensure to place this function at `0x80_000`.
+#[naked]
+/// - Linker script must ensure to place this function where it is expected by the target machine.
+/// - We have to hope that the compiler omits any stack pointer usage before the stack pointer is
+/// actually set (`SP.set()`).
+#[no_mangle]
+pub unsafe fn _start() -> ! {
+ use crate::runtime_init;
@ -90,7 +91,7 @@ diff -uNr 03_hacky_hello_world/src/_arch/aarch64/cpu.rs 04_zero_overhead_abstrac
//--------------------------------------------------------------------------------------------------
// Public Code
@@ -14,13 +40,7 @@
@@ -14,13 +41,7 @@
/// Pause execution on the core.
#[inline(always)]
pub fn wait_forever() -> ! {

@ -17,8 +17,9 @@ use cortex_a::{asm, regs::*};
///
/// # Safety
///
/// - Linker script must ensure to place this function at `0x80_000`.
#[naked]
/// - Linker script must ensure to place this function where it is expected by the target machine.
/// - We have to hope that the compiler omits any stack pointer usage before the stack pointer is
/// actually set (`SP.set()`).
#[no_mangle]
pub unsafe fn _start() -> ! {
use crate::runtime_init;

@ -17,8 +17,9 @@ use cortex_a::{asm, regs::*};
///
/// # Safety
///
/// - Linker script must ensure to place this function at `0x80_000`.
#[naked]
/// - Linker script must ensure to place this function where it is expected by the target machine.
/// - We have to hope that the compiler omits any stack pointer usage before the stack pointer is
/// actually set (`SP.set()`).
#[no_mangle]
pub unsafe fn _start() -> ! {
use crate::runtime_init;

@ -183,7 +183,7 @@ diff -uNr 05_safe_globals/Makefile 06_drivers_gpio_uart/Makefile
diff -uNr 05_safe_globals/src/_arch/aarch64/cpu.rs 06_drivers_gpio_uart/src/_arch/aarch64/cpu.rs
--- 05_safe_globals/src/_arch/aarch64/cpu.rs
+++ 06_drivers_gpio_uart/src/_arch/aarch64/cpu.rs
@@ -37,6 +37,17 @@
@@ -38,6 +38,17 @@
// Public Code
//--------------------------------------------------------------------------------------------------

@ -17,8 +17,9 @@ use cortex_a::{asm, regs::*};
///
/// # Safety
///
/// - Linker script must ensure to place this function at `0x80_000`.
#[naked]
/// - Linker script must ensure to place this function where it is expected by the target machine.
/// - We have to hope that the compiler omits any stack pointer usage before the stack pointer is
/// actually set (`SP.set()`).
#[no_mangle]
pub unsafe fn _start() -> ! {
use crate::runtime_init;

@ -179,8 +179,8 @@ diff -uNr 06_drivers_gpio_uart/Makefile 07_uart_chainloader/Makefile
diff -uNr 06_drivers_gpio_uart/src/_arch/aarch64/cpu.rs 07_uart_chainloader/src/_arch/aarch64/cpu.rs
--- 06_drivers_gpio_uart/src/_arch/aarch64/cpu.rs
+++ 07_uart_chainloader/src/_arch/aarch64/cpu.rs
@@ -21,12 +21,12 @@
#[naked]
@@ -22,12 +22,12 @@
/// actually set (`SP.set()`).
#[no_mangle]
pub unsafe fn _start() -> ! {
- use crate::runtime_init;
@ -194,7 +194,7 @@ diff -uNr 06_drivers_gpio_uart/src/_arch/aarch64/cpu.rs 07_uart_chainloader/src/
} else {
// If not core0, infinitely wait for events.
wait_forever()
@@ -55,3 +55,19 @@
@@ -56,3 +56,19 @@
asm::wfe()
}
}

@ -17,8 +17,9 @@ use cortex_a::{asm, regs::*};
///
/// # Safety
///
/// - Linker script must ensure to place this function at `0x80_000`.
#[naked]
/// - Linker script must ensure to place this function where it is expected by the target machine.
/// - We have to hope that the compiler omits any stack pointer usage before the stack pointer is
/// actually set (`SP.set()`).
#[no_mangle]
pub unsafe fn _start() -> ! {
use crate::relocate;

@ -115,8 +115,8 @@ diff -uNr 07_uart_chainloader/Makefile 08_timestamps/Makefile
diff -uNr 07_uart_chainloader/src/_arch/aarch64/cpu.rs 08_timestamps/src/_arch/aarch64/cpu.rs
--- 07_uart_chainloader/src/_arch/aarch64/cpu.rs
+++ 08_timestamps/src/_arch/aarch64/cpu.rs
@@ -21,12 +21,12 @@
#[naked]
@@ -22,12 +22,12 @@
/// actually set (`SP.set()`).
#[no_mangle]
pub unsafe fn _start() -> ! {
- use crate::relocate;
@ -130,7 +130,7 @@ diff -uNr 07_uart_chainloader/src/_arch/aarch64/cpu.rs 08_timestamps/src/_arch/a
} else {
// If not core0, infinitely wait for events.
wait_forever()
@@ -39,15 +39,6 @@
@@ -40,15 +40,6 @@
pub use asm::nop;
@ -146,7 +146,7 @@ diff -uNr 07_uart_chainloader/src/_arch/aarch64/cpu.rs 08_timestamps/src/_arch/a
/// Pause execution on the core.
#[inline(always)]
pub fn wait_forever() -> ! {
@@ -55,19 +46,3 @@
@@ -56,19 +47,3 @@
asm::wfe()
}
}

@ -17,8 +17,9 @@ use cortex_a::{asm, regs::*};
///
/// # Safety
///
/// - Linker script must ensure to place this function at `0x80_000`.
#[naked]
/// - Linker script must ensure to place this function where it is expected by the target machine.
/// - We have to hope that the compiler omits any stack pointer usage before the stack pointer is
/// actually set (`SP.set()`).
#[no_mangle]
pub unsafe fn _start() -> ! {
use crate::runtime_init;

@ -17,8 +17,9 @@ use cortex_a::{asm, regs::*};
///
/// # Safety
///
/// - Linker script must ensure to place this function at `0x80_000`.
#[naked]
/// - Linker script must ensure to place this function where it is expected by the target machine.
/// - We have to hope that the compiler omits any stack pointer usage before the stack pointer is
/// actually set (`SP.set()`).
#[no_mangle]
pub unsafe fn _start() -> ! {
use crate::runtime_init;

@ -225,8 +225,14 @@ Minipush 1.0
diff -uNr 09_hw_debug_JTAG/src/_arch/aarch64/cpu.rs 10_privilege_level/src/_arch/aarch64/cpu.rs
--- 09_hw_debug_JTAG/src/_arch/aarch64/cpu.rs
+++ 10_privilege_level/src/_arch/aarch64/cpu.rs
@@ -21,18 +21,59 @@
#[naked]
@@ -18,22 +18,65 @@
/// # Safety
///
/// - Linker script must ensure to place this function where it is expected by the target machine.
-/// - We have to hope that the compiler omits any stack pointer usage before the stack pointer is
-/// actually set (`SP.set()`).
+/// - We have to hope that the compiler omits any stack pointer usage, because we are not setting up
+/// a stack for EL2.
#[no_mangle]
pub unsafe fn _start() -> ! {
- use crate::runtime_init;
@ -252,6 +258,8 @@ diff -uNr 09_hw_debug_JTAG/src/_arch/aarch64/cpu.rs 10_privilege_level/src/_arch
+/// - The HW state of EL1 must be prepared in a sound way.
+/// - Exception return from EL2 must must continue execution in EL1 with
+/// `runtime_init::runtime_init()`.
+/// - We have to hope that the compiler omits any stack pointer usage, because we are not setting up
+/// a stack for EL2.
+#[inline(always)]
+unsafe fn el2_to_el1_transition() -> ! {
+ use crate::runtime_init;

@ -17,8 +17,9 @@ use cortex_a::{asm, regs::*};
///
/// # Safety
///
/// - Linker script must ensure to place this function at `0x80_000`.
#[naked]
/// - Linker script must ensure to place this function where it is expected by the target machine.
/// - We have to hope that the compiler omits any stack pointer usage, because we are not setting up
/// a stack for EL2.
#[no_mangle]
pub unsafe fn _start() -> ! {
// Expect the boot core to start in EL2.
@ -39,6 +40,8 @@ pub unsafe fn _start() -> ! {
/// - The HW state of EL1 must be prepared in a sound way.
/// - Exception return from EL2 must must continue execution in EL1 with
/// `runtime_init::runtime_init()`.
/// - We have to hope that the compiler omits any stack pointer usage, because we are not setting up
/// a stack for EL2.
#[inline(always)]
unsafe fn el2_to_el1_transition() -> ! {
use crate::runtime_init;

@ -17,8 +17,9 @@ use cortex_a::{asm, regs::*};
///
/// # Safety
///
/// - Linker script must ensure to place this function at `0x80_000`.
#[naked]
/// - Linker script must ensure to place this function where it is expected by the target machine.
/// - We have to hope that the compiler omits any stack pointer usage, because we are not setting up
/// a stack for EL2.
#[no_mangle]
pub unsafe fn _start() -> ! {
// Expect the boot core to start in EL2.
@ -39,6 +40,8 @@ pub unsafe fn _start() -> ! {
/// - The HW state of EL1 must be prepared in a sound way.
/// - Exception return from EL2 must must continue execution in EL1 with
/// `runtime_init::runtime_init()`.
/// - We have to hope that the compiler omits any stack pointer usage, because we are not setting up
/// a stack for EL2.
#[inline(always)]
unsafe fn el2_to_el1_transition() -> ! {
use crate::runtime_init;

@ -17,8 +17,9 @@ use cortex_a::{asm, regs::*};
///
/// # Safety
///
/// - Linker script must ensure to place this function at `0x80_000`.
#[naked]
/// - Linker script must ensure to place this function where it is expected by the target machine.
/// - We have to hope that the compiler omits any stack pointer usage, because we are not setting up
/// a stack for EL2.
#[no_mangle]
pub unsafe fn _start() -> ! {
// Expect the boot core to start in EL2.
@ -39,6 +40,8 @@ pub unsafe fn _start() -> ! {
/// - The HW state of EL1 must be prepared in a sound way.
/// - Exception return from EL2 must must continue execution in EL1 with
/// `runtime_init::runtime_init()`.
/// - We have to hope that the compiler omits any stack pointer usage, because we are not setting up
/// a stack for EL2.
#[inline(always)]
unsafe fn el2_to_el1_transition() -> ! {
use crate::runtime_init;

@ -935,7 +935,7 @@ diff -uNr 12_exceptions_part1_groundwork/Makefile 13_integrated_testing/Makefile
diff -uNr 12_exceptions_part1_groundwork/src/_arch/aarch64/cpu.rs 13_integrated_testing/src/_arch/aarch64/cpu.rs
--- 12_exceptions_part1_groundwork/src/_arch/aarch64/cpu.rs
+++ 13_integrated_testing/src/_arch/aarch64/cpu.rs
@@ -87,3 +87,20 @@
@@ -90,3 +90,20 @@
asm::wfe()
}
}

@ -17,8 +17,9 @@ use cortex_a::{asm, regs::*};
///
/// # Safety
///
/// - Linker script must ensure to place this function at `0x80_000`.
#[naked]
/// - Linker script must ensure to place this function where it is expected by the target machine.
/// - We have to hope that the compiler omits any stack pointer usage, because we are not setting up
/// a stack for EL2.
#[no_mangle]
pub unsafe fn _start() -> ! {
// Expect the boot core to start in EL2.
@ -39,6 +40,8 @@ pub unsafe fn _start() -> ! {
/// - The HW state of EL1 must be prepared in a sound way.
/// - Exception return from EL2 must must continue execution in EL1 with
/// `runtime_init::runtime_init()`.
/// - We have to hope that the compiler omits any stack pointer usage, because we are not setting up
/// a stack for EL2.
#[inline(always)]
unsafe fn el2_to_el1_transition() -> ! {
use crate::runtime_init;

@ -17,8 +17,9 @@ use cortex_a::{asm, regs::*};
///
/// # Safety
///
/// - Linker script must ensure to place this function at `0x80_000`.
#[naked]
/// - Linker script must ensure to place this function where it is expected by the target machine.
/// - We have to hope that the compiler omits any stack pointer usage, because we are not setting up
/// a stack for EL2.
#[no_mangle]
pub unsafe fn _start() -> ! {
// Expect the boot core to start in EL2.
@ -39,6 +40,8 @@ pub unsafe fn _start() -> ! {
/// - The HW state of EL1 must be prepared in a sound way.
/// - Exception return from EL2 must must continue execution in EL1 with
/// `runtime_init::runtime_init()`.
/// - We have to hope that the compiler omits any stack pointer usage, because we are not setting up
/// a stack for EL2.
#[inline(always)]
unsafe fn el2_to_el1_transition() -> ! {
use crate::runtime_init;

@ -311,7 +311,7 @@ Minipush 1.0
diff -uNr 14_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/cpu.rs 15_virtual_mem_part2_mmio_remap/src/_arch/aarch64/cpu.rs
--- 14_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/cpu.rs
+++ 15_virtual_mem_part2_mmio_remap/src/_arch/aarch64/cpu.rs
@@ -68,7 +68,7 @@
@@ -71,7 +71,7 @@
ELR_EL2.set(runtime_init::runtime_init as *const () as u64);
// Set up SP_EL1 (stack pointer), which will be used by EL1 once we "return" to it.

@ -17,8 +17,9 @@ use cortex_a::{asm, regs::*};
///
/// # Safety
///
/// - Linker script must ensure to place this function at `0x80_000`.
#[naked]
/// - Linker script must ensure to place this function where it is expected by the target machine.
/// - We have to hope that the compiler omits any stack pointer usage, because we are not setting up
/// a stack for EL2.
#[no_mangle]
pub unsafe fn _start() -> ! {
// Expect the boot core to start in EL2.
@ -39,6 +40,8 @@ pub unsafe fn _start() -> ! {
/// - The HW state of EL1 must be prepared in a sound way.
/// - Exception return from EL2 must must continue execution in EL1 with
/// `runtime_init::runtime_init()`.
/// - We have to hope that the compiler omits any stack pointer usage, because we are not setting up
/// a stack for EL2.
#[inline(always)]
unsafe fn el2_to_el1_transition() -> ! {
use crate::runtime_init;

Binary file not shown.

Binary file not shown.

@ -17,8 +17,9 @@ use cortex_a::{asm, regs::*};
///
/// # Safety
///
/// - Linker script must ensure to place this function at `0x80_000`.
#[naked]
/// - Linker script must ensure to place this function where it is expected by the target machine.
/// - We have to hope that the compiler omits any stack pointer usage before the stack pointer is
/// actually set (`SP.set()`).
#[no_mangle]
pub unsafe fn _start() -> ! {
use crate::runtime_init;

@ -1,4 +1,4 @@
[toolchain]
channel = "nightly-2020-12-08"
channel = "nightly-2020-12-09"
components = ["llvm-tools-preview"]
targets = ["aarch64-unknown-none-softfloat"]

Loading…
Cancel
Save