|
|
1.1 root 1: /*
2: * Mach Operating System
3: * Copyright (c) 1991,1990,1989 Carnegie Mellon University.
4: * Copyright (c) 1993,1994 The University of Utah and
5: * the Computer Systems Laboratory (CSL).
6: * All rights reserved.
7: *
8: * Permission to use, copy, modify and distribute this software and its
9: * documentation is hereby granted, provided that both the copyright
10: * notice and this permission notice appear in all copies of the
11: * software, derivative works or modified versions, and any portions
12: * thereof, and that both notices appear in supporting documentation.
13: *
14: * CARNEGIE MELLON, THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF
15: * THIS SOFTWARE IN ITS "AS IS" CONDITION, AND DISCLAIM ANY LIABILITY
16: * OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF
17: * THIS SOFTWARE.
18: *
19: * Carnegie Mellon requests users of this software to return to
20: *
21: * Software Distribution Coordinator or [email protected]
22: * School of Computer Science
23: * Carnegie Mellon University
24: * Pittsburgh PA 15213-3890
25: *
26: * any improvements or extensions that they make and grant Carnegie Mellon
27: * the rights to redistribute these changes.
28: */
29: /*
30: * File: ipc/ipc_entry.h
31: * Author: Rich Draves
32: * Date: 1989
33: *
34: * Definitions for translation entries, which represent
35: * tasks' capabilities for ports and port sets.
36: */
37:
38: #ifndef _IPC_IPC_ENTRY_H_
39: #define _IPC_IPC_ENTRY_H_
40:
1.1.1.3 root 41: #include <mach/mach_types.h>
1.1 root 42: #include <mach/port.h>
43: #include <mach/kern_return.h>
1.1.1.3 root 44: #include <kern/slab.h>
1.1 root 45: #include <ipc/port.h>
46: #include <ipc/ipc_table.h>
1.1.1.3 root 47: #include <ipc/ipc_types.h>
1.1 root 48:
49: /*
50: * Spaces hold capabilities for ipc_object_t's (ports and port sets).
1.1.1.5 ! root 51: * Each ipc_entry_t records a capability.
1.1 root 52: */
53:
54: typedef unsigned int ipc_entry_bits_t;
55: typedef ipc_table_elems_t ipc_entry_num_t; /* number of entries */
56:
57: typedef struct ipc_entry {
1.1.1.5 ! root 58: mach_port_t ie_name;
1.1 root 59: ipc_entry_bits_t ie_bits;
60: struct ipc_object *ie_object;
61: union {
1.1.1.5 ! root 62: struct ipc_entry *next_free;
1.1 root 63: /*XXX ipc_port_request_index_t request;*/
64: unsigned int request;
65: } index;
66: } *ipc_entry_t;
67:
68: #define IE_NULL ((ipc_entry_t) 0)
69:
70: #define ie_request index.request
1.1.1.5 ! root 71: #define ie_next_free index.next_free
1.1 root 72:
73: #define IE_BITS_UREFS_MASK 0x0000ffff /* 16 bits of user-reference */
74: #define IE_BITS_UREFS(bits) ((bits) & IE_BITS_UREFS_MASK)
75:
76: #define IE_BITS_TYPE_MASK 0x001f0000 /* 5 bits of capability type */
77: #define IE_BITS_TYPE(bits) ((bits) & IE_BITS_TYPE_MASK)
78:
79: #define IE_BITS_MAREQUEST 0x00200000 /* 1 bit for msg-accepted */
80:
1.1.1.5 ! root 81: #define IE_BITS_RIGHT_MASK 0x003fffff /* relevant to the right */
1.1 root 82:
83: #if PORT_GENERATIONS
1.1.1.5 ! root 84: #error "not supported"
1.1 root 85: #define IE_BITS_GEN_MASK 0xff000000U /* 8 bits for generation */
86: #define IE_BITS_GEN(bits) ((bits) & IE_BITS_GEN_MASK)
87: #define IE_BITS_GEN_ONE 0x01000000 /* low bit of generation */
88: #else
89: #define IE_BITS_GEN_MASK 0
90: #define IE_BITS_GEN(bits) 0
91: #define IE_BITS_GEN_ONE 0
92: #endif
93:
94:
1.1.1.5 ! root 95: extern struct kmem_cache ipc_entry_cache;
! 96: #define ie_alloc() ((ipc_entry_t) kmem_cache_alloc(&ipc_entry_cache))
! 97: #define ie_free(e) kmem_cache_free(&ipc_entry_cache, (vm_offset_t) (e))
1.1 root 98:
99: extern kern_return_t
1.1.1.3 root 100: ipc_entry_alloc(ipc_space_t space, mach_port_t *namep, ipc_entry_t *entryp);
1.1 root 101:
102: extern kern_return_t
1.1.1.3 root 103: ipc_entry_alloc_name(ipc_space_t space, mach_port_t name, ipc_entry_t *entryp);
1.1 root 104:
1.1.1.4 root 105: ipc_entry_t
106: db_ipc_object_by_name(
107: task_t task,
108: mach_port_t name);
109:
1.1.1.2 root 110: #endif /* _IPC_IPC_ENTRY_H_ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.