]> git.saurik.com Git - apple/xnu.git/blame - osfmk/ipc/ipc_hash.h
xnu-792.6.56.tar.gz
[apple/xnu.git] / osfmk / ipc / ipc_hash.h
CommitLineData
1c79356b 1/*
91447636 2 * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
1c79356b
A
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
ff6e181a
A
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
1c79356b
A
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
ff6e181a
A
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
1c79356b
A
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23/*
24 * @OSF_COPYRIGHT@
25 */
26/*
27 * Mach Operating System
28 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
29 * All Rights Reserved.
30 *
31 * Permission to use, copy, modify and distribute this software and its
32 * documentation is hereby granted, provided that both the copyright
33 * notice and this permission notice appear in all copies of the
34 * software, derivative works or modified versions, and any portions
35 * thereof, and that both notices appear in supporting documentation.
36 *
37 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
38 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
39 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
40 *
41 * Carnegie Mellon requests users of this software to return to
42 *
43 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
44 * School of Computer Science
45 * Carnegie Mellon University
46 * Pittsburgh PA 15213-3890
47 *
48 * any improvements or extensions that they make and grant Carnegie Mellon
49 * the rights to redistribute these changes.
50 */
51/*
52 */
53/*
54 * File: ipc/ipc_hash.h
55 * Author: Rich Draves
56 * Date: 1989
57 *
58 * Declarations of entry hash table operations.
59 */
60
61#ifndef _IPC_IPC_HASH_H_
62#define _IPC_IPC_HASH_H_
63
91447636
A
64#include <mach/port.h>
65#include <mach/mach_types.h>
1c79356b
A
66#include <mach/boolean.h>
67#include <mach/kern_return.h>
91447636 68#include <ipc/ipc_types.h>
1c79356b
A
69/*
70 * Exported interfaces
71 */
72
73/* Lookup (space, obj) in the appropriate reverse hash table */
74extern boolean_t ipc_hash_lookup(
75 ipc_space_t space,
76 ipc_object_t obj,
77 mach_port_name_t *namep,
78 ipc_entry_t *entryp);
79
80/* Insert an entry into the appropriate reverse hash table */
81extern void ipc_hash_insert(
82 ipc_space_t space,
83 ipc_object_t obj,
84 mach_port_name_t name,
85 ipc_entry_t entry);
86
87/* Delete an entry from the appropriate reverse hash table */
88extern void ipc_hash_delete(
89 ipc_space_t space,
90 ipc_object_t obj,
91 mach_port_name_t name,
92 ipc_entry_t entry);
93
94/*
95 * For use by functions that know what they're doing:
96 * the global primitives, for splay tree entries,
97 * and the local primitives, for table entries.
98 */
99
100/* Delete an entry from the global reverse hash table */
101extern void ipc_hash_global_delete(
102 ipc_space_t space,
103 ipc_object_t obj,
104 mach_port_name_t name,
105 ipc_tree_entry_t entry);
106
107/* Lookup (space, obj) in local hash table */
108extern boolean_t ipc_hash_local_lookup(
109 ipc_space_t space,
110 ipc_object_t obj,
111 mach_port_name_t *namep,
112 ipc_entry_t *entryp);
113
114/* Inserts an entry into the local reverse hash table */
115extern void ipc_hash_local_insert(
116 ipc_space_t space,
117 ipc_object_t obj,
118 mach_port_index_t index,
119 ipc_entry_t entry);
120
121/* Initialize the reverse hash table implementation */
122extern void ipc_hash_init(void);
123
124#include <mach_ipc_debug.h>
125
126#if MACH_IPC_DEBUG
127
91447636
A
128#include <mach_debug/hash_info.h>
129
1c79356b
A
130extern natural_t ipc_hash_info(
131 hash_info_bucket_t *info,
132 mach_msg_type_number_t count);
133
134#endif /* MACH_IPC_DEBUG */
135
136#endif /* _IPC_IPC_HASH_H_ */