aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/kmi/syscalls.h9
-rw-r--r--include/kmi/uapi.h20
-rw-r--r--include/kmi/vmem.h8
3 files changed, 31 insertions, 6 deletions
diff --git a/include/kmi/syscalls.h b/include/kmi/syscalls.h
index 0826a6b..eece89e 100644
--- a/include/kmi/syscalls.h
+++ b/include/kmi/syscalls.h
@@ -47,18 +47,21 @@ enum sys_code {
/** Request memory from anywhere. */
SYS_REQ_MEM,
- /** Request physical page from ram. */
- SYS_REF_SHAREDMEM,
-
/** Request memory with physical address. */
SYS_REQ_PMEM,
/** Request memory at fixed virtual address. */
SYS_REQ_FIXMEM,
+ /** Request one page of memory, useful for stuff like virtio buffers */
+ SYS_REQ_PAGE,
+
/** Request shared memory. */
SYS_REQ_SHAREDMEM,
+ /** Request physical page from ram. */
+ SYS_REF_SHAREDMEM,
+
/** Free memory. */
SYS_FREE_MEM,
/** @} */
diff --git a/include/kmi/uapi.h b/include/kmi/uapi.h
index 53ae9cb..8047632 100644
--- a/include/kmi/uapi.h
+++ b/include/kmi/uapi.h
@@ -324,6 +324,26 @@ SYSCALL_DECLARE3(ref_sharedmem, tid, addr, flags);
SYSCALL_DECLARE3(req_pmem, paddr, size, flags);
/**
+ * Get physically contiguous region of memory, useful for stuff like virtio
+ * buffers.
+ *
+ * @param t Current tcb.
+ * @param size Minimum size of region.
+ * @param flags Flags of allocation.
+ * @param c Unused.
+ * @param d Unused.
+ * @param e Unused.
+ *
+ * Return\ref OK and start of virtual address, start of physical address and
+ * size, in that order.
+ *
+ * @note Users are encouraged to check the return size, as it may be
+ * significantly larger than requested, in which case it is recommended to place
+ * multiple buffers in the region if required by the application.
+ */
+SYSCALL_DECLARE2(req_page, size, flags);
+
+/**
* Request fixed memory syscall.
*
* Allocates at least the specified size of allocation which includes the start
diff --git a/include/kmi/vmem.h b/include/kmi/vmem.h
index 3f7ab71..dd968ca 100644
--- a/include/kmi/vmem.h
+++ b/include/kmi/vmem.h
@@ -30,16 +30,18 @@ vm_t alloc_uvmem(struct tcb *r, size_t size, vmflags_t flags);
/**
* Allocate one physical page for user virtual memory.
+ * Useful for virtio buffers etc. I'm repeating myself quite a lot with these
+ * doxygen descriptions, aren't I?
*
* @param r Process to allocate memory in.
* @param size Minimum size of allocation.
* @param flags Flags of allocation.
- * @param asize Where to write actual size of allocation.
- * @param paddr Where to write physical address of page.
+ * @param startp Address of allocated physical page.
+ * @param sizep Actual size of page.
* @return Start of allocation when succesful, \c NULL otherwise.
*/
vm_t alloc_uvpage(struct tcb *r, size_t size, vmflags_t flags,
- size_t *asize, pm_t *paddr);
+ pm_t *startp, size_t *sizep);
/**
* Allocate fixed user virtual memory.