From ff382c3fafa6257e37c208015cbea3aa3d1b2515 Mon Sep 17 00:00:00 2001 From: Andre Richter Date: Sat, 2 Jan 2021 16:04:27 +0100 Subject: [PATCH] Remove comment --- 04_zero_overhead_abstraction/README.md | 5 ++--- 04_zero_overhead_abstraction/src/_arch/aarch64/cpu.rs | 1 - 05_safe_globals/src/_arch/aarch64/cpu.rs | 1 - 06_drivers_gpio_uart/README.md | 2 +- 06_drivers_gpio_uart/src/_arch/aarch64/cpu.rs | 1 - 07_uart_chainloader/README.md | 5 ++--- 07_uart_chainloader/src/_arch/aarch64/cpu.rs | 1 - 08_timestamps/README.md | 7 +++---- 08_timestamps/src/_arch/aarch64/cpu.rs | 1 - 09_hw_debug_JTAG/src/_arch/aarch64/cpu.rs | 1 - 10_privilege_level/README.md | 4 ++-- 11 files changed, 10 insertions(+), 19 deletions(-) diff --git a/04_zero_overhead_abstraction/README.md b/04_zero_overhead_abstraction/README.md index 1e8d4c6d..ce452fb7 100644 --- a/04_zero_overhead_abstraction/README.md +++ b/04_zero_overhead_abstraction/README.md @@ -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,35 @@ +@@ -4,8 +4,34 @@ //! Architectural processor code. @@ -79,7 +79,6 @@ diff -uNr 03_hacky_hello_world/src/_arch/aarch64/cpu.rs 04_zero_overhead_abstrac +pub unsafe fn _start() -> ! { + use crate::runtime_init; + -+ // Expect the boot core to start in EL2. + if bsp::cpu::BOOT_CORE_ID == cpu::smp::core_id() { + SP.set(bsp::memory::boot_core_stack_end() as u64); + runtime_init::runtime_init() @@ -91,7 +90,7 @@ diff -uNr 03_hacky_hello_world/src/_arch/aarch64/cpu.rs 04_zero_overhead_abstrac //-------------------------------------------------------------------------------------------------- // Public Code -@@ -14,13 +41,7 @@ +@@ -14,13 +40,7 @@ /// Pause execution on the core. #[inline(always)] pub fn wait_forever() -> ! { diff --git a/04_zero_overhead_abstraction/src/_arch/aarch64/cpu.rs b/04_zero_overhead_abstraction/src/_arch/aarch64/cpu.rs index 61a68a18..b02903c9 100644 --- a/04_zero_overhead_abstraction/src/_arch/aarch64/cpu.rs +++ b/04_zero_overhead_abstraction/src/_arch/aarch64/cpu.rs @@ -24,7 +24,6 @@ use cortex_a::{asm, regs::*}; pub unsafe fn _start() -> ! { use crate::runtime_init; - // Expect the boot core to start in EL2. if bsp::cpu::BOOT_CORE_ID == cpu::smp::core_id() { SP.set(bsp::memory::boot_core_stack_end() as u64); runtime_init::runtime_init() diff --git a/05_safe_globals/src/_arch/aarch64/cpu.rs b/05_safe_globals/src/_arch/aarch64/cpu.rs index 61a68a18..b02903c9 100644 --- a/05_safe_globals/src/_arch/aarch64/cpu.rs +++ b/05_safe_globals/src/_arch/aarch64/cpu.rs @@ -24,7 +24,6 @@ use cortex_a::{asm, regs::*}; pub unsafe fn _start() -> ! { use crate::runtime_init; - // Expect the boot core to start in EL2. if bsp::cpu::BOOT_CORE_ID == cpu::smp::core_id() { SP.set(bsp::memory::boot_core_stack_end() as u64); runtime_init::runtime_init() diff --git a/06_drivers_gpio_uart/README.md b/06_drivers_gpio_uart/README.md index 4c030e74..7e3da3ba 100644 --- a/06_drivers_gpio_uart/README.md +++ b/06_drivers_gpio_uart/README.md @@ -185,7 +185,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 -@@ -38,6 +38,17 @@ +@@ -37,6 +37,17 @@ // Public Code //-------------------------------------------------------------------------------------------------- diff --git a/06_drivers_gpio_uart/src/_arch/aarch64/cpu.rs b/06_drivers_gpio_uart/src/_arch/aarch64/cpu.rs index 0f545a00..dfc6be13 100644 --- a/06_drivers_gpio_uart/src/_arch/aarch64/cpu.rs +++ b/06_drivers_gpio_uart/src/_arch/aarch64/cpu.rs @@ -24,7 +24,6 @@ use cortex_a::{asm, regs::*}; pub unsafe fn _start() -> ! { use crate::runtime_init; - // Expect the boot core to start in EL2. if bsp::cpu::BOOT_CORE_ID == cpu::smp::core_id() { SP.set(bsp::memory::boot_core_stack_end() as u64); runtime_init::runtime_init() diff --git a/07_uart_chainloader/README.md b/07_uart_chainloader/README.md index b87b4bed..ef90e02e 100644 --- a/07_uart_chainloader/README.md +++ b/07_uart_chainloader/README.md @@ -183,14 +183,13 @@ 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 -@@ -22,12 +22,12 @@ +@@ -22,11 +22,11 @@ /// actually set (`SP.set()`). #[no_mangle] pub unsafe fn _start() -> ! { - use crate::runtime_init; + use crate::relocate; - // Expect the boot core to start in EL2. if bsp::cpu::BOOT_CORE_ID == cpu::smp::core_id() { SP.set(bsp::memory::boot_core_stack_end() as u64); - runtime_init::runtime_init() @@ -198,7 +197,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() -@@ -56,3 +56,19 @@ +@@ -55,3 +55,19 @@ asm::wfe() } } diff --git a/07_uart_chainloader/src/_arch/aarch64/cpu.rs b/07_uart_chainloader/src/_arch/aarch64/cpu.rs index ccafe9ff..1895b6f1 100644 --- a/07_uart_chainloader/src/_arch/aarch64/cpu.rs +++ b/07_uart_chainloader/src/_arch/aarch64/cpu.rs @@ -24,7 +24,6 @@ use cortex_a::{asm, regs::*}; pub unsafe fn _start() -> ! { use crate::relocate; - // Expect the boot core to start in EL2. if bsp::cpu::BOOT_CORE_ID == cpu::smp::core_id() { SP.set(bsp::memory::boot_core_stack_end() as u64); relocate::relocate_self() diff --git a/08_timestamps/README.md b/08_timestamps/README.md index 0bd34252..45a5c270 100644 --- a/08_timestamps/README.md +++ b/08_timestamps/README.md @@ -115,14 +115,13 @@ 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 -@@ -22,12 +22,12 @@ +@@ -22,11 +22,11 @@ /// actually set (`SP.set()`). #[no_mangle] pub unsafe fn _start() -> ! { - use crate::relocate; + use crate::runtime_init; - // Expect the boot core to start in EL2. if bsp::cpu::BOOT_CORE_ID == cpu::smp::core_id() { SP.set(bsp::memory::boot_core_stack_end() as u64); - relocate::relocate_self() @@ -130,7 +129,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() -@@ -40,15 +40,6 @@ +@@ -39,15 +39,6 @@ pub use asm::nop; @@ -146,7 +145,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() -> ! { -@@ -56,19 +47,3 @@ +@@ -55,19 +46,3 @@ asm::wfe() } } diff --git a/08_timestamps/src/_arch/aarch64/cpu.rs b/08_timestamps/src/_arch/aarch64/cpu.rs index 6072751d..a65a0682 100644 --- a/08_timestamps/src/_arch/aarch64/cpu.rs +++ b/08_timestamps/src/_arch/aarch64/cpu.rs @@ -24,7 +24,6 @@ use cortex_a::{asm, regs::*}; pub unsafe fn _start() -> ! { use crate::runtime_init; - // Expect the boot core to start in EL2. if bsp::cpu::BOOT_CORE_ID == cpu::smp::core_id() { SP.set(bsp::memory::boot_core_stack_end() as u64); runtime_init::runtime_init() diff --git a/09_hw_debug_JTAG/src/_arch/aarch64/cpu.rs b/09_hw_debug_JTAG/src/_arch/aarch64/cpu.rs index 6072751d..a65a0682 100644 --- a/09_hw_debug_JTAG/src/_arch/aarch64/cpu.rs +++ b/09_hw_debug_JTAG/src/_arch/aarch64/cpu.rs @@ -24,7 +24,6 @@ use cortex_a::{asm, regs::*}; pub unsafe fn _start() -> ! { use crate::runtime_init; - // Expect the boot core to start in EL2. if bsp::cpu::BOOT_CORE_ID == cpu::smp::core_id() { SP.set(bsp::memory::boot_core_stack_end() as u64); runtime_init::runtime_init() diff --git a/10_privilege_level/README.md b/10_privilege_level/README.md index 8716099e..3ffa1bbe 100644 --- a/10_privilege_level/README.md +++ b/10_privilege_level/README.md @@ -226,7 +226,7 @@ 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 -@@ -18,22 +18,65 @@ +@@ -18,21 +18,65 @@ /// # Safety /// /// - Linker script must ensure to place this function where it is expected by the target machine. @@ -238,10 +238,10 @@ diff -uNr 09_hw_debug_JTAG/src/_arch/aarch64/cpu.rs 10_privilege_level/src/_arch pub unsafe fn _start() -> ! { - use crate::runtime_init; - - // Expect the boot core to start in EL2. - if bsp::cpu::BOOT_CORE_ID == cpu::smp::core_id() { - SP.set(bsp::memory::boot_core_stack_end() as u64); - runtime_init::runtime_init() ++ // Expect the boot core to start in EL2. + if (bsp::cpu::BOOT_CORE_ID == cpu::smp::core_id()) + && (CurrentEL.get() == CurrentEL::EL::EL2.value) + {