/* IPC port right table 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_table_h #define __ipc_table_h 1 #include #include "ipc-entry.h" /* Number of rights that each table contains. */ #define MTABLERIGHTS 64 /* Table for fast right mapping of small names. */ struct ipc_table { struct ipc_entry *it_tbl [MTABLERIGHTS]; }; /* Intialize IPC table object TBL. Marks all slots as unused. */ extern void ipc_table_object_init (struct ipc_table *tbl); /* Try to reserve entry named by NAME in TBL. Return true if we succeed with pointer to entry structure in ENTRYP. False is retuned if we fail to reserve slot in tbale. */ extern bool ipc_table_reserve_name (struct ipc_table *tbl, struct ipc_entry **entryp, rtmk_port_t name); /* This function tries to reserve an entry within TBL. It returns true if it succeed to reserve an entry, with name of entry in NAMEP and pointer to entry in ENTRYP. */ extern bool ipc_table_reserve (struct ipc_table *tbl, struct ipc_entry **entryp, rtmk_port_t *namep); /* Lookup NAME in TBL. If slot was not empty, we return true and pointer to entry structure in ENTRYP. */ extern bool ipc_table_lookup (struct ipc_table *tbl, rtmk_port_t name, struct ipc_entry **entryp); /* Remove entry named NAME from TBL. Return true if we removed the entry (and it was valid). */ extern bool ipc_table_remove (struct ipc_table *tbl, rtmk_port_t name); /* Remove entry named NAME from TBL. Return true if we removed the entry (and it was valid). */ extern bool ipc_table_remove (struct ipc_table *tbl, rtmk_port_t name); #endif /* ipc-table.h */