/* IPC entry defintions. 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 __ipc_entry_h #define __ipc_entry_h 1 #include #include "queue.h" struct ipc_port; /* Forward declaration for a entry in the tree or table. */ typedef struct ipc_entry *ipc_entry; typedef struct ipc_entry *splay_tree_node; typedef struct ipc_entry ipc_entry_data; /* Port right entry. This structure is located either in the right table and/or in revese lookup hash table. */ struct ipc_entry { /* Right and status bits. */ unsigned int ie_bits; /* The port. */ struct ipc_port *ie_port; /* Next entry in reverse lookup hash-table. */ struct ipc_entry *ie_next; /* Pointer to object that we are located within. */ struct ipc_object *ie_object; /* Offset (or name) within that bucket. */ rtmk_port_t ie_key; union { /* XXX data that is only needed in table here. */ /* Members that is only needed when we're present in a splay-tree. */ struct { /* The left and right children, respectively. */ struct ipc_entry *ieuns_left; struct ipc_entry *ieuns_right; #define ie_left ie_un.ieun_splay.ieuns_left #define ie_right ie_un.ieun_splay.ieuns_right } ieun_splay; } ie_un; }; /* IPC entry bits defintions. */ #define IE_BITS(RIGHT,BITS) ((RIGHT) | (BITS)) #define IE_BITS_RIGHTS(BITS) ((BITS) & 0xffff0000) #define IE_BITS_STATUS(STATUS) ((STATUS) & 0x0000ffff) /* If the IPC entry is valid. */ #define IE_BITS_VALID 0x00000001 #endif /* ipc-entry.h */