From b1c438dc6693431885e597890daeb5536a991e0b Mon Sep 17 00:00:00 2001 From: Andre Richter Date: Sun, 31 Oct 2021 20:10:45 +0100 Subject: [PATCH] Remove unused external symbols --- 14_virtual_mem_part2_mmio_remap/README.md | 45 +++++++++---------- .../src/bsp/raspberrypi/memory.rs | 3 -- .../src/bsp/raspberrypi/memory.rs | 3 -- .../src/bsp/raspberrypi/memory.rs | 3 -- 4 files changed, 21 insertions(+), 33 deletions(-) diff --git a/14_virtual_mem_part2_mmio_remap/README.md b/14_virtual_mem_part2_mmio_remap/README.md index 9d861bf6..89671163 100644 --- a/14_virtual_mem_part2_mmio_remap/README.md +++ b/14_virtual_mem_part2_mmio_remap/README.md @@ -1796,7 +1796,7 @@ diff -uNr 13_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/memory.rs 14_v use core::cell::UnsafeCell; //-------------------------------------------------------------------------------------------------- -@@ -16,6 +47,15 @@ +@@ -16,6 +47,12 @@ extern "Rust" { static __rx_start: UnsafeCell<()>; static __rx_end_exclusive: UnsafeCell<()>; @@ -1806,13 +1806,10 @@ diff -uNr 13_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/memory.rs 14_v + + static __boot_core_stack_start: UnsafeCell<()>; + static __boot_core_stack_end_exclusive: UnsafeCell<()>; -+ -+ static __boot_core_stack_guard_page_start: UnsafeCell<()>; -+ static __boot_core_stack_guard_page_end_exclusive: UnsafeCell<()>; } //-------------------------------------------------------------------------------------------------- -@@ -25,35 +65,26 @@ +@@ -25,35 +62,26 @@ /// The board's physical memory map. #[rustfmt::skip] pub(super) mod map { @@ -1862,7 +1859,7 @@ diff -uNr 13_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/memory.rs 14_v } /// Physical devices. -@@ -61,13 +92,22 @@ +@@ -61,13 +89,22 @@ pub mod mmio { use super::*; @@ -1891,7 +1888,7 @@ diff -uNr 13_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/memory.rs 14_v } //-------------------------------------------------------------------------------------------------- -@@ -80,16 +120,52 @@ +@@ -80,16 +117,52 @@ /// /// - Value is provided by the linker script and must be trusted as-is. #[inline(always)] @@ -1899,17 +1896,14 @@ diff -uNr 13_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/memory.rs 14_v - unsafe { __rx_start.get() as usize } +fn virt_rx_start() -> Address { + Address::new(unsafe { __rx_start.get() as usize }) - } - --/// Exclusive end address of the Read+Execute (RX) range. ++} ++ +/// Size of the Read+Execute (RX) range. - /// - /// # Safety - /// - /// - Value is provided by the linker script and must be trusted as-is. - #[inline(always)] --fn rx_end_exclusive() -> usize { -- unsafe { __rx_end_exclusive.get() as usize } ++/// ++/// # Safety ++/// ++/// - Value is provided by the linker script and must be trusted as-is. ++#[inline(always)] +fn rx_size() -> usize { + unsafe { (__rx_end_exclusive.get() as usize) - (__rx_start.get() as usize) } +} @@ -1918,14 +1912,17 @@ diff -uNr 13_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/memory.rs 14_v +#[inline(always)] +fn virt_rw_start() -> Address { + Address::new(unsafe { __rw_start.get() as usize }) -+} -+ + } + +-/// Exclusive end address of the Read+Execute (RX) range. +/// Size of the Read+Write (RW) range. -+/// -+/// # Safety -+/// -+/// - Value is provided by the linker script and must be trusted as-is. -+#[inline(always)] + /// + /// # Safety + /// + /// - Value is provided by the linker script and must be trusted as-is. + #[inline(always)] +-fn rx_end_exclusive() -> usize { +- unsafe { __rx_end_exclusive.get() as usize } +fn rw_size() -> usize { + unsafe { (__rw_end_exclusive.get() as usize) - (__rw_start.get() as usize) } +} diff --git a/14_virtual_mem_part2_mmio_remap/src/bsp/raspberrypi/memory.rs b/14_virtual_mem_part2_mmio_remap/src/bsp/raspberrypi/memory.rs index 2675633a..88dcaf58 100644 --- a/14_virtual_mem_part2_mmio_remap/src/bsp/raspberrypi/memory.rs +++ b/14_virtual_mem_part2_mmio_remap/src/bsp/raspberrypi/memory.rs @@ -53,9 +53,6 @@ extern "Rust" { static __boot_core_stack_start: UnsafeCell<()>; static __boot_core_stack_end_exclusive: UnsafeCell<()>; - - static __boot_core_stack_guard_page_start: UnsafeCell<()>; - static __boot_core_stack_guard_page_end_exclusive: UnsafeCell<()>; } //-------------------------------------------------------------------------------------------------- diff --git a/15_virtual_mem_part3_precomputed_tables/src/bsp/raspberrypi/memory.rs b/15_virtual_mem_part3_precomputed_tables/src/bsp/raspberrypi/memory.rs index 2675633a..88dcaf58 100644 --- a/15_virtual_mem_part3_precomputed_tables/src/bsp/raspberrypi/memory.rs +++ b/15_virtual_mem_part3_precomputed_tables/src/bsp/raspberrypi/memory.rs @@ -53,9 +53,6 @@ extern "Rust" { static __boot_core_stack_start: UnsafeCell<()>; static __boot_core_stack_end_exclusive: UnsafeCell<()>; - - static __boot_core_stack_guard_page_start: UnsafeCell<()>; - static __boot_core_stack_guard_page_end_exclusive: UnsafeCell<()>; } //-------------------------------------------------------------------------------------------------- diff --git a/16_virtual_mem_part4_higher_half_kernel/src/bsp/raspberrypi/memory.rs b/16_virtual_mem_part4_higher_half_kernel/src/bsp/raspberrypi/memory.rs index 2675633a..88dcaf58 100644 --- a/16_virtual_mem_part4_higher_half_kernel/src/bsp/raspberrypi/memory.rs +++ b/16_virtual_mem_part4_higher_half_kernel/src/bsp/raspberrypi/memory.rs @@ -53,9 +53,6 @@ extern "Rust" { static __boot_core_stack_start: UnsafeCell<()>; static __boot_core_stack_end_exclusive: UnsafeCell<()>; - - static __boot_core_stack_guard_page_start: UnsafeCell<()>; - static __boot_core_stack_guard_page_end_exclusive: UnsafeCell<()>; } //--------------------------------------------------------------------------------------------------