|
|
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_splay.h
30: * Author: Rich Draves
31: * Date: 1989
32: *
33: * Declarations of primitive splay tree operations.
34: */
35:
36: #ifndef _IPC_IPC_SPLAY_H_
37: #define _IPC_IPC_SPLAY_H_
38:
39: #include <mach/port.h>
40: #include <kern/assert.h>
41: #include <kern/macro_help.h>
42: #include <ipc/ipc_entry.h>
43:
44: typedef struct ipc_splay_tree {
45: mach_port_t ist_name; /* name used in last lookup */
46: ipc_tree_entry_t ist_root; /* root of middle tree */
47: ipc_tree_entry_t ist_ltree; /* root of left tree */
48: ipc_tree_entry_t *ist_ltreep; /* pointer into left tree */
49: ipc_tree_entry_t ist_rtree; /* root of right tree */
50: ipc_tree_entry_t *ist_rtreep; /* pointer into right tree */
51: } *ipc_splay_tree_t;
52:
53: #define ist_lock(splay) /* no locking */
54: #define ist_unlock(splay) /* no locking */
55:
56: /* Initialize a raw splay tree */
57: extern void ipc_splay_tree_init(
58: ipc_splay_tree_t splay);
59:
60: /* Pick a random entry in a splay tree */
61: extern boolean_t ipc_splay_tree_pick(
62: ipc_splay_tree_t splay,
63: mach_port_t *namep,
64: ipc_tree_entry_t *entryp);
65:
66: /* Find an entry in a splay tree */
67: extern ipc_tree_entry_t ipc_splay_tree_lookup(
68: ipc_splay_tree_t splay,
69: mach_port_t name);
70:
71: /* Insert a new entry into a splay tree */
72: extern void ipc_splay_tree_insert(
73: ipc_splay_tree_t splay,
74: mach_port_t name,
75: ipc_tree_entry_t entry);
76:
77: /* Delete an entry from a splay tree */
78: extern void ipc_splay_tree_delete(
79: ipc_splay_tree_t splay,
80: mach_port_t name,
81: ipc_tree_entry_t entry);
82:
83: /* Split a splay tree */
84: extern void ipc_splay_tree_split(
85: ipc_splay_tree_t splay,
86: mach_port_t name,
87: ipc_splay_tree_t entry);
88:
89: /* Join two splay trees */
90: extern void ipc_splay_tree_join(
91: ipc_splay_tree_t splay,
92: ipc_splay_tree_t small);
93:
94: /* Do a bounded splay tree lookup */
95: extern void ipc_splay_tree_bounds(
96: ipc_splay_tree_t splay,
97: mach_port_t name,
98: mach_port_t *lowerp,
99: mach_port_t *upperp);
100:
101: /* Initialize a symmetric order traversal of a splay tree */
102: extern ipc_tree_entry_t ipc_splay_traverse_start(
103: ipc_splay_tree_t splay);
104:
105: /* Return the next entry in a symmetric order traversal of a splay tree */
106: extern ipc_tree_entry_t ipc_splay_traverse_next(
107: ipc_splay_tree_t splay,
108: boolean_t delete);
109:
110: /* Terminate a symmetric order traversal of a splay tree */
111: extern void ipc_splay_traverse_finish(
112: ipc_splay_tree_t splay);
113:
114: #endif /* _IPC_IPC_SPLAY_H_ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.