From 2a091d6689ed8f85b14d858abe2f31abe9f6a218 Mon Sep 17 00:00:00 2001 From: edef Date: Thu, 28 Jul 2022 01:09:31 +0000 Subject: ripple/minitrace: bitflags-ify mmap/mprotect protection flags Change-Id: Iaf6d5717e2d83a6f81fda34da086311d21f345c2 --- ripple/minitrace/src/main.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'ripple/minitrace') diff --git a/ripple/minitrace/src/main.rs b/ripple/minitrace/src/main.rs index 6db4747..aa761de 100644 --- a/ripple/minitrace/src/main.rs +++ b/ripple/minitrace/src/main.rs @@ -235,8 +235,8 @@ define_syscalls! { fn read(fd: FileDesc, buf: *mut u8, count: usize) -> i64 = 0; fn write(fd: FileDesc, buf: *const u8, count: usize) -> i64 = 1; fn close(fd: FileDesc) -> i64 = 3; - fn mmap(addr: u64, len: u64, prot: u64, flags: MapFlags, fd: FileDesc, off: u64) -> i64 = 9; - fn mprotect(addr: u64, len: usize, prot: u64) -> i64 = 10; + fn mmap(addr: u64, len: u64, prot: ProtFlags, flags: MapFlags, fd: FileDesc, off: u64) -> i64 = 9; + fn mprotect(addr: u64, len: usize, prot: ProtFlags) -> i64 = 10; fn brk(brk: u64) -> i64 = 12; fn rt_sigaction(sig: i32, act: *const SigAction, oact: *mut SigAction, sigsetsize: usize) -> i64 = 13; fn ioctl(fd: FileDesc, cmd: u32, arg: u64) -> i64 = 16; @@ -479,4 +479,10 @@ syscall_bitflags! { const ANONYMOUS = 1 << 5; const DENYWRITE = 1 << 11; } + + struct ProtFlags: i32 { + const READ = 1 << 0; + const WRITE = 1 << 1; + const EXEC = 1 << 2; + } } -- cgit 1.4.1