aboutsummaryrefslogtreecommitdiff
path: root/include/arch
diff options
context:
space:
mode:
Diffstat (limited to 'include/arch')
-rw-r--r--include/arch/proc.h7
-rw-r--r--include/arch/tcb.h6
-rw-r--r--include/arch/vmem.h12
3 files changed, 24 insertions, 1 deletions
diff --git a/include/arch/proc.h b/include/arch/proc.h
index 7921e5c..b0f0944 100644
--- a/include/arch/proc.h
+++ b/include/arch/proc.h
@@ -127,6 +127,13 @@ __noreturn void run_init(struct tcb *t, vm_t fdt, vm_t initrd);
* so I'm not too worried.
*/
__noreturn void ret_userspace_fast();
+
+/**
+ * Return to userspace, restoring some registers.
+ * Mainly for returning from an ipc_resp, where the user is expected to save
+ * temporary registers on their own.
+ * Same as with \ref ret_userspace_fast(), skips canary checking.
+ */
__noreturn void ret_userspace_partial();
#endif /* KMI_ARCH_PROC_H */
diff --git a/include/arch/tcb.h b/include/arch/tcb.h
index 8eddb07..18386d3 100644
--- a/include/arch/tcb.h
+++ b/include/arch/tcb.h
@@ -42,6 +42,12 @@ stat_t setup_rpc_stack(struct tcb *t);
*/
void destroy_rpc_stack(struct tcb *t);
+/**
+ * Copy over contents in rpc stack from \p t to \p c.
+ *
+ * @param t 'Source'.
+ * @param c 'Destination'-
+ */
void copy_rpc_stack(struct tcb *t, struct tcb *c);
/**
diff --git a/include/arch/vmem.h b/include/arch/vmem.h
index 0f06cc5..ad32519 100644
--- a/include/arch/vmem.h
+++ b/include/arch/vmem.h
@@ -167,11 +167,21 @@ struct vmem *create_vmem();
void use_vmem(struct vmem *b);
/**
- * Destroy virtual memory space.
+ * Completely destroy virtual memory space.
+ * Should only be called for ->proc.vmem, as it is the only one that is sure to
+ * own all nodes.
*
* @param b Virtual memory to destroy.
*/
void destroy_vmem(struct vmem *b);
+
+/**
+ * Destroy 'regular' virtual memory space.
+ * Should be called for ->rpc.vmem, as rpc can have some references that it
+ * doesn't own into ->proc.vmem, and this function is careful not to free those.
+ *
+ * @param b Virtual memory to destroy.
+ */
void destroy_rpcmem(struct vmem *b);
/**