Verified Commit bca011c7 authored by jD91mZM2's avatar jD91mZM2

Add funmap2 scheme call

parent 7cc003d5
......@@ -13,6 +13,7 @@ sed 's/trait Scheme/trait SchemeBlock/' scheme.rs \
| sed 's/packet.a = Error::mux(res);/res.transpose().map(Error::mux)/' \
| sed 's/\.map(|f| f\.bits())/\.map(|f| f.map(|f| f.bits()))/' \
| sed 's/\.map(|o| o as usize)/.map(|o| o.map(|o| o as usize))/' \
| sed 's/Ok(0)/Ok(Some(0))/g' \
| sed 's/Result<\([^>]\+\)>/Result<Option<\1>>/g' \
> scheme_block.rs
......
......@@ -32,6 +32,7 @@ pub trait Scheme {
Err(Error::new(EFAULT))
},
SYS_FUNMAP => self.funmap(packet.b),
SYS_FUNMAP2 => self.funmap2(packet.b, packet.c),
SYS_FPATH => self.fpath(packet.b, unsafe { slice::from_raw_parts_mut(packet.c as *mut u8, packet.d) }),
SYS_FRENAME => self.frename(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }, packet.uid, packet.gid),
SYS_FSTAT => if packet.d >= mem::size_of::<Stat>() {
......@@ -139,7 +140,12 @@ pub trait Scheme {
#[allow(unused_variables)]
fn funmap(&self, address: usize) -> Result<usize> {
Err(Error::new(EBADF))
Ok(0)
}
#[allow(unused_variables)]
fn funmap2(&self, address: usize, length: usize) -> Result<usize> {
Ok(0)
}
#[allow(unused_variables)]
......
......@@ -32,6 +32,7 @@ pub trait SchemeBlock {
Err(Error::new(EFAULT))
},
SYS_FUNMAP => self.funmap(packet.b),
SYS_FUNMAP2 => self.funmap2(packet.b, packet.c),
SYS_FPATH => self.fpath(packet.b, unsafe { slice::from_raw_parts_mut(packet.c as *mut u8, packet.d) }),
SYS_FRENAME => self.frename(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }, packet.uid, packet.gid),
SYS_FSTAT => if packet.d >= mem::size_of::<Stat>() {
......@@ -139,7 +140,12 @@ pub trait SchemeBlock {
#[allow(unused_variables)]
fn funmap(&self, address: usize) -> Result<Option<usize>> {
Err(Error::new(EBADF))
Ok(Some(0))
}
#[allow(unused_variables)]
fn funmap2(&self, address: usize, length: usize) -> Result<Option<usize>> {
Ok(Some(0))
}
#[allow(unused_variables)]
......
......@@ -32,6 +32,7 @@ pub trait SchemeBlockMut {
Err(Error::new(EFAULT))
},
SYS_FUNMAP => self.funmap(packet.b),
SYS_FUNMAP2 => self.funmap2(packet.b, packet.c),
SYS_FPATH => self.fpath(packet.b, unsafe { slice::from_raw_parts_mut(packet.c as *mut u8, packet.d) }),
SYS_FRENAME => self.frename(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }, packet.uid, packet.gid),
SYS_FSTAT => if packet.d >= mem::size_of::<Stat>() {
......@@ -139,7 +140,12 @@ pub trait SchemeBlockMut {
#[allow(unused_variables)]
fn funmap(&mut self, address: usize) -> Result<Option<usize>> {
Err(Error::new(EBADF))
Ok(Some(0))
}
#[allow(unused_variables)]
fn funmap2(&mut self, address: usize, length: usize) -> Result<Option<usize>> {
Ok(Some(0))
}
#[allow(unused_variables)]
......
......@@ -32,6 +32,7 @@ pub trait SchemeMut {
Err(Error::new(EFAULT))
},
SYS_FUNMAP => self.funmap(packet.b),
SYS_FUNMAP2 => self.funmap2(packet.b, packet.c),
SYS_FPATH => self.fpath(packet.b, unsafe { slice::from_raw_parts_mut(packet.c as *mut u8, packet.d) }),
SYS_FRENAME => self.frename(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }, packet.uid, packet.gid),
SYS_FSTAT => if packet.d >= mem::size_of::<Stat>() {
......@@ -139,7 +140,12 @@ pub trait SchemeMut {
#[allow(unused_variables)]
fn funmap(&mut self, address: usize) -> Result<usize> {
Err(Error::new(EBADF))
Ok(0)
}
#[allow(unused_variables)]
fn funmap2(&mut self, address: usize, length: usize) -> Result<usize> {
Ok(0)
}
#[allow(unused_variables)]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment