diff options
author | dzwdz | 2024-03-13 22:33:38 +0100 |
---|---|---|
committer | dzwdz | 2024-03-13 22:46:47 +0100 |
commit | 72f55421fb61b750512f324d284b30e3e67e36e0 (patch) | |
tree | 8933dc013580a2440730644807a03606c6805547 /src/kernel/syscalls.c | |
parent | e47412d940db4e9be2d05608272e30f560a275d0 (diff) |
kernel/malloc: slight rework (it's still bad), store more metadata
Diffstat (limited to 'src/kernel/syscalls.c')
-rw-r--r-- | src/kernel/syscalls.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/kernel/syscalls.c b/src/kernel/syscalls.c index 5cec6c4..2a9a7b5 100644 --- a/src/kernel/syscalls.c +++ b/src/kernel/syscalls.c @@ -38,7 +38,7 @@ long _sys_fork(int flags, hid_t __user *fs_front) { SYSCALL_RETURN(-EMFILE); } - h->backend = kzalloc(sizeof *h->backend); + h->backend = kzalloc(sizeof *h->backend, "user fs"); h->backend->is_user = true; h->backend->provhcnt = 1; /* child */ h->backend->usehcnt = 1; /* handle */ @@ -67,7 +67,7 @@ hid_t _sys_open(const char __user *path, long len, int flags) { /* Doesn't check for free handles. Another thread could use up all * handles in the meantime anyways, or free some up. */ - path_buf = kmalloc(len); + path_buf = kmalloc(len, "path opn"); if (pcpy_from(proc_cur, path_buf, path, len) < (size_t)len) { goto fail; } @@ -110,7 +110,7 @@ long _sys_mount(hid_t hid, const char __user *path, long len) { if (PATH_MAX < len) SYSCALL_RETURN(-1); - path_buf = kmalloc(len); + path_buf = kmalloc(len, "path mnt"); if (pcpy_from(proc_cur, path_buf, path, len) < (size_t)len) { goto fail; } @@ -135,7 +135,7 @@ long _sys_mount(hid_t hid, const char __user *path, long len) { // append to mount list // TODO move to kernel/vfs/mount.c - mount = kmalloc(sizeof *mount); + mount = kmalloc(sizeof *mount, "user mnt"); mount->prev = proc_cur->mount; mount->prefix = path_buf; mount->prefix_owned = true; @@ -458,7 +458,7 @@ long _sys_execbuf(void __user *ubuf, size_t len) { SYSCALL_RETURN(-1); // TODO consider supporting nesting execbufs - char *kbuf = kmalloc(len); + char *kbuf = kmalloc(len, "execbuf"); if (pcpy_from(proc_cur, kbuf, ubuf, len) < len) { kfree(kbuf); SYSCALL_RETURN(-1); |