From 7d025375156097127e788d6d983a83d043e68a1c Mon Sep 17 00:00:00 2001 From: Andre Richter Date: Mon, 20 Dec 2021 00:01:38 +0100 Subject: [PATCH] Bump toolchain --- 01_wait_forever/src/_arch/aarch64/cpu/boot.rs | 2 +- 01_wait_forever/src/main.rs | 2 - 02_runtime_init/Cargo.lock | 4 +- 02_runtime_init/Cargo.toml | 3 +- 02_runtime_init/README.md | 13 ++---- 02_runtime_init/src/_arch/aarch64/cpu/boot.rs | 2 +- 02_runtime_init/src/main.rs | 1 - 03_hacky_hello_world/Cargo.lock | 4 +- 03_hacky_hello_world/Cargo.toml | 3 +- 03_hacky_hello_world/README.md | 5 +- .../src/_arch/aarch64/cpu/boot.rs | 2 +- 03_hacky_hello_world/src/main.rs | 1 - 04_safe_globals/Cargo.lock | 4 +- 04_safe_globals/Cargo.toml | 3 +- 04_safe_globals/README.md | 8 ++-- 04_safe_globals/src/_arch/aarch64/cpu/boot.rs | 2 +- 04_safe_globals/src/main.rs | 1 - 05_drivers_gpio_uart/Cargo.lock | 4 +- 05_drivers_gpio_uart/Cargo.toml | 3 +- 05_drivers_gpio_uart/README.md | 8 ++-- .../src/_arch/aarch64/cpu/boot.rs | 2 +- 05_drivers_gpio_uart/src/main.rs | 1 - 06_uart_chainloader/Cargo.lock | 4 +- 06_uart_chainloader/Cargo.toml | 3 +- 06_uart_chainloader/README.md | 43 +++++++----------- 06_uart_chainloader/demo_payload_rpi3.img | Bin 6872 -> 6664 bytes 06_uart_chainloader/demo_payload_rpi4.img | Bin 6712 -> 6512 bytes .../src/_arch/aarch64/cpu/boot.rs | 2 +- 06_uart_chainloader/src/main.rs | 2 - 07_timestamps/Cargo.lock | 4 +- 07_timestamps/Cargo.toml | 3 +- 07_timestamps/README.md | 12 +---- 07_timestamps/src/_arch/aarch64/cpu/boot.rs | 2 +- 07_timestamps/src/main.rs | 1 - 08_hw_debug_JTAG/Cargo.lock | 4 +- 08_hw_debug_JTAG/Cargo.toml | 3 +- .../src/_arch/aarch64/cpu/boot.rs | 2 +- 08_hw_debug_JTAG/src/main.rs | 1 - 09_privilege_level/Cargo.lock | 4 +- 09_privilege_level/Cargo.toml | 3 +- 09_privilege_level/README.md | 25 +++++----- .../src/_arch/aarch64/cpu/boot.rs | 1 + 09_privilege_level/src/main.rs | 1 - .../Cargo.lock | 4 +- .../Cargo.toml | 3 +- .../README.md | 10 ++-- .../src/_arch/aarch64/cpu/boot.rs | 1 + .../src/main.rs | 1 - 11_exceptions_part1_groundwork/Cargo.lock | 4 +- 11_exceptions_part1_groundwork/Cargo.toml | 3 +- 11_exceptions_part1_groundwork/README.md | 6 +-- .../src/_arch/aarch64/cpu/boot.rs | 1 + .../src/_arch/aarch64/exception.rs | 2 +- 11_exceptions_part1_groundwork/src/main.rs | 1 - 12_integrated_testing/Cargo.lock | 8 ++-- 12_integrated_testing/Cargo.toml | 4 +- 12_integrated_testing/README.md | 20 ++++---- .../src/_arch/aarch64/cpu/boot.rs | 1 + .../src/_arch/aarch64/exception.rs | 2 +- 12_integrated_testing/src/lib.rs | 1 - .../Cargo.lock | 8 ++-- .../Cargo.toml | 4 +- 13_exceptions_part2_peripheral_IRQs/README.md | 14 +++--- .../src/_arch/aarch64/cpu/boot.rs | 1 + .../src/_arch/aarch64/exception.rs | 2 +- .../_arch/aarch64/exception/asynchronous.rs | 1 + .../src/lib.rs | 3 +- 14_virtual_mem_part2_mmio_remap/Cargo.lock | 8 ++-- 14_virtual_mem_part2_mmio_remap/Cargo.toml | 4 +- 14_virtual_mem_part2_mmio_remap/README.md | 17 ++++--- .../src/_arch/aarch64/cpu/boot.rs | 1 + .../src/_arch/aarch64/exception.rs | 2 +- .../_arch/aarch64/exception/asynchronous.rs | 1 + .../src/bsp/device_driver/arm/gicv2.rs | 4 +- 14_virtual_mem_part2_mmio_remap/src/lib.rs | 3 +- 14_virtual_mem_part2_mmio_remap/src/memory.rs | 2 + .../Cargo.lock | 8 ++-- .../Cargo.toml | 4 +- .../README.md | 11 +++-- .../src/_arch/aarch64/cpu/boot.rs | 1 + .../src/_arch/aarch64/exception.rs | 2 +- .../_arch/aarch64/exception/asynchronous.rs | 1 + .../src/bsp/device_driver/arm/gicv2.rs | 4 +- .../src/bsp/raspberrypi/memory/mmu.rs | 1 + .../src/lib.rs | 3 +- .../src/memory.rs | 2 + .../Cargo.lock | 8 ++-- .../Cargo.toml | 4 +- .../README.md | 12 ++--- .../src/_arch/aarch64/cpu/boot.rs | 1 + .../src/_arch/aarch64/exception.rs | 2 +- .../_arch/aarch64/exception/asynchronous.rs | 1 + .../src/bsp/device_driver/arm/gicv2.rs | 4 +- .../src/bsp/raspberrypi/memory/mmu.rs | 1 + .../src/lib.rs | 3 +- .../src/memory.rs | 2 + X1_JTAG_boot/Cargo.lock | 4 +- X1_JTAG_boot/Cargo.toml | 3 +- X1_JTAG_boot/jtag_boot_rpi3.img | Bin 8016 -> 7832 bytes X1_JTAG_boot/jtag_boot_rpi4.img | Bin 6736 -> 6520 bytes X1_JTAG_boot/src/_arch/aarch64/cpu/boot.rs | 2 +- X1_JTAG_boot/src/main.rs | 1 - rust-toolchain.toml | 2 +- 103 files changed, 198 insertions(+), 234 deletions(-) diff --git a/01_wait_forever/src/_arch/aarch64/cpu/boot.rs b/01_wait_forever/src/_arch/aarch64/cpu/boot.rs index 4bc6ed6d..13aee3a3 100644 --- a/01_wait_forever/src/_arch/aarch64/cpu/boot.rs +++ b/01_wait_forever/src/_arch/aarch64/cpu/boot.rs @@ -12,4 +12,4 @@ //! crate::cpu::boot::arch_boot // Assembly counterpart to this file. -global_asm!(include_str!("boot.s")); +core::arch::global_asm!(include_str!("boot.s")); diff --git a/01_wait_forever/src/main.rs b/01_wait_forever/src/main.rs index b01a84cb..84e9c8c1 100644 --- a/01_wait_forever/src/main.rs +++ b/01_wait_forever/src/main.rs @@ -103,8 +103,6 @@ //! 1. The kernel's entry point is the function `cpu::boot::arch_boot::_start()`. //! - It is implemented in `src/_arch/__arch_name__/cpu/boot.s`. -#![feature(asm)] -#![feature(global_asm)] #![no_main] #![no_std] diff --git a/02_runtime_init/Cargo.lock b/02_runtime_init/Cargo.lock index 1fd03899..19fc8b73 100644 --- a/02_runtime_init/Cargo.lock +++ b/02_runtime_init/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "cortex-a" -version = "6.1.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "509fc35485a2b4ddbacabe0bf2212cdfff88da93658608e5cc651afcb75b7733" +checksum = "b27f5d071b671f9799dfdf0c0afcec11de65195383d36e186639c83b00705e4f" dependencies = [ "tock-registers", ] diff --git a/02_runtime_init/Cargo.toml b/02_runtime_init/Cargo.toml index c4fd83e3..52786a40 100644 --- a/02_runtime_init/Cargo.toml +++ b/02_runtime_init/Cargo.toml @@ -24,5 +24,4 @@ path = "src/main.rs" # Platform specific dependencies [target.'cfg(target_arch = "aarch64")'.dependencies] -cortex-a = { version = "6.x.x" } - +cortex-a = { version = "7.x.x" } diff --git a/02_runtime_init/README.md b/02_runtime_init/README.md index 7c8d44cf..530c1a3f 100644 --- a/02_runtime_init/README.md +++ b/02_runtime_init/README.md @@ -40,15 +40,14 @@ diff -uNr 01_wait_forever/Cargo.toml 02_runtime_init/Cargo.toml authors = ["Andre Richter "] edition = "2021" -@@ -21,3 +21,8 @@ +@@ -21,3 +21,7 @@ ##-------------------------------------------------------------------------------------------------- [dependencies] + +# Platform specific dependencies +[target.'cfg(target_arch = "aarch64")'.dependencies] -+cortex-a = { version = "6.x.x" } -+ ++cortex-a = { version = "7.x.x" } diff -uNr 01_wait_forever/Makefile 02_runtime_init/Makefile --- 01_wait_forever/Makefile @@ -69,7 +68,7 @@ diff -uNr 01_wait_forever/src/_arch/aarch64/cpu/boot.rs 02_runtime_init/src/_arc @@ -13,3 +13,15 @@ // Assembly counterpart to this file. - global_asm!(include_str!("boot.s")); + core::arch::global_asm!(include_str!("boot.s")); + +//-------------------------------------------------------------------------------------------------- +// Public Code @@ -303,17 +302,15 @@ diff -uNr 01_wait_forever/src/cpu.rs 02_runtime_init/src/cpu.rs diff -uNr 01_wait_forever/src/main.rs 02_runtime_init/src/main.rs --- 01_wait_forever/src/main.rs +++ 02_runtime_init/src/main.rs -@@ -102,8 +102,8 @@ +@@ -102,6 +102,7 @@ //! //! 1. The kernel's entry point is the function `cpu::boot::arch_boot::_start()`. //! - It is implemented in `src/_arch/__arch_name__/cpu/boot.s`. +//! 2. Once finished with architectural setup, the arch code calls `kernel_init()`. --#![feature(asm)] - #![feature(global_asm)] #![no_main] #![no_std] -@@ -112,4 +112,11 @@ +@@ -110,4 +111,11 @@ mod cpu; mod panic_wait; diff --git a/02_runtime_init/src/_arch/aarch64/cpu/boot.rs b/02_runtime_init/src/_arch/aarch64/cpu/boot.rs index 7513df07..a8defcda 100644 --- a/02_runtime_init/src/_arch/aarch64/cpu/boot.rs +++ b/02_runtime_init/src/_arch/aarch64/cpu/boot.rs @@ -12,7 +12,7 @@ //! crate::cpu::boot::arch_boot // Assembly counterpart to this file. -global_asm!(include_str!("boot.s")); +core::arch::global_asm!(include_str!("boot.s")); //-------------------------------------------------------------------------------------------------- // Public Code diff --git a/02_runtime_init/src/main.rs b/02_runtime_init/src/main.rs index cf15402f..561ee9d2 100644 --- a/02_runtime_init/src/main.rs +++ b/02_runtime_init/src/main.rs @@ -104,7 +104,6 @@ //! - It is implemented in `src/_arch/__arch_name__/cpu/boot.s`. //! 2. Once finished with architectural setup, the arch code calls `kernel_init()`. -#![feature(global_asm)] #![no_main] #![no_std] diff --git a/03_hacky_hello_world/Cargo.lock b/03_hacky_hello_world/Cargo.lock index 1213b384..cdaf44bf 100644 --- a/03_hacky_hello_world/Cargo.lock +++ b/03_hacky_hello_world/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "cortex-a" -version = "6.1.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "509fc35485a2b4ddbacabe0bf2212cdfff88da93658608e5cc651afcb75b7733" +checksum = "b27f5d071b671f9799dfdf0c0afcec11de65195383d36e186639c83b00705e4f" dependencies = [ "tock-registers", ] diff --git a/03_hacky_hello_world/Cargo.toml b/03_hacky_hello_world/Cargo.toml index 75cf6701..cca92834 100644 --- a/03_hacky_hello_world/Cargo.toml +++ b/03_hacky_hello_world/Cargo.toml @@ -24,5 +24,4 @@ path = "src/main.rs" # Platform specific dependencies [target.'cfg(target_arch = "aarch64")'.dependencies] -cortex-a = { version = "6.x.x" } - +cortex-a = { version = "7.x.x" } diff --git a/03_hacky_hello_world/README.md b/03_hacky_hello_world/README.md index c9c5862a..cb04d375 100644 --- a/03_hacky_hello_world/README.md +++ b/03_hacky_hello_world/README.md @@ -208,12 +208,11 @@ diff -uNr 02_runtime_init/src/console.rs 03_hacky_hello_world/src/console.rs diff -uNr 02_runtime_init/src/main.rs 03_hacky_hello_world/src/main.rs --- 02_runtime_init/src/main.rs +++ 03_hacky_hello_world/src/main.rs -@@ -104,13 +104,17 @@ +@@ -104,12 +104,16 @@ //! - It is implemented in `src/_arch/__arch_name__/cpu/boot.s`. //! 2. Once finished with architectural setup, the arch code calls `kernel_init()`. +#![feature(format_args_nl)] - #![feature(global_asm)] +#![feature(panic_info_message)] #![no_main] #![no_std] @@ -226,7 +225,7 @@ diff -uNr 02_runtime_init/src/main.rs 03_hacky_hello_world/src/main.rs /// Early init code. /// -@@ -118,5 +122,7 @@ +@@ -117,5 +121,7 @@ /// /// - Only a single core must be active and running this function. unsafe fn kernel_init() -> ! { diff --git a/03_hacky_hello_world/src/_arch/aarch64/cpu/boot.rs b/03_hacky_hello_world/src/_arch/aarch64/cpu/boot.rs index 7513df07..a8defcda 100644 --- a/03_hacky_hello_world/src/_arch/aarch64/cpu/boot.rs +++ b/03_hacky_hello_world/src/_arch/aarch64/cpu/boot.rs @@ -12,7 +12,7 @@ //! crate::cpu::boot::arch_boot // Assembly counterpart to this file. -global_asm!(include_str!("boot.s")); +core::arch::global_asm!(include_str!("boot.s")); //-------------------------------------------------------------------------------------------------- // Public Code diff --git a/03_hacky_hello_world/src/main.rs b/03_hacky_hello_world/src/main.rs index de9a0576..7ae7138d 100644 --- a/03_hacky_hello_world/src/main.rs +++ b/03_hacky_hello_world/src/main.rs @@ -105,7 +105,6 @@ //! 2. Once finished with architectural setup, the arch code calls `kernel_init()`. #![feature(format_args_nl)] -#![feature(global_asm)] #![feature(panic_info_message)] #![no_main] #![no_std] diff --git a/04_safe_globals/Cargo.lock b/04_safe_globals/Cargo.lock index bd028f28..08a979d5 100644 --- a/04_safe_globals/Cargo.lock +++ b/04_safe_globals/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "cortex-a" -version = "6.1.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "509fc35485a2b4ddbacabe0bf2212cdfff88da93658608e5cc651afcb75b7733" +checksum = "b27f5d071b671f9799dfdf0c0afcec11de65195383d36e186639c83b00705e4f" dependencies = [ "tock-registers", ] diff --git a/04_safe_globals/Cargo.toml b/04_safe_globals/Cargo.toml index 3d282da6..cb51da55 100644 --- a/04_safe_globals/Cargo.toml +++ b/04_safe_globals/Cargo.toml @@ -24,5 +24,4 @@ path = "src/main.rs" # Platform specific dependencies [target.'cfg(target_arch = "aarch64")'.dependencies] -cortex-a = { version = "6.x.x" } - +cortex-a = { version = "7.x.x" } diff --git a/04_safe_globals/README.md b/04_safe_globals/README.md index b03f0c11..86767a95 100644 --- a/04_safe_globals/README.md +++ b/04_safe_globals/README.md @@ -224,15 +224,15 @@ diff -uNr 03_hacky_hello_world/src/console.rs 04_safe_globals/src/console.rs diff -uNr 03_hacky_hello_world/src/main.rs 04_safe_globals/src/main.rs --- 03_hacky_hello_world/src/main.rs +++ 04_safe_globals/src/main.rs -@@ -107,6 +107,7 @@ +@@ -106,6 +106,7 @@ + #![feature(format_args_nl)] - #![feature(global_asm)] #![feature(panic_info_message)] +#![feature(trait_alias)] #![no_main] #![no_std] -@@ -115,6 +116,7 @@ +@@ -114,6 +115,7 @@ mod cpu; mod panic_wait; mod print; @@ -240,7 +240,7 @@ diff -uNr 03_hacky_hello_world/src/main.rs 04_safe_globals/src/main.rs /// Early init code. /// -@@ -122,7 +124,15 @@ +@@ -121,7 +123,15 @@ /// /// - Only a single core must be active and running this function. unsafe fn kernel_init() -> ! { diff --git a/04_safe_globals/src/_arch/aarch64/cpu/boot.rs b/04_safe_globals/src/_arch/aarch64/cpu/boot.rs index 7513df07..a8defcda 100644 --- a/04_safe_globals/src/_arch/aarch64/cpu/boot.rs +++ b/04_safe_globals/src/_arch/aarch64/cpu/boot.rs @@ -12,7 +12,7 @@ //! crate::cpu::boot::arch_boot // Assembly counterpart to this file. -global_asm!(include_str!("boot.s")); +core::arch::global_asm!(include_str!("boot.s")); //-------------------------------------------------------------------------------------------------- // Public Code diff --git a/04_safe_globals/src/main.rs b/04_safe_globals/src/main.rs index 82262ea1..dddacdb2 100644 --- a/04_safe_globals/src/main.rs +++ b/04_safe_globals/src/main.rs @@ -105,7 +105,6 @@ //! 2. Once finished with architectural setup, the arch code calls `kernel_init()`. #![feature(format_args_nl)] -#![feature(global_asm)] #![feature(panic_info_message)] #![feature(trait_alias)] #![no_main] diff --git a/05_drivers_gpio_uart/Cargo.lock b/05_drivers_gpio_uart/Cargo.lock index 8ac198e1..ff66f548 100644 --- a/05_drivers_gpio_uart/Cargo.lock +++ b/05_drivers_gpio_uart/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "cortex-a" -version = "6.1.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "509fc35485a2b4ddbacabe0bf2212cdfff88da93658608e5cc651afcb75b7733" +checksum = "b27f5d071b671f9799dfdf0c0afcec11de65195383d36e186639c83b00705e4f" dependencies = [ "tock-registers", ] diff --git a/05_drivers_gpio_uart/Cargo.toml b/05_drivers_gpio_uart/Cargo.toml index 44d10141..b2f17d8d 100644 --- a/05_drivers_gpio_uart/Cargo.toml +++ b/05_drivers_gpio_uart/Cargo.toml @@ -27,5 +27,4 @@ tock-registers = { version = "0.7.x", default-features = false, features = ["reg # Platform specific dependencies [target.'cfg(target_arch = "aarch64")'.dependencies] -cortex-a = { version = "6.x.x" } - +cortex-a = { version = "7.x.x" } diff --git a/05_drivers_gpio_uart/README.md b/05_drivers_gpio_uart/README.md index 00d23212..e9f59429 100644 --- a/05_drivers_gpio_uart/README.md +++ b/05_drivers_gpio_uart/README.md @@ -140,7 +140,7 @@ diff -uNr 04_safe_globals/Cargo.toml 05_drivers_gpio_uart/Cargo.toml + # Platform specific dependencies [target.'cfg(target_arch = "aarch64")'.dependencies] - cortex-a = { version = "6.x.x" } + cortex-a = { version = "7.x.x" } diff -uNr 04_safe_globals/Makefile 05_drivers_gpio_uart/Makefile --- 04_safe_globals/Makefile @@ -1340,9 +1340,9 @@ diff -uNr 04_safe_globals/src/main.rs 05_drivers_gpio_uart/src/main.rs +#![allow(clippy::upper_case_acronyms)] +#![feature(const_fn_fn_ptr_basics)] #![feature(format_args_nl)] - #![feature(global_asm)] #![feature(panic_info_message)] -@@ -114,6 +116,7 @@ + #![feature(trait_alias)] +@@ -113,6 +115,7 @@ mod bsp; mod console; mod cpu; @@ -1350,7 +1350,7 @@ diff -uNr 04_safe_globals/src/main.rs 05_drivers_gpio_uart/src/main.rs mod panic_wait; mod print; mod synchronization; -@@ -123,16 +126,54 @@ +@@ -122,16 +125,54 @@ /// # Safety /// /// - Only a single core must be active and running this function. diff --git a/05_drivers_gpio_uart/src/_arch/aarch64/cpu/boot.rs b/05_drivers_gpio_uart/src/_arch/aarch64/cpu/boot.rs index 7513df07..a8defcda 100644 --- a/05_drivers_gpio_uart/src/_arch/aarch64/cpu/boot.rs +++ b/05_drivers_gpio_uart/src/_arch/aarch64/cpu/boot.rs @@ -12,7 +12,7 @@ //! crate::cpu::boot::arch_boot // Assembly counterpart to this file. -global_asm!(include_str!("boot.s")); +core::arch::global_asm!(include_str!("boot.s")); //-------------------------------------------------------------------------------------------------- // Public Code diff --git a/05_drivers_gpio_uart/src/main.rs b/05_drivers_gpio_uart/src/main.rs index 0261a136..1ca13aeb 100644 --- a/05_drivers_gpio_uart/src/main.rs +++ b/05_drivers_gpio_uart/src/main.rs @@ -107,7 +107,6 @@ #![allow(clippy::upper_case_acronyms)] #![feature(const_fn_fn_ptr_basics)] #![feature(format_args_nl)] -#![feature(global_asm)] #![feature(panic_info_message)] #![feature(trait_alias)] #![no_main] diff --git a/06_uart_chainloader/Cargo.lock b/06_uart_chainloader/Cargo.lock index 98f3ca1c..c642ff43 100644 --- a/06_uart_chainloader/Cargo.lock +++ b/06_uart_chainloader/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "cortex-a" -version = "6.1.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "509fc35485a2b4ddbacabe0bf2212cdfff88da93658608e5cc651afcb75b7733" +checksum = "b27f5d071b671f9799dfdf0c0afcec11de65195383d36e186639c83b00705e4f" dependencies = [ "tock-registers", ] diff --git a/06_uart_chainloader/Cargo.toml b/06_uart_chainloader/Cargo.toml index 1ea68580..f00c87a8 100644 --- a/06_uart_chainloader/Cargo.toml +++ b/06_uart_chainloader/Cargo.toml @@ -27,5 +27,4 @@ tock-registers = { version = "0.7.x", default-features = false, features = ["reg # Platform specific dependencies [target.'cfg(target_arch = "aarch64")'.dependencies] -cortex-a = { version = "6.x.x" } - +cortex-a = { version = "7.x.x" } diff --git a/06_uart_chainloader/README.md b/06_uart_chainloader/README.md index 857a3a83..ef4bee8c 100644 --- a/06_uart_chainloader/README.md +++ b/06_uart_chainloader/README.md @@ -456,15 +456,7 @@ diff -uNr 05_drivers_gpio_uart/src/bsp/raspberrypi/memory.rs 06_uart_chainloader diff -uNr 05_drivers_gpio_uart/src/main.rs 06_uart_chainloader/src/main.rs --- 05_drivers_gpio_uart/src/main.rs +++ 06_uart_chainloader/src/main.rs -@@ -105,6 +105,7 @@ - //! 2. Once finished with architectural setup, the arch code calls `kernel_init()`. - - #![allow(clippy::upper_case_acronyms)] -+#![feature(asm)] - #![feature(const_fn_fn_ptr_basics)] - #![feature(format_args_nl)] - #![feature(global_asm)] -@@ -142,38 +143,56 @@ +@@ -141,38 +141,56 @@ kernel_main() } @@ -480,7 +472,7 @@ diff -uNr 05_drivers_gpio_uart/src/main.rs 06_uart_chainloader/src/main.rs use bsp::console::console; use console::interface::All; - use driver::interface::DriverManager; -- + - println!( - "[0] {} version {}", - env!("CARGO_PKG_NAME"), @@ -495,37 +487,36 @@ diff -uNr 05_drivers_gpio_uart/src/main.rs 06_uart_chainloader/src/main.rs - .enumerate() - { - println!(" {}. {}", i + 1, driver.compatible()); -- } - -- println!( -- "[3] Chars written: {}", -- bsp::console::console().chars_written() -- ); -- println!("[4] Echoing input now"); + println!("{}", MINILOAD_LOGO); + println!("{:^37}", bsp::board_name()); + println!(); + println!("[ML] Requesting binary"); + console().flush(); - -- // Discard any spurious received characters before going into echo mode. ++ + // Discard any spurious received characters before starting with the loader protocol. - console().clear_rx(); -- loop { -- let c = bsp::console::console().read_char(); -- bsp::console::console().write_char(c); ++ console().clear_rx(); + + // Notify `Minipush` to send the binary. + for _ in 0..3 { + console().write_char(3 as char); } -+ + +- println!( +- "[3] Chars written: {}", +- bsp::console::console().chars_written() +- ); +- println!("[4] Echoing input now"); + // Read the binary's size. + let mut size: u32 = u32::from(console().read_char() as u8); + size |= u32::from(console().read_char() as u8) << 8; + size |= u32::from(console().read_char() as u8) << 16; + size |= u32::from(console().read_char() as u8) << 24; -+ + +- // Discard any spurious received characters before going into echo mode. +- console().clear_rx(); +- loop { +- let c = bsp::console::console().read_char(); +- bsp::console::console().write_char(c); + // Trust it's not too big. + console().write_char('O'); + console().write_char('K'); @@ -536,7 +527,7 @@ diff -uNr 05_drivers_gpio_uart/src/main.rs 06_uart_chainloader/src/main.rs + for i in 0..size { + core::ptr::write_volatile(kernel_addr.offset(i as isize), console().read_char() as u8) + } -+ } + } + + println!("[ML] Loaded! Executing the payload now\n"); + console().flush(); diff --git a/06_uart_chainloader/demo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VeTSEtM-3w?Z2Cy4f7ewB zad7RX-2KPay7i^)>W*!z>+998wX{cxY)Z~IN0A<7GJq$l1Iu>sQKx?ip)$fwg-`XTH)eVd3}X;5N%p zX{{aBy0AQF&)3z5g!^H8P5-LT#}4SdzM$uA%co@CNB@zphMmxfJ zQ|47zu0QeBc>GqM7!~>LHU65a9oBZfoA$1Q2VU=q#oknR^r~z1Id4Ep6zhSqD(Rue9!+ z)?xas;5jQ%r7ibVXWjjQ+!!T$< ! { @@ -518,7 +519,7 @@ diff -uNr 08_hw_debug_JTAG/src/main.rs 09_privilege_level/src/main.rs use core::time::Duration; use driver::interface::DriverManager; use time::interface::TimeManager; -@@ -156,6 +159,12 @@ +@@ -155,6 +158,12 @@ ); info!("Booting on: {}", bsp::board_name()); @@ -531,7 +532,7 @@ diff -uNr 08_hw_debug_JTAG/src/main.rs 09_privilege_level/src/main.rs info!( "Architectural timer resolution: {} ns", time::time_manager().resolution().as_nanos() -@@ -170,11 +179,15 @@ +@@ -169,11 +178,15 @@ info!(" {}. {}", i + 1, driver.compatible()); } diff --git a/09_privilege_level/src/_arch/aarch64/cpu/boot.rs b/09_privilege_level/src/_arch/aarch64/cpu/boot.rs index 4f006862..f54ae739 100644 --- a/09_privilege_level/src/_arch/aarch64/cpu/boot.rs +++ b/09_privilege_level/src/_arch/aarch64/cpu/boot.rs @@ -11,6 +11,7 @@ //! //! crate::cpu::boot::arch_boot +use core::arch::global_asm; use cortex_a::{asm, registers::*}; use tock_registers::interfaces::Writeable; diff --git a/09_privilege_level/src/main.rs b/09_privilege_level/src/main.rs index 74902def..7a692a0c 100644 --- a/09_privilege_level/src/main.rs +++ b/09_privilege_level/src/main.rs @@ -107,7 +107,6 @@ #![allow(clippy::upper_case_acronyms)] #![feature(const_fn_fn_ptr_basics)] #![feature(format_args_nl)] -#![feature(global_asm)] #![feature(panic_info_message)] #![feature(trait_alias)] #![no_main] diff --git a/10_virtual_mem_part1_identity_mapping/Cargo.lock b/10_virtual_mem_part1_identity_mapping/Cargo.lock index d0180466..23fe8e43 100644 --- a/10_virtual_mem_part1_identity_mapping/Cargo.lock +++ b/10_virtual_mem_part1_identity_mapping/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "cortex-a" -version = "6.1.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "509fc35485a2b4ddbacabe0bf2212cdfff88da93658608e5cc651afcb75b7733" +checksum = "b27f5d071b671f9799dfdf0c0afcec11de65195383d36e186639c83b00705e4f" dependencies = [ "tock-registers", ] diff --git a/10_virtual_mem_part1_identity_mapping/Cargo.toml b/10_virtual_mem_part1_identity_mapping/Cargo.toml index e52ac34c..144767d3 100644 --- a/10_virtual_mem_part1_identity_mapping/Cargo.toml +++ b/10_virtual_mem_part1_identity_mapping/Cargo.toml @@ -27,5 +27,4 @@ tock-registers = { version = "0.7.x", default-features = false, features = ["reg # Platform specific dependencies [target.'cfg(target_arch = "aarch64")'.dependencies] -cortex-a = { version = "6.x.x" } - +cortex-a = { version = "7.x.x" } diff --git a/10_virtual_mem_part1_identity_mapping/README.md b/10_virtual_mem_part1_identity_mapping/README.md index ed01e03d..759f324b 100644 --- a/10_virtual_mem_part1_identity_mapping/README.md +++ b/10_virtual_mem_part1_identity_mapping/README.md @@ -1089,9 +1089,9 @@ diff -uNr 09_privilege_level/src/main.rs 10_virtual_mem_part1_identity_mapping/s #![feature(const_fn_fn_ptr_basics)] +#![feature(core_intrinsics)] #![feature(format_args_nl)] - #![feature(global_asm)] #![feature(panic_info_message)] -@@ -118,6 +120,7 @@ + #![feature(trait_alias)] +@@ -117,6 +119,7 @@ mod cpu; mod driver; mod exception; @@ -1099,7 +1099,7 @@ diff -uNr 09_privilege_level/src/main.rs 10_virtual_mem_part1_identity_mapping/s mod panic_wait; mod print; mod synchronization; -@@ -128,9 +131,17 @@ +@@ -127,9 +130,17 @@ /// # Safety /// /// - Only a single core must be active and running this function. @@ -1118,7 +1118,7 @@ diff -uNr 09_privilege_level/src/main.rs 10_virtual_mem_part1_identity_mapping/s for i in bsp::driver::driver_manager().all_device_drivers().iter() { if let Err(x) = i.init() { -@@ -159,6 +170,9 @@ +@@ -158,6 +169,9 @@ ); info!("Booting on: {}", bsp::board_name()); @@ -1128,7 +1128,7 @@ diff -uNr 09_privilege_level/src/main.rs 10_virtual_mem_part1_identity_mapping/s let (_, privilege_level) = exception::current_privilege_level(); info!("Current privilege level: {}", privilege_level); -@@ -182,6 +196,13 @@ +@@ -181,6 +195,13 @@ info!("Timer test, spinning for 1 second"); time::time_manager().spin_for(Duration::from_secs(1)); diff --git a/10_virtual_mem_part1_identity_mapping/src/_arch/aarch64/cpu/boot.rs b/10_virtual_mem_part1_identity_mapping/src/_arch/aarch64/cpu/boot.rs index 4f006862..f54ae739 100644 --- a/10_virtual_mem_part1_identity_mapping/src/_arch/aarch64/cpu/boot.rs +++ b/10_virtual_mem_part1_identity_mapping/src/_arch/aarch64/cpu/boot.rs @@ -11,6 +11,7 @@ //! //! crate::cpu::boot::arch_boot +use core::arch::global_asm; use cortex_a::{asm, registers::*}; use tock_registers::interfaces::Writeable; diff --git a/10_virtual_mem_part1_identity_mapping/src/main.rs b/10_virtual_mem_part1_identity_mapping/src/main.rs index f7c949be..86d7f473 100644 --- a/10_virtual_mem_part1_identity_mapping/src/main.rs +++ b/10_virtual_mem_part1_identity_mapping/src/main.rs @@ -109,7 +109,6 @@ #![feature(const_fn_fn_ptr_basics)] #![feature(core_intrinsics)] #![feature(format_args_nl)] -#![feature(global_asm)] #![feature(panic_info_message)] #![feature(trait_alias)] #![no_main] diff --git a/11_exceptions_part1_groundwork/Cargo.lock b/11_exceptions_part1_groundwork/Cargo.lock index d25b6b78..2c16d5d5 100644 --- a/11_exceptions_part1_groundwork/Cargo.lock +++ b/11_exceptions_part1_groundwork/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "cortex-a" -version = "6.1.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "509fc35485a2b4ddbacabe0bf2212cdfff88da93658608e5cc651afcb75b7733" +checksum = "b27f5d071b671f9799dfdf0c0afcec11de65195383d36e186639c83b00705e4f" dependencies = [ "tock-registers", ] diff --git a/11_exceptions_part1_groundwork/Cargo.toml b/11_exceptions_part1_groundwork/Cargo.toml index e92d9f43..aa8a870c 100644 --- a/11_exceptions_part1_groundwork/Cargo.toml +++ b/11_exceptions_part1_groundwork/Cargo.toml @@ -27,5 +27,4 @@ tock-registers = { version = "0.7.x", default-features = false, features = ["reg # Platform specific dependencies [target.'cfg(target_arch = "aarch64")'.dependencies] -cortex-a = { version = "6.x.x" } - +cortex-a = { version = "7.x.x" } diff --git a/11_exceptions_part1_groundwork/README.md b/11_exceptions_part1_groundwork/README.md index ec6a312d..8424b79c 100644 --- a/11_exceptions_part1_groundwork/README.md +++ b/11_exceptions_part1_groundwork/README.md @@ -502,7 +502,7 @@ diff -uNr 10_virtual_mem_part1_identity_mapping/src/_arch/aarch64/exception.rs 1 -use cortex_a::registers::*; -use tock_registers::interfaces::Readable; -+use core::{cell::UnsafeCell, fmt}; ++use core::{arch::global_asm, cell::UnsafeCell, fmt}; +use cortex_a::{asm::barrier, registers::*}; +use tock_registers::{ + interfaces::{Readable, Writeable}, @@ -1013,7 +1013,7 @@ diff -uNr 10_virtual_mem_part1_identity_mapping/src/exception.rs 11_exceptions_p diff -uNr 10_virtual_mem_part1_identity_mapping/src/main.rs 11_exceptions_part1_groundwork/src/main.rs --- 10_virtual_mem_part1_identity_mapping/src/main.rs +++ 11_exceptions_part1_groundwork/src/main.rs -@@ -139,6 +139,8 @@ +@@ -138,6 +138,8 @@ use driver::interface::DriverManager; use memory::mmu::interface::MMU; @@ -1022,7 +1022,7 @@ diff -uNr 10_virtual_mem_part1_identity_mapping/src/main.rs 11_exceptions_part1_ if let Err(string) = memory::mmu::mmu().enable_mmu_and_caching() { panic!("MMU: {}", string); } -@@ -196,13 +198,28 @@ +@@ -195,13 +197,28 @@ info!("Timer test, spinning for 1 second"); time::time_manager().spin_for(Duration::from_secs(1)); diff --git a/11_exceptions_part1_groundwork/src/_arch/aarch64/cpu/boot.rs b/11_exceptions_part1_groundwork/src/_arch/aarch64/cpu/boot.rs index 4f006862..f54ae739 100644 --- a/11_exceptions_part1_groundwork/src/_arch/aarch64/cpu/boot.rs +++ b/11_exceptions_part1_groundwork/src/_arch/aarch64/cpu/boot.rs @@ -11,6 +11,7 @@ //! //! crate::cpu::boot::arch_boot +use core::arch::global_asm; use cortex_a::{asm, registers::*}; use tock_registers::interfaces::Writeable; diff --git a/11_exceptions_part1_groundwork/src/_arch/aarch64/exception.rs b/11_exceptions_part1_groundwork/src/_arch/aarch64/exception.rs index 2db1741c..1454145e 100644 --- a/11_exceptions_part1_groundwork/src/_arch/aarch64/exception.rs +++ b/11_exceptions_part1_groundwork/src/_arch/aarch64/exception.rs @@ -11,7 +11,7 @@ //! //! crate::exception::arch_exception -use core::{cell::UnsafeCell, fmt}; +use core::{arch::global_asm, cell::UnsafeCell, fmt}; use cortex_a::{asm::barrier, registers::*}; use tock_registers::{ interfaces::{Readable, Writeable}, diff --git a/11_exceptions_part1_groundwork/src/main.rs b/11_exceptions_part1_groundwork/src/main.rs index 637684b0..12deeb2c 100644 --- a/11_exceptions_part1_groundwork/src/main.rs +++ b/11_exceptions_part1_groundwork/src/main.rs @@ -109,7 +109,6 @@ #![feature(const_fn_fn_ptr_basics)] #![feature(core_intrinsics)] #![feature(format_args_nl)] -#![feature(global_asm)] #![feature(panic_info_message)] #![feature(trait_alias)] #![no_main] diff --git a/12_integrated_testing/Cargo.lock b/12_integrated_testing/Cargo.lock index c4d231f9..7294834d 100644 --- a/12_integrated_testing/Cargo.lock +++ b/12_integrated_testing/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "cortex-a" -version = "6.1.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "509fc35485a2b4ddbacabe0bf2212cdfff88da93658608e5cc651afcb75b7733" +checksum = "b27f5d071b671f9799dfdf0c0afcec11de65195383d36e186639c83b00705e4f" dependencies = [ "tock-registers", ] @@ -33,9 +33,9 @@ dependencies = [ [[package]] name = "qemu-exit" -version = "2.0.1" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "220eb94f40665452ab6114bf8a8d86aa1fd41c6dbfaa4ab71b5912c8adb80389" +checksum = "0e0fa04276d522a40ed717bf874183a3b2a8bbb3fb4c646b03a7eb874ce5d543" [[package]] name = "quote" diff --git a/12_integrated_testing/Cargo.toml b/12_integrated_testing/Cargo.toml index 40f28b18..80a3a0bc 100644 --- a/12_integrated_testing/Cargo.toml +++ b/12_integrated_testing/Cargo.toml @@ -22,11 +22,11 @@ test-types = { path = "test-types" } # Optional dependencies tock-registers = { version = "0.7.x", default-features = false, features = ["register_types"], optional = true } -qemu-exit = { version = "2.x.x", optional = true } +qemu-exit = { version = "3.x.x", optional = true } # Platform specific dependencies [target.'cfg(target_arch = "aarch64")'.dependencies] -cortex-a = { version = "6.x.x" } +cortex-a = { version = "7.x.x" } ##-------------------------------------------------------------------------------------------------- ## Testing diff --git a/12_integrated_testing/README.md b/12_integrated_testing/README.md index 607c5b5d..ac37d541 100644 --- a/12_integrated_testing/README.md +++ b/12_integrated_testing/README.md @@ -883,7 +883,7 @@ diff -uNr 11_exceptions_part1_groundwork/Cargo.toml 12_integrated_testing/Cargo. authors = ["Andre Richter "] edition = "2021" -@@ -11,21 +11,46 @@ +@@ -11,20 +11,46 @@ default = [] bsp_rpi3 = ["tock-registers"] bsp_rpi4 = ["tock-registers"] @@ -902,12 +902,12 @@ diff -uNr 11_exceptions_part1_groundwork/Cargo.toml 12_integrated_testing/Cargo. # Optional dependencies tock-registers = { version = "0.7.x", default-features = false, features = ["register_types"], optional = true } -+qemu-exit = { version = "2.x.x", optional = true } ++qemu-exit = { version = "3.x.x", optional = true } # Platform specific dependencies [target.'cfg(target_arch = "aarch64")'.dependencies] - cortex-a = { version = "6.x.x" } - + cortex-a = { version = "7.x.x" } ++ +##-------------------------------------------------------------------------------------------------- +## Testing +##-------------------------------------------------------------------------------------------------- @@ -1274,7 +1274,7 @@ diff -uNr 11_exceptions_part1_groundwork/src/exception.rs 12_integrated_testing/ diff -uNr 11_exceptions_part1_groundwork/src/lib.rs 12_integrated_testing/src/lib.rs --- 11_exceptions_part1_groundwork/src/lib.rs +++ 12_integrated_testing/src/lib.rs -@@ -0,0 +1,185 @@ +@@ -0,0 +1,184 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 +// +// Copyright (c) 2018-2021 Andre Richter @@ -1388,7 +1388,6 @@ diff -uNr 11_exceptions_part1_groundwork/src/lib.rs 12_integrated_testing/src/li +#![feature(const_fn_fn_ptr_basics)] +#![feature(core_intrinsics)] +#![feature(format_args_nl)] -+#![feature(global_asm)] +#![feature(linkage)] +#![feature(panic_info_message)] +#![feature(trait_alias)] @@ -1464,7 +1463,7 @@ diff -uNr 11_exceptions_part1_groundwork/src/lib.rs 12_integrated_testing/src/li diff -uNr 11_exceptions_part1_groundwork/src/main.rs 12_integrated_testing/src/main.rs --- 11_exceptions_part1_groundwork/src/main.rs +++ 12_integrated_testing/src/main.rs -@@ -6,125 +6,12 @@ +@@ -6,124 +6,12 @@ #![doc(html_logo_url = "https://git.io/JeGIp")] //! The `kernel` binary. @@ -1572,7 +1571,6 @@ diff -uNr 11_exceptions_part1_groundwork/src/main.rs 12_integrated_testing/src/m -#![feature(core_intrinsics)] + #![feature(format_args_nl)] --#![feature(global_asm)] -#![feature(panic_info_message)] -#![feature(trait_alias)] #![no_main] @@ -1592,7 +1590,7 @@ diff -uNr 11_exceptions_part1_groundwork/src/main.rs 12_integrated_testing/src/m /// Early init code. /// -@@ -135,6 +22,7 @@ +@@ -134,6 +22,7 @@ /// - MMU + Data caching must be activated at the earliest. Without it, any atomic operations, /// e.g. the yet-to-be-introduced spinlocks in the device drivers (which currently employ /// NullLocks instead of spinlocks), will fail to work (properly) on the RPi SoCs. @@ -1600,7 +1598,7 @@ diff -uNr 11_exceptions_part1_groundwork/src/main.rs 12_integrated_testing/src/m unsafe fn kernel_init() -> ! { use driver::interface::DriverManager; use memory::mmu::interface::MMU; -@@ -161,15 +49,9 @@ +@@ -160,15 +49,9 @@ fn kernel_main() -> ! { use bsp::console::console; use console::interface::All; @@ -1617,7 +1615,7 @@ diff -uNr 11_exceptions_part1_groundwork/src/main.rs 12_integrated_testing/src/m info!("Booting on: {}", bsp::board_name()); info!("MMU online. Special regions:"); -@@ -195,31 +77,6 @@ +@@ -194,31 +77,6 @@ info!(" {}. {}", i + 1, driver.compatible()); } diff --git a/12_integrated_testing/src/_arch/aarch64/cpu/boot.rs b/12_integrated_testing/src/_arch/aarch64/cpu/boot.rs index 4f006862..f54ae739 100644 --- a/12_integrated_testing/src/_arch/aarch64/cpu/boot.rs +++ b/12_integrated_testing/src/_arch/aarch64/cpu/boot.rs @@ -11,6 +11,7 @@ //! //! crate::cpu::boot::arch_boot +use core::arch::global_asm; use cortex_a::{asm, registers::*}; use tock_registers::interfaces::Writeable; diff --git a/12_integrated_testing/src/_arch/aarch64/exception.rs b/12_integrated_testing/src/_arch/aarch64/exception.rs index 6e8485b7..05b729e2 100644 --- a/12_integrated_testing/src/_arch/aarch64/exception.rs +++ b/12_integrated_testing/src/_arch/aarch64/exception.rs @@ -11,7 +11,7 @@ //! //! crate::exception::arch_exception -use core::{cell::UnsafeCell, fmt}; +use core::{arch::global_asm, cell::UnsafeCell, fmt}; use cortex_a::{asm::barrier, registers::*}; use tock_registers::{ interfaces::{Readable, Writeable}, diff --git a/12_integrated_testing/src/lib.rs b/12_integrated_testing/src/lib.rs index 723b2a80..39eea925 100644 --- a/12_integrated_testing/src/lib.rs +++ b/12_integrated_testing/src/lib.rs @@ -111,7 +111,6 @@ #![feature(const_fn_fn_ptr_basics)] #![feature(core_intrinsics)] #![feature(format_args_nl)] -#![feature(global_asm)] #![feature(linkage)] #![feature(panic_info_message)] #![feature(trait_alias)] diff --git a/13_exceptions_part2_peripheral_IRQs/Cargo.lock b/13_exceptions_part2_peripheral_IRQs/Cargo.lock index db1cd2db..b3514b23 100644 --- a/13_exceptions_part2_peripheral_IRQs/Cargo.lock +++ b/13_exceptions_part2_peripheral_IRQs/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "cortex-a" -version = "6.1.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "509fc35485a2b4ddbacabe0bf2212cdfff88da93658608e5cc651afcb75b7733" +checksum = "b27f5d071b671f9799dfdf0c0afcec11de65195383d36e186639c83b00705e4f" dependencies = [ "tock-registers", ] @@ -33,9 +33,9 @@ dependencies = [ [[package]] name = "qemu-exit" -version = "2.0.1" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "220eb94f40665452ab6114bf8a8d86aa1fd41c6dbfaa4ab71b5912c8adb80389" +checksum = "0e0fa04276d522a40ed717bf874183a3b2a8bbb3fb4c646b03a7eb874ce5d543" [[package]] name = "quote" diff --git a/13_exceptions_part2_peripheral_IRQs/Cargo.toml b/13_exceptions_part2_peripheral_IRQs/Cargo.toml index c81105a5..b4572cb2 100644 --- a/13_exceptions_part2_peripheral_IRQs/Cargo.toml +++ b/13_exceptions_part2_peripheral_IRQs/Cargo.toml @@ -22,11 +22,11 @@ test-types = { path = "test-types" } # Optional dependencies tock-registers = { version = "0.7.x", default-features = false, features = ["register_types"], optional = true } -qemu-exit = { version = "2.x.x", optional = true } +qemu-exit = { version = "3.x.x", optional = true } # Platform specific dependencies [target.'cfg(target_arch = "aarch64")'.dependencies] -cortex-a = { version = "6.x.x" } +cortex-a = { version = "7.x.x" } ##-------------------------------------------------------------------------------------------------- ## Testing diff --git a/13_exceptions_part2_peripheral_IRQs/README.md b/13_exceptions_part2_peripheral_IRQs/README.md index efb83e64..18de9ac6 100644 --- a/13_exceptions_part2_peripheral_IRQs/README.md +++ b/13_exceptions_part2_peripheral_IRQs/README.md @@ -809,9 +809,11 @@ diff -uNr 12_integrated_testing/src/_arch/aarch64/cpu/smp.rs 13_exceptions_part2 diff -uNr 12_integrated_testing/src/_arch/aarch64/exception/asynchronous.rs 13_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/exception/asynchronous.rs --- 12_integrated_testing/src/_arch/aarch64/exception/asynchronous.rs +++ 13_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/exception/asynchronous.rs -@@ -12,12 +12,16 @@ +@@ -11,13 +11,18 @@ + //! //! crate::exception::asynchronous::arch_asynchronous ++use core::arch::asm; use cortex_a::registers::*; -use tock_registers::interfaces::Readable; +use tock_registers::interfaces::{Readable, Writeable}; @@ -827,7 +829,7 @@ diff -uNr 12_integrated_testing/src/_arch/aarch64/exception/asynchronous.rs 13_e trait DaifField { fn daif_field() -> tock_registers::fields::Field; } -@@ -66,6 +70,71 @@ +@@ -66,6 +71,71 @@ // Public Code //-------------------------------------------------------------------------------------------------- @@ -908,7 +910,7 @@ diff -uNr 12_integrated_testing/src/_arch/aarch64/exception.rs 13_exceptions_par //! crate::exception::arch_exception +use crate::{bsp, exception}; - use core::{cell::UnsafeCell, fmt}; + use core::{arch::global_asm, cell::UnsafeCell, fmt}; use cortex_a::{asm::barrier, registers::*}; use tock_registers::{ @@ -91,8 +92,11 @@ @@ -2413,13 +2415,13 @@ diff -uNr 12_integrated_testing/src/lib.rs 13_exceptions_part2_peripheral_IRQs/s #![allow(clippy::upper_case_acronyms)] #![allow(incomplete_features)] -+#![feature(asm)] ++#![feature(asm_const)] #![feature(const_fn_fn_ptr_basics)] +#![feature(const_fn_trait_bound)] #![feature(core_intrinsics)] #![feature(format_args_nl)] - #![feature(global_asm)] -@@ -132,6 +134,7 @@ + #![feature(linkage)] +@@ -131,6 +133,7 @@ pub mod exception; pub mod memory; pub mod print; diff --git a/13_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/cpu/boot.rs b/13_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/cpu/boot.rs index 4f006862..f54ae739 100644 --- a/13_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/cpu/boot.rs +++ b/13_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/cpu/boot.rs @@ -11,6 +11,7 @@ //! //! crate::cpu::boot::arch_boot +use core::arch::global_asm; use cortex_a::{asm, registers::*}; use tock_registers::interfaces::Writeable; diff --git a/13_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/exception.rs b/13_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/exception.rs index 880cc92b..708f63dd 100644 --- a/13_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/exception.rs +++ b/13_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/exception.rs @@ -12,7 +12,7 @@ //! crate::exception::arch_exception use crate::{bsp, exception}; -use core::{cell::UnsafeCell, fmt}; +use core::{arch::global_asm, cell::UnsafeCell, fmt}; use cortex_a::{asm::barrier, registers::*}; use tock_registers::{ interfaces::{Readable, Writeable}, diff --git a/13_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/exception/asynchronous.rs b/13_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/exception/asynchronous.rs index 4e79cc8a..799ab4e8 100644 --- a/13_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/exception/asynchronous.rs +++ b/13_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/exception/asynchronous.rs @@ -11,6 +11,7 @@ //! //! crate::exception::asynchronous::arch_asynchronous +use core::arch::asm; use cortex_a::registers::*; use tock_registers::interfaces::{Readable, Writeable}; diff --git a/13_exceptions_part2_peripheral_IRQs/src/lib.rs b/13_exceptions_part2_peripheral_IRQs/src/lib.rs index af4f6240..5b1eb3e1 100644 --- a/13_exceptions_part2_peripheral_IRQs/src/lib.rs +++ b/13_exceptions_part2_peripheral_IRQs/src/lib.rs @@ -108,12 +108,11 @@ #![allow(clippy::upper_case_acronyms)] #![allow(incomplete_features)] -#![feature(asm)] +#![feature(asm_const)] #![feature(const_fn_fn_ptr_basics)] #![feature(const_fn_trait_bound)] #![feature(core_intrinsics)] #![feature(format_args_nl)] -#![feature(global_asm)] #![feature(linkage)] #![feature(panic_info_message)] #![feature(trait_alias)] diff --git a/14_virtual_mem_part2_mmio_remap/Cargo.lock b/14_virtual_mem_part2_mmio_remap/Cargo.lock index 41426eba..38d026fd 100644 --- a/14_virtual_mem_part2_mmio_remap/Cargo.lock +++ b/14_virtual_mem_part2_mmio_remap/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "cortex-a" -version = "6.1.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "509fc35485a2b4ddbacabe0bf2212cdfff88da93658608e5cc651afcb75b7733" +checksum = "b27f5d071b671f9799dfdf0c0afcec11de65195383d36e186639c83b00705e4f" dependencies = [ "tock-registers", ] @@ -33,9 +33,9 @@ dependencies = [ [[package]] name = "qemu-exit" -version = "2.0.1" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "220eb94f40665452ab6114bf8a8d86aa1fd41c6dbfaa4ab71b5912c8adb80389" +checksum = "0e0fa04276d522a40ed717bf874183a3b2a8bbb3fb4c646b03a7eb874ce5d543" [[package]] name = "quote" diff --git a/14_virtual_mem_part2_mmio_remap/Cargo.toml b/14_virtual_mem_part2_mmio_remap/Cargo.toml index d3b17db1..760dbce2 100644 --- a/14_virtual_mem_part2_mmio_remap/Cargo.toml +++ b/14_virtual_mem_part2_mmio_remap/Cargo.toml @@ -22,11 +22,11 @@ test-types = { path = "test-types" } # Optional dependencies tock-registers = { version = "0.7.x", default-features = false, features = ["register_types"], optional = true } -qemu-exit = { version = "2.x.x", optional = true } +qemu-exit = { version = "3.x.x", optional = true } # Platform specific dependencies [target.'cfg(target_arch = "aarch64")'.dependencies] -cortex-a = { version = "6.x.x" } +cortex-a = { version = "7.x.x" } ##-------------------------------------------------------------------------------------------------- ## Testing diff --git a/14_virtual_mem_part2_mmio_remap/README.md b/14_virtual_mem_part2_mmio_remap/README.md index 8fac022a..a068bc7a 100644 --- a/14_virtual_mem_part2_mmio_remap/README.md +++ b/14_virtual_mem_part2_mmio_remap/README.md @@ -1021,16 +1021,14 @@ diff -uNr 13_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/arm/gicv2.rs handler_table: InitStateLock::new([None; Self::NUM_IRQS]), } } -@@ -139,6 +152,22 @@ +@@ -139,6 +152,20 @@ } unsafe fn init(&self) -> Result<(), &'static str> { + let remapped = self.is_mmio_remapped.load(Ordering::Relaxed); + if !remapped { -+ let mut virt_addr; -+ + // GICD -+ virt_addr = memory::mmu::kernel_map_mmio("GICD", &self.gicd_mmio_descriptor)?; ++ let mut virt_addr = memory::mmu::kernel_map_mmio("GICD", &self.gicd_mmio_descriptor)?; + self.gicd.set_mmio(virt_addr.as_usize()); + + // GICC @@ -2137,19 +2135,18 @@ diff -uNr 13_exceptions_part2_peripheral_IRQs/src/driver.rs 14_virtual_mem_part2 diff -uNr 13_exceptions_part2_peripheral_IRQs/src/lib.rs 14_virtual_mem_part2_mmio_remap/src/lib.rs --- 13_exceptions_part2_peripheral_IRQs/src/lib.rs +++ 14_virtual_mem_part2_mmio_remap/src/lib.rs -@@ -113,9 +113,11 @@ +@@ -113,8 +113,10 @@ #![feature(const_fn_trait_bound)] #![feature(core_intrinsics)] #![feature(format_args_nl)] +#![feature(generic_const_exprs)] - #![feature(global_asm)] #![feature(linkage)] #![feature(panic_info_message)] +#![feature(step_trait)] #![feature(trait_alias)] #![no_std] // Testing -@@ -128,6 +130,7 @@ +@@ -127,6 +129,7 @@ mod synchronization; pub mod bsp; @@ -2157,7 +2154,7 @@ diff -uNr 13_exceptions_part2_peripheral_IRQs/src/lib.rs 14_virtual_mem_part2_mm pub mod console; pub mod cpu; pub mod driver; -@@ -180,6 +183,7 @@ +@@ -179,6 +182,7 @@ #[no_mangle] unsafe fn kernel_init() -> ! { exception::handling_init(); @@ -3430,7 +3427,7 @@ diff -uNr 13_exceptions_part2_peripheral_IRQs/src/memory/mmu.rs 14_virtual_mem_p diff -uNr 13_exceptions_part2_peripheral_IRQs/src/memory.rs 14_virtual_mem_part2_mmio_remap/src/memory.rs --- 13_exceptions_part2_peripheral_IRQs/src/memory.rs +++ 14_virtual_mem_part2_mmio_remap/src/memory.rs -@@ -5,3 +5,161 @@ +@@ -5,3 +5,163 @@ //! Memory Management. pub mod mmu; @@ -3486,6 +3483,7 @@ diff -uNr 13_exceptions_part2_peripheral_IRQs/src/memory.rs 14_virtual_mem_part2 + } + + /// Align down to page size. ++ #[must_use] + pub const fn align_down_page(self) -> Self { + let aligned = common::align_down(self.value, bsp::memory::mmu::KernelGranule::SIZE); + @@ -3493,6 +3491,7 @@ diff -uNr 13_exceptions_part2_peripheral_IRQs/src/memory.rs 14_virtual_mem_part2 + } + + /// Align up to page size. ++ #[must_use] + pub const fn align_up_page(self) -> Self { + let aligned = common::align_up(self.value, bsp::memory::mmu::KernelGranule::SIZE); + diff --git a/14_virtual_mem_part2_mmio_remap/src/_arch/aarch64/cpu/boot.rs b/14_virtual_mem_part2_mmio_remap/src/_arch/aarch64/cpu/boot.rs index 4f006862..f54ae739 100644 --- a/14_virtual_mem_part2_mmio_remap/src/_arch/aarch64/cpu/boot.rs +++ b/14_virtual_mem_part2_mmio_remap/src/_arch/aarch64/cpu/boot.rs @@ -11,6 +11,7 @@ //! //! crate::cpu::boot::arch_boot +use core::arch::global_asm; use cortex_a::{asm, registers::*}; use tock_registers::interfaces::Writeable; diff --git a/14_virtual_mem_part2_mmio_remap/src/_arch/aarch64/exception.rs b/14_virtual_mem_part2_mmio_remap/src/_arch/aarch64/exception.rs index 880cc92b..708f63dd 100644 --- a/14_virtual_mem_part2_mmio_remap/src/_arch/aarch64/exception.rs +++ b/14_virtual_mem_part2_mmio_remap/src/_arch/aarch64/exception.rs @@ -12,7 +12,7 @@ //! crate::exception::arch_exception use crate::{bsp, exception}; -use core::{cell::UnsafeCell, fmt}; +use core::{arch::global_asm, cell::UnsafeCell, fmt}; use cortex_a::{asm::barrier, registers::*}; use tock_registers::{ interfaces::{Readable, Writeable}, diff --git a/14_virtual_mem_part2_mmio_remap/src/_arch/aarch64/exception/asynchronous.rs b/14_virtual_mem_part2_mmio_remap/src/_arch/aarch64/exception/asynchronous.rs index 4e79cc8a..799ab4e8 100644 --- a/14_virtual_mem_part2_mmio_remap/src/_arch/aarch64/exception/asynchronous.rs +++ b/14_virtual_mem_part2_mmio_remap/src/_arch/aarch64/exception/asynchronous.rs @@ -11,6 +11,7 @@ //! //! crate::exception::asynchronous::arch_asynchronous +use core::arch::asm; use cortex_a::registers::*; use tock_registers::interfaces::{Readable, Writeable}; diff --git a/14_virtual_mem_part2_mmio_remap/src/bsp/device_driver/arm/gicv2.rs b/14_virtual_mem_part2_mmio_remap/src/bsp/device_driver/arm/gicv2.rs index 3f69bd11..bbafa5fe 100644 --- a/14_virtual_mem_part2_mmio_remap/src/bsp/device_driver/arm/gicv2.rs +++ b/14_virtual_mem_part2_mmio_remap/src/bsp/device_driver/arm/gicv2.rs @@ -154,10 +154,8 @@ impl driver::interface::DeviceDriver for GICv2 { unsafe fn init(&self) -> Result<(), &'static str> { let remapped = self.is_mmio_remapped.load(Ordering::Relaxed); if !remapped { - let mut virt_addr; - // GICD - virt_addr = memory::mmu::kernel_map_mmio("GICD", &self.gicd_mmio_descriptor)?; + let mut virt_addr = memory::mmu::kernel_map_mmio("GICD", &self.gicd_mmio_descriptor)?; self.gicd.set_mmio(virt_addr.as_usize()); // GICC diff --git a/14_virtual_mem_part2_mmio_remap/src/lib.rs b/14_virtual_mem_part2_mmio_remap/src/lib.rs index 6b944627..d36e5448 100644 --- a/14_virtual_mem_part2_mmio_remap/src/lib.rs +++ b/14_virtual_mem_part2_mmio_remap/src/lib.rs @@ -108,13 +108,12 @@ #![allow(clippy::upper_case_acronyms)] #![allow(incomplete_features)] -#![feature(asm)] +#![feature(asm_const)] #![feature(const_fn_fn_ptr_basics)] #![feature(const_fn_trait_bound)] #![feature(core_intrinsics)] #![feature(format_args_nl)] #![feature(generic_const_exprs)] -#![feature(global_asm)] #![feature(linkage)] #![feature(panic_info_message)] #![feature(step_trait)] diff --git a/14_virtual_mem_part2_mmio_remap/src/memory.rs b/14_virtual_mem_part2_mmio_remap/src/memory.rs index 36054173..f33ca323 100644 --- a/14_virtual_mem_part2_mmio_remap/src/memory.rs +++ b/14_virtual_mem_part2_mmio_remap/src/memory.rs @@ -57,6 +57,7 @@ impl Address { } /// Align down to page size. + #[must_use] pub const fn align_down_page(self) -> Self { let aligned = common::align_down(self.value, bsp::memory::mmu::KernelGranule::SIZE); @@ -64,6 +65,7 @@ impl Address { } /// Align up to page size. + #[must_use] pub const fn align_up_page(self) -> Self { let aligned = common::align_up(self.value, bsp::memory::mmu::KernelGranule::SIZE); diff --git a/15_virtual_mem_part3_precomputed_tables/Cargo.lock b/15_virtual_mem_part3_precomputed_tables/Cargo.lock index 6cb12baa..6c03310c 100644 --- a/15_virtual_mem_part3_precomputed_tables/Cargo.lock +++ b/15_virtual_mem_part3_precomputed_tables/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "cortex-a" -version = "6.1.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "509fc35485a2b4ddbacabe0bf2212cdfff88da93658608e5cc651afcb75b7733" +checksum = "b27f5d071b671f9799dfdf0c0afcec11de65195383d36e186639c83b00705e4f" dependencies = [ "tock-registers", ] @@ -33,9 +33,9 @@ dependencies = [ [[package]] name = "qemu-exit" -version = "2.0.1" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "220eb94f40665452ab6114bf8a8d86aa1fd41c6dbfaa4ab71b5912c8adb80389" +checksum = "0e0fa04276d522a40ed717bf874183a3b2a8bbb3fb4c646b03a7eb874ce5d543" [[package]] name = "quote" diff --git a/15_virtual_mem_part3_precomputed_tables/Cargo.toml b/15_virtual_mem_part3_precomputed_tables/Cargo.toml index 91a69bf3..ea20f0db 100644 --- a/15_virtual_mem_part3_precomputed_tables/Cargo.toml +++ b/15_virtual_mem_part3_precomputed_tables/Cargo.toml @@ -22,11 +22,11 @@ test-types = { path = "test-types" } # Optional dependencies tock-registers = { version = "0.7.x", default-features = false, features = ["register_types"], optional = true } -qemu-exit = { version = "2.x.x", optional = true } +qemu-exit = { version = "3.x.x", optional = true } # Platform specific dependencies [target.'cfg(target_arch = "aarch64")'.dependencies] -cortex-a = { version = "6.x.x" } +cortex-a = { version = "7.x.x" } ##-------------------------------------------------------------------------------------------------- ## Testing diff --git a/15_virtual_mem_part3_precomputed_tables/README.md b/15_virtual_mem_part3_precomputed_tables/README.md index f0067cda..f87d297a 100644 --- a/15_virtual_mem_part3_precomputed_tables/README.md +++ b/15_virtual_mem_part3_precomputed_tables/README.md @@ -821,10 +821,10 @@ diff -uNr 14_virtual_mem_part2_mmio_remap/src/_arch/aarch64/cpu/boot.rs 15_virtu //! crate::cpu::boot::arch_boot +use crate::{memory, memory::Address}; + use core::arch::global_asm; use cortex_a::{asm, registers::*}; use tock_registers::interfaces::Writeable; - -@@ -70,9 +71,16 @@ +@@ -71,9 +72,16 @@ /// /// - Exception return from EL2 must must continue execution in EL1 with `kernel_init()`. #[no_mangle] @@ -1167,7 +1167,7 @@ diff -uNr 14_virtual_mem_part2_mmio_remap/src/bsp/raspberrypi/memory/mmu.rs 15_v //-------------------------------------------------------------------------------------------------- // Global instances -@@ -43,13 +43,34 @@ +@@ -43,13 +43,35 @@ /// /// That is, `size_of(InitStateLock) == size_of(KernelTranslationTable)`. /// There is a unit tests that checks this porperty. @@ -1192,6 +1192,7 @@ diff -uNr 14_virtual_mem_part2_mmio_remap/src/bsp/raspberrypi/memory/mmu.rs 15_v +/// This is a hack for retrieving the value for the kernel's virtual address space size as a +/// constant from a common place, since it is needed as a compile-time/link-time constant in both, +/// the linker script and the Rust sources. ++#[allow(clippy::needless_late_init)] +const fn kernel_virt_addr_space_size() -> usize { + let __kernel_virt_addr_space_size; + @@ -1203,7 +1204,7 @@ diff -uNr 14_virtual_mem_part2_mmio_remap/src/bsp/raspberrypi/memory/mmu.rs 15_v /// Helper function for calculating the number of pages the given parameter spans. const fn size_to_num_pages(size: usize) -> usize { assert!(size > 0); -@@ -88,18 +109,22 @@ +@@ -88,18 +110,22 @@ MemoryRegion::new(start_page_addr, end_exclusive_page_addr) } @@ -1237,7 +1238,7 @@ diff -uNr 14_virtual_mem_part2_mmio_remap/src/bsp/raspberrypi/memory/mmu.rs 15_v } //-------------------------------------------------------------------------------------------------- -@@ -121,109 +146,33 @@ +@@ -121,109 +147,33 @@ MemoryRegion::new(start_page_addr, end_exclusive_page_addr) } diff --git a/15_virtual_mem_part3_precomputed_tables/src/_arch/aarch64/cpu/boot.rs b/15_virtual_mem_part3_precomputed_tables/src/_arch/aarch64/cpu/boot.rs index 52195d8f..e604e112 100644 --- a/15_virtual_mem_part3_precomputed_tables/src/_arch/aarch64/cpu/boot.rs +++ b/15_virtual_mem_part3_precomputed_tables/src/_arch/aarch64/cpu/boot.rs @@ -12,6 +12,7 @@ //! crate::cpu::boot::arch_boot use crate::{memory, memory::Address}; +use core::arch::global_asm; use cortex_a::{asm, registers::*}; use tock_registers::interfaces::Writeable; diff --git a/15_virtual_mem_part3_precomputed_tables/src/_arch/aarch64/exception.rs b/15_virtual_mem_part3_precomputed_tables/src/_arch/aarch64/exception.rs index 880cc92b..708f63dd 100644 --- a/15_virtual_mem_part3_precomputed_tables/src/_arch/aarch64/exception.rs +++ b/15_virtual_mem_part3_precomputed_tables/src/_arch/aarch64/exception.rs @@ -12,7 +12,7 @@ //! crate::exception::arch_exception use crate::{bsp, exception}; -use core::{cell::UnsafeCell, fmt}; +use core::{arch::global_asm, cell::UnsafeCell, fmt}; use cortex_a::{asm::barrier, registers::*}; use tock_registers::{ interfaces::{Readable, Writeable}, diff --git a/15_virtual_mem_part3_precomputed_tables/src/_arch/aarch64/exception/asynchronous.rs b/15_virtual_mem_part3_precomputed_tables/src/_arch/aarch64/exception/asynchronous.rs index 4e79cc8a..799ab4e8 100644 --- a/15_virtual_mem_part3_precomputed_tables/src/_arch/aarch64/exception/asynchronous.rs +++ b/15_virtual_mem_part3_precomputed_tables/src/_arch/aarch64/exception/asynchronous.rs @@ -11,6 +11,7 @@ //! //! crate::exception::asynchronous::arch_asynchronous +use core::arch::asm; use cortex_a::registers::*; use tock_registers::interfaces::{Readable, Writeable}; diff --git a/15_virtual_mem_part3_precomputed_tables/src/bsp/device_driver/arm/gicv2.rs b/15_virtual_mem_part3_precomputed_tables/src/bsp/device_driver/arm/gicv2.rs index 3f69bd11..bbafa5fe 100644 --- a/15_virtual_mem_part3_precomputed_tables/src/bsp/device_driver/arm/gicv2.rs +++ b/15_virtual_mem_part3_precomputed_tables/src/bsp/device_driver/arm/gicv2.rs @@ -154,10 +154,8 @@ impl driver::interface::DeviceDriver for GICv2 { unsafe fn init(&self) -> Result<(), &'static str> { let remapped = self.is_mmio_remapped.load(Ordering::Relaxed); if !remapped { - let mut virt_addr; - // GICD - virt_addr = memory::mmu::kernel_map_mmio("GICD", &self.gicd_mmio_descriptor)?; + let mut virt_addr = memory::mmu::kernel_map_mmio("GICD", &self.gicd_mmio_descriptor)?; self.gicd.set_mmio(virt_addr.as_usize()); // GICC diff --git a/15_virtual_mem_part3_precomputed_tables/src/bsp/raspberrypi/memory/mmu.rs b/15_virtual_mem_part3_precomputed_tables/src/bsp/raspberrypi/memory/mmu.rs index 2881ab11..441000db 100644 --- a/15_virtual_mem_part3_precomputed_tables/src/bsp/raspberrypi/memory/mmu.rs +++ b/15_virtual_mem_part3_precomputed_tables/src/bsp/raspberrypi/memory/mmu.rs @@ -63,6 +63,7 @@ static PHYS_KERNEL_TABLES_BASE_ADDR: u64 = 0xCCCCAAAAFFFFEEEE; /// This is a hack for retrieving the value for the kernel's virtual address space size as a /// constant from a common place, since it is needed as a compile-time/link-time constant in both, /// the linker script and the Rust sources. +#[allow(clippy::needless_late_init)] const fn kernel_virt_addr_space_size() -> usize { let __kernel_virt_addr_space_size; diff --git a/15_virtual_mem_part3_precomputed_tables/src/lib.rs b/15_virtual_mem_part3_precomputed_tables/src/lib.rs index 6b944627..d36e5448 100644 --- a/15_virtual_mem_part3_precomputed_tables/src/lib.rs +++ b/15_virtual_mem_part3_precomputed_tables/src/lib.rs @@ -108,13 +108,12 @@ #![allow(clippy::upper_case_acronyms)] #![allow(incomplete_features)] -#![feature(asm)] +#![feature(asm_const)] #![feature(const_fn_fn_ptr_basics)] #![feature(const_fn_trait_bound)] #![feature(core_intrinsics)] #![feature(format_args_nl)] #![feature(generic_const_exprs)] -#![feature(global_asm)] #![feature(linkage)] #![feature(panic_info_message)] #![feature(step_trait)] diff --git a/15_virtual_mem_part3_precomputed_tables/src/memory.rs b/15_virtual_mem_part3_precomputed_tables/src/memory.rs index 36054173..f33ca323 100644 --- a/15_virtual_mem_part3_precomputed_tables/src/memory.rs +++ b/15_virtual_mem_part3_precomputed_tables/src/memory.rs @@ -57,6 +57,7 @@ impl Address { } /// Align down to page size. + #[must_use] pub const fn align_down_page(self) -> Self { let aligned = common::align_down(self.value, bsp::memory::mmu::KernelGranule::SIZE); @@ -64,6 +65,7 @@ impl Address { } /// Align up to page size. + #[must_use] pub const fn align_up_page(self) -> Self { let aligned = common::align_up(self.value, bsp::memory::mmu::KernelGranule::SIZE); diff --git a/16_virtual_mem_part4_higher_half_kernel/Cargo.lock b/16_virtual_mem_part4_higher_half_kernel/Cargo.lock index d2e5b0d6..13d1d928 100644 --- a/16_virtual_mem_part4_higher_half_kernel/Cargo.lock +++ b/16_virtual_mem_part4_higher_half_kernel/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "cortex-a" -version = "6.1.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "509fc35485a2b4ddbacabe0bf2212cdfff88da93658608e5cc651afcb75b7733" +checksum = "b27f5d071b671f9799dfdf0c0afcec11de65195383d36e186639c83b00705e4f" dependencies = [ "tock-registers", ] @@ -33,9 +33,9 @@ dependencies = [ [[package]] name = "qemu-exit" -version = "2.0.1" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "220eb94f40665452ab6114bf8a8d86aa1fd41c6dbfaa4ab71b5912c8adb80389" +checksum = "0e0fa04276d522a40ed717bf874183a3b2a8bbb3fb4c646b03a7eb874ce5d543" [[package]] name = "quote" diff --git a/16_virtual_mem_part4_higher_half_kernel/Cargo.toml b/16_virtual_mem_part4_higher_half_kernel/Cargo.toml index 9bf6df42..07a1c57e 100644 --- a/16_virtual_mem_part4_higher_half_kernel/Cargo.toml +++ b/16_virtual_mem_part4_higher_half_kernel/Cargo.toml @@ -22,11 +22,11 @@ test-types = { path = "test-types" } # Optional dependencies tock-registers = { version = "0.7.x", default-features = false, features = ["register_types"], optional = true } -qemu-exit = { version = "2.x.x", optional = true } +qemu-exit = { version = "3.x.x", optional = true } # Platform specific dependencies [target.'cfg(target_arch = "aarch64")'.dependencies] -cortex-a = { version = "6.x.x" } +cortex-a = { version = "7.x.x" } ##-------------------------------------------------------------------------------------------------- ## Testing diff --git a/16_virtual_mem_part4_higher_half_kernel/README.md b/16_virtual_mem_part4_higher_half_kernel/README.md index 86276cde..bde23439 100644 --- a/16_virtual_mem_part4_higher_half_kernel/README.md +++ b/16_virtual_mem_part4_higher_half_kernel/README.md @@ -340,7 +340,7 @@ diff -uNr 15_virtual_mem_part3_precomputed_tables/Cargo.toml 16_virtual_mem_part diff -uNr 15_virtual_mem_part3_precomputed_tables/src/_arch/aarch64/cpu/boot.rs 16_virtual_mem_part4_higher_half_kernel/src/_arch/aarch64/cpu/boot.rs --- 15_virtual_mem_part3_precomputed_tables/src/_arch/aarch64/cpu/boot.rs +++ 16_virtual_mem_part4_higher_half_kernel/src/_arch/aarch64/cpu/boot.rs -@@ -29,7 +29,10 @@ +@@ -30,7 +30,10 @@ /// - The `bss` section is not initialized yet. The code must not use or reference it in any way. /// - The HW state of EL1 must be prepared in a sound way. #[inline(always)] @@ -352,7 +352,7 @@ diff -uNr 15_virtual_mem_part3_precomputed_tables/src/_arch/aarch64/cpu/boot.rs // Enable timer counter registers for EL1. CNTHCTL_EL2.write(CNTHCTL_EL2::EL1PCEN::SET + CNTHCTL_EL2::EL1PCTEN::SET); -@@ -52,11 +55,11 @@ +@@ -53,11 +56,11 @@ ); // Second, let the link register point to kernel_init(). @@ -366,7 +366,7 @@ diff -uNr 15_virtual_mem_part3_precomputed_tables/src/_arch/aarch64/cpu/boot.rs } //-------------------------------------------------------------------------------------------------- -@@ -73,14 +76,19 @@ +@@ -74,14 +77,19 @@ #[no_mangle] pub unsafe extern "C" fn _start_rust( phys_kernel_tables_base_addr: u64, @@ -731,7 +731,7 @@ diff -uNr 15_virtual_mem_part3_precomputed_tables/src/bsp/raspberrypi/memory/mmu //-------------------------------------------------------------------------------------------------- // Public Definitions -@@ -152,14 +152,6 @@ +@@ -153,14 +153,6 @@ /// `translation table tool` and patched into the kernel binary. This function just adds the mapping /// record entries. pub fn kernel_add_mapping_records_for_precomputed() { @@ -746,7 +746,7 @@ diff -uNr 15_virtual_mem_part3_precomputed_tables/src/bsp/raspberrypi/memory/mmu let virt_code_region = virt_code_region(); generic_mmu::kernel_add_mapping_record( "Kernel code and RO data", -@@ -175,4 +167,12 @@ +@@ -176,4 +168,12 @@ &kernel_virt_to_phys_region(virt_data_region), &kernel_page_attributes(virt_data_region.start_page_addr()), ); @@ -799,7 +799,7 @@ diff -uNr 15_virtual_mem_part3_precomputed_tables/src/bsp/raspberrypi/memory.rs diff -uNr 15_virtual_mem_part3_precomputed_tables/src/lib.rs 16_virtual_mem_part4_higher_half_kernel/src/lib.rs --- 15_virtual_mem_part3_precomputed_tables/src/lib.rs +++ 16_virtual_mem_part4_higher_half_kernel/src/lib.rs -@@ -153,11 +153,6 @@ +@@ -152,11 +152,6 @@ ) } diff --git a/16_virtual_mem_part4_higher_half_kernel/src/_arch/aarch64/cpu/boot.rs b/16_virtual_mem_part4_higher_half_kernel/src/_arch/aarch64/cpu/boot.rs index 96a5bbb3..87f120d2 100644 --- a/16_virtual_mem_part4_higher_half_kernel/src/_arch/aarch64/cpu/boot.rs +++ b/16_virtual_mem_part4_higher_half_kernel/src/_arch/aarch64/cpu/boot.rs @@ -12,6 +12,7 @@ //! crate::cpu::boot::arch_boot use crate::{memory, memory::Address}; +use core::arch::global_asm; use cortex_a::{asm, registers::*}; use tock_registers::interfaces::Writeable; diff --git a/16_virtual_mem_part4_higher_half_kernel/src/_arch/aarch64/exception.rs b/16_virtual_mem_part4_higher_half_kernel/src/_arch/aarch64/exception.rs index 880cc92b..708f63dd 100644 --- a/16_virtual_mem_part4_higher_half_kernel/src/_arch/aarch64/exception.rs +++ b/16_virtual_mem_part4_higher_half_kernel/src/_arch/aarch64/exception.rs @@ -12,7 +12,7 @@ //! crate::exception::arch_exception use crate::{bsp, exception}; -use core::{cell::UnsafeCell, fmt}; +use core::{arch::global_asm, cell::UnsafeCell, fmt}; use cortex_a::{asm::barrier, registers::*}; use tock_registers::{ interfaces::{Readable, Writeable}, diff --git a/16_virtual_mem_part4_higher_half_kernel/src/_arch/aarch64/exception/asynchronous.rs b/16_virtual_mem_part4_higher_half_kernel/src/_arch/aarch64/exception/asynchronous.rs index 4e79cc8a..799ab4e8 100644 --- a/16_virtual_mem_part4_higher_half_kernel/src/_arch/aarch64/exception/asynchronous.rs +++ b/16_virtual_mem_part4_higher_half_kernel/src/_arch/aarch64/exception/asynchronous.rs @@ -11,6 +11,7 @@ //! //! crate::exception::asynchronous::arch_asynchronous +use core::arch::asm; use cortex_a::registers::*; use tock_registers::interfaces::{Readable, Writeable}; diff --git a/16_virtual_mem_part4_higher_half_kernel/src/bsp/device_driver/arm/gicv2.rs b/16_virtual_mem_part4_higher_half_kernel/src/bsp/device_driver/arm/gicv2.rs index 3f69bd11..bbafa5fe 100644 --- a/16_virtual_mem_part4_higher_half_kernel/src/bsp/device_driver/arm/gicv2.rs +++ b/16_virtual_mem_part4_higher_half_kernel/src/bsp/device_driver/arm/gicv2.rs @@ -154,10 +154,8 @@ impl driver::interface::DeviceDriver for GICv2 { unsafe fn init(&self) -> Result<(), &'static str> { let remapped = self.is_mmio_remapped.load(Ordering::Relaxed); if !remapped { - let mut virt_addr; - // GICD - virt_addr = memory::mmu::kernel_map_mmio("GICD", &self.gicd_mmio_descriptor)?; + let mut virt_addr = memory::mmu::kernel_map_mmio("GICD", &self.gicd_mmio_descriptor)?; self.gicd.set_mmio(virt_addr.as_usize()); // GICC diff --git a/16_virtual_mem_part4_higher_half_kernel/src/bsp/raspberrypi/memory/mmu.rs b/16_virtual_mem_part4_higher_half_kernel/src/bsp/raspberrypi/memory/mmu.rs index 07df4483..86e09c01 100644 --- a/16_virtual_mem_part4_higher_half_kernel/src/bsp/raspberrypi/memory/mmu.rs +++ b/16_virtual_mem_part4_higher_half_kernel/src/bsp/raspberrypi/memory/mmu.rs @@ -63,6 +63,7 @@ static PHYS_KERNEL_TABLES_BASE_ADDR: u64 = 0xCCCCAAAAFFFFEEEE; /// This is a hack for retrieving the value for the kernel's virtual address space size as a /// constant from a common place, since it is needed as a compile-time/link-time constant in both, /// the linker script and the Rust sources. +#[allow(clippy::needless_late_init)] const fn kernel_virt_addr_space_size() -> usize { let __kernel_virt_addr_space_size; diff --git a/16_virtual_mem_part4_higher_half_kernel/src/lib.rs b/16_virtual_mem_part4_higher_half_kernel/src/lib.rs index f768643a..7fd5a761 100644 --- a/16_virtual_mem_part4_higher_half_kernel/src/lib.rs +++ b/16_virtual_mem_part4_higher_half_kernel/src/lib.rs @@ -108,13 +108,12 @@ #![allow(clippy::upper_case_acronyms)] #![allow(incomplete_features)] -#![feature(asm)] +#![feature(asm_const)] #![feature(const_fn_fn_ptr_basics)] #![feature(const_fn_trait_bound)] #![feature(core_intrinsics)] #![feature(format_args_nl)] #![feature(generic_const_exprs)] -#![feature(global_asm)] #![feature(linkage)] #![feature(panic_info_message)] #![feature(step_trait)] diff --git a/16_virtual_mem_part4_higher_half_kernel/src/memory.rs b/16_virtual_mem_part4_higher_half_kernel/src/memory.rs index 36054173..f33ca323 100644 --- a/16_virtual_mem_part4_higher_half_kernel/src/memory.rs +++ b/16_virtual_mem_part4_higher_half_kernel/src/memory.rs @@ -57,6 +57,7 @@ impl Address { } /// Align down to page size. + #[must_use] pub const fn align_down_page(self) -> Self { let aligned = common::align_down(self.value, bsp::memory::mmu::KernelGranule::SIZE); @@ -64,6 +65,7 @@ impl Address { } /// Align up to page size. + #[must_use] pub const fn align_up_page(self) -> Self { let aligned = common::align_up(self.value, bsp::memory::mmu::KernelGranule::SIZE); diff --git a/X1_JTAG_boot/Cargo.lock b/X1_JTAG_boot/Cargo.lock index 884ec5f0..2abe1c74 100644 --- a/X1_JTAG_boot/Cargo.lock +++ b/X1_JTAG_boot/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "cortex-a" -version = "6.1.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "509fc35485a2b4ddbacabe0bf2212cdfff88da93658608e5cc651afcb75b7733" +checksum = "b27f5d071b671f9799dfdf0c0afcec11de65195383d36e186639c83b00705e4f" dependencies = [ "tock-registers", ] diff --git a/X1_JTAG_boot/Cargo.toml b/X1_JTAG_boot/Cargo.toml index b6d42173..638d4de1 100644 --- a/X1_JTAG_boot/Cargo.toml +++ b/X1_JTAG_boot/Cargo.toml @@ -27,5 +27,4 @@ tock-registers = { version = "0.7.x", default-features = false, features = ["reg # Platform specific dependencies [target.'cfg(target_arch = "aarch64")'.dependencies] -cortex-a = { version = "6.x.x" } - +cortex-a = { version = "7.x.x" } diff --git a/X1_JTAG_boot/jtag_boot_rpi3.img b/X1_JTAG_boot/jtag_boot_rpi3.img index be80f810e3be61b54b0af0694cec1c5d73d1f1f5..76a5d4c6e7aa0ab07c6bb1d6edb323b85c4c819d 100755 GIT binary patch delta 2976 zcmb7FYj6|S6~4PG$&xG^OO|c?l!S>b$u`Ca+maLF6(j*{D8VSxNt%i58XCYh!AhH9 zrg0=s1_&58zFAr*{0NU9VFd;fLtB?L*yT@C2&K?4`B91lZN^U?o=zJzgSOw5*F%%( zk9KGFaqqe3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8defcda 100644 --- a/X1_JTAG_boot/src/_arch/aarch64/cpu/boot.rs +++ b/X1_JTAG_boot/src/_arch/aarch64/cpu/boot.rs @@ -12,7 +12,7 @@ //! crate::cpu::boot::arch_boot // Assembly counterpart to this file. -global_asm!(include_str!("boot.s")); +core::arch::global_asm!(include_str!("boot.s")); //-------------------------------------------------------------------------------------------------- // Public Code diff --git a/X1_JTAG_boot/src/main.rs b/X1_JTAG_boot/src/main.rs index 23221621..4f0a6ffc 100644 --- a/X1_JTAG_boot/src/main.rs +++ b/X1_JTAG_boot/src/main.rs @@ -107,7 +107,6 @@ #![allow(clippy::upper_case_acronyms)] #![feature(const_fn_fn_ptr_basics)] #![feature(format_args_nl)] -#![feature(global_asm)] #![feature(panic_info_message)] #![feature(trait_alias)] #![no_main] diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 6051e9b6..19f8449a 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "nightly-2021-10-10" +channel = "nightly-2021-12-18" components = ["llvm-tools-preview"] targets = ["aarch64-unknown-none-softfloat"]