Fix rustdoc warnings

pull/110/head
Andre Richter 3 years ago
parent dc9b3c0f38
commit a5884321a7
No known key found for this signature in database
GPG Key ID: 2116C1AB102F615E

@ -100,8 +100,10 @@
//!
//! # Boot flow
//!
//! 1. The kernel's entry point is the function `cpu::boot::arch_boot::_start()`.
//! 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`.
//!
//! [`cpu::boot::arch_boot::_start()`]: ../src/kernel/cpu/up/_arch/aarch64/cpu/boot.rs.html
#![feature(asm)]
#![feature(global_asm)]

@ -199,15 +199,18 @@ 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,6 +102,7 @@
@@ -102,8 +102,10 @@
//!
//! 1. The kernel's entry point is the function `cpu::boot::arch_boot::_start()`.
//! 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 [`runtime_init::runtime_init()`].
//!
//! [`cpu::boot::arch_boot::_start()`]: ../src/kernel/cpu/up/_arch/aarch64/cpu/boot.rs.html
+//! [`runtime_init::runtime_init()`]: runtime_init/fn.runtime_init.html
#![feature(asm)]
#![feature(global_asm)]
@@ -110,6 +111,15 @@
@@ -112,6 +114,15 @@
mod bsp;
mod cpu;

@ -100,9 +100,12 @@
//!
//! # Boot flow
//!
//! 1. The kernel's entry point is the function `cpu::boot::arch_boot::_start()`.
//! 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 [`runtime_init::runtime_init()`].
//!
//! [`cpu::boot::arch_boot::_start()`]: ../src/kernel/cpu/up/_arch/aarch64/cpu/boot.rs.html
//! [`runtime_init::runtime_init()`]: runtime_init/fn.runtime_init.html
#![feature(asm)]
#![feature(global_asm)]

@ -139,17 +139,17 @@ 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
@@ -100,19 +100,25 @@
//!
@@ -101,21 +101,25 @@
//! # Boot flow
//!
-//! 1. The kernel's entry point is the function `cpu::boot::arch_boot::_start()`.
//! 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`.
+//! 1. The kernel's entry point is the function [`cpu::boot::arch_boot::_start()`].
+//! - It is implemented in `src/_arch/__arch_name__/cpu/boot.rs`.
//! 2. Once finished with architectural setup, the arch code calls [`runtime_init::runtime_init()`].
+//!
//!
-//! [`cpu::boot::arch_boot::_start()`]: ../src/kernel/cpu/up/_arch/aarch64/cpu/boot.rs.html
+//! [`cpu::boot::arch_boot::_start()`]: cpu/boot/arch_boot/fn._start.html
//! [`runtime_init::runtime_init()`]: runtime_init/fn.runtime_init.html
#![feature(asm)]
+#![feature(format_args_nl)]
@ -167,7 +167,7 @@ diff -uNr 02_runtime_init/src/main.rs 03_hacky_hello_world/src/main.rs
mod runtime_init;
/// Early init code.
@@ -121,5 +127,7 @@
@@ -124,5 +128,7 @@
///
/// - Only a single core must be active and running this function.
unsafe fn kernel_init() -> ! {
@ -226,7 +226,7 @@ diff -uNr 02_runtime_init/src/print.rs 03_hacky_hello_world/src/print.rs
+
+/// Prints without a newline.
+///
+/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
+/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
+#[macro_export]
+macro_rules! print {
+ ($($arg:tt)*) => ($crate::print::_print(format_args!($($arg)*)));
@ -234,7 +234,7 @@ diff -uNr 02_runtime_init/src/print.rs 03_hacky_hello_world/src/print.rs
+
+/// Prints with a newline.
+///
+/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
+/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
+#[macro_export]
+macro_rules! println {
+ () => ($crate::print!("\n"));

@ -105,6 +105,7 @@
//! 2. Once finished with architectural setup, the arch code calls [`runtime_init::runtime_init()`].
//!
//! [`cpu::boot::arch_boot::_start()`]: cpu/boot/arch_boot/fn._start.html
//! [`runtime_init::runtime_init()`]: runtime_init/fn.runtime_init.html
#![feature(asm)]
#![feature(format_args_nl)]

@ -20,7 +20,7 @@ pub fn _print(args: fmt::Arguments) {
/// Prints without a newline.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! print {
($($arg:tt)*) => ($crate::print::_print(format_args!($($arg)*)));
@ -28,7 +28,7 @@ macro_rules! print {
/// Prints with a newline.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! println {
() => ($crate::print!("\n"));

@ -242,9 +242,9 @@ diff -uNr 03_hacky_hello_world/src/cpu.rs 04_zero_overhead_abstraction/src/cpu.r
diff -uNr 03_hacky_hello_world/src/main.rs 04_zero_overhead_abstraction/src/main.rs
--- 03_hacky_hello_world/src/main.rs
+++ 04_zero_overhead_abstraction/src/main.rs
@@ -106,9 +106,7 @@
//!
@@ -107,9 +107,7 @@
//! [`cpu::boot::arch_boot::_start()`]: cpu/boot/arch_boot/fn._start.html
//! [`runtime_init::runtime_init()`]: runtime_init/fn.runtime_init.html
-#![feature(asm)]
#![feature(format_args_nl)]
@ -252,7 +252,7 @@ diff -uNr 03_hacky_hello_world/src/main.rs 04_zero_overhead_abstraction/src/main
#![feature(panic_info_message)]
#![no_main]
#![no_std]
@@ -127,7 +125,8 @@
@@ -128,7 +126,8 @@
///
/// - Only a single core must be active and running this function.
unsafe fn kernel_init() -> ! {

@ -105,6 +105,7 @@
//! 2. Once finished with architectural setup, the arch code calls [`runtime_init::runtime_init()`].
//!
//! [`cpu::boot::arch_boot::_start()`]: cpu/boot/arch_boot/fn._start.html
//! [`runtime_init::runtime_init()`]: runtime_init/fn.runtime_init.html
#![feature(format_args_nl)]
#![feature(panic_info_message)]

@ -20,7 +20,7 @@ pub fn _print(args: fmt::Arguments) {
/// Prints without a newline.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! print {
($($arg:tt)*) => ($crate::print::_print(format_args!($($arg)*)));
@ -28,7 +28,7 @@ macro_rules! print {
/// Prints with a newline.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! println {
() => ($crate::print!("\n"));

@ -211,7 +211,7 @@ diff -uNr 04_zero_overhead_abstraction/src/console.rs 05_safe_globals/src/consol
diff -uNr 04_zero_overhead_abstraction/src/main.rs 05_safe_globals/src/main.rs
--- 04_zero_overhead_abstraction/src/main.rs
+++ 05_safe_globals/src/main.rs
@@ -108,6 +108,7 @@
@@ -109,6 +109,7 @@
#![feature(format_args_nl)]
#![feature(panic_info_message)]
@ -219,7 +219,7 @@ diff -uNr 04_zero_overhead_abstraction/src/main.rs 05_safe_globals/src/main.rs
#![no_main]
#![no_std]
@@ -118,6 +119,7 @@
@@ -119,6 +120,7 @@
mod panic_wait;
mod print;
mod runtime_init;
@ -227,7 +227,7 @@ diff -uNr 04_zero_overhead_abstraction/src/main.rs 05_safe_globals/src/main.rs
/// Early init code.
///
@@ -125,8 +127,15 @@
@@ -126,8 +128,15 @@
///
/// - Only a single core must be active and running this function.
unsafe fn kernel_init() -> ! {
@ -248,17 +248,18 @@ diff -uNr 04_zero_overhead_abstraction/src/main.rs 05_safe_globals/src/main.rs
diff -uNr 04_zero_overhead_abstraction/src/synchronization.rs 05_safe_globals/src/synchronization.rs
--- 04_zero_overhead_abstraction/src/synchronization.rs
+++ 05_safe_globals/src/synchronization.rs
@@ -0,0 +1,76 @@
@@ -0,0 +1,77 @@
+// SPDX-License-Identifier: MIT OR Apache-2.0
+//
+// Copyright (c) 2020-2021 Andre Richter <andre.o.richter@gmail.com>
+
+//! Synchronization primitives.
+//!
+//! Suggested literature:
+//! - https://doc.rust-lang.org/book/ch16-04-extensible-concurrency-sync-and-send.html
+//! - https://stackoverflow.com/questions/59428096/understanding-the-send-trait
+//! - https://doc.rust-lang.org/std/cell/index.html
+//! # Resources
+//!
+//! - <https://doc.rust-lang.org/book/ch16-04-extensible-concurrency-sync-and-send.html>
+//! - <https://stackoverflow.com/questions/59428096/understanding-the-send-trait>
+//! - <https://doc.rust-lang.org/std/cell/index.html>
+
+use core::cell::UnsafeCell;
+

@ -105,6 +105,7 @@
//! 2. Once finished with architectural setup, the arch code calls [`runtime_init::runtime_init()`].
//!
//! [`cpu::boot::arch_boot::_start()`]: cpu/boot/arch_boot/fn._start.html
//! [`runtime_init::runtime_init()`]: runtime_init/fn.runtime_init.html
#![feature(format_args_nl)]
#![feature(panic_info_message)]

@ -20,7 +20,7 @@ pub fn _print(args: fmt::Arguments) {
/// Prints without a newline.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! print {
($($arg:tt)*) => ($crate::print::_print(format_args!($($arg)*)));
@ -28,7 +28,7 @@ macro_rules! print {
/// Prints with a newline.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! println {
() => ($crate::print!("\n"));

@ -4,10 +4,11 @@
//! Synchronization primitives.
//!
//! Suggested literature:
//! - https://doc.rust-lang.org/book/ch16-04-extensible-concurrency-sync-and-send.html
//! - https://stackoverflow.com/questions/59428096/understanding-the-send-trait
//! - https://doc.rust-lang.org/std/cell/index.html
//! # Resources
//!
//! - <https://doc.rust-lang.org/book/ch16-04-extensible-concurrency-sync-and-send.html>
//! - <https://stackoverflow.com/questions/59428096/understanding-the-send-trait>
//! - <https://doc.rust-lang.org/std/cell/index.html>
use core::cell::UnsafeCell;

@ -445,8 +445,8 @@ diff -uNr 05_safe_globals/src/bsp/device_driver/bcm/bcm2xxx_pl011_uart.rs 06_dri
+//!
+//! # Resources
+//!
+//! - https://github.com/raspberrypi/documentation/files/1888662/BCM2837-ARM-Peripherals.-.Revised.-.V2-1.pdf
+//! - https://developer.arm.com/documentation/ddi0183/latest
+//! - <https://github.com/raspberrypi/documentation/files/1888662/BCM2837-ARM-Peripherals.-.Revised.-.V2-1.pdf>
+//! - <https://developer.arm.com/documentation/ddi0183/latest>
+
+use crate::{
+ bsp::device_driver::common::MMIODerefWrapper, console, cpu, driver, synchronization,
@ -1302,15 +1302,15 @@ diff -uNr 05_safe_globals/src/driver.rs 06_drivers_gpio_uart/src/driver.rs
diff -uNr 05_safe_globals/src/main.rs 06_drivers_gpio_uart/src/main.rs
--- 05_safe_globals/src/main.rs
+++ 06_drivers_gpio_uart/src/main.rs
@@ -106,6 +106,7 @@
//!
@@ -107,6 +107,7 @@
//! [`cpu::boot::arch_boot::_start()`]: cpu/boot/arch_boot/fn._start.html
//! [`runtime_init::runtime_init()`]: runtime_init/fn.runtime_init.html
+#![feature(const_fn_fn_ptr_basics)]
#![feature(format_args_nl)]
#![feature(panic_info_message)]
#![feature(trait_alias)]
@@ -115,6 +116,7 @@
@@ -116,6 +117,7 @@
mod bsp;
mod console;
mod cpu;
@ -1318,7 +1318,7 @@ diff -uNr 05_safe_globals/src/main.rs 06_drivers_gpio_uart/src/main.rs
mod memory;
mod panic_wait;
mod print;
@@ -126,16 +128,49 @@
@@ -127,16 +129,49 @@
/// # Safety
///
/// - Only a single core must be active and running this function.
@ -1398,7 +1398,7 @@ diff -uNr 05_safe_globals/src/panic_wait.rs 06_drivers_gpio_uart/src/panic_wait.
+
+/// Prints with a newline - only use from the panic handler.
+///
+/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
+/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
+#[macro_export]
+macro_rules! panic_println {
+ ($($arg:tt)*) => ({

@ -6,8 +6,8 @@
//!
//! # Resources
//!
//! - https://github.com/raspberrypi/documentation/files/1888662/BCM2837-ARM-Peripherals.-.Revised.-.V2-1.pdf
//! - https://developer.arm.com/documentation/ddi0183/latest
//! - <https://github.com/raspberrypi/documentation/files/1888662/BCM2837-ARM-Peripherals.-.Revised.-.V2-1.pdf>
//! - <https://developer.arm.com/documentation/ddi0183/latest>
use crate::{
bsp::device_driver::common::MMIODerefWrapper, console, cpu, driver, synchronization,

@ -105,6 +105,7 @@
//! 2. Once finished with architectural setup, the arch code calls [`runtime_init::runtime_init()`].
//!
//! [`cpu::boot::arch_boot::_start()`]: cpu/boot/arch_boot/fn._start.html
//! [`runtime_init::runtime_init()`]: runtime_init/fn.runtime_init.html
#![feature(const_fn_fn_ptr_basics)]
#![feature(format_args_nl)]

@ -19,7 +19,7 @@ fn _panic_print(args: fmt::Arguments) {
/// Prints with a newline - only use from the panic handler.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! panic_println {
($($arg:tt)*) => ({

@ -20,7 +20,7 @@ pub fn _print(args: fmt::Arguments) {
/// Prints without a newline.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! print {
($($arg:tt)*) => ($crate::print::_print(format_args!($($arg)*)));
@ -28,7 +28,7 @@ macro_rules! print {
/// Prints with a newline.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! println {
() => ($crate::print!("\n"));

@ -4,10 +4,11 @@
//! Synchronization primitives.
//!
//! Suggested literature:
//! - https://doc.rust-lang.org/book/ch16-04-extensible-concurrency-sync-and-send.html
//! - https://stackoverflow.com/questions/59428096/understanding-the-send-trait
//! - https://doc.rust-lang.org/std/cell/index.html
//! # Resources
//!
//! - <https://doc.rust-lang.org/book/ch16-04-extensible-concurrency-sync-and-send.html>
//! - <https://stackoverflow.com/questions/59428096/understanding-the-send-trait>
//! - <https://doc.rust-lang.org/std/cell/index.html>
use core::cell::UnsafeCell;

@ -406,7 +406,7 @@ diff -uNr 06_drivers_gpio_uart/src/cpu.rs 07_uart_chainloader/src/cpu.rs
diff -uNr 06_drivers_gpio_uart/src/main.rs 07_uart_chainloader/src/main.rs
--- 06_drivers_gpio_uart/src/main.rs
+++ 07_uart_chainloader/src/main.rs
@@ -102,11 +102,14 @@
@@ -102,12 +102,16 @@
//!
//! 1. The kernel's entry point is the function [`cpu::boot::arch_boot::_start()`].
//! - It is implemented in `src/_arch/__arch_name__/cpu/boot.rs`.
@ -415,6 +415,8 @@ diff -uNr 06_drivers_gpio_uart/src/main.rs 07_uart_chainloader/src/main.rs
+//! 3. Finally, [`runtime_init::runtime_init()`] is called.
//!
//! [`cpu::boot::arch_boot::_start()`]: cpu/boot/arch_boot/fn._start.html
+//! [`relocate::relocate_self()`]: relocate/fn.relocate_self.html
//! [`runtime_init::runtime_init()`]: runtime_init/fn.runtime_init.html
+#![feature(asm)]
#![feature(const_fn_fn_ptr_basics)]
@ -422,7 +424,7 @@ diff -uNr 06_drivers_gpio_uart/src/main.rs 07_uart_chainloader/src/main.rs
#![feature(format_args_nl)]
#![feature(panic_info_message)]
#![feature(trait_alias)]
@@ -120,6 +123,7 @@
@@ -121,6 +125,7 @@
mod memory;
mod panic_wait;
mod print;
@ -430,7 +432,7 @@ diff -uNr 06_drivers_gpio_uart/src/main.rs 07_uart_chainloader/src/main.rs
mod runtime_init;
mod synchronization;
@@ -148,29 +152,49 @@
@@ -149,29 +154,49 @@
fn kernel_main() -> ! {
use bsp::console::console;
use console::interface::All;

@ -6,8 +6,8 @@
//!
//! # Resources
//!
//! - https://github.com/raspberrypi/documentation/files/1888662/BCM2837-ARM-Peripherals.-.Revised.-.V2-1.pdf
//! - https://developer.arm.com/documentation/ddi0183/latest
//! - <https://github.com/raspberrypi/documentation/files/1888662/BCM2837-ARM-Peripherals.-.Revised.-.V2-1.pdf>
//! - <https://developer.arm.com/documentation/ddi0183/latest>
use crate::{
bsp::device_driver::common::MMIODerefWrapper, console, cpu, driver, synchronization,

@ -106,6 +106,8 @@
//! 3. Finally, [`runtime_init::runtime_init()`] is called.
//!
//! [`cpu::boot::arch_boot::_start()`]: cpu/boot/arch_boot/fn._start.html
//! [`relocate::relocate_self()`]: relocate/fn.relocate_self.html
//! [`runtime_init::runtime_init()`]: runtime_init/fn.runtime_init.html
#![feature(asm)]
#![feature(const_fn_fn_ptr_basics)]

@ -19,7 +19,7 @@ fn _panic_print(args: fmt::Arguments) {
/// Prints with a newline - only use from the panic handler.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! panic_println {
($($arg:tt)*) => ({

@ -20,7 +20,7 @@ pub fn _print(args: fmt::Arguments) {
/// Prints without a newline.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! print {
($($arg:tt)*) => ($crate::print::_print(format_args!($($arg)*)));
@ -28,7 +28,7 @@ macro_rules! print {
/// Prints with a newline.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! println {
() => ($crate::print!("\n"));

@ -4,10 +4,11 @@
//! Synchronization primitives.
//!
//! Suggested literature:
//! - https://doc.rust-lang.org/book/ch16-04-extensible-concurrency-sync-and-send.html
//! - https://stackoverflow.com/questions/59428096/understanding-the-send-trait
//! - https://doc.rust-lang.org/std/cell/index.html
//! # Resources
//!
//! - <https://doc.rust-lang.org/book/ch16-04-extensible-concurrency-sync-and-send.html>
//! - <https://stackoverflow.com/questions/59428096/understanding-the-send-trait>
//! - <https://doc.rust-lang.org/std/cell/index.html>
use core::cell::UnsafeCell;

@ -499,7 +499,7 @@ diff -uNr 07_uart_chainloader/src/cpu.rs 08_timestamps/src/cpu.rs
diff -uNr 07_uart_chainloader/src/main.rs 08_timestamps/src/main.rs
--- 07_uart_chainloader/src/main.rs
+++ 08_timestamps/src/main.rs
@@ -102,14 +102,11 @@
@@ -102,16 +102,12 @@
//!
//! 1. The kernel's entry point is the function [`cpu::boot::arch_boot::_start()`].
//! - It is implemented in `src/_arch/__arch_name__/cpu/boot.rs`.
@ -508,6 +508,8 @@ diff -uNr 07_uart_chainloader/src/main.rs 08_timestamps/src/main.rs
+//! 2. Once finished with architectural setup, the arch code calls [`runtime_init::runtime_init()`].
//!
//! [`cpu::boot::arch_boot::_start()`]: cpu/boot/arch_boot/fn._start.html
-//! [`relocate::relocate_self()`]: relocate/fn.relocate_self.html
//! [`runtime_init::runtime_init()`]: runtime_init/fn.runtime_init.html
-#![feature(asm)]
#![feature(const_fn_fn_ptr_basics)]
@ -515,7 +517,7 @@ diff -uNr 07_uart_chainloader/src/main.rs 08_timestamps/src/main.rs
#![feature(format_args_nl)]
#![feature(panic_info_message)]
#![feature(trait_alias)]
@@ -123,9 +120,9 @@
@@ -125,9 +121,9 @@
mod memory;
mod panic_wait;
mod print;
@ -526,7 +528,7 @@ diff -uNr 07_uart_chainloader/src/main.rs 08_timestamps/src/main.rs
/// Early init code.
///
@@ -150,51 +147,31 @@
@@ -152,51 +148,31 @@
/// The main function running after the early init.
fn kernel_main() -> ! {

@ -6,8 +6,8 @@
//!
//! # Resources
//!
//! - https://github.com/raspberrypi/documentation/files/1888662/BCM2837-ARM-Peripherals.-.Revised.-.V2-1.pdf
//! - https://developer.arm.com/documentation/ddi0183/latest
//! - <https://github.com/raspberrypi/documentation/files/1888662/BCM2837-ARM-Peripherals.-.Revised.-.V2-1.pdf>
//! - <https://developer.arm.com/documentation/ddi0183/latest>
use crate::{
bsp::device_driver::common::MMIODerefWrapper, console, cpu, driver, synchronization,

@ -105,6 +105,7 @@
//! 2. Once finished with architectural setup, the arch code calls [`runtime_init::runtime_init()`].
//!
//! [`cpu::boot::arch_boot::_start()`]: cpu/boot/arch_boot/fn._start.html
//! [`runtime_init::runtime_init()`]: runtime_init/fn.runtime_init.html
#![feature(const_fn_fn_ptr_basics)]
#![feature(format_args_nl)]

@ -19,7 +19,7 @@ fn _panic_print(args: fmt::Arguments) {
/// Prints with a newline - only use from the panic handler.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! panic_println {
($($arg:tt)*) => ({

@ -20,7 +20,7 @@ pub fn _print(args: fmt::Arguments) {
/// Prints without a newline.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! print {
($($arg:tt)*) => ($crate::print::_print(format_args!($($arg)*)));
@ -28,7 +28,7 @@ macro_rules! print {
/// Prints with a newline.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! println {
() => ($crate::print!("\n"));

@ -4,10 +4,11 @@
//! Synchronization primitives.
//!
//! Suggested literature:
//! - https://doc.rust-lang.org/book/ch16-04-extensible-concurrency-sync-and-send.html
//! - https://stackoverflow.com/questions/59428096/understanding-the-send-trait
//! - https://doc.rust-lang.org/std/cell/index.html
//! # Resources
//!
//! - <https://doc.rust-lang.org/book/ch16-04-extensible-concurrency-sync-and-send.html>
//! - <https://stackoverflow.com/questions/59428096/understanding-the-send-trait>
//! - <https://doc.rust-lang.org/std/cell/index.html>
use core::cell::UnsafeCell;

@ -6,8 +6,8 @@
//!
//! # Resources
//!
//! - https://github.com/raspberrypi/documentation/files/1888662/BCM2837-ARM-Peripherals.-.Revised.-.V2-1.pdf
//! - https://developer.arm.com/documentation/ddi0183/latest
//! - <https://github.com/raspberrypi/documentation/files/1888662/BCM2837-ARM-Peripherals.-.Revised.-.V2-1.pdf>
//! - <https://developer.arm.com/documentation/ddi0183/latest>
use crate::{
bsp::device_driver::common::MMIODerefWrapper, console, cpu, driver, synchronization,

@ -105,6 +105,7 @@
//! 2. Once finished with architectural setup, the arch code calls [`runtime_init::runtime_init()`].
//!
//! [`cpu::boot::arch_boot::_start()`]: cpu/boot/arch_boot/fn._start.html
//! [`runtime_init::runtime_init()`]: runtime_init/fn.runtime_init.html
#![feature(const_fn_fn_ptr_basics)]
#![feature(format_args_nl)]

@ -19,7 +19,7 @@ fn _panic_print(args: fmt::Arguments) {
/// Prints with a newline - only use from the panic handler.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! panic_println {
($($arg:tt)*) => ({

@ -20,7 +20,7 @@ pub fn _print(args: fmt::Arguments) {
/// Prints without a newline.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! print {
($($arg:tt)*) => ($crate::print::_print(format_args!($($arg)*)));
@ -28,7 +28,7 @@ macro_rules! print {
/// Prints with a newline.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! println {
() => ($crate::print!("\n"));

@ -4,10 +4,11 @@
//! Synchronization primitives.
//!
//! Suggested literature:
//! - https://doc.rust-lang.org/book/ch16-04-extensible-concurrency-sync-and-send.html
//! - https://stackoverflow.com/questions/59428096/understanding-the-send-trait
//! - https://doc.rust-lang.org/std/cell/index.html
//! # Resources
//!
//! - <https://doc.rust-lang.org/book/ch16-04-extensible-concurrency-sync-and-send.html>
//! - <https://stackoverflow.com/questions/59428096/understanding-the-send-trait>
//! - <https://doc.rust-lang.org/std/cell/index.html>
use core::cell::UnsafeCell;

@ -484,7 +484,7 @@ diff -uNr 09_hw_debug_JTAG/src/exception.rs 10_privilege_level/src/exception.rs
diff -uNr 09_hw_debug_JTAG/src/main.rs 10_privilege_level/src/main.rs
--- 09_hw_debug_JTAG/src/main.rs
+++ 10_privilege_level/src/main.rs
@@ -117,6 +117,7 @@
@@ -118,6 +118,7 @@
mod console;
mod cpu;
mod driver;
@ -492,7 +492,7 @@ diff -uNr 09_hw_debug_JTAG/src/main.rs 10_privilege_level/src/main.rs
mod memory;
mod panic_wait;
mod print;
@@ -147,12 +148,20 @@
@@ -148,12 +149,20 @@
/// The main function running after the early init.
fn kernel_main() -> ! {
@ -513,7 +513,7 @@ diff -uNr 09_hw_debug_JTAG/src/main.rs 10_privilege_level/src/main.rs
info!(
"Architectural timer resolution: {} ns",
time::time_manager().resolution().as_nanos()
@@ -167,11 +176,15 @@
@@ -168,11 +177,15 @@
info!(" {}. {}", i + 1, driver.compatible());
}

@ -6,8 +6,8 @@
//!
//! # Resources
//!
//! - https://github.com/raspberrypi/documentation/files/1888662/BCM2837-ARM-Peripherals.-.Revised.-.V2-1.pdf
//! - https://developer.arm.com/documentation/ddi0183/latest
//! - <https://github.com/raspberrypi/documentation/files/1888662/BCM2837-ARM-Peripherals.-.Revised.-.V2-1.pdf>
//! - <https://developer.arm.com/documentation/ddi0183/latest>
use crate::{
bsp::device_driver::common::MMIODerefWrapper, console, cpu, driver, synchronization,

@ -105,6 +105,7 @@
//! 2. Once finished with architectural setup, the arch code calls [`runtime_init::runtime_init()`].
//!
//! [`cpu::boot::arch_boot::_start()`]: cpu/boot/arch_boot/fn._start.html
//! [`runtime_init::runtime_init()`]: runtime_init/fn.runtime_init.html
#![feature(const_fn_fn_ptr_basics)]
#![feature(format_args_nl)]

@ -19,7 +19,7 @@ fn _panic_print(args: fmt::Arguments) {
/// Prints with a newline - only use from the panic handler.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! panic_println {
($($arg:tt)*) => ({

@ -20,7 +20,7 @@ pub fn _print(args: fmt::Arguments) {
/// Prints without a newline.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! print {
($($arg:tt)*) => ($crate::print::_print(format_args!($($arg)*)));
@ -28,7 +28,7 @@ macro_rules! print {
/// Prints with a newline.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! println {
() => ($crate::print!("\n"));

@ -4,10 +4,11 @@
//! Synchronization primitives.
//!
//! Suggested literature:
//! - https://doc.rust-lang.org/book/ch16-04-extensible-concurrency-sync-and-send.html
//! - https://stackoverflow.com/questions/59428096/understanding-the-send-trait
//! - https://doc.rust-lang.org/std/cell/index.html
//! # Resources
//!
//! - <https://doc.rust-lang.org/book/ch16-04-extensible-concurrency-sync-and-send.html>
//! - <https://stackoverflow.com/questions/59428096/understanding-the-send-trait>
//! - <https://doc.rust-lang.org/std/cell/index.html>
use core::cell::UnsafeCell;

@ -1006,9 +1006,9 @@ diff -uNr 10_privilege_level/src/bsp.rs 11_virtual_mem_part1_identity_mapping/sr
diff -uNr 10_privilege_level/src/main.rs 11_virtual_mem_part1_identity_mapping/src/main.rs
--- 10_privilege_level/src/main.rs
+++ 11_virtual_mem_part1_identity_mapping/src/main.rs
@@ -106,7 +106,10 @@
//!
@@ -107,7 +107,10 @@
//! [`cpu::boot::arch_boot::_start()`]: cpu/boot/arch_boot/fn._start.html
//! [`runtime_init::runtime_init()`]: runtime_init/fn.runtime_init.html
+#![allow(incomplete_features)]
#![feature(const_fn_fn_ptr_basics)]
@ -1017,7 +1017,7 @@ diff -uNr 10_privilege_level/src/main.rs 11_virtual_mem_part1_identity_mapping/s
#![feature(format_args_nl)]
#![feature(panic_info_message)]
#![feature(trait_alias)]
@@ -130,9 +133,18 @@
@@ -131,9 +134,18 @@
/// # Safety
///
/// - Only a single core must be active and running this function.
@ -1037,7 +1037,7 @@ diff -uNr 10_privilege_level/src/main.rs 11_virtual_mem_part1_identity_mapping/s
for i in bsp::driver::driver_manager().all_device_drivers().iter() {
if let Err(x) = i.init() {
@@ -156,6 +168,9 @@
@@ -157,6 +169,9 @@
info!("Booting on: {}", bsp::board_name());
@ -1047,7 +1047,7 @@ diff -uNr 10_privilege_level/src/main.rs 11_virtual_mem_part1_identity_mapping/s
let (_, privilege_level) = exception::current_privilege_level();
info!("Current privilege level: {}", privilege_level);
@@ -179,6 +194,13 @@
@@ -180,6 +195,13 @@
info!("Timer test, spinning for 1 second");
time::time_manager().spin_for(Duration::from_secs(1));

@ -6,8 +6,8 @@
//!
//! # Resources
//!
//! - https://github.com/raspberrypi/documentation/files/1888662/BCM2837-ARM-Peripherals.-.Revised.-.V2-1.pdf
//! - https://developer.arm.com/documentation/ddi0183/latest
//! - <https://github.com/raspberrypi/documentation/files/1888662/BCM2837-ARM-Peripherals.-.Revised.-.V2-1.pdf>
//! - <https://developer.arm.com/documentation/ddi0183/latest>
use crate::{
bsp::device_driver::common::MMIODerefWrapper, console, cpu, driver, synchronization,

@ -105,6 +105,7 @@
//! 2. Once finished with architectural setup, the arch code calls [`runtime_init::runtime_init()`].
//!
//! [`cpu::boot::arch_boot::_start()`]: cpu/boot/arch_boot/fn._start.html
//! [`runtime_init::runtime_init()`]: runtime_init/fn.runtime_init.html
#![allow(incomplete_features)]
#![feature(const_fn_fn_ptr_basics)]

@ -19,7 +19,7 @@ fn _panic_print(args: fmt::Arguments) {
/// Prints with a newline - only use from the panic handler.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! panic_println {
($($arg:tt)*) => ({

@ -20,7 +20,7 @@ pub fn _print(args: fmt::Arguments) {
/// Prints without a newline.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! print {
($($arg:tt)*) => ($crate::print::_print(format_args!($($arg)*)));
@ -28,7 +28,7 @@ macro_rules! print {
/// Prints with a newline.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! println {
() => ($crate::print!("\n"));

@ -4,10 +4,11 @@
//! Synchronization primitives.
//!
//! Suggested literature:
//! - https://doc.rust-lang.org/book/ch16-04-extensible-concurrency-sync-and-send.html
//! - https://stackoverflow.com/questions/59428096/understanding-the-send-trait
//! - https://doc.rust-lang.org/std/cell/index.html
//! # Resources
//!
//! - <https://doc.rust-lang.org/book/ch16-04-extensible-concurrency-sync-and-send.html>
//! - <https://stackoverflow.com/questions/59428096/understanding-the-send-trait>
//! - <https://doc.rust-lang.org/std/cell/index.html>
use core::cell::UnsafeCell;

@ -967,7 +967,7 @@ diff -uNr 11_virtual_mem_part1_identity_mapping/src/exception.rs 12_exceptions_p
diff -uNr 11_virtual_mem_part1_identity_mapping/src/main.rs 12_exceptions_part1_groundwork/src/main.rs
--- 11_virtual_mem_part1_identity_mapping/src/main.rs
+++ 12_exceptions_part1_groundwork/src/main.rs
@@ -111,6 +111,7 @@
@@ -112,6 +112,7 @@
#![feature(const_generics)]
#![feature(const_panic)]
#![feature(format_args_nl)]
@ -975,7 +975,7 @@ diff -uNr 11_virtual_mem_part1_identity_mapping/src/main.rs 12_exceptions_part1_
#![feature(panic_info_message)]
#![feature(trait_alias)]
#![no_main]
@@ -142,6 +143,8 @@
@@ -143,6 +144,8 @@
use driver::interface::DriverManager;
use memory::mmu::interface::MMU;
@ -984,7 +984,7 @@ diff -uNr 11_virtual_mem_part1_identity_mapping/src/main.rs 12_exceptions_part1_
if let Err(string) = memory::mmu::mmu().init() {
panic!("MMU: {}", string);
}
@@ -194,13 +197,28 @@
@@ -195,13 +198,28 @@
info!("Timer test, spinning for 1 second");
time::time_manager().spin_for(Duration::from_secs(1));

@ -6,8 +6,8 @@
//!
//! # Resources
//!
//! - https://github.com/raspberrypi/documentation/files/1888662/BCM2837-ARM-Peripherals.-.Revised.-.V2-1.pdf
//! - https://developer.arm.com/documentation/ddi0183/latest
//! - <https://github.com/raspberrypi/documentation/files/1888662/BCM2837-ARM-Peripherals.-.Revised.-.V2-1.pdf>
//! - <https://developer.arm.com/documentation/ddi0183/latest>
use crate::{
bsp::device_driver::common::MMIODerefWrapper, console, cpu, driver, synchronization,

@ -105,6 +105,7 @@
//! 2. Once finished with architectural setup, the arch code calls [`runtime_init::runtime_init()`].
//!
//! [`cpu::boot::arch_boot::_start()`]: cpu/boot/arch_boot/fn._start.html
//! [`runtime_init::runtime_init()`]: runtime_init/fn.runtime_init.html
#![allow(incomplete_features)]
#![feature(const_fn_fn_ptr_basics)]

@ -19,7 +19,7 @@ fn _panic_print(args: fmt::Arguments) {
/// Prints with a newline - only use from the panic handler.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! panic_println {
($($arg:tt)*) => ({

@ -20,7 +20,7 @@ pub fn _print(args: fmt::Arguments) {
/// Prints without a newline.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! print {
($($arg:tt)*) => ($crate::print::_print(format_args!($($arg)*)));
@ -28,7 +28,7 @@ macro_rules! print {
/// Prints with a newline.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! println {
() => ($crate::print!("\n"));

@ -4,10 +4,11 @@
//! Synchronization primitives.
//!
//! Suggested literature:
//! - https://doc.rust-lang.org/book/ch16-04-extensible-concurrency-sync-and-send.html
//! - https://stackoverflow.com/questions/59428096/understanding-the-send-trait
//! - https://doc.rust-lang.org/std/cell/index.html
//! # Resources
//!
//! - <https://doc.rust-lang.org/book/ch16-04-extensible-concurrency-sync-and-send.html>
//! - <https://stackoverflow.com/questions/59428096/understanding-the-send-trait>
//! - <https://doc.rust-lang.org/std/cell/index.html>
use core::cell::UnsafeCell;

@ -1157,7 +1157,7 @@ diff -uNr 12_exceptions_part1_groundwork/src/exception.rs 13_integrated_testing/
diff -uNr 12_exceptions_part1_groundwork/src/lib.rs 13_integrated_testing/src/lib.rs
--- 12_exceptions_part1_groundwork/src/lib.rs
+++ 13_integrated_testing/src/lib.rs
@@ -0,0 +1,168 @@
@@ -0,0 +1,169 @@
+// SPDX-License-Identifier: MIT OR Apache-2.0
+//
+// Copyright (c) 2018-2021 Andre Richter <andre.o.richter@gmail.com>
@ -1267,6 +1267,7 @@ diff -uNr 12_exceptions_part1_groundwork/src/lib.rs 13_integrated_testing/src/li
+//! 2. Once finished with architectural setup, the arch code calls [`runtime_init::runtime_init()`].
+//!
+//! [`cpu::boot::arch_boot::_start()`]: cpu/boot/arch_boot/fn._start.html
+//! [`runtime_init::runtime_init()`]: runtime_init/fn.runtime_init.html
+
+#![allow(incomplete_features)]
+#![feature(const_fn_fn_ptr_basics)]
@ -1330,7 +1331,7 @@ diff -uNr 12_exceptions_part1_groundwork/src/lib.rs 13_integrated_testing/src/li
diff -uNr 12_exceptions_part1_groundwork/src/main.rs 13_integrated_testing/src/main.rs
--- 12_exceptions_part1_groundwork/src/main.rs
+++ 13_integrated_testing/src/main.rs
@@ -6,128 +6,12 @@
@@ -6,129 +6,12 @@
#![doc(html_logo_url = "https://git.io/JeGIp")]
//! The `kernel` binary.
@ -1433,6 +1434,7 @@ diff -uNr 12_exceptions_part1_groundwork/src/main.rs 13_integrated_testing/src/m
-//! 2. Once finished with architectural setup, the arch code calls [`runtime_init::runtime_init()`].
-//!
-//! [`cpu::boot::arch_boot::_start()`]: cpu/boot/arch_boot/fn._start.html
-//! [`runtime_init::runtime_init()`]: runtime_init/fn.runtime_init.html
-
-#![allow(incomplete_features)]
-#![feature(const_fn_fn_ptr_basics)]
@ -1461,7 +1463,7 @@ diff -uNr 12_exceptions_part1_groundwork/src/main.rs 13_integrated_testing/src/m
/// Early init code.
///
@@ -139,6 +23,7 @@
@@ -140,6 +23,7 @@
/// - 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 on
/// the RPi SoCs.
@ -1469,7 +1471,7 @@ diff -uNr 12_exceptions_part1_groundwork/src/main.rs 13_integrated_testing/src/m
unsafe fn kernel_init() -> ! {
use driver::interface::DriverManager;
use memory::mmu::interface::MMU;
@@ -165,9 +50,7 @@
@@ -166,9 +50,7 @@
fn kernel_main() -> ! {
use bsp::console::console;
use console::interface::All;
@ -1479,7 +1481,7 @@ diff -uNr 12_exceptions_part1_groundwork/src/main.rs 13_integrated_testing/src/m
info!("Booting on: {}", bsp::board_name());
@@ -194,31 +77,6 @@
@@ -195,31 +77,6 @@
info!(" {}. {}", i + 1, driver.compatible());
}
@ -1605,7 +1607,7 @@ diff -uNr 12_exceptions_part1_groundwork/src/panic_wait.rs 13_integrated_testing
+
/// Prints with a newline - only use from the panic handler.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
@@ -35,5 +52,16 @@
panic_println!("\nKernel panic!");
}

@ -6,8 +6,8 @@
//!
//! # Resources
//!
//! - https://github.com/raspberrypi/documentation/files/1888662/BCM2837-ARM-Peripherals.-.Revised.-.V2-1.pdf
//! - https://developer.arm.com/documentation/ddi0183/latest
//! - <https://github.com/raspberrypi/documentation/files/1888662/BCM2837-ARM-Peripherals.-.Revised.-.V2-1.pdf>
//! - <https://developer.arm.com/documentation/ddi0183/latest>
use crate::{
bsp::device_driver::common::MMIODerefWrapper, console, cpu, driver, synchronization,

@ -107,6 +107,7 @@
//! 2. Once finished with architectural setup, the arch code calls [`runtime_init::runtime_init()`].
//!
//! [`cpu::boot::arch_boot::_start()`]: cpu/boot/arch_boot/fn._start.html
//! [`runtime_init::runtime_init()`]: runtime_init/fn.runtime_init.html
#![allow(incomplete_features)]
#![feature(const_fn_fn_ptr_basics)]

@ -36,7 +36,7 @@ fn _panic_exit() -> ! {
/// Prints with a newline - only use from the panic handler.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! panic_println {
($($arg:tt)*) => ({

@ -20,7 +20,7 @@ pub fn _print(args: fmt::Arguments) {
/// Prints without a newline.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! print {
($($arg:tt)*) => ($crate::print::_print(format_args!($($arg)*)));
@ -28,7 +28,7 @@ macro_rules! print {
/// Prints with a newline.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! println {
() => ($crate::print!("\n"));

@ -4,10 +4,11 @@
//! Synchronization primitives.
//!
//! Suggested literature:
//! - https://doc.rust-lang.org/book/ch16-04-extensible-concurrency-sync-and-send.html
//! - https://stackoverflow.com/questions/59428096/understanding-the-send-trait
//! - https://doc.rust-lang.org/std/cell/index.html
//! # Resources
//!
//! - <https://doc.rust-lang.org/book/ch16-04-extensible-concurrency-sync-and-send.html>
//! - <https://stackoverflow.com/questions/59428096/understanding-the-send-trait>
//! - <https://doc.rust-lang.org/std/cell/index.html>
use core::cell::UnsafeCell;

@ -1776,7 +1776,7 @@ diff -uNr 13_integrated_testing/src/bsp/device_driver/bcm/bcm2xxx_pl011_uart.rs
--- 13_integrated_testing/src/bsp/device_driver/bcm/bcm2xxx_pl011_uart.rs
+++ 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/bcm/bcm2xxx_pl011_uart.rs
@@ -10,8 +10,8 @@
//! - https://developer.arm.com/documentation/ddi0183/latest
//! - <https://developer.arm.com/documentation/ddi0183/latest>
use crate::{
- bsp::device_driver::common::MMIODerefWrapper, console, cpu, driver, synchronization,
@ -2180,7 +2180,7 @@ diff -uNr 13_integrated_testing/src/exception/asynchronous.rs 14_exceptions_part
+/// context, aka executing an interrupt vector or subcalls of it.
+///
+/// Concept and implementation derived from the `CriticalSection` introduced in
+/// https://github.com/rust-embedded/bare-metal
+/// <https://github.com/rust-embedded/bare-metal>
+#[derive(Clone, Copy)]
+pub struct IRQContext<'irq_context> {
+ _0: PhantomData<&'irq_context ()>,
@ -2296,8 +2296,8 @@ diff -uNr 13_integrated_testing/src/exception/asynchronous.rs 14_exceptions_part
diff -uNr 13_integrated_testing/src/lib.rs 14_exceptions_part2_peripheral_IRQs/src/lib.rs
--- 13_integrated_testing/src/lib.rs
+++ 14_exceptions_part2_peripheral_IRQs/src/lib.rs
@@ -109,9 +109,11 @@
//! [`cpu::boot::arch_boot::_start()`]: cpu/boot/arch_boot/fn._start.html
@@ -110,9 +110,11 @@
//! [`runtime_init::runtime_init()`]: runtime_init/fn.runtime_init.html
#![allow(incomplete_features)]
+#![feature(asm)]
@ -2308,7 +2308,7 @@ diff -uNr 13_integrated_testing/src/lib.rs 14_exceptions_part2_peripheral_IRQs/s
#![feature(format_args_nl)]
#![feature(global_asm)]
#![feature(linkage)]
@@ -135,6 +137,7 @@
@@ -136,6 +138,7 @@
pub mod exception;
pub mod memory;
pub mod print;
@ -2510,7 +2510,7 @@ diff -uNr 13_integrated_testing/src/state.rs 14_exceptions_part2_peripheral_IRQs
diff -uNr 13_integrated_testing/src/synchronization.rs 14_exceptions_part2_peripheral_IRQs/src/synchronization.rs
--- 13_integrated_testing/src/synchronization.rs
+++ 14_exceptions_part2_peripheral_IRQs/src/synchronization.rs
@@ -27,6 +27,21 @@
@@ -28,6 +28,21 @@
/// Locks the mutex and grants the closure temporary mutable access to the wrapped data.
fn lock<R>(&self, f: impl FnOnce(&mut Self::Data) -> R) -> R;
}
@ -2532,7 +2532,7 @@ diff -uNr 13_integrated_testing/src/synchronization.rs 14_exceptions_part2_perip
}
/// A pseudo-lock for teaching purposes.
@@ -35,8 +50,18 @@
@@ -36,8 +51,18 @@
/// other cores to the contained data. This part is preserved for later lessons.
///
/// The lock will only be used as long as it is safe to do so, i.e. as long as the kernel is
@ -2553,7 +2553,7 @@ diff -uNr 13_integrated_testing/src/synchronization.rs 14_exceptions_part2_perip
where
T: ?Sized,
{
@@ -47,10 +72,22 @@
@@ -48,10 +73,22 @@
// Public Code
//--------------------------------------------------------------------------------------------------
@ -2579,7 +2579,7 @@ diff -uNr 13_integrated_testing/src/synchronization.rs 14_exceptions_part2_perip
/// Create an instance.
pub const fn new(data: T) -> Self {
Self {
@@ -62,8 +99,9 @@
@@ -63,8 +100,9 @@
//------------------------------------------------------------------------------
// OS Interface Code
//------------------------------------------------------------------------------
@ -2590,7 +2590,7 @@ diff -uNr 13_integrated_testing/src/synchronization.rs 14_exceptions_part2_perip
type Data = T;
fn lock<R>(&self, f: impl FnOnce(&mut Self::Data) -> R) -> R {
@@ -71,6 +109,32 @@
@@ -72,6 +110,32 @@
// mutable reference will ever only be given out once at a time.
let data = unsafe { &mut *self.data.get() };

@ -6,8 +6,8 @@
//!
//! # Resources
//!
//! - https://github.com/raspberrypi/documentation/files/1888662/BCM2837-ARM-Peripherals.-.Revised.-.V2-1.pdf
//! - https://developer.arm.com/documentation/ddi0183/latest
//! - <https://github.com/raspberrypi/documentation/files/1888662/BCM2837-ARM-Peripherals.-.Revised.-.V2-1.pdf>
//! - <https://developer.arm.com/documentation/ddi0183/latest>
use crate::{
bsp, bsp::device_driver::common::MMIODerefWrapper, console, cpu, driver, exception,

@ -38,7 +38,7 @@ pub struct IRQDescriptor {
/// context, aka executing an interrupt vector or subcalls of it.
///
/// Concept and implementation derived from the `CriticalSection` introduced in
/// https://github.com/rust-embedded/bare-metal
/// <https://github.com/rust-embedded/bare-metal>
#[derive(Clone, Copy)]
pub struct IRQContext<'irq_context> {
_0: PhantomData<&'irq_context ()>,

@ -107,6 +107,7 @@
//! 2. Once finished with architectural setup, the arch code calls [`runtime_init::runtime_init()`].
//!
//! [`cpu::boot::arch_boot::_start()`]: cpu/boot/arch_boot/fn._start.html
//! [`runtime_init::runtime_init()`]: runtime_init/fn.runtime_init.html
#![allow(incomplete_features)]
#![feature(asm)]

@ -36,7 +36,7 @@ fn _panic_exit() -> ! {
/// Prints with a newline - only use from the panic handler.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! panic_println {
($($arg:tt)*) => ({

@ -20,7 +20,7 @@ pub fn _print(args: fmt::Arguments) {
/// Prints without a newline.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! print {
($($arg:tt)*) => ($crate::print::_print(format_args!($($arg)*)));
@ -28,7 +28,7 @@ macro_rules! print {
/// Prints with a newline.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! println {
() => ($crate::print!("\n"));

@ -4,10 +4,11 @@
//! Synchronization primitives.
//!
//! Suggested literature:
//! - https://doc.rust-lang.org/book/ch16-04-extensible-concurrency-sync-and-send.html
//! - https://stackoverflow.com/questions/59428096/understanding-the-send-trait
//! - https://doc.rust-lang.org/std/cell/index.html
//! # Resources
//!
//! - <https://doc.rust-lang.org/book/ch16-04-extensible-concurrency-sync-and-send.html>
//! - <https://stackoverflow.com/questions/59428096/understanding-the-send-trait>
//! - <https://doc.rust-lang.org/std/cell/index.html>
use core::cell::UnsafeCell;

@ -1190,7 +1190,7 @@ diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/bcm/bcm2xxx_
--- 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/bcm/bcm2xxx_pl011_uart.rs
+++ 15_virtual_mem_part2_mmio_remap/src/bsp/device_driver/bcm/bcm2xxx_pl011_uart.rs
@@ -10,10 +10,13 @@
//! - https://developer.arm.com/documentation/ddi0183/latest
//! - <https://developer.arm.com/documentation/ddi0183/latest>
use crate::{
- bsp, bsp::device_driver::common::MMIODerefWrapper, console, cpu, driver, exception,
@ -1939,7 +1939,7 @@ diff -uNr 14_exceptions_part2_peripheral_IRQs/src/driver.rs 15_virtual_mem_part2
diff -uNr 14_exceptions_part2_peripheral_IRQs/src/lib.rs 15_virtual_mem_part2_mmio_remap/src/lib.rs
--- 14_exceptions_part2_peripheral_IRQs/src/lib.rs
+++ 15_virtual_mem_part2_mmio_remap/src/lib.rs
@@ -110,6 +110,7 @@
@@ -111,6 +111,7 @@
#![allow(incomplete_features)]
#![feature(asm)]
@ -1947,7 +1947,7 @@ diff -uNr 14_exceptions_part2_peripheral_IRQs/src/lib.rs 15_virtual_mem_part2_mm
#![feature(const_fn_fn_ptr_basics)]
#![feature(const_generics)]
#![feature(const_panic)]
@@ -131,6 +132,7 @@
@@ -132,6 +133,7 @@
mod synchronization;
pub mod bsp;

@ -6,8 +6,8 @@
//!
//! # Resources
//!
//! - https://github.com/raspberrypi/documentation/files/1888662/BCM2837-ARM-Peripherals.-.Revised.-.V2-1.pdf
//! - https://developer.arm.com/documentation/ddi0183/latest
//! - <https://github.com/raspberrypi/documentation/files/1888662/BCM2837-ARM-Peripherals.-.Revised.-.V2-1.pdf>
//! - <https://developer.arm.com/documentation/ddi0183/latest>
use crate::{
bsp, bsp::device_driver::common::MMIODerefWrapper, console, cpu, driver, exception, memory,

@ -38,7 +38,7 @@ pub struct IRQDescriptor {
/// context, aka executing an interrupt vector or subcalls of it.
///
/// Concept and implementation derived from the `CriticalSection` introduced in
/// https://github.com/rust-embedded/bare-metal
/// <https://github.com/rust-embedded/bare-metal>
#[derive(Clone, Copy)]
pub struct IRQContext<'irq_context> {
_0: PhantomData<&'irq_context ()>,

@ -107,6 +107,7 @@
//! 2. Once finished with architectural setup, the arch code calls [`runtime_init::runtime_init()`].
//!
//! [`cpu::boot::arch_boot::_start()`]: cpu/boot/arch_boot/fn._start.html
//! [`runtime_init::runtime_init()`]: runtime_init/fn.runtime_init.html
#![allow(incomplete_features)]
#![feature(asm)]

@ -36,7 +36,7 @@ fn _panic_exit() -> ! {
/// Prints with a newline - only use from the panic handler.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! panic_println {
($($arg:tt)*) => ({

@ -20,7 +20,7 @@ pub fn _print(args: fmt::Arguments) {
/// Prints without a newline.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! print {
($($arg:tt)*) => ($crate::print::_print(format_args!($($arg)*)));
@ -28,7 +28,7 @@ macro_rules! print {
/// Prints with a newline.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! println {
() => ($crate::print!("\n"));

@ -4,10 +4,11 @@
//! Synchronization primitives.
//!
//! Suggested literature:
//! - https://doc.rust-lang.org/book/ch16-04-extensible-concurrency-sync-and-send.html
//! - https://stackoverflow.com/questions/59428096/understanding-the-send-trait
//! - https://doc.rust-lang.org/std/cell/index.html
//! # Resources
//!
//! - <https://doc.rust-lang.org/book/ch16-04-extensible-concurrency-sync-and-send.html>
//! - <https://stackoverflow.com/questions/59428096/understanding-the-send-trait>
//! - <https://doc.rust-lang.org/std/cell/index.html>
use core::cell::UnsafeCell;

@ -6,8 +6,8 @@
//!
//! # Resources
//!
//! - https://github.com/raspberrypi/documentation/files/1888662/BCM2837-ARM-Peripherals.-.Revised.-.V2-1.pdf
//! - https://developer.arm.com/documentation/ddi0183/latest
//! - <https://github.com/raspberrypi/documentation/files/1888662/BCM2837-ARM-Peripherals.-.Revised.-.V2-1.pdf>
//! - <https://developer.arm.com/documentation/ddi0183/latest>
use crate::{
bsp::device_driver::common::MMIODerefWrapper, console, cpu, driver, synchronization,

@ -105,6 +105,7 @@
//! 2. Once finished with architectural setup, the arch code calls [`runtime_init::runtime_init()`].
//!
//! [`cpu::boot::arch_boot::_start()`]: cpu/boot/arch_boot/fn._start.html
//! [`runtime_init::runtime_init()`]: runtime_init/fn.runtime_init.html
#![feature(const_fn_fn_ptr_basics)]
#![feature(format_args_nl)]

@ -19,7 +19,7 @@ fn _panic_print(args: fmt::Arguments) {
/// Prints with a newline - only use from the panic handler.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! panic_println {
($($arg:tt)*) => ({

@ -20,7 +20,7 @@ pub fn _print(args: fmt::Arguments) {
/// Prints without a newline.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! print {
($($arg:tt)*) => ($crate::print::_print(format_args!($($arg)*)));
@ -28,7 +28,7 @@ macro_rules! print {
/// Prints with a newline.
///
/// Carbon copy from https://doc.rust-lang.org/src/std/macros.rs.html
/// Carbon copy from <https://doc.rust-lang.org/src/std/macros.rs.html>
#[macro_export]
macro_rules! println {
() => ($crate::print!("\n"));

@ -4,10 +4,11 @@
//! Synchronization primitives.
//!
//! Suggested literature:
//! - https://doc.rust-lang.org/book/ch16-04-extensible-concurrency-sync-and-send.html
//! - https://stackoverflow.com/questions/59428096/understanding-the-send-trait
//! - https://doc.rust-lang.org/std/cell/index.html
//! # Resources
//!
//! - <https://doc.rust-lang.org/book/ch16-04-extensible-concurrency-sync-and-send.html>
//! - <https://stackoverflow.com/questions/59428096/understanding-the-send-trait>
//! - <https://doc.rust-lang.org/std/cell/index.html>
use core::cell::UnsafeCell;

Loading…
Cancel
Save