diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-11-01 04:44:50 +0200 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-11-01 10:28:11 +0200 |
| commit | 9914b44878ca52cc615d2f4e47fec400dd55ab76 (patch) | |
| tree | 7678216d4049fa5d2a4a9e381daa4d34dc317c22 /include/arch/tcb.h | |
| parent | 89e162f3916de5a4faef5bd626590d004bdcdc39 (diff) | |
| download | kmi-9914b44878ca52cc615d2f4e47fec400dd55ab76.tar.gz kmi-9914b44878ca52cc615d2f4e47fec400dd55ab76.zip | |
test all ipc variants more-or-less properly
Diffstat (limited to 'include/arch/tcb.h')
| -rw-r--r-- | include/arch/tcb.h | 52 |
1 files changed, 18 insertions, 34 deletions
diff --git a/include/arch/tcb.h b/include/arch/tcb.h index b04dc56..3f99ae9 100644 --- a/include/arch/tcb.h +++ b/include/arch/tcb.h @@ -89,33 +89,31 @@ vm_t rpc_position(struct tcb *t); bool in_rpc_stack(struct tcb *t, vm_t addr); /** - * Shrinks rpc stack down to where the previous reserved area is, so stack looks - * something like this: + * Reuse current rpc activation. + * Effectively marks all stack pages except the first in the 'new' stack + * activation inaccessible. * - * ``` - * ctx | user | < - * v - * ctx | < - * ``` - * - * Implementation note: t->arch.rpc_idx now points to ctx. + * @param t Current tcb. + */ +void reuse_rpc(struct tcb *t); + +/** + * Create new rpc activation. + * Marks all current stack pages inaccessible, marks the first in the new stack + * accessible. * - * @param t tcb to shrink. + * @param t Current tcb. */ -void shrink_rpc(struct tcb *t); +void new_rpc(struct tcb *t); /** - * Opens back up a previous stack frame, so - * ``` - * ctx | user | ctx | < - * v - * ctx | user | < - * ``` + * Destroy a stack activation. + * Marks all current stack pages inaccessible, and marks all user stack pages in + * the previous activation accessible again. * - * @param t tcb to open up again. - * @param top Address to where previous ctx is. + * @param t Current tcb. */ -void open_rpc(struct tcb *t, vm_t top); +void destroy_rpc(struct tcb *t); /** * Adds more accessible space on the stack, so @@ -134,18 +132,4 @@ void open_rpc(struct tcb *t, vm_t top); */ void grow_rpc(struct tcb *t, vm_t top); -/** - * Marks all user accessible areas inaccessible, so - * ``` - * ctx | user | < - * ctx | ---- | < - * ``` - * - * Used by \ref do_ipc to make sure different processes can't mess with - * eachother's stacks. - * - * @param t tcb whose stack should be closed. - */ -void close_rpc(struct tcb *t); - #endif /* KMI_ARCH_TCB_H */ |
