diff options
author | dzwdz | 2021-11-02 19:51:04 +0100 |
---|---|---|
committer | dzwdz | 2021-11-02 19:51:04 +0100 |
commit | a957c8f0c6b35171378522e03b4360cfc5527832 (patch) | |
tree | 65e0a052a5f9cd5a36dac918f31294b295ee3032 /src/init | |
parent | c0903edc3ee1fe4dd9c9921f4b7712a94271f238 (diff) |
fork2 refactor: every process now has (only) a single controlled vfs_backend
Diffstat (limited to 'src/init')
-rw-r--r-- | src/init/main.c | 6 | ||||
-rw-r--r-- | src/init/syscalls.c | 9 | ||||
-rw-r--r-- | src/init/tar.c | 4 | ||||
-rw-r--r-- | src/init/tar.h | 2 |
4 files changed, 10 insertions, 11 deletions
diff --git a/src/init/main.c b/src/init/main.c index 73df25b..5df6bb3 100644 --- a/src/init/main.c +++ b/src/init/main.c @@ -32,11 +32,11 @@ int main(void) { } void fs_prep(void) { - handle_t front, back; - front = _syscall_fs_create(&back); + handle_t front; + front = _syscall_fs_create(); if (!_syscall_fork()) { - tar_driver(back, &_initrd); + tar_driver(&_initrd); _syscall_exit(1); } diff --git a/src/init/syscalls.c b/src/init/syscalls.c index 57a7344..e14dfe8 100644 --- a/src/init/syscalls.c +++ b/src/init/syscalls.c @@ -34,13 +34,12 @@ int _syscall_close(handle_t handle) { return _syscall(_SYSCALL_CLOSE, handle, 0, 0, 0); } -handle_t _syscall_fs_create(handle_t __user *back) { - return _syscall(_SYSCALL_FS_CREATE, (int)back, 0, 0, 0); +handle_t _syscall_fs_create(void) { + return _syscall(_SYSCALL_FS_CREATE, 0, 0, 0, 0); } -int _syscall_fs_wait(handle_t back, char __user *buf, int max_len, - struct fs_wait_response __user *res) { - return _syscall(_SYSCALL_FS_WAIT, back, (int)buf, max_len, (int)res); +int _syscall_fs_wait(char __user *buf, int max_len, struct fs_wait_response __user *res) { + return _syscall(_SYSCALL_FS_WAIT, (int)buf, max_len, (int)res, 0); } int _syscall_fs_respond(char __user *buf, int ret) { diff --git a/src/init/tar.c b/src/init/tar.c index 42efcdf..89f4e69 100644 --- a/src/init/tar.c +++ b/src/init/tar.c @@ -13,11 +13,11 @@ static int tar_size(void *sector); static void *tar_find(const char *path, size_t path_len, void *base, size_t base_len); static int oct_parse(char *str, size_t len); -void tar_driver(handle_t back, void *base) { +void tar_driver(void *base) { static char buf[BUF_SIZE]; struct fs_wait_response res; for (;;) { - switch (_syscall_fs_wait(back, buf, BUF_SIZE, &res)) { + switch (_syscall_fs_wait(buf, BUF_SIZE, &res)) { case VFSOP_OPEN: _syscall_fs_respond(NULL, tar_open(buf, res.len, base, ~0)); break; diff --git a/src/init/tar.h b/src/init/tar.h index 71c30fe..c1dee78 100644 --- a/src/init/tar.h +++ b/src/init/tar.h @@ -1,4 +1,4 @@ #pragma once #include <shared/types.h> -_Noreturn void tar_driver(handle_t back, void *base); +_Noreturn void tar_driver(void *base); |