feat(adapter): higher-half kernel (linked at PHYS_OFFSET, boot trampoline, no low mappings), fix SBI ecall clobbers
This commit is contained in:
@@ -87,9 +87,11 @@ pub const MMIO_FIRST: usize = 0x10001000;
|
||||
pub const MMIO_STRIDE: usize = 0x1000;
|
||||
pub const MMIO_SLOTS: usize = 8;
|
||||
|
||||
pub fn scan_for_device(device_id: u32) -> Option<DirectMmio> {
|
||||
/// Probes the MMIO slots starting at `first`, the address the caller sees
|
||||
/// slot 0 at (`MMIO_FIRST` itself, or wherever it is mapped).
|
||||
pub fn scan_for_device(first: usize, device_id: u32) -> Option<DirectMmio> {
|
||||
for slot in 0..MMIO_SLOTS {
|
||||
if let Some(mmio) = probe_slot(MMIO_FIRST + slot * MMIO_STRIDE, device_id) {
|
||||
if let Some(mmio) = probe_slot(first + slot * MMIO_STRIDE, device_id) {
|
||||
return Some(mmio);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user