From 548506392b789f58b1556a6ffca917441e1d89fd Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Tue, 13 Oct 2026 22:31:43 -0400 Subject: ipc functions. work on process spawning --- proc/ipc.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 proc/ipc.h (limited to 'proc/ipc.h') 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 +#include + +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 -- cgit v1.2.3