virtio-blk worked.

This commit is contained in:
Yifan Wu 2020-12-16 10:18:38 +08:00
parent 2d34cab989
commit eca5ee2eb7
12 changed files with 145 additions and 11 deletions

View file

@ -3,15 +3,19 @@ use super::PageTableEntry;
use core::fmt::{self, Debug, Formatter};
/// Definitions
#[repr(C)]
#[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq)]
pub struct PhysAddr(pub usize);
#[repr(C)]
#[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq)]
pub struct VirtAddr(pub usize);
#[repr(C)]
#[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq)]
pub struct PhysPageNum(pub usize);
#[repr(C)]
#[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq)]
pub struct VirtPageNum(pub usize);
@ -144,6 +148,11 @@ impl StepByOne for VirtPageNum {
self.0 += 1;
}
}
impl StepByOne for PhysPageNum {
fn step(&mut self) {
self.0 += 1;
}
}
#[derive(Copy, Clone)]
pub struct SimpleRange<T> where