/* IPC port definitions. Copyright 1999, 2000, 2001 Johan Rydberg, jrydberg@opencores.org. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __rtmk_ipc_port_h #define __rtmk_ipc_port_h 1 #include /* Port right types. */ #define RTMK_PORT_RIGHT_RECEIVE ((rtmk_port_right_t) 1) #define RTMK_PORT_RIGHT_SEND ((rtmk_port_right_t) 2) #define RTMK_PORT_RIGHT_SEND_ONCE ((rtmk_port_right_t) 3) #define RTMK_PORT_RIGHT_DEAD_NAME ((rtmk_port_right_t) 4) /* Port types. */ #define RTMK_PORT_TYPE(TYPE) (1 << (16 + (TYPE))) #define RTMK_PORT_TYPE_NONE RTMK_PORT_TYPE(0) #define RTMK_PORT_TYPE_SEND RTMK_PORT_TYPE(RTMK_PORT_RIGHT_SEND) #define RTMK_PORT_TYPE_SEND_ONCE RTMK_PORT_TYPE(RTMK_PORT_RIGHT_SEND_ONCE) #define RTMK_PORT_TYPE_RECEIVE RTMK_PORT_TYPE(RTMK_PORT_RIGHT_RECEIVE) #define RTMK_PORT_TYPE_SEND_RECEIVE \ (RTMK_PORT_TYPE_SEND|RTMK_PORT_TYPE_RECEIVE) #define RTMK_PORT_TYPE_SEND_RIGHTS \ (RTMK_PORT_TYPE_SEND|RTMK_PORT_TYPE_SEND_ONCE) #define RTMK_PORT_TYPE_PORT_RIGHTS \ (RTMK_PORT_TYPE_SEND_RIGHTS|RTMK_PORT_TYPE_RECEIVE) /* Port status structure. Contains information and statistics about a port. Structure fetched with "rtmk_port_status" RPC call. */ struct rtmk_port_status { rtmk_port_t rps_pset; /* containing port set. */ rtmk_port_seqno_t rps_seqno; /* sequence number. */ unsigned int rps_qlimit; /* queue limit. */ unsigned int rps_msgcount; /* number of messages in queue. */ unsigned int rps_sorights; /* number of send once rights. */ unsigned int rps_srights; /* number of send rights. */ }; typedef struct rtmk_port_status rtmk_port_status_t; #define RTMK_PORT_STATUS_COUNT 6 /* Queue limits. By default, 8 messages can be queued before the sender (thread) is being blocked. */ #define RTMK_PORT_QLIMIT_DEFAULT 8 #define RTMK_PORT_QLIMIT_MAX 32 #endif /* ipc-port.h */