fix: 🐛 Update rpi4 target to use virtual MMIO bases

This commit is contained in:
Berkus Decker 2023-11-12 00:09:22 +02:00 committed by Berkus Decker
parent 90d5d96098
commit 89943857af
3 changed files with 13 additions and 4 deletions

View File

@ -5,7 +5,11 @@
//! GICC Driver - GIC CPU interface.
use {
crate::{exception, platform::device_driver::common::MMIODerefWrapper},
crate::{
exception,
memory::{Address, Virtual},
platform::device_driver::common::MMIODerefWrapper,
},
tock_registers::{
interfaces::{Readable, Writeable},
register_bitfields, register_structs,
@ -75,7 +79,7 @@ impl GICC {
/// # Safety
///
/// - The user must ensure to provide a correct MMIO start address.
pub const unsafe fn new(mmio_start_addr: usize) -> Self {
pub const unsafe fn new(mmio_start_addr: Address<Virtual>) -> Self {
Self {
registers: Registers::new(mmio_start_addr),
}

View File

@ -9,6 +9,7 @@
use {
crate::{
memory::{Address, Virtual},
platform::device_driver::common::MMIODerefWrapper,
state,
synchronization::{self, IRQSafeNullLock},
@ -131,7 +132,7 @@ impl GICD {
/// # Safety
///
/// - The user must ensure to provide a correct MMIO start address.
pub const unsafe fn new(mmio_start_addr: usize) -> Self {
pub const unsafe fn new(mmio_start_addr: Address<Virtual>) -> Self {
Self {
shared_registers: IRQSafeNullLock::new(SharedRegisters::new(mmio_start_addr)),
banked_registers: BankedRegisters::new(mmio_start_addr),

View File

@ -81,6 +81,7 @@ mod gicd;
use crate::{
cpu, drivers, exception,
memory::{Address, Virtual},
platform::{self, cpu::BOOT_CORE_ID, device_driver::common::BoundedUsize},
synchronization::{self, InitStateLock},
};
@ -125,7 +126,10 @@ impl GICv2 {
/// # Safety
///
/// - The user must ensure to provide a correct MMIO start address.
pub const unsafe fn new(gicd_mmio_start_addr: usize, gicc_mmio_start_addr: usize) -> Self {
pub const unsafe fn new(
gicd_mmio_start_addr: Address<Virtual>,
gicc_mmio_start_addr: Address<Virtual>,
) -> Self {
Self {
gicd: gicd::GICD::new(gicd_mmio_start_addr),
gicc: gicc::GICC::new(gicc_mmio_start_addr),