diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-07-18 17:39:15 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-07-18 17:39:15 +0300 |
| commit | f9e23e6e41068d63d42f950941c3d2fc155ef21c (patch) | |
| tree | f548be5eab98389108dbd52b69eae413800405da /include | |
| parent | f952391ee86f42d7606b2d3791931aba746a7aca (diff) | |
| download | kmi-f9e23e6e41068d63d42f950941c3d2fc155ef21c.tar.gz kmi-f9e23e6e41068d63d42f950941c3d2fc155ef21c.zip | |
add ipc_tail()
+ ipc_kick() does a forward and a tail at the same time
The idea with ipc_tail() is to allow 'trusted' calls, so for example a
process is not allowed to willy-nilly open a file, as it has to go via
init(), making the eid 1. This way the receiver can know that the
request has gone through init() and can open up a new connection
(file, whatever) after which requests from that pid/tid are allowed
without init() intervention
Diffstat (limited to 'include')
| -rw-r--r-- | include/kmi/syscalls.h | 8 | ||||
| -rw-r--r-- | include/kmi/uapi.h | 19 |
2 files changed, 23 insertions, 4 deletions
diff --git a/include/kmi/syscalls.h b/include/kmi/syscalls.h index 4319812..2701bbc 100644 --- a/include/kmi/syscalls.h +++ b/include/kmi/syscalls.h @@ -87,12 +87,16 @@ enum sys_code { /** @name IPC. */ /** @{ */ /** Send IPC request as client. */ - SYS_IPC_REQ, /* IPC request to server */ + SYS_IPC_REQ, /** Forward IPC request from client. */ SYS_IPC_FWD, - /** Kick request handling to someone else. */ + /** Tail call, i.e. 'do this for me and then return to whoever called + * me" */ + SYS_IPC_TAIL, + + /** Kick request handling to someone else. Forwards AND does a tailcall. */ SYS_IPC_KICK, /** IPC response from server. */ diff --git a/include/kmi/uapi.h b/include/kmi/uapi.h index 2805a04..fa4aeae 100644 --- a/include/kmi/uapi.h +++ b/include/kmi/uapi.h @@ -513,9 +513,24 @@ SYSCALL_DECLARE5(ipc_req, pid, d0, d1, d2, d3); SYSCALL_DECLARE5(ipc_fwd, pid, d0, d1, d2, d3); /** + * Tail syscall. + * + * Requests that the current process doesn't get returned to in an rpc stack. + * + * @param t Current tcb. + * @param pid Tail target process. + * @param d0 First argument. + * @param d1 Second argument. + * @param d2 Third argument. + * @param d3 Fourth argument. + */ +SYSCALL_DECLARE5(ipc_tail, pid, d0, d1, d2, d3); + +/** * Kicking syscall. - * Kicks the handling of an IPC req/fwd to someone else, jumping over the - * current process at ipc_resp(). + * Kicks the handling of an IPC to someone else, jumping over the + * current process at ipc_resp(). Effectively does a forward and a tail at the + * same time. * * I'm imagining that this is useful in cases where an init process connects a * client to another server, and kicks the actual request handling to the |
