Commit cdf115d3 authored by last-las's avatar last-las
Browse files

feat: add constants related to filesystem

No related merge requests found
Showing with 27 additions and 0 deletions
+27 -0
bitflags! {
pub struct OpenFlag: u32 {
const RDONLY = 0x0;
const WRONLY = 0x1;
const RDWR = 0x2;
const CREAT = 0x40;
const EXCL = 0x80;
const TRUNC = 0x200;
const APPEND = 0x400;
const DIRECTORY = 0x10000;
}
}
\ No newline at end of file
......@@ -9,6 +9,9 @@ pub const WRITE: usize = 4;
pub const IOCTL: usize = 5;
pub const CLOSE: usize = 6;
pub const REPLY: usize = 7;
pub const FORK: usize = 8; // process to filesystem
pub const EXIT: usize = 9; // process to filesystem
pub const FSYSCALL: usize = 10; // process to filesystem, when process inovke filesystem syscall like 'open'
/* Args position constant */
pub const MSG_ARGS_0: usize = 0;
......
......@@ -5,6 +5,7 @@ pub mod syscall;
pub mod util;
pub mod ffi;
pub mod terminal;
pub mod file;
extern crate alloc;
#[macro_use]
......
// filesystem syscall.
pub const SYSCALL_GETCWD: usize = 17;
pub const SYSCALL_DUP: usize = 23;
pub const SYSCALL_DUP3: usize = 24;
pub const SYSCALL_MKDIRAT: usize = 34;
pub const SYSCALL_UNMOUNT: usize = 39;
pub const SYSCALL_MOUNT: usize = 40;
pub const SYSCALL_CHDIR: usize = 49;
pub const SYSCALL_OPEN: usize = 56;
pub const SYSCALL_CLOSE: usize = 57;
pub const SYSCALL_READ: usize = 63;
pub const _SYSCALL_READ: usize = KCALL_MASK | SYSCALL_READ;
pub const SYSCALL_WRITE: usize = 64;
pub const _SYSCALL_WRITE: usize = KCALL_MASK | SYSCALL_WRITE;
pub const SYSCALL_EXIT: usize = 93;
pub const SYSCALL_YIELD: usize = 124;
pub const SYSCALL_GET_PRIORITY: usize = 140;
......
Supports Markdown
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