kernel: mem: fix build on hosted mode

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2021-05-10 14:42:53 +08:00
parent e43f333faa
commit 5bca939c37

View file

@ -182,6 +182,7 @@ impl MemoryManager {
/// Print the number of RAM bytes used by the specified process.
/// This does not include memory such as peripherals and CSRs.
#[cfg(baremetal)]
pub fn ram_used_by(&self, pid: PID) -> usize {
let mut owned_bytes = 0;
unsafe {
@ -194,6 +195,11 @@ impl MemoryManager {
owned_bytes
}
#[cfg(not(baremetal))]
pub fn ram_used_by(&self, _pid: PID) -> usize {
0
}
#[cfg(all(baremetal, feature = "print-debug"))]
pub fn print_ownership(&self) {
println!("Ownership ({} bytes in all):", unsafe {