Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion page_table_multiarch/src/arch/riscv.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! RISC-V specific page table structures.

use crate::{PageTable64, PagingMetaData};
use core::fmt::{Debug, LowerHex};
use page_table_entry::riscv::Rv64PTE;

#[inline]
Expand All @@ -15,7 +16,7 @@ fn riscv_flush_tlb(vaddr: Option<memory_addr::VirtAddr>) {
}

/// A virtual address that can be used in RISC-V Sv39 and Sv48 page tables.
pub trait SvVirtAddr: memory_addr::MemoryAddr + Send + Sync {
pub trait SvVirtAddr: memory_addr::MemoryAddr + Debug + LowerHex + Send + Sync {
/// Flush the TLB.
fn flush_tlb(vaddr: Option<Self>);
}
Expand Down
4 changes: 2 additions & 2 deletions page_table_multiarch/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ extern crate log;
mod arch;
mod bits64;

use core::{fmt::Debug, marker::PhantomData};
use core::{fmt::Debug, fmt::LowerHex, marker::PhantomData};

use memory_addr::{MemoryAddr, PhysAddr, VirtAddr};

Expand Down Expand Up @@ -54,7 +54,7 @@ pub trait PagingMetaData: Sync + Send {
///
/// This associated type allows more flexible use of page tables structs like [`PageTable64`],
/// for example, to implement EPTs.
type VirtAddr: MemoryAddr;
type VirtAddr: MemoryAddr + Debug + LowerHex;
// (^)it can be converted from/to usize and it's trivially copyable

/// Whether a given physical address is valid.
Expand Down