1 |
/* IPC rights table. |
/* IPC rights table. |
2 |
Copyright 1999, 2000, 2001 Johan Rydberg, jrydberg@opencores.org. |
Copyright 1999, 2000, 2001, 2002 Johan Rydberg, jrydberg@opencores.org. |
3 |
|
|
4 |
This program is free software; you can redistribute it and/or modify |
This program is free software; you can redistribute it and/or modify |
5 |
it under the terms of the GNU General Public License as published by |
it under the terms of the GNU General Public License as published by |
19 |
#include "ipc-port.h" |
#include "ipc-port.h" |
20 |
#include "ipc-object.h" |
#include "ipc-object.h" |
21 |
#include "trace.h" |
#include "trace.h" |
22 |
|
#include "vm-kmem.h" |
23 |
|
|
24 |
/* Intialize IPC table object TBL. Marks all slots as unused. */ |
/* Intialize IPC table object TBL. Marks all slots as unused. */ |
25 |
|
|
26 |
void |
void |
27 |
ipc_table_object_init (struct ipc_table *tbl) |
ipc_table_object_init (struct ipc_table *tbl) |
28 |
{ |
{ |
29 |
int cnt; |
tbl->it_tbl = (struct ipc_entry **) |
30 |
|
kmem_alloc_wired (VM_MAP_KERNEL (), |
31 |
for (cnt = 0; cnt < MTABLERIGHTS; cnt++) |
MTABLERIGHTS * sizeof (struct ipc_entry *)); |
32 |
tbl->it_tbl [cnt] = 0; |
assert (tbl->it_tbl); |
33 |
|
memset (tbl->it_tbl, 0, MTABLERIGHTS * sizeof (struct ipc_entry *)); |
34 |
} |
} |
35 |
|
|
36 |
/* Try to reserve entry named by NAME in TBL. Return true if we succeed |
/* Try to reserve entry named by NAME in TBL. Return true if we succeed |