|
|
1.1 root 1: /*
2: * Mach Operating System
3: * Copyright (c) 1991,1990,1989 Carnegie Mellon University
4: * All Rights Reserved.
5: *
6: * Permission to use, copy, modify and distribute this software and its
7: * documentation is hereby granted, provided that both the copyright
8: * notice and this permission notice appear in all copies of the
9: * software, derivative works or modified versions, and any portions
10: * thereof, and that both notices appear in supporting documentation.
11: *
12: * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13: * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14: * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15: *
16: * Carnegie Mellon requests users of this software to return to
17: *
18: * Software Distribution Coordinator or [email protected]
19: * School of Computer Science
20: * Carnegie Mellon University
21: * Pittsburgh PA 15213-3890
22: *
23: * any improvements or extensions that they make and grant Carnegie Mellon
24: * the rights to redistribute these changes.
25: */
26: /*
27: */
28: /*
29: * File: ipc/ipc_table.h
30: * Author: Rich Draves
31: * Date: 1989
32: *
1.1.1.4 ! root 33: * Definitions for tables, used for dead-name requests
! 34: * (ipc_port_request_t).
1.1 root 35: */
36:
37: #ifndef _IPC_IPC_TABLE_H_
38: #define _IPC_IPC_TABLE_H_
39:
40: #include <mach/boolean.h>
41: #include <mach/vm_param.h>
42:
43: /*
1.1.1.3 root 44: * Every its_size value must must be a power of two.
45: *
1.1 root 46: * The ipr_size field of the first element in a table of
47: * dead-name requests (ipc_port_request_t) points to the
48: * ipc_table_size structure. The structures must be elements
49: * of ipc_table_dnrequests. ipc_table_dnrequests must end
50: * with an element with zero its_size, and except for this last
51: * element, the its_size values must be strictly increasing.
52: *
53: * The ipr_size field points to the currently used ipc_table_size.
54: */
55:
56: typedef unsigned int ipc_table_index_t; /* index into tables */
57: typedef unsigned int ipc_table_elems_t; /* size of tables */
58:
59: typedef struct ipc_table_size {
60: ipc_table_elems_t its_size; /* number of elements in table */
61: } *ipc_table_size_t;
62:
63: #define ITS_NULL ((ipc_table_size_t) 0)
64:
65: extern ipc_table_size_t ipc_table_dnrequests;
66:
67: extern void
1.1.1.2 root 68: ipc_table_init(void);
1.1 root 69:
70: /*
1.1.1.4 ! root 71: * Note that ipc_table_alloc, and ipc_table_free all potentially
! 72: * use the VM system. Hence simple locks can't be held across
! 73: * them.
1.1 root 74: */
75:
76: /* Allocate a table */
77: extern vm_offset_t ipc_table_alloc(
78: vm_size_t size);
79:
80: /* Free a table */
81: extern void ipc_table_free(
82: vm_size_t size,
83: vm_offset_t table);
84:
1.1.1.3 root 85: void ipc_table_fill(
86: ipc_table_size_t its,
87: unsigned int num,
88: unsigned int min,
89: vm_size_t elemsize);
90:
1.1 root 91: #define it_dnrequests_alloc(its) \
92: ((ipc_port_request_t) \
93: ipc_table_alloc((its)->its_size * \
94: sizeof(struct ipc_port_request)))
95:
96: #define it_dnrequests_free(its, table) \
97: ipc_table_free((its)->its_size * \
98: sizeof(struct ipc_port_request), \
99: (vm_offset_t)(table))
100:
101: #endif /* _IPC_IPC_TABLE_H_ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.