aboutsummaryrefslogtreecommitdiff
path: root/include/apos/uapi.h
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2023-01-26 15:53:16 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2023-01-26 15:53:16 +0200
commit8a5e4cf53d981e793fca90d9b51bd395265cf4db (patch)
tree245aabe14f45aa717f4f3156bdcfc1afb0388131 /include/apos/uapi.h
parent5dad7c7ecccaa1e11be23f53e3198af6933c9f60 (diff)
downloadkmi-8a5e4cf53d981e793fca90d9b51bd395265cf4db.tar.gz
kmi-8a5e4cf53d981e793fca90d9b51bd395265cf4db.zip
add req_page syscall
Diffstat (limited to 'include/apos/uapi.h')
-rw-r--r--include/apos/uapi.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/apos/uapi.h b/include/apos/uapi.h
index dda4391..fefd1bf 100644
--- a/include/apos/uapi.h
+++ b/include/apos/uapi.h
@@ -320,6 +320,32 @@ SYSCALL_DECLARE1(putch, ch);
SYSCALL_DECLARE2(req_mem, size, flags);
/**
+ * Request one page of memory. The nearest fitting size is chosen.
+ *
+ * This might be better implemented as some number of adjacent physical pages,
+ * but the underlying physical page allocator doesn't really handle it very
+ * well. This weird design decision is because I don't know if there are devices
+ * whose drivers need multiple adjacent physical pages, only that at least
+ * virtio devices need to be able to access the physical address of a single
+ * page. Basic adjacent physical pages can be made from higher order pages,
+ * just with a massive overhead. Still, probably good eough for now.
+ *
+ * For example, if you need two adjacent 4K pages, you pass size = 8K and you
+ * get back a 2M page, if one is available.
+ *
+ * @param t Current tcb.
+ * @param size Required size of region.
+ * @param flags Mapping flags to use.
+ * @param c Unused.
+ * @param d Unused.
+ * @param e Unused.
+ *
+ * Returns \ref ERR_OOMEM if no page is available, otherwise \c OK, virtual
+ * address, actual size, physical size in that order.
+ */
+SYSCALL_DECLARE2(req_page, size, flags);
+
+/**
* Request physical memory syscall.
*
* Allocates at least the specified size of allocation which includes the