diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2026-01-24 23:24:45 +0200 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2026-01-24 23:24:45 +0200 |
| commit | 6fb77c70559782a9928432af5cc6f83906a530c1 (patch) | |
| tree | 5fee1c302e088445576e6c6bccac8414f8e34377 /src/uapi | |
| parent | 1eaac15cdb220df7536c74774a1ce7d1f0519c63 (diff) | |
| download | kmi-6fb77c70559782a9928432af5cc6f83906a530c1.tar.gz kmi-6fb77c70559782a9928432af5cc6f83906a530c1.zip | |
make physical memory request a capability
+ Seems obvious, not sure why I hadn't done it already
Diffstat (limited to 'src/uapi')
| -rw-r--r-- | src/uapi/mem.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/uapi/mem.c b/src/uapi/mem.c index 5c18797..561b5eb 100644 --- a/src/uapi/mem.c +++ b/src/uapi/mem.c @@ -100,6 +100,9 @@ SYSCALL_DEFINE3(req_pmem)(struct tcb *t, sys_arg_t paddr, sys_arg_t size, * that keeps track of used regions outside of RAM. We'll see. */ struct tcb *r = get_cproc(t); + if (!has_cap(r->caps, CAP_PHYSICAL)) + return_args1(t, ERR_PERM); + flags = sanitize_uvflags(flags); vm_t start = alloc_devmem(r, paddr, size, flags); if (ERR_CODE(start)) |
