Change to aarch64-cpu crate

pull/175/head
Andre Richter 2 years ago
parent 60ae47032b
commit 5e3af39bdc
No known key found for this signature in database
GPG Key ID: 2116C1AB102F615E

@ -3,10 +3,10 @@
version = 3 version = 3
[[package]] [[package]]
name = "cortex-a" name = "aarch64-cpu"
version = "8.0.0" version = "9.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0cd4524931a4e0ec50ae91f0d55f571f31ffe11dd9ce2f9905b8343c018c25bb" checksum = "3aceb88e55ba626a5479279268d009a92d9d00eacce0de1b8c236c7ad31b7225"
dependencies = [ dependencies = [
"tock-registers", "tock-registers",
] ]
@ -15,7 +15,7 @@ dependencies = [
name = "mingo" name = "mingo"
version = "0.2.0" version = "0.2.0"
dependencies = [ dependencies = [
"cortex-a", "aarch64-cpu",
] ]
[[package]] [[package]]

@ -24,4 +24,4 @@ path = "src/main.rs"
# Platform specific dependencies # Platform specific dependencies
[target.'cfg(target_arch = "aarch64")'.dependencies] [target.'cfg(target_arch = "aarch64")'.dependencies]
cortex-a = { version = "8.x.x" } aarch64-cpu = { version = "9.x.x" }

@ -28,7 +28,7 @@
* Llama a `kernel_init()`, que llama a `panic!()`, que al final también pone al núcleo 0 en pausa. * Llama a `kernel_init()`, que llama a `panic!()`, que al final también pone al núcleo 0 en pausa.
* La librería ahora usa el crate [cortex-a](https://github.com/rust-embedded/cortex-a), que nos da abstracciones sin coste y envuelve las partes que hacen uso de un `unsafe` (partes con código que no es seguro y podría causar errores) cuando se trabaja directamente con los recursos del procesador. * La librería ahora usa el crate [aarch64-cpu](https://github.com/rust-embedded/aarch64-cpu), que nos da abstracciones sin coste y envuelve las partes que hacen uso de un `unsafe` (partes con código que no es seguro y podría causar errores) cuando se trabaja directamente con los recursos del procesador.
* Lo puedes ver en acción en `_arch/__arch_name__/cpu.rs`. * Lo puedes ver en acción en `_arch/__arch_name__/cpu.rs`.

@ -19,12 +19,12 @@
1. Jumps to the `_start_rust()` function, defined in `arch/__arch_name__/cpu/boot.rs`. 1. Jumps to the `_start_rust()` function, defined in `arch/__arch_name__/cpu/boot.rs`.
- `_start_rust()`: - `_start_rust()`:
- Calls `kernel_init()`, which calls `panic!()`, which eventually halts core0 as well. - Calls `kernel_init()`, which calls `panic!()`, which eventually halts core0 as well.
- The library now uses the [cortex-a] crate, which provides zero-overhead abstractions and wraps - The library now uses the [aarch64-cpu] crate, which provides zero-overhead abstractions and wraps
`unsafe` parts when dealing with the CPU's resources. `unsafe` parts when dealing with the CPU's resources.
- See it in action in `_arch/__arch_name__/cpu.rs`. - See it in action in `_arch/__arch_name__/cpu.rs`.
[bss]: https://en.wikipedia.org/wiki/.bss [bss]: https://en.wikipedia.org/wiki/.bss
[cortex-a]: https://github.com/rust-embedded/cortex-a [aarch64-cpu]: https://github.com/rust-embedded/aarch64-cpu
## Diff to previous ## Diff to previous
```diff ```diff
@ -47,7 +47,7 @@ diff -uNr 01_wait_forever/Cargo.toml 02_runtime_init/Cargo.toml
+ +
+# Platform specific dependencies +# Platform specific dependencies
+[target.'cfg(target_arch = "aarch64")'.dependencies] +[target.'cfg(target_arch = "aarch64")'.dependencies]
+cortex-a = { version = "8.x.x" } +aarch64-cpu = { version = "9.x.x" }
diff -uNr 01_wait_forever/Makefile 02_runtime_init/Makefile diff -uNr 01_wait_forever/Makefile 02_runtime_init/Makefile
--- 01_wait_forever/Makefile --- 01_wait_forever/Makefile
@ -165,7 +165,7 @@ diff -uNr 01_wait_forever/src/_arch/aarch64/cpu.rs 02_runtime_init/src/_arch/aar
+//! +//!
+//! crate::cpu::arch_cpu +//! crate::cpu::arch_cpu
+ +
+use cortex_a::asm; +use aarch64_cpu::asm;
+ +
+//-------------------------------------------------------------------------------------------------- +//--------------------------------------------------------------------------------------------------
+// Public Code +// Public Code

@ -11,7 +11,7 @@
//! //!
//! crate::cpu::arch_cpu //! crate::cpu::arch_cpu
use cortex_a::asm; use aarch64_cpu::asm;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
// Public Code // Public Code

@ -3,10 +3,10 @@
version = 3 version = 3
[[package]] [[package]]
name = "cortex-a" name = "aarch64-cpu"
version = "8.0.0" version = "9.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0cd4524931a4e0ec50ae91f0d55f571f31ffe11dd9ce2f9905b8343c018c25bb" checksum = "3aceb88e55ba626a5479279268d009a92d9d00eacce0de1b8c236c7ad31b7225"
dependencies = [ dependencies = [
"tock-registers", "tock-registers",
] ]
@ -15,7 +15,7 @@ dependencies = [
name = "mingo" name = "mingo"
version = "0.3.0" version = "0.3.0"
dependencies = [ dependencies = [
"cortex-a", "aarch64-cpu",
] ]
[[package]] [[package]]

@ -24,4 +24,4 @@ path = "src/main.rs"
# Platform specific dependencies # Platform specific dependencies
[target.'cfg(target_arch = "aarch64")'.dependencies] [target.'cfg(target_arch = "aarch64")'.dependencies]
cortex-a = { version = "8.x.x" } aarch64-cpu = { version = "9.x.x" }

@ -11,7 +11,7 @@
//! //!
//! crate::cpu::arch_cpu //! crate::cpu::arch_cpu
use cortex_a::asm; use aarch64_cpu::asm;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
// Public Code // Public Code

@ -3,10 +3,10 @@
version = 3 version = 3
[[package]] [[package]]
name = "cortex-a" name = "aarch64-cpu"
version = "8.0.0" version = "9.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0cd4524931a4e0ec50ae91f0d55f571f31ffe11dd9ce2f9905b8343c018c25bb" checksum = "3aceb88e55ba626a5479279268d009a92d9d00eacce0de1b8c236c7ad31b7225"
dependencies = [ dependencies = [
"tock-registers", "tock-registers",
] ]
@ -15,7 +15,7 @@ dependencies = [
name = "mingo" name = "mingo"
version = "0.4.0" version = "0.4.0"
dependencies = [ dependencies = [
"cortex-a", "aarch64-cpu",
] ]
[[package]] [[package]]

@ -24,4 +24,4 @@ path = "src/main.rs"
# Platform specific dependencies # Platform specific dependencies
[target.'cfg(target_arch = "aarch64")'.dependencies] [target.'cfg(target_arch = "aarch64")'.dependencies]
cortex-a = { version = "8.x.x" } aarch64-cpu = { version = "9.x.x" }

@ -11,7 +11,7 @@
//! //!
//! crate::cpu::arch_cpu //! crate::cpu::arch_cpu
use cortex_a::asm; use aarch64_cpu::asm;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
// Public Code // Public Code

@ -3,10 +3,10 @@
version = 3 version = 3
[[package]] [[package]]
name = "cortex-a" name = "aarch64-cpu"
version = "8.0.0" version = "9.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0cd4524931a4e0ec50ae91f0d55f571f31ffe11dd9ce2f9905b8343c018c25bb" checksum = "3aceb88e55ba626a5479279268d009a92d9d00eacce0de1b8c236c7ad31b7225"
dependencies = [ dependencies = [
"tock-registers", "tock-registers",
] ]
@ -15,7 +15,7 @@ dependencies = [
name = "mingo" name = "mingo"
version = "0.5.0" version = "0.5.0"
dependencies = [ dependencies = [
"cortex-a", "aarch64-cpu",
"tock-registers", "tock-registers",
] ]

@ -27,4 +27,4 @@ tock-registers = { version = "0.8.x", default-features = false, features = ["reg
# Platform specific dependencies # Platform specific dependencies
[target.'cfg(target_arch = "aarch64")'.dependencies] [target.'cfg(target_arch = "aarch64")'.dependencies]
cortex-a = { version = "8.x.x" } aarch64-cpu = { version = "9.x.x" }

@ -181,7 +181,7 @@ diff -uNr 04_safe_globals/Cargo.toml 05_drivers_gpio_uart/Cargo.toml
+ +
# Platform specific dependencies # Platform specific dependencies
[target.'cfg(target_arch = "aarch64")'.dependencies] [target.'cfg(target_arch = "aarch64")'.dependencies]
cortex-a = { version = "8.x.x" } aarch64-cpu = { version = "9.x.x" }
diff -uNr 04_safe_globals/Makefile 05_drivers_gpio_uart/Makefile diff -uNr 04_safe_globals/Makefile 05_drivers_gpio_uart/Makefile
--- 04_safe_globals/Makefile --- 04_safe_globals/Makefile

@ -11,7 +11,7 @@
//! //!
//! crate::cpu::arch_cpu //! crate::cpu::arch_cpu
use cortex_a::asm; use aarch64_cpu::asm;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
// Public Code // Public Code

@ -3,10 +3,10 @@
version = 3 version = 3
[[package]] [[package]]
name = "cortex-a" name = "aarch64-cpu"
version = "8.0.0" version = "9.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0cd4524931a4e0ec50ae91f0d55f571f31ffe11dd9ce2f9905b8343c018c25bb" checksum = "3aceb88e55ba626a5479279268d009a92d9d00eacce0de1b8c236c7ad31b7225"
dependencies = [ dependencies = [
"tock-registers", "tock-registers",
] ]
@ -15,7 +15,7 @@ dependencies = [
name = "mingo" name = "mingo"
version = "0.6.0" version = "0.6.0"
dependencies = [ dependencies = [
"cortex-a", "aarch64-cpu",
"tock-registers", "tock-registers",
] ]

@ -27,4 +27,4 @@ tock-registers = { version = "0.8.x", default-features = false, features = ["reg
# Platform specific dependencies # Platform specific dependencies
[target.'cfg(target_arch = "aarch64")'.dependencies] [target.'cfg(target_arch = "aarch64")'.dependencies]
cortex-a = { version = "8.x.x" } aarch64-cpu = { version = "9.x.x" }

@ -11,7 +11,7 @@
//! //!
//! crate::cpu::arch_cpu //! crate::cpu::arch_cpu
use cortex_a::asm; use aarch64_cpu::asm;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
// Public Code // Public Code

@ -3,10 +3,10 @@
version = 3 version = 3
[[package]] [[package]]
name = "cortex-a" name = "aarch64-cpu"
version = "8.0.0" version = "9.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0cd4524931a4e0ec50ae91f0d55f571f31ffe11dd9ce2f9905b8343c018c25bb" checksum = "3aceb88e55ba626a5479279268d009a92d9d00eacce0de1b8c236c7ad31b7225"
dependencies = [ dependencies = [
"tock-registers", "tock-registers",
] ]
@ -15,7 +15,7 @@ dependencies = [
name = "mingo" name = "mingo"
version = "0.7.0" version = "0.7.0"
dependencies = [ dependencies = [
"cortex-a", "aarch64-cpu",
"tock-registers", "tock-registers",
] ]

@ -27,4 +27,4 @@ tock-registers = { version = "0.8.x", default-features = false, features = ["reg
# Platform specific dependencies # Platform specific dependencies
[target.'cfg(target_arch = "aarch64")'.dependencies] [target.'cfg(target_arch = "aarch64")'.dependencies]
cortex-a = { version = "8.x.x" } aarch64-cpu = { version = "9.x.x" }

@ -272,12 +272,12 @@ diff -uNr 06_uart_chainloader/src/_arch/aarch64/time.rs 07_timestamps/src/_arch/
+//! crate::time::arch_time +//! crate::time::arch_time
+ +
+use crate::warn; +use crate::warn;
+use aarch64_cpu::{asm::barrier, registers::*};
+use core::{ +use core::{
+ num::{NonZeroU128, NonZeroU32, NonZeroU64}, + num::{NonZeroU128, NonZeroU32, NonZeroU64},
+ ops::{Add, Div}, + ops::{Add, Div},
+ time::Duration, + time::Duration,
+}; +};
+use cortex_a::{asm::barrier, registers::*};
+use tock_registers::interfaces::Readable; +use tock_registers::interfaces::Readable;
+ +
+//-------------------------------------------------------------------------------------------------- +//--------------------------------------------------------------------------------------------------

@ -11,7 +11,7 @@
//! //!
//! crate::cpu::arch_cpu //! crate::cpu::arch_cpu
use cortex_a::asm; use aarch64_cpu::asm;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
// Public Code // Public Code

@ -12,12 +12,12 @@
//! crate::time::arch_time //! crate::time::arch_time
use crate::warn; use crate::warn;
use aarch64_cpu::{asm::barrier, registers::*};
use core::{ use core::{
num::{NonZeroU128, NonZeroU32, NonZeroU64}, num::{NonZeroU128, NonZeroU32, NonZeroU64},
ops::{Add, Div}, ops::{Add, Div},
time::Duration, time::Duration,
}; };
use cortex_a::{asm::barrier, registers::*};
use tock_registers::interfaces::Readable; use tock_registers::interfaces::Readable;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

@ -3,10 +3,10 @@
version = 3 version = 3
[[package]] [[package]]
name = "cortex-a" name = "aarch64-cpu"
version = "8.0.0" version = "9.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0cd4524931a4e0ec50ae91f0d55f571f31ffe11dd9ce2f9905b8343c018c25bb" checksum = "3aceb88e55ba626a5479279268d009a92d9d00eacce0de1b8c236c7ad31b7225"
dependencies = [ dependencies = [
"tock-registers", "tock-registers",
] ]
@ -15,7 +15,7 @@ dependencies = [
name = "mingo" name = "mingo"
version = "0.8.0" version = "0.8.0"
dependencies = [ dependencies = [
"cortex-a", "aarch64-cpu",
"tock-registers", "tock-registers",
] ]

@ -27,4 +27,4 @@ tock-registers = { version = "0.8.x", default-features = false, features = ["reg
# Platform specific dependencies # Platform specific dependencies
[target.'cfg(target_arch = "aarch64")'.dependencies] [target.'cfg(target_arch = "aarch64")'.dependencies]
cortex-a = { version = "8.x.x" } aarch64-cpu = { version = "9.x.x" }

@ -11,7 +11,7 @@
//! //!
//! crate::cpu::arch_cpu //! crate::cpu::arch_cpu
use cortex_a::asm; use aarch64_cpu::asm;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
// Public Code // Public Code

@ -12,12 +12,12 @@
//! crate::time::arch_time //! crate::time::arch_time
use crate::warn; use crate::warn;
use aarch64_cpu::{asm::barrier, registers::*};
use core::{ use core::{
num::{NonZeroU128, NonZeroU32, NonZeroU64}, num::{NonZeroU128, NonZeroU32, NonZeroU64},
ops::{Add, Div}, ops::{Add, Div},
time::Duration, time::Duration,
}; };
use cortex_a::{asm::barrier, registers::*};
use tock_registers::interfaces::Readable; use tock_registers::interfaces::Readable;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

@ -3,10 +3,10 @@
version = 3 version = 3
[[package]] [[package]]
name = "cortex-a" name = "aarch64-cpu"
version = "8.0.0" version = "9.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0cd4524931a4e0ec50ae91f0d55f571f31ffe11dd9ce2f9905b8343c018c25bb" checksum = "3aceb88e55ba626a5479279268d009a92d9d00eacce0de1b8c236c7ad31b7225"
dependencies = [ dependencies = [
"tock-registers", "tock-registers",
] ]
@ -15,7 +15,7 @@ dependencies = [
name = "mingo" name = "mingo"
version = "0.9.0" version = "0.9.0"
dependencies = [ dependencies = [
"cortex-a", "aarch64-cpu",
"tock-registers", "tock-registers",
] ]

@ -27,4 +27,4 @@ tock-registers = { version = "0.8.x", default-features = false, features = ["reg
# Platform specific dependencies # Platform specific dependencies
[target.'cfg(target_arch = "aarch64")'.dependencies] [target.'cfg(target_arch = "aarch64")'.dependencies]
cortex-a = { version = "8.x.x" } aarch64-cpu = { version = "9.x.x" }

@ -75,7 +75,7 @@ We are already using them since [tutorial 07](../07_timestamps/), so of course w
Therefore we set the respective flags in the [Counter-timer Hypervisor Control register] and Therefore we set the respective flags in the [Counter-timer Hypervisor Control register] and
additionally set the virtual offset to zero so that we get the real physical value everytime: additionally set the virtual offset to zero so that we get the real physical value everytime:
[Counter-timer Hypervisor Control register]: https://docs.rs/cortex-a/5.1.2/src/cortex_a/regs/cnthctl_el2.rs.html [Counter-timer Hypervisor Control register]: https://docs.rs/aarch64-cpu/9.0.0/src/aarch64_cpu/registers/cnthctl_el2.rs.html
```rust ```rust
// Enable timer counter registers for EL1. // Enable timer counter registers for EL1.
@ -88,7 +88,7 @@ CNTVOFF_EL2.set(0);
Next, we configure the [Hypervisor Configuration Register] such that `EL1` runs in `AArch64` mode, Next, we configure the [Hypervisor Configuration Register] such that `EL1` runs in `AArch64` mode,
and not in `AArch32`, which would also be possible. and not in `AArch32`, which would also be possible.
[Hypervisor Configuration Register]: https://docs.rs/cortex-a/5.1.2/src/cortex_a/regs/hcr_el2.rs.html [Hypervisor Configuration Register]: https://docs.rs/aarch64-cpu/9.0.0/src/aarch64_cpu/registers/hcr_el2.rs.html
```rust ```rust
// Set EL1 execution state to AArch64. // Set EL1 execution state to AArch64.
@ -100,7 +100,7 @@ HCR_EL2.write(HCR_EL2::RW::EL1IsAarch64);
There is actually only one way to transition from a higher EL to a lower EL, which is by way of There is actually only one way to transition from a higher EL to a lower EL, which is by way of
executing the [ERET] instruction. executing the [ERET] instruction.
[ERET]: https://docs.rs/cortex-a/5.1.2/src/cortex_a/asm.rs.html#87-96 [ERET]: https://docs.rs/aarch64-cpu/9.0.0/src/aarch64_cpu/asm.rs.html#92-101
This instruction will copy the contents of the [Saved Program Status Register - EL2] to `Current This instruction will copy the contents of the [Saved Program Status Register - EL2] to `Current
Program Status Register - EL1` and jump to the instruction address that is stored in the [Exception Program Status Register - EL1` and jump to the instruction address that is stored in the [Exception
@ -109,8 +109,8 @@ Link Register - EL2].
This is basically the reverse of what is happening when an exception is taken. You'll learn about This is basically the reverse of what is happening when an exception is taken. You'll learn about
that in an upcoming tutorial. that in an upcoming tutorial.
[Saved Program Status Register - EL2]: https://docs.rs/cortex-a/5.1.2/src/cortex_a/regs/spsr_el2.rs.html [Saved Program Status Register - EL2]: https://docs.rs/aarch64-cpu/9.0.0/src/aarch64_cpu/registers/spsr_el2.rs.html
[Exception Link Register - EL2]: https://docs.rs/cortex-a/5.1.2/src/cortex_a/regs/elr_el2.rs.html [Exception Link Register - EL2]: https://docs.rs/aarch64-cpu/9.0.0/src/aarch64_cpu/registers/elr_el2.rs.html
```rust ```rust
// Set up a simulated exception return. // Set up a simulated exception return.
@ -212,11 +212,12 @@ diff -uNr 08_hw_debug_JTAG/Cargo.toml 09_privilege_level/Cargo.toml
diff -uNr 08_hw_debug_JTAG/src/_arch/aarch64/cpu/boot.rs 09_privilege_level/src/_arch/aarch64/cpu/boot.rs diff -uNr 08_hw_debug_JTAG/src/_arch/aarch64/cpu/boot.rs 09_privilege_level/src/_arch/aarch64/cpu/boot.rs
--- 08_hw_debug_JTAG/src/_arch/aarch64/cpu/boot.rs --- 08_hw_debug_JTAG/src/_arch/aarch64/cpu/boot.rs
+++ 09_privilege_level/src/_arch/aarch64/cpu/boot.rs +++ 09_privilege_level/src/_arch/aarch64/cpu/boot.rs
@@ -12,21 +12,72 @@ @@ -11,22 +11,73 @@
//!
//! crate::cpu::boot::arch_boot //! crate::cpu::boot::arch_boot
+use aarch64_cpu::{asm, registers::*};
use core::arch::global_asm; use core::arch::global_asm;
+use cortex_a::{asm, registers::*};
+use tock_registers::interfaces::Writeable; +use tock_registers::interfaces::Writeable;
// Assembly counterpart to this file. // Assembly counterpart to this file.
@ -348,7 +349,7 @@ diff -uNr 08_hw_debug_JTAG/src/_arch/aarch64/exception/asynchronous.rs 09_privil
+//! +//!
+//! crate::exception::asynchronous::arch_asynchronous +//! crate::exception::asynchronous::arch_asynchronous
+ +
+use cortex_a::registers::*; +use aarch64_cpu::registers::*;
+use tock_registers::interfaces::Readable; +use tock_registers::interfaces::Readable;
+ +
+//-------------------------------------------------------------------------------------------------- +//--------------------------------------------------------------------------------------------------
@ -435,7 +436,7 @@ diff -uNr 08_hw_debug_JTAG/src/_arch/aarch64/exception.rs 09_privilege_level/src
+//! +//!
+//! crate::exception::arch_exception +//! crate::exception::arch_exception
+ +
+use cortex_a::registers::*; +use aarch64_cpu::registers::*;
+use tock_registers::interfaces::Readable; +use tock_registers::interfaces::Readable;
+ +
+//-------------------------------------------------------------------------------------------------- +//--------------------------------------------------------------------------------------------------

@ -11,7 +11,7 @@
//! //!
//! crate::cpu::arch_cpu //! crate::cpu::arch_cpu
use cortex_a::asm; use aarch64_cpu::asm;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
// Public Code // Public Code

@ -11,8 +11,8 @@
//! //!
//! crate::cpu::boot::arch_boot //! crate::cpu::boot::arch_boot
use aarch64_cpu::{asm, registers::*};
use core::arch::global_asm; use core::arch::global_asm;
use cortex_a::{asm, registers::*};
use tock_registers::interfaces::Writeable; use tock_registers::interfaces::Writeable;
// Assembly counterpart to this file. // Assembly counterpart to this file.

@ -11,7 +11,7 @@
//! //!
//! crate::exception::arch_exception //! crate::exception::arch_exception
use cortex_a::registers::*; use aarch64_cpu::registers::*;
use tock_registers::interfaces::Readable; use tock_registers::interfaces::Readable;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

@ -11,7 +11,7 @@
//! //!
//! crate::exception::asynchronous::arch_asynchronous //! crate::exception::asynchronous::arch_asynchronous
use cortex_a::registers::*; use aarch64_cpu::registers::*;
use tock_registers::interfaces::Readable; use tock_registers::interfaces::Readable;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

@ -12,12 +12,12 @@
//! crate::time::arch_time //! crate::time::arch_time
use crate::warn; use crate::warn;
use aarch64_cpu::{asm::barrier, registers::*};
use core::{ use core::{
num::{NonZeroU128, NonZeroU32, NonZeroU64}, num::{NonZeroU128, NonZeroU32, NonZeroU64},
ops::{Add, Div}, ops::{Add, Div},
time::Duration, time::Duration,
}; };
use cortex_a::{asm::barrier, registers::*};
use tock_registers::interfaces::Readable; use tock_registers::interfaces::Readable;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

@ -3,10 +3,10 @@
version = 3 version = 3
[[package]] [[package]]
name = "cortex-a" name = "aarch64-cpu"
version = "8.0.0" version = "9.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0cd4524931a4e0ec50ae91f0d55f571f31ffe11dd9ce2f9905b8343c018c25bb" checksum = "3aceb88e55ba626a5479279268d009a92d9d00eacce0de1b8c236c7ad31b7225"
dependencies = [ dependencies = [
"tock-registers", "tock-registers",
] ]
@ -15,7 +15,7 @@ dependencies = [
name = "mingo" name = "mingo"
version = "0.10.0" version = "0.10.0"
dependencies = [ dependencies = [
"cortex-a", "aarch64-cpu",
"tock-registers", "tock-registers",
] ]

@ -27,4 +27,4 @@ tock-registers = { version = "0.8.x", default-features = false, features = ["reg
# Platform specific dependencies # Platform specific dependencies
[target.'cfg(target_arch = "aarch64")'.dependencies] [target.'cfg(target_arch = "aarch64")'.dependencies]
cortex-a = { version = "8.x.x" } aarch64-cpu = { version = "9.x.x" }

@ -218,9 +218,9 @@ self.configure_translation_control();
Finally, the `MMU` is turned on through the [System Control Register - EL1]. The last step also Finally, the `MMU` is turned on through the [System Control Register - EL1]. The last step also
enables caching for data and instructions. enables caching for data and instructions.
[Translation Table Base Register 0 - EL1]: https://docs.rs/crate/cortex-a/5.1.2/source/src/regs/ttbr0_el1.rs [Translation Table Base Register 0 - EL1]: https://docs.rs/aarch64-cpu/9.0.0/src/aarch64_cpu/registers/ttbr0_el1.rs.html
[Translation Control Register - EL1]: https://docs.rs/crate/cortex-a/5.1.2/source/src/regs/tcr_el1.rs [Translation Control Register - EL1]: https://docs.rs/aarch64-cpu/9.0.0/src/aarch64_cpu/registers/tcr_el1.rs.html
[System Control Register - EL1]: https://docs.rs/crate/cortex-a/5.1.2/source/src/regs/sctlr_el1.rs [System Control Register - EL1]: https://docs.rs/aarch64-cpu/9.0.0/src/aarch64_cpu/registers/sctlr_el1.rs.html
### `kernel.ld` ### `kernel.ld`
@ -257,11 +257,11 @@ The MMU init code is again a good example to see the great potential of Rust's z
abstractions[[1]][[2]] for embedded programming. abstractions[[1]][[2]] for embedded programming.
Let's take a look again at the piece of code for setting up the `MAIR_EL1` register using the Let's take a look again at the piece of code for setting up the `MAIR_EL1` register using the
[cortex-a] crate: [aarch64-cpu] crate:
[1]: https://blog.rust-lang.org/2015/05/11/traits.html [1]: https://blog.rust-lang.org/2015/05/11/traits.html
[2]: https://ruudvanasseldonk.com/2016/11/30/zero-cost-abstractions [2]: https://ruudvanasseldonk.com/2016/11/30/zero-cost-abstractions
[cortex-a]: https://crates.io/crates/cortex-a [aarch64-cpu]: https://crates.io/crates/aarch64-cpu
```rust ```rust
/// Setup function for the MAIR_EL1 register. /// Setup function for the MAIR_EL1 register.
@ -681,8 +681,8 @@ diff -uNr 09_privilege_level/src/_arch/aarch64/memory/mmu.rs 10_virtual_mem_part
+ bsp, memory, + bsp, memory,
+ memory::mmu::{translation_table::KernelTranslationTable, TranslationGranule}, + memory::mmu::{translation_table::KernelTranslationTable, TranslationGranule},
+}; +};
+use aarch64_cpu::{asm::barrier, registers::*};
+use core::intrinsics::unlikely; +use core::intrinsics::unlikely;
+use cortex_a::{asm::barrier, registers::*};
+use tock_registers::interfaces::{ReadWriteable, Readable, Writeable}; +use tock_registers::interfaces::{ReadWriteable, Readable, Writeable};
+ +
+//-------------------------------------------------------------------------------------------------- +//--------------------------------------------------------------------------------------------------

@ -11,7 +11,7 @@
//! //!
//! crate::cpu::arch_cpu //! crate::cpu::arch_cpu
use cortex_a::asm; use aarch64_cpu::asm;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
// Public Code // Public Code

@ -11,8 +11,8 @@
//! //!
//! crate::cpu::boot::arch_boot //! crate::cpu::boot::arch_boot
use aarch64_cpu::{asm, registers::*};
use core::arch::global_asm; use core::arch::global_asm;
use cortex_a::{asm, registers::*};
use tock_registers::interfaces::Writeable; use tock_registers::interfaces::Writeable;
// Assembly counterpart to this file. // Assembly counterpart to this file.

@ -11,7 +11,7 @@
//! //!
//! crate::exception::arch_exception //! crate::exception::arch_exception
use cortex_a::registers::*; use aarch64_cpu::registers::*;
use tock_registers::interfaces::Readable; use tock_registers::interfaces::Readable;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

@ -11,7 +11,7 @@
//! //!
//! crate::exception::asynchronous::arch_asynchronous //! crate::exception::asynchronous::arch_asynchronous
use cortex_a::registers::*; use aarch64_cpu::registers::*;
use tock_registers::interfaces::Readable; use tock_registers::interfaces::Readable;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

@ -17,8 +17,8 @@ use crate::{
bsp, memory, bsp, memory,
memory::mmu::{translation_table::KernelTranslationTable, TranslationGranule}, memory::mmu::{translation_table::KernelTranslationTable, TranslationGranule},
}; };
use aarch64_cpu::{asm::barrier, registers::*};
use core::intrinsics::unlikely; use core::intrinsics::unlikely;
use cortex_a::{asm::barrier, registers::*};
use tock_registers::interfaces::{ReadWriteable, Readable, Writeable}; use tock_registers::interfaces::{ReadWriteable, Readable, Writeable};
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

@ -12,12 +12,12 @@
//! crate::time::arch_time //! crate::time::arch_time
use crate::warn; use crate::warn;
use aarch64_cpu::{asm::barrier, registers::*};
use core::{ use core::{
num::{NonZeroU128, NonZeroU32, NonZeroU64}, num::{NonZeroU128, NonZeroU32, NonZeroU64},
ops::{Add, Div}, ops::{Add, Div},
time::Duration, time::Duration,
}; };
use cortex_a::{asm::barrier, registers::*};
use tock_registers::interfaces::Readable; use tock_registers::interfaces::Readable;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

@ -3,10 +3,10 @@
version = 3 version = 3
[[package]] [[package]]
name = "cortex-a" name = "aarch64-cpu"
version = "8.0.0" version = "9.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0cd4524931a4e0ec50ae91f0d55f571f31ffe11dd9ce2f9905b8343c018c25bb" checksum = "3aceb88e55ba626a5479279268d009a92d9d00eacce0de1b8c236c7ad31b7225"
dependencies = [ dependencies = [
"tock-registers", "tock-registers",
] ]
@ -15,7 +15,7 @@ dependencies = [
name = "mingo" name = "mingo"
version = "0.11.0" version = "0.11.0"
dependencies = [ dependencies = [
"cortex-a", "aarch64-cpu",
"tock-registers", "tock-registers",
] ]

@ -27,4 +27,4 @@ tock-registers = { version = "0.8.x", default-features = false, features = ["reg
# Platform specific dependencies # Platform specific dependencies
[target.'cfg(target_arch = "aarch64")'.dependencies] [target.'cfg(target_arch = "aarch64")'.dependencies]
cortex-a = { version = "8.x.x" } aarch64-cpu = { version = "9.x.x" }

@ -507,10 +507,10 @@ diff -uNr 10_virtual_mem_part1_identity_mapping/src/_arch/aarch64/exception.rs 1
//! //!
//! crate::exception::arch_exception //! crate::exception::arch_exception
-use cortex_a::registers::*; -use aarch64_cpu::registers::*;
-use tock_registers::interfaces::Readable; -use tock_registers::interfaces::Readable;
+use aarch64_cpu::{asm::barrier, registers::*};
+use core::{arch::global_asm, cell::UnsafeCell, fmt}; +use core::{arch::global_asm, cell::UnsafeCell, fmt};
+use cortex_a::{asm::barrier, registers::*};
+use tock_registers::{ +use tock_registers::{
+ interfaces::{Readable, Writeable}, + interfaces::{Readable, Writeable},
+ registers::InMemoryRegister, + registers::InMemoryRegister,

@ -11,7 +11,7 @@
//! //!
//! crate::cpu::arch_cpu //! crate::cpu::arch_cpu
use cortex_a::asm; use aarch64_cpu::asm;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
// Public Code // Public Code

@ -11,8 +11,8 @@
//! //!
//! crate::cpu::boot::arch_boot //! crate::cpu::boot::arch_boot
use aarch64_cpu::{asm, registers::*};
use core::arch::global_asm; use core::arch::global_asm;
use cortex_a::{asm, registers::*};
use tock_registers::interfaces::Writeable; use tock_registers::interfaces::Writeable;
// Assembly counterpart to this file. // Assembly counterpart to this file.

@ -11,8 +11,8 @@
//! //!
//! crate::exception::arch_exception //! crate::exception::arch_exception
use aarch64_cpu::{asm::barrier, registers::*};
use core::{arch::global_asm, cell::UnsafeCell, fmt}; use core::{arch::global_asm, cell::UnsafeCell, fmt};
use cortex_a::{asm::barrier, registers::*};
use tock_registers::{ use tock_registers::{
interfaces::{Readable, Writeable}, interfaces::{Readable, Writeable},
registers::InMemoryRegister, registers::InMemoryRegister,

@ -11,7 +11,7 @@
//! //!
//! crate::exception::asynchronous::arch_asynchronous //! crate::exception::asynchronous::arch_asynchronous
use cortex_a::registers::*; use aarch64_cpu::registers::*;
use tock_registers::interfaces::Readable; use tock_registers::interfaces::Readable;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

@ -17,8 +17,8 @@ use crate::{
bsp, memory, bsp, memory,
memory::mmu::{translation_table::KernelTranslationTable, TranslationGranule}, memory::mmu::{translation_table::KernelTranslationTable, TranslationGranule},
}; };
use aarch64_cpu::{asm::barrier, registers::*};
use core::intrinsics::unlikely; use core::intrinsics::unlikely;
use cortex_a::{asm::barrier, registers::*};
use tock_registers::interfaces::{ReadWriteable, Readable, Writeable}; use tock_registers::interfaces::{ReadWriteable, Readable, Writeable};
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

@ -12,12 +12,12 @@
//! crate::time::arch_time //! crate::time::arch_time
use crate::warn; use crate::warn;
use aarch64_cpu::{asm::barrier, registers::*};
use core::{ use core::{
num::{NonZeroU128, NonZeroU32, NonZeroU64}, num::{NonZeroU128, NonZeroU32, NonZeroU64},
ops::{Add, Div}, ops::{Add, Div},
time::Duration, time::Duration,
}; };
use cortex_a::{asm::barrier, registers::*};
use tock_registers::interfaces::Readable; use tock_registers::interfaces::Readable;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

@ -3,10 +3,10 @@
version = 3 version = 3
[[package]] [[package]]
name = "cortex-a" name = "aarch64-cpu"
version = "8.0.0" version = "9.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0cd4524931a4e0ec50ae91f0d55f571f31ffe11dd9ce2f9905b8343c018c25bb" checksum = "3aceb88e55ba626a5479279268d009a92d9d00eacce0de1b8c236c7ad31b7225"
dependencies = [ dependencies = [
"tock-registers", "tock-registers",
] ]
@ -15,7 +15,7 @@ dependencies = [
name = "mingo" name = "mingo"
version = "0.12.0" version = "0.12.0"
dependencies = [ dependencies = [
"cortex-a", "aarch64-cpu",
"qemu-exit", "qemu-exit",
"test-macros", "test-macros",
"test-types", "test-types",

@ -23,7 +23,7 @@ qemu-exit = { version = "3.x.x", optional = true }
# Platform specific dependencies # Platform specific dependencies
[target.'cfg(target_arch = "aarch64")'.dependencies] [target.'cfg(target_arch = "aarch64")'.dependencies]
cortex-a = { version = "8.x.x" } aarch64-cpu = { version = "9.x.x" }
##-------------------------------------------------------------------------------------------------- ##--------------------------------------------------------------------------------------------------
## Testing ## Testing

@ -11,7 +11,7 @@
//! //!
//! crate::cpu::arch_cpu //! crate::cpu::arch_cpu
use cortex_a::asm; use aarch64_cpu::asm;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
// Public Code // Public Code

@ -11,8 +11,8 @@
//! //!
//! crate::cpu::boot::arch_boot //! crate::cpu::boot::arch_boot
use aarch64_cpu::{asm, registers::*};
use core::arch::global_asm; use core::arch::global_asm;
use cortex_a::{asm, registers::*};
use tock_registers::interfaces::Writeable; use tock_registers::interfaces::Writeable;
// Assembly counterpart to this file. // Assembly counterpart to this file.

@ -11,8 +11,8 @@
//! //!
//! crate::exception::arch_exception //! crate::exception::arch_exception
use aarch64_cpu::{asm::barrier, registers::*};
use core::{arch::global_asm, cell::UnsafeCell, fmt}; use core::{arch::global_asm, cell::UnsafeCell, fmt};
use cortex_a::{asm::barrier, registers::*};
use tock_registers::{ use tock_registers::{
interfaces::{Readable, Writeable}, interfaces::{Readable, Writeable},
registers::InMemoryRegister, registers::InMemoryRegister,

@ -11,7 +11,7 @@
//! //!
//! crate::exception::asynchronous::arch_asynchronous //! crate::exception::asynchronous::arch_asynchronous
use cortex_a::registers::*; use aarch64_cpu::registers::*;
use tock_registers::interfaces::Readable; use tock_registers::interfaces::Readable;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

@ -17,8 +17,8 @@ use crate::{
bsp, memory, bsp, memory,
memory::mmu::{translation_table::KernelTranslationTable, TranslationGranule}, memory::mmu::{translation_table::KernelTranslationTable, TranslationGranule},
}; };
use aarch64_cpu::{asm::barrier, registers::*};
use core::intrinsics::unlikely; use core::intrinsics::unlikely;
use cortex_a::{asm::barrier, registers::*};
use tock_registers::interfaces::{ReadWriteable, Readable, Writeable}; use tock_registers::interfaces::{ReadWriteable, Readable, Writeable};
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

@ -12,12 +12,12 @@
//! crate::time::arch_time //! crate::time::arch_time
use crate::warn; use crate::warn;
use aarch64_cpu::{asm::barrier, registers::*};
use core::{ use core::{
num::{NonZeroU128, NonZeroU32, NonZeroU64}, num::{NonZeroU128, NonZeroU32, NonZeroU64},
ops::{Add, Div}, ops::{Add, Div},
time::Duration, time::Duration,
}; };
use cortex_a::{asm::barrier, registers::*};
use tock_registers::interfaces::Readable; use tock_registers::interfaces::Readable;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

@ -3,10 +3,10 @@
version = 3 version = 3
[[package]] [[package]]
name = "cortex-a" name = "aarch64-cpu"
version = "8.0.0" version = "9.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0cd4524931a4e0ec50ae91f0d55f571f31ffe11dd9ce2f9905b8343c018c25bb" checksum = "3aceb88e55ba626a5479279268d009a92d9d00eacce0de1b8c236c7ad31b7225"
dependencies = [ dependencies = [
"tock-registers", "tock-registers",
] ]
@ -15,7 +15,7 @@ dependencies = [
name = "mingo" name = "mingo"
version = "0.13.0" version = "0.13.0"
dependencies = [ dependencies = [
"cortex-a", "aarch64-cpu",
"qemu-exit", "qemu-exit",
"test-macros", "test-macros",
"test-types", "test-types",

@ -802,7 +802,7 @@ diff -uNr 12_integrated_testing/kernel/src/_arch/aarch64/cpu/smp.rs 13_exception
+//! +//!
+//! crate::cpu::smp::arch_smp +//! crate::cpu::smp::arch_smp
+ +
+use cortex_a::registers::*; +use aarch64_cpu::registers::*;
+use tock_registers::interfaces::Readable; +use tock_registers::interfaces::Readable;
+ +
+//-------------------------------------------------------------------------------------------------- +//--------------------------------------------------------------------------------------------------
@ -823,13 +823,12 @@ diff -uNr 12_integrated_testing/kernel/src/_arch/aarch64/cpu/smp.rs 13_exception
diff -uNr 12_integrated_testing/kernel/src/_arch/aarch64/exception/asynchronous.rs 13_exceptions_part2_peripheral_IRQs/kernel/src/_arch/aarch64/exception/asynchronous.rs diff -uNr 12_integrated_testing/kernel/src/_arch/aarch64/exception/asynchronous.rs 13_exceptions_part2_peripheral_IRQs/kernel/src/_arch/aarch64/exception/asynchronous.rs
--- 12_integrated_testing/kernel/src/_arch/aarch64/exception/asynchronous.rs --- 12_integrated_testing/kernel/src/_arch/aarch64/exception/asynchronous.rs
+++ 13_exceptions_part2_peripheral_IRQs/kernel/src/_arch/aarch64/exception/asynchronous.rs +++ 13_exceptions_part2_peripheral_IRQs/kernel/src/_arch/aarch64/exception/asynchronous.rs
@@ -11,13 +11,18 @@ @@ -12,12 +12,17 @@
//!
//! crate::exception::asynchronous::arch_asynchronous //! crate::exception::asynchronous::arch_asynchronous
+use core::arch::asm; use aarch64_cpu::registers::*;
use cortex_a::registers::*;
-use tock_registers::interfaces::Readable; -use tock_registers::interfaces::Readable;
+use core::arch::asm;
+use tock_registers::interfaces::{Readable, Writeable}; +use tock_registers::interfaces::{Readable, Writeable};
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -913,8 +912,8 @@ diff -uNr 12_integrated_testing/kernel/src/_arch/aarch64/exception.rs 13_excepti
//! crate::exception::arch_exception //! crate::exception::arch_exception
+use crate::exception; +use crate::exception;
use aarch64_cpu::{asm::barrier, registers::*};
use core::{arch::global_asm, cell::UnsafeCell, fmt}; use core::{arch::global_asm, cell::UnsafeCell, fmt};
use cortex_a::{asm::barrier, registers::*};
use tock_registers::{ use tock_registers::{
@@ -102,8 +103,9 @@ @@ -102,8 +103,9 @@
} }

@ -23,7 +23,7 @@ qemu-exit = { version = "3.x.x", optional = true }
# Platform specific dependencies # Platform specific dependencies
[target.'cfg(target_arch = "aarch64")'.dependencies] [target.'cfg(target_arch = "aarch64")'.dependencies]
cortex-a = { version = "8.x.x" } aarch64-cpu = { version = "9.x.x" }
##-------------------------------------------------------------------------------------------------- ##--------------------------------------------------------------------------------------------------
## Testing ## Testing

@ -11,7 +11,7 @@
//! //!
//! crate::cpu::arch_cpu //! crate::cpu::arch_cpu
use cortex_a::asm; use aarch64_cpu::asm;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
// Public Code // Public Code

@ -11,8 +11,8 @@
//! //!
//! crate::cpu::boot::arch_boot //! crate::cpu::boot::arch_boot
use aarch64_cpu::{asm, registers::*};
use core::arch::global_asm; use core::arch::global_asm;
use cortex_a::{asm, registers::*};
use tock_registers::interfaces::Writeable; use tock_registers::interfaces::Writeable;
// Assembly counterpart to this file. // Assembly counterpart to this file.

@ -11,7 +11,7 @@
//! //!
//! crate::cpu::smp::arch_smp //! crate::cpu::smp::arch_smp
use cortex_a::registers::*; use aarch64_cpu::registers::*;
use tock_registers::interfaces::Readable; use tock_registers::interfaces::Readable;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

@ -12,8 +12,8 @@
//! crate::exception::arch_exception //! crate::exception::arch_exception
use crate::exception; use crate::exception;
use aarch64_cpu::{asm::barrier, registers::*};
use core::{arch::global_asm, cell::UnsafeCell, fmt}; use core::{arch::global_asm, cell::UnsafeCell, fmt};
use cortex_a::{asm::barrier, registers::*};
use tock_registers::{ use tock_registers::{
interfaces::{Readable, Writeable}, interfaces::{Readable, Writeable},
registers::InMemoryRegister, registers::InMemoryRegister,

@ -11,8 +11,8 @@
//! //!
//! crate::exception::asynchronous::arch_asynchronous //! crate::exception::asynchronous::arch_asynchronous
use aarch64_cpu::registers::*;
use core::arch::asm; use core::arch::asm;
use cortex_a::registers::*;
use tock_registers::interfaces::{Readable, Writeable}; use tock_registers::interfaces::{Readable, Writeable};
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

@ -17,8 +17,8 @@ use crate::{
bsp, memory, bsp, memory,
memory::mmu::{translation_table::KernelTranslationTable, TranslationGranule}, memory::mmu::{translation_table::KernelTranslationTable, TranslationGranule},
}; };
use aarch64_cpu::{asm::barrier, registers::*};
use core::intrinsics::unlikely; use core::intrinsics::unlikely;
use cortex_a::{asm::barrier, registers::*};
use tock_registers::interfaces::{ReadWriteable, Readable, Writeable}; use tock_registers::interfaces::{ReadWriteable, Readable, Writeable};
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

@ -12,12 +12,12 @@
//! crate::time::arch_time //! crate::time::arch_time
use crate::warn; use crate::warn;
use aarch64_cpu::{asm::barrier, registers::*};
use core::{ use core::{
num::{NonZeroU128, NonZeroU32, NonZeroU64}, num::{NonZeroU128, NonZeroU32, NonZeroU64},
ops::{Add, Div}, ops::{Add, Div},
time::Duration, time::Duration,
}; };
use cortex_a::{asm::barrier, registers::*};
use tock_registers::interfaces::Readable; use tock_registers::interfaces::Readable;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

@ -3,10 +3,10 @@
version = 3 version = 3
[[package]] [[package]]
name = "cortex-a" name = "aarch64-cpu"
version = "8.0.0" version = "9.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0cd4524931a4e0ec50ae91f0d55f571f31ffe11dd9ce2f9905b8343c018c25bb" checksum = "3aceb88e55ba626a5479279268d009a92d9d00eacce0de1b8c236c7ad31b7225"
dependencies = [ dependencies = [
"tock-registers", "tock-registers",
] ]
@ -15,7 +15,7 @@ dependencies = [
name = "mingo" name = "mingo"
version = "0.14.0" version = "0.14.0"
dependencies = [ dependencies = [
"cortex-a", "aarch64-cpu",
"qemu-exit", "qemu-exit",
"test-macros", "test-macros",
"test-types", "test-types",

@ -751,8 +751,8 @@ diff -uNr 13_exceptions_part2_peripheral_IRQs/kernel/src/_arch/aarch64/memory/mm
- memory::mmu::{translation_table::KernelTranslationTable, TranslationGranule}, - memory::mmu::{translation_table::KernelTranslationTable, TranslationGranule},
+ memory::{mmu::TranslationGranule, Address, Physical}, + memory::{mmu::TranslationGranule, Address, Physical},
}; };
use aarch64_cpu::{asm::barrier, registers::*};
use core::intrinsics::unlikely; use core::intrinsics::unlikely;
use cortex_a::{asm::barrier, registers::*};
@@ -46,13 +46,6 @@ @@ -46,13 +46,6 @@
// Global instances // Global instances
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

@ -23,7 +23,7 @@ qemu-exit = { version = "3.x.x", optional = true }
# Platform specific dependencies # Platform specific dependencies
[target.'cfg(target_arch = "aarch64")'.dependencies] [target.'cfg(target_arch = "aarch64")'.dependencies]
cortex-a = { version = "8.x.x" } aarch64-cpu = { version = "9.x.x" }
##-------------------------------------------------------------------------------------------------- ##--------------------------------------------------------------------------------------------------
## Testing ## Testing

@ -11,7 +11,7 @@
//! //!
//! crate::cpu::arch_cpu //! crate::cpu::arch_cpu
use cortex_a::asm; use aarch64_cpu::asm;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
// Public Code // Public Code

@ -11,8 +11,8 @@
//! //!
//! crate::cpu::boot::arch_boot //! crate::cpu::boot::arch_boot
use aarch64_cpu::{asm, registers::*};
use core::arch::global_asm; use core::arch::global_asm;
use cortex_a::{asm, registers::*};
use tock_registers::interfaces::Writeable; use tock_registers::interfaces::Writeable;
// Assembly counterpart to this file. // Assembly counterpart to this file.

@ -11,7 +11,7 @@
//! //!
//! crate::cpu::smp::arch_smp //! crate::cpu::smp::arch_smp
use cortex_a::registers::*; use aarch64_cpu::registers::*;
use tock_registers::interfaces::Readable; use tock_registers::interfaces::Readable;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

@ -12,8 +12,8 @@
//! crate::exception::arch_exception //! crate::exception::arch_exception
use crate::exception; use crate::exception;
use aarch64_cpu::{asm::barrier, registers::*};
use core::{arch::global_asm, cell::UnsafeCell, fmt}; use core::{arch::global_asm, cell::UnsafeCell, fmt};
use cortex_a::{asm::barrier, registers::*};
use tock_registers::{ use tock_registers::{
interfaces::{Readable, Writeable}, interfaces::{Readable, Writeable},
registers::InMemoryRegister, registers::InMemoryRegister,

@ -11,8 +11,8 @@
//! //!
//! crate::exception::asynchronous::arch_asynchronous //! crate::exception::asynchronous::arch_asynchronous
use aarch64_cpu::registers::*;
use core::arch::asm; use core::arch::asm;
use cortex_a::registers::*;
use tock_registers::interfaces::{Readable, Writeable}; use tock_registers::interfaces::{Readable, Writeable};
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

@ -17,8 +17,8 @@ use crate::{
bsp, memory, bsp, memory,
memory::{mmu::TranslationGranule, Address, Physical}, memory::{mmu::TranslationGranule, Address, Physical},
}; };
use aarch64_cpu::{asm::barrier, registers::*};
use core::intrinsics::unlikely; use core::intrinsics::unlikely;
use cortex_a::{asm::barrier, registers::*};
use tock_registers::interfaces::{ReadWriteable, Readable, Writeable}; use tock_registers::interfaces::{ReadWriteable, Readable, Writeable};
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

@ -12,12 +12,12 @@
//! crate::time::arch_time //! crate::time::arch_time
use crate::warn; use crate::warn;
use aarch64_cpu::{asm::barrier, registers::*};
use core::{ use core::{
num::{NonZeroU128, NonZeroU32, NonZeroU64}, num::{NonZeroU128, NonZeroU32, NonZeroU64},
ops::{Add, Div}, ops::{Add, Div},
time::Duration, time::Duration,
}; };
use cortex_a::{asm::barrier, registers::*};
use tock_registers::interfaces::Readable; use tock_registers::interfaces::Readable;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

@ -3,10 +3,10 @@
version = 3 version = 3
[[package]] [[package]]
name = "cortex-a" name = "aarch64-cpu"
version = "8.0.0" version = "9.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0cd4524931a4e0ec50ae91f0d55f571f31ffe11dd9ce2f9905b8343c018c25bb" checksum = "3aceb88e55ba626a5479279268d009a92d9d00eacce0de1b8c236c7ad31b7225"
dependencies = [ dependencies = [
"tock-registers", "tock-registers",
] ]
@ -15,7 +15,7 @@ dependencies = [
name = "mingo" name = "mingo"
version = "0.15.0" version = "0.15.0"
dependencies = [ dependencies = [
"cortex-a", "aarch64-cpu",
"qemu-exit", "qemu-exit",
"test-macros", "test-macros",
"test-types", "test-types",

@ -816,8 +816,8 @@ diff -uNr 14_virtual_mem_part2_mmio_remap/kernel/src/_arch/aarch64/cpu/boot.rs 1
//! crate::cpu::boot::arch_boot //! crate::cpu::boot::arch_boot
+use crate::{memory, memory::Address}; +use crate::{memory, memory::Address};
use aarch64_cpu::{asm, registers::*};
use core::arch::global_asm; use core::arch::global_asm;
use cortex_a::{asm, registers::*};
use tock_registers::interfaces::Writeable; use tock_registers::interfaces::Writeable;
@@ -75,9 +76,16 @@ @@ -75,9 +76,16 @@
/// ///

@ -23,7 +23,7 @@ qemu-exit = { version = "3.x.x", optional = true }
# Platform specific dependencies # Platform specific dependencies
[target.'cfg(target_arch = "aarch64")'.dependencies] [target.'cfg(target_arch = "aarch64")'.dependencies]
cortex-a = { version = "8.x.x" } aarch64-cpu = { version = "9.x.x" }
##-------------------------------------------------------------------------------------------------- ##--------------------------------------------------------------------------------------------------
## Testing ## Testing

@ -11,7 +11,7 @@
//! //!
//! crate::cpu::arch_cpu //! crate::cpu::arch_cpu
use cortex_a::asm; use aarch64_cpu::asm;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
// Public Code // Public Code

@ -12,8 +12,8 @@
//! crate::cpu::boot::arch_boot //! crate::cpu::boot::arch_boot
use crate::{memory, memory::Address}; use crate::{memory, memory::Address};
use aarch64_cpu::{asm, registers::*};
use core::arch::global_asm; use core::arch::global_asm;
use cortex_a::{asm, registers::*};
use tock_registers::interfaces::Writeable; use tock_registers::interfaces::Writeable;
// Assembly counterpart to this file. // Assembly counterpart to this file.

@ -11,7 +11,7 @@
//! //!
//! crate::cpu::smp::arch_smp //! crate::cpu::smp::arch_smp
use cortex_a::registers::*; use aarch64_cpu::registers::*;
use tock_registers::interfaces::Readable; use tock_registers::interfaces::Readable;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

@ -12,8 +12,8 @@
//! crate::exception::arch_exception //! crate::exception::arch_exception
use crate::exception; use crate::exception;
use aarch64_cpu::{asm::barrier, registers::*};
use core::{arch::global_asm, cell::UnsafeCell, fmt}; use core::{arch::global_asm, cell::UnsafeCell, fmt};
use cortex_a::{asm::barrier, registers::*};
use tock_registers::{ use tock_registers::{
interfaces::{Readable, Writeable}, interfaces::{Readable, Writeable},
registers::InMemoryRegister, registers::InMemoryRegister,

@ -11,8 +11,8 @@
//! //!
//! crate::exception::asynchronous::arch_asynchronous //! crate::exception::asynchronous::arch_asynchronous
use aarch64_cpu::registers::*;
use core::arch::asm; use core::arch::asm;
use cortex_a::registers::*;
use tock_registers::interfaces::{Readable, Writeable}; use tock_registers::interfaces::{Readable, Writeable};
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

@ -17,8 +17,8 @@ use crate::{
bsp, memory, bsp, memory,
memory::{mmu::TranslationGranule, Address, Physical}, memory::{mmu::TranslationGranule, Address, Physical},
}; };
use aarch64_cpu::{asm::barrier, registers::*};
use core::intrinsics::unlikely; use core::intrinsics::unlikely;
use cortex_a::{asm::barrier, registers::*};
use tock_registers::interfaces::{ReadWriteable, Readable, Writeable}; use tock_registers::interfaces::{ReadWriteable, Readable, Writeable};
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

@ -12,12 +12,12 @@
//! crate::time::arch_time //! crate::time::arch_time
use crate::warn; use crate::warn;
use aarch64_cpu::{asm::barrier, registers::*};
use core::{ use core::{
num::{NonZeroU128, NonZeroU32, NonZeroU64}, num::{NonZeroU128, NonZeroU32, NonZeroU64},
ops::{Add, Div}, ops::{Add, Div},
time::Duration, time::Duration,
}; };
use cortex_a::{asm::barrier, registers::*};
use tock_registers::interfaces::Readable; use tock_registers::interfaces::Readable;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

@ -3,10 +3,10 @@
version = 3 version = 3
[[package]] [[package]]
name = "cortex-a" name = "aarch64-cpu"
version = "8.0.0" version = "9.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0cd4524931a4e0ec50ae91f0d55f571f31ffe11dd9ce2f9905b8343c018c25bb" checksum = "3aceb88e55ba626a5479279268d009a92d9d00eacce0de1b8c236c7ad31b7225"
dependencies = [ dependencies = [
"tock-registers", "tock-registers",
] ]
@ -15,7 +15,7 @@ dependencies = [
name = "mingo" name = "mingo"
version = "0.16.0" version = "0.16.0"
dependencies = [ dependencies = [
"cortex-a", "aarch64-cpu",
"qemu-exit", "qemu-exit",
"test-macros", "test-macros",
"test-types", "test-types",

@ -23,7 +23,7 @@ qemu-exit = { version = "3.x.x", optional = true }
# Platform specific dependencies # Platform specific dependencies
[target.'cfg(target_arch = "aarch64")'.dependencies] [target.'cfg(target_arch = "aarch64")'.dependencies]
cortex-a = { version = "8.x.x" } aarch64-cpu = { version = "9.x.x" }
##-------------------------------------------------------------------------------------------------- ##--------------------------------------------------------------------------------------------------
## Testing ## Testing

@ -11,7 +11,7 @@
//! //!
//! crate::cpu::arch_cpu //! crate::cpu::arch_cpu
use cortex_a::asm; use aarch64_cpu::asm;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
// Public Code // Public Code

@ -12,8 +12,8 @@
//! crate::cpu::boot::arch_boot //! crate::cpu::boot::arch_boot
use crate::{memory, memory::Address}; use crate::{memory, memory::Address};
use aarch64_cpu::{asm, registers::*};
use core::arch::global_asm; use core::arch::global_asm;
use cortex_a::{asm, registers::*};
use tock_registers::interfaces::Writeable; use tock_registers::interfaces::Writeable;
// Assembly counterpart to this file. // Assembly counterpart to this file.

@ -11,7 +11,7 @@
//! //!
//! crate::cpu::smp::arch_smp //! crate::cpu::smp::arch_smp
use cortex_a::registers::*; use aarch64_cpu::registers::*;
use tock_registers::interfaces::Readable; use tock_registers::interfaces::Readable;
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

@ -12,8 +12,8 @@
//! crate::exception::arch_exception //! crate::exception::arch_exception
use crate::exception; use crate::exception;
use aarch64_cpu::{asm::barrier, registers::*};
use core::{arch::global_asm, cell::UnsafeCell, fmt}; use core::{arch::global_asm, cell::UnsafeCell, fmt};
use cortex_a::{asm::barrier, registers::*};
use tock_registers::{ use tock_registers::{
interfaces::{Readable, Writeable}, interfaces::{Readable, Writeable},
registers::InMemoryRegister, registers::InMemoryRegister,

@ -11,8 +11,8 @@
//! //!
//! crate::exception::asynchronous::arch_asynchronous //! crate::exception::asynchronous::arch_asynchronous
use aarch64_cpu::registers::*;
use core::arch::asm; use core::arch::asm;
use cortex_a::registers::*;
use tock_registers::interfaces::{Readable, Writeable}; use tock_registers::interfaces::{Readable, Writeable};
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save