Implement bidirectional SYS_CALL support
This commit is contained in:
committed by
Jeremy Soller
parent
8f24d894eb
commit
4607576006
@@ -17,6 +17,7 @@ pub struct UserSlice<const READ: bool, const WRITE: bool> {
|
||||
}
|
||||
pub type UserSliceRo = UserSlice<true, false>;
|
||||
pub type UserSliceWo = UserSlice<false, true>;
|
||||
pub type UserSliceRw = UserSlice<true, true>;
|
||||
|
||||
impl<const READ: bool, const WRITE: bool> UserSlice<READ, WRITE> {
|
||||
pub fn empty() -> Self {
|
||||
@@ -207,6 +208,11 @@ impl UserSliceWo {
|
||||
Self::new(base, size)
|
||||
}
|
||||
}
|
||||
impl UserSliceRw {
|
||||
pub fn rw(base: usize, size: usize) -> Result<Self> {
|
||||
Self::new(base, size)
|
||||
}
|
||||
}
|
||||
|
||||
fn is_kernel_mem(slice: &[u8]) -> bool {
|
||||
(slice.as_ptr() as usize) >= crate::USER_END_OFFSET
|
||||
|
||||
Reference in New Issue
Block a user