diff options
author | dzwdz | 2021-09-05 18:01:41 +0200 |
---|---|---|
committer | dzwdz | 2021-09-05 18:01:41 +0200 |
commit | d6c1dceba2511fa2edf839942b237d3a27bb9535 (patch) | |
tree | dc30096397bc249e0b0ed68d92d44206762240ee /src/init | |
parent | 9b720cbc827956643a100b29e4d36ca77b1ea5b0 (diff) |
remove the fd_ / fs_ prefixes from syscall names
Diffstat (limited to 'src/init')
-rw-r--r-- | src/init/main.c | 10 | ||||
-rw-r--r-- | src/init/syscalls.c | 20 |
2 files changed, 15 insertions, 15 deletions
diff --git a/src/init/main.c b/src/init/main.c index 71732cd..939f15f 100644 --- a/src/init/main.c +++ b/src/init/main.c @@ -3,7 +3,7 @@ #include <stdint.h> #define argify(str) str, sizeof(str) - 1 -#define log(str) _syscall_fd_write(tty_fd, argify(str)) +#define log(str) _syscall_write(tty_fd, argify(str)) __attribute__((section("text"))) int tty_fd; @@ -12,10 +12,10 @@ void misc_tests(void); // takes a cstring and copies it right before a page boundary const char *multipageify(const char *str); -#define mount(fd, path) _syscall_fd_mount(fd, path, sizeof(path)-1) +#define mount(fd, path) _syscall_mount(fd, path, sizeof(path)-1) int main(void) { - tty_fd = _syscall_fs_open("/tty", sizeof("/tty") - 1); + tty_fd = _syscall_open("/tty", sizeof("/tty") - 1); if (tty_fd < 0) _syscall_exit(argify("couldn't open tty")); log(" opened /tty "); @@ -27,9 +27,9 @@ int main(void) { void misc_tests(void) { int res; - res = _syscall_fs_open(argify("/tty/nonexistant")); + res = _syscall_open(argify("/tty/nonexistant")); if (res >= 0) log("test failed "); - res = _syscall_fs_open(argify("/ttynonexistant")); + res = _syscall_open(argify("/ttynonexistant")); if (res >= 0) log("test failed "); log("the \"tests\" went ok"); } diff --git a/src/init/syscalls.c b/src/init/syscalls.c index ebf174e..730a243 100644 --- a/src/init/syscalls.c +++ b/src/init/syscalls.c @@ -17,22 +17,22 @@ int _syscall_await(user_ptr buf, int len) { return _syscall(_SYSCALL_AWAIT, (int)buf, (int)len, 0); } -handle_t _syscall_fs_open(const user_ptr path, int len) { - return _syscall(_SYSCALL_FS_OPEN, (int)path, len, 0); +handle_t _syscall_open(const user_ptr path, int len) { + return _syscall(_SYSCALL_OPEN, (int)path, len, 0); } -int _syscall_fd_mount(handle_t handle, const user_ptr path, int len) { - return _syscall(_SYSCALL_FD_MOUNT, handle, (int)path, len); +int _syscall_mount(handle_t handle, const user_ptr path, int len) { + return _syscall(_SYSCALL_MOUNT, handle, (int)path, len); } -int _syscall_fd_read(handle_t handle, user_ptr buf, int len) { - return _syscall(_SYSCALL_FD_READ, handle, (int)buf, len); +int _syscall_read(handle_t handle, user_ptr buf, int len) { + return _syscall(_SYSCALL_READ, handle, (int)buf, len); } -int _syscall_fd_write(handle_t handle, user_ptr buf, int len) { - return _syscall(_SYSCALL_FD_WRITE, handle, (int)buf, len); +int _syscall_write(handle_t handle, user_ptr buf, int len) { + return _syscall(_SYSCALL_WRITE, handle, (int)buf, len); } -int _syscall_fd_close(handle_t handle) { - return _syscall(_SYSCALL_FD_CLOSE, handle, 0, 0); +int _syscall_close(handle_t handle) { + return _syscall(_SYSCALL_CLOSE, handle, 0, 0); } |