From 5948affdd53f27bccce21dbb8f193fb4805b39c6 Mon Sep 17 00:00:00 2001 From: 4lDO2 <4lDO2@protonmail.com> Date: Fri, 17 Nov 2023 20:24:49 +0100 Subject: [PATCH] Remove SYS_PHYSMAP. --- src/call.rs | 9 --------- src/flag.rs | 8 -------- src/number.rs | 1 - 3 files changed, 18 deletions(-) diff --git a/src/call.rs b/src/call.rs index ccb51aa82a..daa4636680 100644 --- a/src/call.rs +++ b/src/call.rs @@ -205,15 +205,6 @@ pub fn open>(path: T, flags: usize) -> Result { unsafe { syscall3(SYS_OPEN, path.as_ref().as_ptr() as usize, path.as_ref().len(), flags) } } -/// Map physical memory to virtual memory -/// -/// # Errors -/// -/// * `EPERM` - `uid != 0` -pub unsafe fn physmap(physical_address: usize, size: usize, flags: PhysmapFlags) -> Result { - syscall3(SYS_PHYSMAP, physical_address, size, flags.bits()) -} - /// Read from a file descriptor into a buffer pub fn read(fd: usize, buf: &mut [u8]) -> Result { unsafe { syscall3(SYS_READ, fd, buf.as_mut_ptr() as usize, buf.len()) } diff --git a/src/flag.rs b/src/flag.rs index 40b41ff387..7199439deb 100644 --- a/src/flag.rs +++ b/src/flag.rs @@ -166,14 +166,6 @@ pub const O_SYMLINK: usize = 0x4000_0000; pub const O_NOFOLLOW: usize = 0x8000_0000; pub const O_ACCMODE: usize = O_RDONLY | O_WRONLY | O_RDWR; -bitflags! { - pub struct PhysmapFlags: usize { - const PHYSMAP_WRITE = 0x0000_0001; - const PHYSMAP_WRITE_COMBINE = 0x0000_0002; - const PHYSMAP_NO_CACHE = 0x0000_0004; - } -} - // The top 48 bits of PTRACE_* are reserved, for now bitflags! { diff --git a/src/number.rs b/src/number.rs index c22cdc306a..1ff572d706 100644 --- a/src/number.rs +++ b/src/number.rs @@ -74,7 +74,6 @@ pub const SYS_KILL: usize = 37; pub const SYS_MPROTECT: usize = 125; pub const SYS_MKNS: usize = 984; pub const SYS_NANOSLEEP: usize =162; -pub const SYS_PHYSMAP: usize = 947; pub const SYS_VIRTTOPHYS: usize=949; pub const SYS_SETPGID: usize = 57; pub const SYS_SETREGID: usize = 204;