diff options
| author | Jon Santmyer <jon@jonsantmyer.com> | 2026-10-13 22:31:43 -0400 |
|---|---|---|
| committer | Jon Santmyer <jon@jonsantmyer.com> | 2026-10-13 22:31:43 -0400 |
| commit | 548506392b789f58b1556a6ffca917441e1d89fd (patch) | |
| tree | 58e4b747446ea64e7951e523353f58510b3a8b2f /proc/ipc.h | |
| parent | c5e3bb7917689bc9ed54fee23a143144fade802d (diff) | |
| download | jove-kernel-548506392b789f58b1556a6ffca917441e1d89fd.tar.gz jove-kernel-548506392b789f58b1556a6ffca917441e1d89fd.tar.bz2 jove-kernel-548506392b789f58b1556a6ffca917441e1d89fd.zip | |
ipc functions. work on process spawning
Diffstat (limited to 'proc/ipc.h')
| -rw-r--r-- | proc/ipc.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/proc/ipc.h b/proc/ipc.h new file mode 100644 index 0000000..4a3dce3 --- /dev/null +++ b/proc/ipc.h @@ -0,0 +1,35 @@ +#ifndef _JOVE_PROC_IPC_H +#define _JOVE_PROC_IPC_H 1 + +#include "hal/obj.h" +#include "api/process.h" +#include <stdatomic.h> +#include <stdbool.h> + +struct port +{ + pid_t owner; + + struct port *send_target; + jove_obj_t send; + + struct port *recv_target; + jove_obj_t recv; +}; + +pid_t port_get_owner(struct port *port); + +struct port *port_get_send_target(struct port *port); +struct port *port_get_recv_target(struct port *port); +void port_set_recv_target(struct port *port, struct port *target); + +bool port_poll_send(struct port *port); +bool port_poll_recv(struct port *port); + +int port_take_send(struct port *port, jove_owned_obj_t *dest_obj); +struct port *port_take_recv(struct port *port, jove_owned_obj_t *dest_obj); + +int port_send(struct port *source, struct port *target, jove_owned_obj_t *sent_obj); +int port_recv(struct port *source, struct port *target); + +#endif |
