diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-11-02 18:58:13 +0200 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-11-02 18:58:13 +0200 |
| commit | 5890df7bf838a5a912465a1bba02e5d8cf34e33c (patch) | |
| tree | 48c17acfc5ed2b44bff817b00123288098273ecc /include | |
| parent | 5531e2eaaa2fd1dd282dba2fb5bc10e09dfec5e0 (diff) | |
| download | kmi-5890df7bf838a5a912465a1bba02e5d8cf34e33c.tar.gz kmi-5890df7bf838a5a912465a1bba02e5d8cf34e33c.zip | |
allow skipping some cache flushes in proc
Diffstat (limited to 'include')
| -rw-r--r-- | include/arch/proc.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/arch/proc.h b/include/arch/proc.h index b0f0944..ec01a55 100644 --- a/include/arch/proc.h +++ b/include/arch/proc.h @@ -7,6 +7,11 @@ /** * @file proc.h * Arch-specific process related stuff. + * + * Note that all functions except *_fast may not assume that the rpc stack is + * mapped into the current address space, so they might have to do some extra + * calculations to find the underlying physical stack or something along those + * lines. */ #if defined(__riscv) @@ -30,6 +35,16 @@ void set_ret(struct tcb *t, size_t n, struct sys_ret a); /** + * Attach argument data to thread, to be returned to userspace. + * Must only be called when cur_tcb() == t. Currently only used by do_ipc() so + * no need to figure out how many registers to set, just set them all. + * + * @param t Current thread. + * @param a Values to place in return registers. + */ +void set_ret_fast(struct tcb *t, struct sys_ret a); + +/** * Get argument data attached to thread. * To some extent a hack, used by swap. * @@ -62,6 +77,16 @@ void set_thread(struct tcb *t); void set_stack(struct tcb *t, vm_t s); /** + * Set userspace stack, but do it very quickly. + * Must only be called when cur_tcb() == t, allowing us to do a fast but 'unsafe' + * direct write to the rpc stack. + * + * @param t Current thread. + * @param s Address to place into the stack register. + */ +void set_stack_fast(struct tcb *t, vm_t s); + +/** * Get current userspace stack. * * @param t Thread whose stack to query. |
