diff --git a/03_hacky_hello_world/README.md b/03_hacky_hello_world/README.md index 527757dd..b0cfee12 100644 --- a/03_hacky_hello_world/README.md +++ b/03_hacky_hello_world/README.md @@ -35,8 +35,8 @@ Stopping here. ``` ## Diff to previous - ```diff + diff -uNr 02_runtime_init/Cargo.toml 03_hacky_hello_world/Cargo.toml --- 02_runtime_init/Cargo.toml +++ 03_hacky_hello_world/Cargo.toml @@ -97,7 +97,7 @@ diff -uNr 02_runtime_init/Makefile 03_hacky_hello_world/Makefile @@ -169,3 +172,28 @@ ##------------------------------------------------------------------------------ check: - @RUSTFLAGS="$(RUSTFLAGS)" $(CHECK_CMD) --message-format=json + @RUSTFLAGS="$(RUSTFLAGS)" $(CHECK_CMD) --message-format=json + + + @@ -109,7 +109,7 @@ diff -uNr 02_runtime_init/Makefile 03_hacky_hello_world/Makefile +ifeq ($(QEMU_MACHINE_TYPE),) # QEMU is not supported for the board. + +test_boot test : -+ $(call colorecho, "\n$(QEMU_MISSING_STRING)") ++ $(call colorecho, "\n$(QEMU_MISSING_STRING)") + +else # QEMU is supported. + @@ -117,8 +117,8 @@ diff -uNr 02_runtime_init/Makefile 03_hacky_hello_world/Makefile +## Run boot test +##------------------------------------------------------------------------------ +test_boot: $(KERNEL_BIN) -+ $(call colorecho, "\nBoot test - $(BSP)") -+ @$(DOCKER_TEST) $(EXEC_TEST_DISPATCH) $(EXEC_QEMU) $(QEMU_RELEASE_ARGS) -kernel $(KERNEL_BIN) ++ $(call colorecho, "\nBoot test - $(BSP)") ++ @$(DOCKER_TEST) $(EXEC_TEST_DISPATCH) $(EXEC_QEMU) $(QEMU_RELEASE_ARGS) -kernel $(KERNEL_BIN) + +test: test_boot + @@ -358,4 +358,5 @@ diff -uNr 02_runtime_init/tests/boot_test_string.rb 03_hacky_hello_world/tests/b +# frozen_string_literal: true + +EXPECTED_PRINT = 'Stopping here' + ``` diff --git a/05_drivers_gpio_uart/README.md b/05_drivers_gpio_uart/README.md index aa39cbaa..d49adf28 100644 --- a/05_drivers_gpio_uart/README.md +++ b/05_drivers_gpio_uart/README.md @@ -1333,16 +1333,15 @@ diff -uNr 04_safe_globals/src/driver.rs 05_drivers_gpio_uart/src/driver.rs diff -uNr 04_safe_globals/src/main.rs 05_drivers_gpio_uart/src/main.rs --- 04_safe_globals/src/main.rs +++ 05_drivers_gpio_uart/src/main.rs -@@ -104,6 +104,8 @@ +@@ -104,6 +104,7 @@ //! - It is implemented in `src/_arch/__arch_name__/cpu/boot.s`. //! 2. Once finished with architectural setup, the arch code calls `kernel_init()`. +#![allow(clippy::upper_case_acronyms)] -+#![feature(const_fn_fn_ptr_basics)] #![feature(format_args_nl)] #![feature(panic_info_message)] #![feature(trait_alias)] -@@ -113,6 +115,7 @@ +@@ -113,6 +114,7 @@ mod bsp; mod console; mod cpu; @@ -1350,7 +1349,7 @@ diff -uNr 04_safe_globals/src/main.rs 05_drivers_gpio_uart/src/main.rs mod panic_wait; mod print; mod synchronization; -@@ -122,16 +125,54 @@ +@@ -122,16 +124,54 @@ /// # Safety /// /// - Only a single core must be active and running this function. diff --git a/05_drivers_gpio_uart/src/main.rs b/05_drivers_gpio_uart/src/main.rs index 55e80f56..70e6b116 100644 --- a/05_drivers_gpio_uart/src/main.rs +++ b/05_drivers_gpio_uart/src/main.rs @@ -105,7 +105,6 @@ //! 2. Once finished with architectural setup, the arch code calls `kernel_init()`. #![allow(clippy::upper_case_acronyms)] -#![feature(const_fn_fn_ptr_basics)] #![feature(format_args_nl)] #![feature(panic_info_message)] #![feature(trait_alias)] diff --git a/06_uart_chainloader/README.md b/06_uart_chainloader/README.md index b904d9d8..6f786dd8 100644 --- a/06_uart_chainloader/README.md +++ b/06_uart_chainloader/README.md @@ -457,7 +457,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 -@@ -141,38 +141,56 @@ +@@ -140,38 +140,56 @@ kernel_main() } diff --git a/06_uart_chainloader/demo_payload_rpi3.img b/06_uart_chainloader/demo_payload_rpi3.img index 1997951a..1491d9b5 100755 Binary files a/06_uart_chainloader/demo_payload_rpi3.img and b/06_uart_chainloader/demo_payload_rpi3.img differ diff --git a/06_uart_chainloader/demo_payload_rpi4.img b/06_uart_chainloader/demo_payload_rpi4.img index 9f463d32..9f7de6df 100755 Binary files a/06_uart_chainloader/demo_payload_rpi4.img and b/06_uart_chainloader/demo_payload_rpi4.img differ diff --git a/06_uart_chainloader/src/main.rs b/06_uart_chainloader/src/main.rs index e44a1ae6..32a56bda 100644 --- a/06_uart_chainloader/src/main.rs +++ b/06_uart_chainloader/src/main.rs @@ -105,7 +105,6 @@ //! 2. Once finished with architectural setup, the arch code calls `kernel_init()`. #![allow(clippy::upper_case_acronyms)] -#![feature(const_fn_fn_ptr_basics)] #![feature(format_args_nl)] #![feature(panic_info_message)] #![feature(trait_alias)] diff --git a/07_timestamps/README.md b/07_timestamps/README.md index 0af0b046..e6796930 100644 --- a/07_timestamps/README.md +++ b/07_timestamps/README.md @@ -538,7 +538,7 @@ diff -uNr 06_uart_chainloader/src/cpu.rs 07_timestamps/src/cpu.rs diff -uNr 06_uart_chainloader/src/main.rs 07_timestamps/src/main.rs --- 06_uart_chainloader/src/main.rs +++ 07_timestamps/src/main.rs -@@ -119,6 +119,7 @@ +@@ -118,6 +118,7 @@ mod panic_wait; mod print; mod synchronization; @@ -546,7 +546,7 @@ diff -uNr 06_uart_chainloader/src/main.rs 07_timestamps/src/main.rs /// Early init code. /// -@@ -141,56 +142,38 @@ +@@ -140,56 +141,38 @@ kernel_main() } diff --git a/07_timestamps/src/main.rs b/07_timestamps/src/main.rs index e5d1d81e..3d4ace4f 100644 --- a/07_timestamps/src/main.rs +++ b/07_timestamps/src/main.rs @@ -105,7 +105,6 @@ //! 2. Once finished with architectural setup, the arch code calls `kernel_init()`. #![allow(clippy::upper_case_acronyms)] -#![feature(const_fn_fn_ptr_basics)] #![feature(format_args_nl)] #![feature(panic_info_message)] #![feature(trait_alias)] diff --git a/08_hw_debug_JTAG/src/main.rs b/08_hw_debug_JTAG/src/main.rs index e5d1d81e..3d4ace4f 100644 --- a/08_hw_debug_JTAG/src/main.rs +++ b/08_hw_debug_JTAG/src/main.rs @@ -105,7 +105,6 @@ //! 2. Once finished with architectural setup, the arch code calls `kernel_init()`. #![allow(clippy::upper_case_acronyms)] -#![feature(const_fn_fn_ptr_basics)] #![feature(format_args_nl)] #![feature(panic_info_message)] #![feature(trait_alias)] diff --git a/09_privilege_level/README.md b/09_privilege_level/README.md index b9843495..729634ac 100644 --- a/09_privilege_level/README.md +++ b/09_privilege_level/README.md @@ -502,7 +502,7 @@ diff -uNr 08_hw_debug_JTAG/src/exception.rs 09_privilege_level/src/exception.rs diff -uNr 08_hw_debug_JTAG/src/main.rs 09_privilege_level/src/main.rs --- 08_hw_debug_JTAG/src/main.rs +++ 09_privilege_level/src/main.rs -@@ -116,6 +116,7 @@ +@@ -115,6 +115,7 @@ mod console; mod cpu; mod driver; @@ -510,7 +510,7 @@ diff -uNr 08_hw_debug_JTAG/src/main.rs 09_privilege_level/src/main.rs mod panic_wait; mod print; mod synchronization; -@@ -144,6 +145,8 @@ +@@ -143,6 +144,8 @@ /// The main function running after the early init. fn kernel_main() -> ! { @@ -519,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; -@@ -155,6 +158,12 @@ +@@ -154,6 +157,12 @@ ); info!("Booting on: {}", bsp::board_name()); @@ -532,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() -@@ -169,11 +178,15 @@ +@@ -168,11 +177,15 @@ info!(" {}. {}", i + 1, driver.compatible()); } diff --git a/09_privilege_level/src/main.rs b/09_privilege_level/src/main.rs index c3bca5c3..b4449734 100644 --- a/09_privilege_level/src/main.rs +++ b/09_privilege_level/src/main.rs @@ -105,7 +105,6 @@ //! 2. Once finished with architectural setup, the arch code calls `kernel_init()`. #![allow(clippy::upper_case_acronyms)] -#![feature(const_fn_fn_ptr_basics)] #![feature(format_args_nl)] #![feature(panic_info_message)] #![feature(trait_alias)] diff --git a/10_virtual_mem_part1_identity_mapping/README.md b/10_virtual_mem_part1_identity_mapping/README.md index f553e0e0..1bf427c0 100644 --- a/10_virtual_mem_part1_identity_mapping/README.md +++ b/10_virtual_mem_part1_identity_mapping/README.md @@ -1081,17 +1081,16 @@ diff -uNr 09_privilege_level/src/bsp.rs 10_virtual_mem_part1_identity_mapping/sr diff -uNr 09_privilege_level/src/main.rs 10_virtual_mem_part1_identity_mapping/src/main.rs --- 09_privilege_level/src/main.rs +++ 10_virtual_mem_part1_identity_mapping/src/main.rs -@@ -105,7 +105,9 @@ +@@ -105,6 +105,8 @@ //! 2. Once finished with architectural setup, the arch code calls `kernel_init()`. #![allow(clippy::upper_case_acronyms)] +#![allow(incomplete_features)] - #![feature(const_fn_fn_ptr_basics)] +#![feature(core_intrinsics)] #![feature(format_args_nl)] #![feature(panic_info_message)] #![feature(trait_alias)] -@@ -117,6 +119,7 @@ +@@ -116,6 +118,7 @@ mod cpu; mod driver; mod exception; @@ -1099,7 +1098,7 @@ diff -uNr 09_privilege_level/src/main.rs 10_virtual_mem_part1_identity_mapping/s mod panic_wait; mod print; mod synchronization; -@@ -127,9 +130,17 @@ +@@ -126,9 +129,17 @@ /// # Safety /// /// - Only a single core must be active and running this function. @@ -1118,7 +1117,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() { -@@ -158,6 +169,9 @@ +@@ -157,6 +168,9 @@ ); info!("Booting on: {}", bsp::board_name()); @@ -1128,7 +1127,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); -@@ -181,6 +195,13 @@ +@@ -180,6 +194,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/main.rs b/10_virtual_mem_part1_identity_mapping/src/main.rs index 5b5cb473..faa81ee8 100644 --- a/10_virtual_mem_part1_identity_mapping/src/main.rs +++ b/10_virtual_mem_part1_identity_mapping/src/main.rs @@ -106,7 +106,6 @@ #![allow(clippy::upper_case_acronyms)] #![allow(incomplete_features)] -#![feature(const_fn_fn_ptr_basics)] #![feature(core_intrinsics)] #![feature(format_args_nl)] #![feature(panic_info_message)] diff --git a/11_exceptions_part1_groundwork/README.md b/11_exceptions_part1_groundwork/README.md index 4df5c939..2f90b7ff 100644 --- a/11_exceptions_part1_groundwork/README.md +++ b/11_exceptions_part1_groundwork/README.md @@ -1016,7 +1016,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 -@@ -138,6 +138,8 @@ +@@ -137,6 +137,8 @@ use driver::interface::DriverManager; use memory::mmu::interface::MMU; @@ -1025,7 +1025,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); } -@@ -195,13 +197,28 @@ +@@ -194,13 +196,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/main.rs b/11_exceptions_part1_groundwork/src/main.rs index 22912318..77ffd9cd 100644 --- a/11_exceptions_part1_groundwork/src/main.rs +++ b/11_exceptions_part1_groundwork/src/main.rs @@ -106,7 +106,6 @@ #![allow(clippy::upper_case_acronyms)] #![allow(incomplete_features)] -#![feature(const_fn_fn_ptr_basics)] #![feature(core_intrinsics)] #![feature(format_args_nl)] #![feature(panic_info_message)] diff --git a/12_integrated_testing/README.md b/12_integrated_testing/README.md index 8a20a0d5..fddd4be5 100644 --- a/12_integrated_testing/README.md +++ b/12_integrated_testing/README.md @@ -1325,7 +1325,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,184 @@ +@@ -0,0 +1,183 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 +// +// Copyright (c) 2018-2022 Andre Richter @@ -1436,7 +1436,6 @@ diff -uNr 11_exceptions_part1_groundwork/src/lib.rs 12_integrated_testing/src/li + +#![allow(clippy::upper_case_acronyms)] +#![allow(incomplete_features)] -+#![feature(const_fn_fn_ptr_basics)] +#![feature(core_intrinsics)] +#![feature(format_args_nl)] +#![feature(linkage)] @@ -1514,7 +1513,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,124 +6,12 @@ +@@ -6,123 +6,12 @@ #![doc(html_logo_url = "https://git.io/JeGIp")] //! The `kernel` binary. @@ -1618,7 +1617,6 @@ diff -uNr 11_exceptions_part1_groundwork/src/main.rs 12_integrated_testing/src/m - -#![allow(clippy::upper_case_acronyms)] -#![allow(incomplete_features)] --#![feature(const_fn_fn_ptr_basics)] -#![feature(core_intrinsics)] + #![feature(format_args_nl)] @@ -1641,7 +1639,7 @@ diff -uNr 11_exceptions_part1_groundwork/src/main.rs 12_integrated_testing/src/m /// Early init code. /// -@@ -134,6 +22,7 @@ +@@ -133,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. @@ -1649,7 +1647,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; -@@ -160,15 +49,9 @@ +@@ -159,15 +49,9 @@ fn kernel_main() -> ! { use bsp::console::console; use console::interface::All; @@ -1666,7 +1664,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:"); -@@ -194,31 +77,6 @@ +@@ -193,31 +77,6 @@ info!(" {}. {}", i + 1, driver.compatible()); } diff --git a/12_integrated_testing/src/lib.rs b/12_integrated_testing/src/lib.rs index 036e8e5d..51f10d7c 100644 --- a/12_integrated_testing/src/lib.rs +++ b/12_integrated_testing/src/lib.rs @@ -108,7 +108,6 @@ #![allow(clippy::upper_case_acronyms)] #![allow(incomplete_features)] -#![feature(const_fn_fn_ptr_basics)] #![feature(core_intrinsics)] #![feature(format_args_nl)] #![feature(linkage)] diff --git a/13_exceptions_part2_peripheral_IRQs/README.md b/13_exceptions_part2_peripheral_IRQs/README.md index d89093df..4224d8b9 100644 --- a/13_exceptions_part2_peripheral_IRQs/README.md +++ b/13_exceptions_part2_peripheral_IRQs/README.md @@ -2376,7 +2376,7 @@ diff -uNr 12_integrated_testing/src/exception/asynchronous.rs 13_exceptions_part + pub const fn new(number: usize) -> Self { + assert!(number <= MAX_INCLUSIVE); + -+ Self { 0: number } ++ Self(number) + } + + /// Return the wrapped number. @@ -2411,17 +2411,15 @@ diff -uNr 12_integrated_testing/src/exception/asynchronous.rs 13_exceptions_part diff -uNr 12_integrated_testing/src/lib.rs 13_exceptions_part2_peripheral_IRQs/src/lib.rs --- 12_integrated_testing/src/lib.rs +++ 13_exceptions_part2_peripheral_IRQs/src/lib.rs -@@ -108,7 +108,9 @@ +@@ -108,6 +108,7 @@ #![allow(clippy::upper_case_acronyms)] #![allow(incomplete_features)] +#![feature(asm_const)] - #![feature(const_fn_fn_ptr_basics)] -+#![feature(const_fn_trait_bound)] #![feature(core_intrinsics)] #![feature(format_args_nl)] #![feature(linkage)] -@@ -131,6 +133,7 @@ +@@ -130,6 +131,7 @@ pub mod exception; pub mod memory; pub mod print; diff --git a/13_exceptions_part2_peripheral_IRQs/src/exception/asynchronous.rs b/13_exceptions_part2_peripheral_IRQs/src/exception/asynchronous.rs index 0e2835b2..fb1785c2 100644 --- a/13_exceptions_part2_peripheral_IRQs/src/exception/asynchronous.rs +++ b/13_exceptions_part2_peripheral_IRQs/src/exception/asynchronous.rs @@ -119,7 +119,7 @@ impl IRQNumber<{ MAX_INCLUSIVE }> { pub const fn new(number: usize) -> Self { assert!(number <= MAX_INCLUSIVE); - Self { 0: number } + Self(number) } /// Return the wrapped number. diff --git a/13_exceptions_part2_peripheral_IRQs/src/lib.rs b/13_exceptions_part2_peripheral_IRQs/src/lib.rs index 235aca13..6133f01a 100644 --- a/13_exceptions_part2_peripheral_IRQs/src/lib.rs +++ b/13_exceptions_part2_peripheral_IRQs/src/lib.rs @@ -109,8 +109,6 @@ #![allow(clippy::upper_case_acronyms)] #![allow(incomplete_features)] #![feature(asm_const)] -#![feature(const_fn_fn_ptr_basics)] -#![feature(const_fn_trait_bound)] #![feature(core_intrinsics)] #![feature(format_args_nl)] #![feature(linkage)] diff --git a/14_virtual_mem_part2_mmio_remap/README.md b/14_virtual_mem_part2_mmio_remap/README.md index ccec183c..07a82cda 100644 --- a/14_virtual_mem_part2_mmio_remap/README.md +++ b/14_virtual_mem_part2_mmio_remap/README.md @@ -2135,8 +2135,8 @@ 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,8 +113,10 @@ - #![feature(const_fn_trait_bound)] +@@ -111,8 +111,10 @@ + #![feature(asm_const)] #![feature(core_intrinsics)] #![feature(format_args_nl)] +#![feature(generic_const_exprs)] @@ -2146,7 +2146,7 @@ diff -uNr 13_exceptions_part2_peripheral_IRQs/src/lib.rs 14_virtual_mem_part2_mm #![feature(trait_alias)] #![no_std] // Testing -@@ -127,6 +129,7 @@ +@@ -125,6 +127,7 @@ mod synchronization; pub mod bsp; @@ -2154,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; -@@ -179,6 +182,7 @@ +@@ -177,6 +180,7 @@ #[no_mangle] unsafe fn kernel_init() -> ! { exception::handling_init(); @@ -2639,7 +2639,7 @@ diff -uNr 13_exceptions_part2_peripheral_IRQs/src/memory/mmu/translation_table.r diff -uNr 13_exceptions_part2_peripheral_IRQs/src/memory/mmu/types.rs 14_virtual_mem_part2_mmio_remap/src/memory/mmu/types.rs --- 13_exceptions_part2_peripheral_IRQs/src/memory/mmu/types.rs +++ 14_virtual_mem_part2_mmio_remap/src/memory/mmu/types.rs -@@ -0,0 +1,373 @@ +@@ -0,0 +1,375 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 +// +// Copyright (c) 2020-2022 Andre Richter @@ -2723,7 +2723,9 @@ diff -uNr 13_exceptions_part2_peripheral_IRQs/src/memory/mmu/types.rs 14_virtual + return Some(self); + } + -+ let delta = (count.abs() as usize).checked_mul(bsp::memory::mmu::KernelGranule::SIZE)?; ++ let delta = count ++ .unsigned_abs() ++ .checked_mul(bsp::memory::mmu::KernelGranule::SIZE)?; + let result = if count.is_positive() { + self.inner.as_usize().checked_add(delta)? + } else { diff --git a/14_virtual_mem_part2_mmio_remap/src/exception/asynchronous.rs b/14_virtual_mem_part2_mmio_remap/src/exception/asynchronous.rs index 0e2835b2..fb1785c2 100644 --- a/14_virtual_mem_part2_mmio_remap/src/exception/asynchronous.rs +++ b/14_virtual_mem_part2_mmio_remap/src/exception/asynchronous.rs @@ -119,7 +119,7 @@ impl IRQNumber<{ MAX_INCLUSIVE }> { pub const fn new(number: usize) -> Self { assert!(number <= MAX_INCLUSIVE); - Self { 0: number } + Self(number) } /// Return the wrapped number. diff --git a/14_virtual_mem_part2_mmio_remap/src/lib.rs b/14_virtual_mem_part2_mmio_remap/src/lib.rs index 7808f5ba..9ed0941c 100644 --- a/14_virtual_mem_part2_mmio_remap/src/lib.rs +++ b/14_virtual_mem_part2_mmio_remap/src/lib.rs @@ -109,8 +109,6 @@ #![allow(clippy::upper_case_acronyms)] #![allow(incomplete_features)] #![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)] diff --git a/14_virtual_mem_part2_mmio_remap/src/memory/mmu/types.rs b/14_virtual_mem_part2_mmio_remap/src/memory/mmu/types.rs index 84214836..82d5009c 100644 --- a/14_virtual_mem_part2_mmio_remap/src/memory/mmu/types.rs +++ b/14_virtual_mem_part2_mmio_remap/src/memory/mmu/types.rs @@ -81,7 +81,9 @@ impl PageAddress { return Some(self); } - let delta = (count.abs() as usize).checked_mul(bsp::memory::mmu::KernelGranule::SIZE)?; + let delta = count + .unsigned_abs() + .checked_mul(bsp::memory::mmu::KernelGranule::SIZE)?; let result = if count.is_positive() { self.inner.as_usize().checked_add(delta)? } else { diff --git a/15_virtual_mem_part3_precomputed_tables/src/exception/asynchronous.rs b/15_virtual_mem_part3_precomputed_tables/src/exception/asynchronous.rs index 0e2835b2..fb1785c2 100644 --- a/15_virtual_mem_part3_precomputed_tables/src/exception/asynchronous.rs +++ b/15_virtual_mem_part3_precomputed_tables/src/exception/asynchronous.rs @@ -119,7 +119,7 @@ impl IRQNumber<{ MAX_INCLUSIVE }> { pub const fn new(number: usize) -> Self { assert!(number <= MAX_INCLUSIVE); - Self { 0: number } + Self(number) } /// Return the wrapped number. diff --git a/15_virtual_mem_part3_precomputed_tables/src/lib.rs b/15_virtual_mem_part3_precomputed_tables/src/lib.rs index 7808f5ba..9ed0941c 100644 --- a/15_virtual_mem_part3_precomputed_tables/src/lib.rs +++ b/15_virtual_mem_part3_precomputed_tables/src/lib.rs @@ -109,8 +109,6 @@ #![allow(clippy::upper_case_acronyms)] #![allow(incomplete_features)] #![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)] diff --git a/15_virtual_mem_part3_precomputed_tables/src/memory/mmu/types.rs b/15_virtual_mem_part3_precomputed_tables/src/memory/mmu/types.rs index 84214836..82d5009c 100644 --- a/15_virtual_mem_part3_precomputed_tables/src/memory/mmu/types.rs +++ b/15_virtual_mem_part3_precomputed_tables/src/memory/mmu/types.rs @@ -81,7 +81,9 @@ impl PageAddress { return Some(self); } - let delta = (count.abs() as usize).checked_mul(bsp::memory::mmu::KernelGranule::SIZE)?; + let delta = count + .unsigned_abs() + .checked_mul(bsp::memory::mmu::KernelGranule::SIZE)?; let result = if count.is_positive() { self.inner.as_usize().checked_add(delta)? } else { diff --git a/16_virtual_mem_part4_higher_half_kernel/README.md b/16_virtual_mem_part4_higher_half_kernel/README.md index 487ce443..52ca9bfe 100644 --- a/16_virtual_mem_part4_higher_half_kernel/README.md +++ b/16_virtual_mem_part4_higher_half_kernel/README.md @@ -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 -@@ -152,11 +152,6 @@ +@@ -150,11 +150,6 @@ ) } diff --git a/16_virtual_mem_part4_higher_half_kernel/src/exception/asynchronous.rs b/16_virtual_mem_part4_higher_half_kernel/src/exception/asynchronous.rs index 0e2835b2..fb1785c2 100644 --- a/16_virtual_mem_part4_higher_half_kernel/src/exception/asynchronous.rs +++ b/16_virtual_mem_part4_higher_half_kernel/src/exception/asynchronous.rs @@ -119,7 +119,7 @@ impl IRQNumber<{ MAX_INCLUSIVE }> { pub const fn new(number: usize) -> Self { assert!(number <= MAX_INCLUSIVE); - Self { 0: number } + Self(number) } /// Return the wrapped number. 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 c15d35ee..76cd3792 100644 --- a/16_virtual_mem_part4_higher_half_kernel/src/lib.rs +++ b/16_virtual_mem_part4_higher_half_kernel/src/lib.rs @@ -109,8 +109,6 @@ #![allow(clippy::upper_case_acronyms)] #![allow(incomplete_features)] #![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)] diff --git a/16_virtual_mem_part4_higher_half_kernel/src/memory/mmu/types.rs b/16_virtual_mem_part4_higher_half_kernel/src/memory/mmu/types.rs index 43a96a11..b72ece28 100644 --- a/16_virtual_mem_part4_higher_half_kernel/src/memory/mmu/types.rs +++ b/16_virtual_mem_part4_higher_half_kernel/src/memory/mmu/types.rs @@ -86,7 +86,9 @@ impl PageAddress { return Some(self); } - let delta = (count.abs() as usize).checked_mul(bsp::memory::mmu::KernelGranule::SIZE)?; + let delta = count + .unsigned_abs() + .checked_mul(bsp::memory::mmu::KernelGranule::SIZE)?; let result = if count.is_positive() { self.inner.as_usize().checked_add(delta)? } else { diff --git a/X1_JTAG_boot/jtag_boot_rpi3.img b/X1_JTAG_boot/jtag_boot_rpi3.img index 14b22a47..a55f8318 100755 Binary files a/X1_JTAG_boot/jtag_boot_rpi3.img and b/X1_JTAG_boot/jtag_boot_rpi3.img differ diff --git a/X1_JTAG_boot/jtag_boot_rpi4.img b/X1_JTAG_boot/jtag_boot_rpi4.img index 8622b9be..c7b3bf0e 100755 Binary files a/X1_JTAG_boot/jtag_boot_rpi4.img and b/X1_JTAG_boot/jtag_boot_rpi4.img differ diff --git a/X1_JTAG_boot/src/main.rs b/X1_JTAG_boot/src/main.rs index 808b3176..6e6cf909 100644 --- a/X1_JTAG_boot/src/main.rs +++ b/X1_JTAG_boot/src/main.rs @@ -105,7 +105,6 @@ //! 2. Once finished with architectural setup, the arch code calls `kernel_init()`. #![allow(clippy::upper_case_acronyms)] -#![feature(const_fn_fn_ptr_basics)] #![feature(format_args_nl)] #![feature(panic_info_message)] #![feature(trait_alias)] diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 19f8449a..96b65c78 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "nightly-2021-12-18" +channel = "nightly-2022-04-10" components = ["llvm-tools-preview"] targets = ["aarch64-unknown-none-softfloat"]