|
@@ -93,7 +93,7 @@ impl CheckedUserPointer {
|
|
|
|
|
|
|
|
/// # Might Sleep
|
|
/// # Might Sleep
|
|
|
pub fn read(&self, buffer: *mut (), total: usize) -> KResult<()> {
|
|
pub fn read(&self, buffer: *mut (), total: usize) -> KResult<()> {
|
|
|
- assert_preempt_enabled!("UserPointer::read");
|
|
|
|
|
|
|
+ /*assert_preempt_enabled!("UserPointer::read");
|
|
|
|
|
|
|
|
if total > self.len {
|
|
if total > self.len {
|
|
|
return Err(EINVAL);
|
|
return Err(EINVAL);
|
|
@@ -113,9 +113,9 @@ impl CheckedUserPointer {
|
|
|
".quad 3b", // fix jump address
|
|
".quad 3b", // fix jump address
|
|
|
".quad 0x3", // type: load
|
|
".quad 0x3", // type: load
|
|
|
".popsection",
|
|
".popsection",
|
|
|
- inout("rcx") total => error_bytes,
|
|
|
|
|
- inout("rsi") self.ptr => _,
|
|
|
|
|
- inout("rdi") buffer => _,
|
|
|
|
|
|
|
+ //inout("rcx") total => error_bytes,
|
|
|
|
|
+ //inout("rsi") self.ptr => _,
|
|
|
|
|
+ //inout("rdi") buffer => _,
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -123,12 +123,13 @@ impl CheckedUserPointer {
|
|
|
Err(EFAULT)
|
|
Err(EFAULT)
|
|
|
} else {
|
|
} else {
|
|
|
Ok(())
|
|
Ok(())
|
|
|
- }
|
|
|
|
|
|
|
+ }*/
|
|
|
|
|
+ Ok(())
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/// # Might Sleep
|
|
/// # Might Sleep
|
|
|
pub fn write(&self, data: *mut (), total: usize) -> KResult<()> {
|
|
pub fn write(&self, data: *mut (), total: usize) -> KResult<()> {
|
|
|
- assert_preempt_enabled!("UserPointer::write");
|
|
|
|
|
|
|
+ /*assert_preempt_enabled!("UserPointer::write");
|
|
|
|
|
|
|
|
if total > self.len {
|
|
if total > self.len {
|
|
|
return Err(EINVAL);
|
|
return Err(EINVAL);
|
|
@@ -157,14 +158,14 @@ impl CheckedUserPointer {
|
|
|
|
|
|
|
|
if error_bytes != 0 {
|
|
if error_bytes != 0 {
|
|
|
return Err(EFAULT);
|
|
return Err(EFAULT);
|
|
|
- }
|
|
|
|
|
|
|
+ }*/
|
|
|
|
|
|
|
|
Ok(())
|
|
Ok(())
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/// # Might Sleep
|
|
/// # Might Sleep
|
|
|
pub fn zero(&self) -> KResult<()> {
|
|
pub fn zero(&self) -> KResult<()> {
|
|
|
- assert_preempt_enabled!("CheckedUserPointer::zero");
|
|
|
|
|
|
|
+ /*assert_preempt_enabled!("CheckedUserPointer::zero");
|
|
|
|
|
|
|
|
if self.len == 0 {
|
|
if self.len == 0 {
|
|
|
return Ok(());
|
|
return Ok(());
|
|
@@ -196,7 +197,8 @@ impl CheckedUserPointer {
|
|
|
Err(EFAULT)
|
|
Err(EFAULT)
|
|
|
} else {
|
|
} else {
|
|
|
Ok(())
|
|
Ok(())
|
|
|
- }
|
|
|
|
|
|
|
+ }*/
|
|
|
|
|
+ Ok(())
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -250,7 +252,7 @@ impl<'lt> Buffer for UserBuffer<'lt> {
|
|
|
impl<'lt> UserString<'lt> {
|
|
impl<'lt> UserString<'lt> {
|
|
|
/// # Might Sleep
|
|
/// # Might Sleep
|
|
|
pub fn new(ptr: *const u8) -> KResult<Self> {
|
|
pub fn new(ptr: *const u8) -> KResult<Self> {
|
|
|
- assert_preempt_enabled!("UserString::new");
|
|
|
|
|
|
|
+ /*assert_preempt_enabled!("UserString::new");
|
|
|
|
|
|
|
|
const MAX_LEN: usize = 4096;
|
|
const MAX_LEN: usize = 4096;
|
|
|
// TODO
|
|
// TODO
|
|
@@ -290,7 +292,8 @@ impl<'lt> UserString<'lt> {
|
|
|
len: MAX_LEN - result,
|
|
len: MAX_LEN - result,
|
|
|
_phantom: core::marker::PhantomData,
|
|
_phantom: core::marker::PhantomData,
|
|
|
})
|
|
})
|
|
|
- }
|
|
|
|
|
|
|
+ }*/
|
|
|
|
|
+ Err(EFAULT)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
pub fn as_cstr(&self) -> &'lt CStr {
|
|
pub fn as_cstr(&self) -> &'lt CStr {
|