Skip to content

Commit

Permalink
Remove some dead code from sgx
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Dec 11, 2018
1 parent 799cadb commit 1346619
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
7 changes: 0 additions & 7 deletions src/libstd/sys/sgx/abi/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ fn image_base() -> u64 {
base
}

pub fn is_enclave_range(p: *const u8, len: usize) -> bool {
let start=p as u64;
let end=start + (len as u64);
start >= image_base() &&
end <= image_base() + (unsafe { ENCLAVE_SIZE } as u64) // unsafe ok: link-time constant
}

pub fn is_user_range(p: *const u8, len: usize) -> bool {
let start=p as u64;
let end=start + (len as u64);
Expand Down
8 changes: 0 additions & 8 deletions src/libstd/sys/sgx/abi/usercalls/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ pub fn read(fd: Fd, buf: &mut [u8]) -> IoResult<usize> {
}
}

pub fn read_alloc(fd: Fd) -> IoResult<Vec<u8>> {
unsafe {
let mut userbuf = alloc::User::<ByteBuffer>::uninitialized();
raw::read_alloc(fd, userbuf.as_raw_mut_ptr()).from_sgx_result()?;
Ok(copy_user_buffer(&userbuf))
}
}

pub fn write(fd: Fd, buf: &[u8]) -> IoResult<usize> {
unsafe {
let userbuf = alloc::User::new_from_enclave(buf);
Expand Down

0 comments on commit 1346619

Please sign in to comment.