feat(kernel): add RequestPages and ReleasePages syscalls
This commit is contained in:
@@ -1,12 +1,42 @@
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub struct EntryPoint(usize);
|
||||
|
||||
impl EntryPoint {
|
||||
pub fn from_raw(addr: usize) -> Self {
|
||||
Self(addr)
|
||||
}
|
||||
|
||||
pub fn raw(&self) -> usize {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub struct StackPointer(usize);
|
||||
|
||||
impl StackPointer {
|
||||
pub fn from_raw(addr: usize) -> Self {
|
||||
Self(addr)
|
||||
}
|
||||
|
||||
pub fn raw(&self) -> usize {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub struct VirtualAddress(usize);
|
||||
|
||||
impl VirtualAddress {
|
||||
pub fn from_raw(addr: usize) -> Self {
|
||||
Self(addr)
|
||||
}
|
||||
|
||||
pub fn raw(&self) -> usize {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub struct PhysicalAddress(usize);
|
||||
|
||||
@@ -29,3 +59,12 @@ pub struct DataRef {
|
||||
addr: VirtualAddress,
|
||||
len: usize,
|
||||
}
|
||||
|
||||
impl DataRef {
|
||||
pub fn empty() -> Self {
|
||||
Self {
|
||||
addr: VirtualAddress::from_raw(0),
|
||||
len: 0,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user