From 6a9af3c2020d3092802ae35b51b22cc93e2aa1a9 Mon Sep 17 00:00:00 2001 From: Andre Richter Date: Tue, 16 Mar 2021 23:24:59 +0100 Subject: [PATCH] change static type --- 04_zero_overhead_abstraction/README.md | 2 +- 04_zero_overhead_abstraction/src/bsp/raspberrypi/cpu.rs | 2 +- 05_safe_globals/src/bsp/raspberrypi/cpu.rs | 2 +- 06_drivers_gpio_uart/src/bsp/raspberrypi/cpu.rs | 2 +- 07_uart_chainloader/src/bsp/raspberrypi/cpu.rs | 2 +- 08_timestamps/src/bsp/raspberrypi/cpu.rs | 2 +- 09_hw_debug_JTAG/src/bsp/raspberrypi/cpu.rs | 2 +- 10_privilege_level/src/bsp/raspberrypi/cpu.rs | 2 +- .../src/bsp/raspberrypi/cpu.rs | 2 +- 12_exceptions_part1_groundwork/src/bsp/raspberrypi/cpu.rs | 2 +- 13_integrated_testing/src/bsp/raspberrypi/cpu.rs | 2 +- 14_exceptions_part2_peripheral_IRQs/README.md | 2 +- .../src/bsp/device_driver/arm/gicv2.rs | 2 +- 14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/cpu.rs | 2 +- 15_virtual_mem_part2_mmio_remap/README.md | 2 +- .../src/bsp/device_driver/arm/gicv2.rs | 2 +- 15_virtual_mem_part2_mmio_remap/src/bsp/raspberrypi/cpu.rs | 2 +- X1_JTAG_boot/src/bsp/raspberrypi/cpu.rs | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/04_zero_overhead_abstraction/README.md b/04_zero_overhead_abstraction/README.md index 358d01e7..69db5c72 100644 --- a/04_zero_overhead_abstraction/README.md +++ b/04_zero_overhead_abstraction/README.md @@ -165,7 +165,7 @@ diff -uNr 03_hacky_hello_world/src/bsp/raspberrypi/cpu.rs 04_zero_overhead_abstr +//-------------------------------------------------------------------------------------------------- + +/// Used by `arch` code to find the early boot core. -+pub const BOOT_CORE_ID: usize = 0; ++pub const BOOT_CORE_ID: u64 = 0; diff -uNr 03_hacky_hello_world/src/bsp/raspberrypi/link.ld 04_zero_overhead_abstraction/src/bsp/raspberrypi/link.ld --- 03_hacky_hello_world/src/bsp/raspberrypi/link.ld diff --git a/04_zero_overhead_abstraction/src/bsp/raspberrypi/cpu.rs b/04_zero_overhead_abstraction/src/bsp/raspberrypi/cpu.rs index 3951618d..16ab927d 100644 --- a/04_zero_overhead_abstraction/src/bsp/raspberrypi/cpu.rs +++ b/04_zero_overhead_abstraction/src/bsp/raspberrypi/cpu.rs @@ -9,4 +9,4 @@ //-------------------------------------------------------------------------------------------------- /// Used by `arch` code to find the early boot core. -pub const BOOT_CORE_ID: usize = 0; +pub const BOOT_CORE_ID: u64 = 0; diff --git a/05_safe_globals/src/bsp/raspberrypi/cpu.rs b/05_safe_globals/src/bsp/raspberrypi/cpu.rs index 3951618d..16ab927d 100644 --- a/05_safe_globals/src/bsp/raspberrypi/cpu.rs +++ b/05_safe_globals/src/bsp/raspberrypi/cpu.rs @@ -9,4 +9,4 @@ //-------------------------------------------------------------------------------------------------- /// Used by `arch` code to find the early boot core. -pub const BOOT_CORE_ID: usize = 0; +pub const BOOT_CORE_ID: u64 = 0; diff --git a/06_drivers_gpio_uart/src/bsp/raspberrypi/cpu.rs b/06_drivers_gpio_uart/src/bsp/raspberrypi/cpu.rs index 3951618d..16ab927d 100644 --- a/06_drivers_gpio_uart/src/bsp/raspberrypi/cpu.rs +++ b/06_drivers_gpio_uart/src/bsp/raspberrypi/cpu.rs @@ -9,4 +9,4 @@ //-------------------------------------------------------------------------------------------------- /// Used by `arch` code to find the early boot core. -pub const BOOT_CORE_ID: usize = 0; +pub const BOOT_CORE_ID: u64 = 0; diff --git a/07_uart_chainloader/src/bsp/raspberrypi/cpu.rs b/07_uart_chainloader/src/bsp/raspberrypi/cpu.rs index 3951618d..16ab927d 100644 --- a/07_uart_chainloader/src/bsp/raspberrypi/cpu.rs +++ b/07_uart_chainloader/src/bsp/raspberrypi/cpu.rs @@ -9,4 +9,4 @@ //-------------------------------------------------------------------------------------------------- /// Used by `arch` code to find the early boot core. -pub const BOOT_CORE_ID: usize = 0; +pub const BOOT_CORE_ID: u64 = 0; diff --git a/08_timestamps/src/bsp/raspberrypi/cpu.rs b/08_timestamps/src/bsp/raspberrypi/cpu.rs index 3951618d..16ab927d 100644 --- a/08_timestamps/src/bsp/raspberrypi/cpu.rs +++ b/08_timestamps/src/bsp/raspberrypi/cpu.rs @@ -9,4 +9,4 @@ //-------------------------------------------------------------------------------------------------- /// Used by `arch` code to find the early boot core. -pub const BOOT_CORE_ID: usize = 0; +pub const BOOT_CORE_ID: u64 = 0; diff --git a/09_hw_debug_JTAG/src/bsp/raspberrypi/cpu.rs b/09_hw_debug_JTAG/src/bsp/raspberrypi/cpu.rs index 3951618d..16ab927d 100644 --- a/09_hw_debug_JTAG/src/bsp/raspberrypi/cpu.rs +++ b/09_hw_debug_JTAG/src/bsp/raspberrypi/cpu.rs @@ -9,4 +9,4 @@ //-------------------------------------------------------------------------------------------------- /// Used by `arch` code to find the early boot core. -pub const BOOT_CORE_ID: usize = 0; +pub const BOOT_CORE_ID: u64 = 0; diff --git a/10_privilege_level/src/bsp/raspberrypi/cpu.rs b/10_privilege_level/src/bsp/raspberrypi/cpu.rs index 3951618d..16ab927d 100644 --- a/10_privilege_level/src/bsp/raspberrypi/cpu.rs +++ b/10_privilege_level/src/bsp/raspberrypi/cpu.rs @@ -9,4 +9,4 @@ //-------------------------------------------------------------------------------------------------- /// Used by `arch` code to find the early boot core. -pub const BOOT_CORE_ID: usize = 0; +pub const BOOT_CORE_ID: u64 = 0; diff --git a/11_virtual_mem_part1_identity_mapping/src/bsp/raspberrypi/cpu.rs b/11_virtual_mem_part1_identity_mapping/src/bsp/raspberrypi/cpu.rs index 3951618d..16ab927d 100644 --- a/11_virtual_mem_part1_identity_mapping/src/bsp/raspberrypi/cpu.rs +++ b/11_virtual_mem_part1_identity_mapping/src/bsp/raspberrypi/cpu.rs @@ -9,4 +9,4 @@ //-------------------------------------------------------------------------------------------------- /// Used by `arch` code to find the early boot core. -pub const BOOT_CORE_ID: usize = 0; +pub const BOOT_CORE_ID: u64 = 0; diff --git a/12_exceptions_part1_groundwork/src/bsp/raspberrypi/cpu.rs b/12_exceptions_part1_groundwork/src/bsp/raspberrypi/cpu.rs index 3951618d..16ab927d 100644 --- a/12_exceptions_part1_groundwork/src/bsp/raspberrypi/cpu.rs +++ b/12_exceptions_part1_groundwork/src/bsp/raspberrypi/cpu.rs @@ -9,4 +9,4 @@ //-------------------------------------------------------------------------------------------------- /// Used by `arch` code to find the early boot core. -pub const BOOT_CORE_ID: usize = 0; +pub const BOOT_CORE_ID: u64 = 0; diff --git a/13_integrated_testing/src/bsp/raspberrypi/cpu.rs b/13_integrated_testing/src/bsp/raspberrypi/cpu.rs index 3951618d..16ab927d 100644 --- a/13_integrated_testing/src/bsp/raspberrypi/cpu.rs +++ b/13_integrated_testing/src/bsp/raspberrypi/cpu.rs @@ -9,4 +9,4 @@ //-------------------------------------------------------------------------------------------------- /// Used by `arch` code to find the early boot core. -pub const BOOT_CORE_ID: usize = 0; +pub const BOOT_CORE_ID: u64 = 0; diff --git a/14_exceptions_part2_peripheral_IRQs/README.md b/14_exceptions_part2_peripheral_IRQs/README.md index 9b4436b8..54e33071 100644 --- a/14_exceptions_part2_peripheral_IRQs/README.md +++ b/14_exceptions_part2_peripheral_IRQs/README.md @@ -1357,7 +1357,7 @@ diff -uNr 13_integrated_testing/src/bsp/device_driver/arm/gicv2.rs 14_exceptions + } + + unsafe fn init(&self) -> Result<(), &'static str> { -+ if cpu::smp::core_id::() == bsp::cpu::BOOT_CORE_ID { ++ if bsp::cpu::BOOT_CORE_ID == cpu::smp::core_id() { + self.gicd.boot_core_init(); + } + diff --git a/14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/arm/gicv2.rs b/14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/arm/gicv2.rs index edbc4166..33713459 100644 --- a/14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/arm/gicv2.rs +++ b/14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/arm/gicv2.rs @@ -139,7 +139,7 @@ impl driver::interface::DeviceDriver for GICv2 { } unsafe fn init(&self) -> Result<(), &'static str> { - if cpu::smp::core_id::() == bsp::cpu::BOOT_CORE_ID { + if bsp::cpu::BOOT_CORE_ID == cpu::smp::core_id() { self.gicd.boot_core_init(); } diff --git a/14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/cpu.rs b/14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/cpu.rs index 3951618d..16ab927d 100644 --- a/14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/cpu.rs +++ b/14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/cpu.rs @@ -9,4 +9,4 @@ //-------------------------------------------------------------------------------------------------- /// Used by `arch` code to find the early boot core. -pub const BOOT_CORE_ID: usize = 0; +pub const BOOT_CORE_ID: u64 = 0; diff --git a/15_virtual_mem_part2_mmio_remap/README.md b/15_virtual_mem_part2_mmio_remap/README.md index 5576de8f..c512c51c 100644 --- a/15_virtual_mem_part2_mmio_remap/README.md +++ b/15_virtual_mem_part2_mmio_remap/README.md @@ -1077,7 +1077,7 @@ diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/arm/gicv2.rs + self.is_mmio_remapped.store(true, Ordering::Relaxed); + } + - if cpu::smp::core_id::() == bsp::cpu::BOOT_CORE_ID { + if bsp::cpu::BOOT_CORE_ID == cpu::smp::core_id() { self.gicd.boot_core_init(); } diff --git a/15_virtual_mem_part2_mmio_remap/src/bsp/device_driver/arm/gicv2.rs b/15_virtual_mem_part2_mmio_remap/src/bsp/device_driver/arm/gicv2.rs index c317abae..51c32186 100644 --- a/15_virtual_mem_part2_mmio_remap/src/bsp/device_driver/arm/gicv2.rs +++ b/15_virtual_mem_part2_mmio_remap/src/bsp/device_driver/arm/gicv2.rs @@ -168,7 +168,7 @@ impl driver::interface::DeviceDriver for GICv2 { self.is_mmio_remapped.store(true, Ordering::Relaxed); } - if cpu::smp::core_id::() == bsp::cpu::BOOT_CORE_ID { + if bsp::cpu::BOOT_CORE_ID == cpu::smp::core_id() { self.gicd.boot_core_init(); } diff --git a/15_virtual_mem_part2_mmio_remap/src/bsp/raspberrypi/cpu.rs b/15_virtual_mem_part2_mmio_remap/src/bsp/raspberrypi/cpu.rs index 3951618d..16ab927d 100644 --- a/15_virtual_mem_part2_mmio_remap/src/bsp/raspberrypi/cpu.rs +++ b/15_virtual_mem_part2_mmio_remap/src/bsp/raspberrypi/cpu.rs @@ -9,4 +9,4 @@ //-------------------------------------------------------------------------------------------------- /// Used by `arch` code to find the early boot core. -pub const BOOT_CORE_ID: usize = 0; +pub const BOOT_CORE_ID: u64 = 0; diff --git a/X1_JTAG_boot/src/bsp/raspberrypi/cpu.rs b/X1_JTAG_boot/src/bsp/raspberrypi/cpu.rs index 3951618d..16ab927d 100644 --- a/X1_JTAG_boot/src/bsp/raspberrypi/cpu.rs +++ b/X1_JTAG_boot/src/bsp/raspberrypi/cpu.rs @@ -9,4 +9,4 @@ //-------------------------------------------------------------------------------------------------- /// Used by `arch` code to find the early boot core. -pub const BOOT_CORE_ID: usize = 0; +pub const BOOT_CORE_ID: u64 = 0;