minix/kernel/ipc.h
Cristiano Giuffrida bde2109b7c IPC status code for receive().
IPC changes:
- receive() is changed to take an additional parameter, which is a pointer to
a status code.
- The status code is filled in by the kernel to provide additional information
to the caller. For now, the kernel only fills in the IPC call used by the
sender.

Syslib changes:
- sef_receive() has been split into sef_receive() (with the original semantics)
and sef_receive_status() which exposes the status code to userland.
- Ideally, every sys process should gradually switch to sef_receive_status()
and use is_ipc_notify() as a dependable way to check for notify.
- SEF has been modified to use is_ipc_notify() and demonstrate how to use the
new status code.
2010-03-23 00:09:11 +00:00

24 lines
789 B
C

#ifndef IPC_H
#define IPC_H
/* This header file defines constants for MINIX inter-process communication.
* These definitions are used in the file proc.c.
*/
#include <minix/com.h>
/* Masks and flags for system calls. */
#define NON_BLOCKING 0x0080 /* do not block if target not ready */
#define WILLRECEIVE(target, source_ep) \
((RTS_ISSET(target, RTS_RECEIVING) && !RTS_ISSET(target, RTS_SENDING)) && \
(target->p_getfrom_e == ANY || target->p_getfrom_e == source_ep))
/* IPC status code macros. */
#define IPC_STATUS_REG bx
#define IPC_STATUS_GET(p) ((p)->p_reg.IPC_STATUS_REG)
#define IPC_STATUS_SET(p, m) ((p)->p_reg.IPC_STATUS_REG = m)
#define IPC_STATUS_CLEAR(p) IPC_STATUS_SET(p, 0)
#define IPC_STATUS_ADD(p, m) ((p)->p_reg.IPC_STATUS_REG |= m)
#endif /* IPC_H */