|
|
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_init.c
31: * Author: Rich Draves
32: * Date: 1989
33: *
34: * Functions to initialize the IPC system.
35: */
36:
37: #include <mach/kern_return.h>
38: #include <kern/ipc_host.h>
1.1.1.4 root 39: #include <kern/slab.h>
1.1 root 40: #include <vm/vm_map.h>
41: #include <vm/vm_kern.h>
42: #include <ipc/ipc_entry.h>
43: #include <ipc/ipc_space.h>
44: #include <ipc/ipc_object.h>
45: #include <ipc/ipc_port.h>
46: #include <ipc/ipc_pset.h>
47: #include <ipc/ipc_marequest.h>
48: #include <ipc/ipc_notify.h>
49: #include <ipc/ipc_kmsg.h>
50: #include <ipc/ipc_init.h>
51:
52:
53:
1.1.1.4 root 54: static struct vm_map ipc_kernel_map_store;
55: vm_map_t ipc_kernel_map = &ipc_kernel_map_store;
1.1.1.5 root 56: const vm_size_t ipc_kernel_map_size = 8 * 1024 * 1024;
1.1 root 57:
58: /*
59: * Routine: ipc_bootstrap
60: * Purpose:
61: * Initialization needed before the kernel task
62: * can be created.
63: */
64:
65: void
66: ipc_bootstrap(void)
67: {
68: kern_return_t kr;
69:
70: ipc_port_multiple_lock_init();
71:
72: ipc_port_timestamp_lock_init();
73: ipc_port_timestamp_data = 0;
74:
1.1.1.4 root 75: kmem_cache_init(&ipc_space_cache, "ipc_space",
1.1.1.7 root 76: sizeof(struct ipc_space), 0, NULL, 0);
1.1.1.4 root 77:
1.1.1.6 root 78: kmem_cache_init(&ipc_entry_cache, "ipc_entry",
1.1.1.7 root 79: sizeof(struct ipc_entry), 0, NULL, 0);
1.1.1.4 root 80:
81: kmem_cache_init(&ipc_object_caches[IOT_PORT], "ipc_port",
1.1.1.7 root 82: sizeof(struct ipc_port), 0, NULL, 0);
1.1.1.4 root 83:
84: kmem_cache_init(&ipc_object_caches[IOT_PORT_SET], "ipc_pset",
1.1.1.7 root 85: sizeof(struct ipc_pset), 0, NULL, 0);
1.1 root 86:
87: /* create special spaces */
88:
89: kr = ipc_space_create_special(&ipc_space_kernel);
90: assert(kr == KERN_SUCCESS);
91:
92: kr = ipc_space_create_special(&ipc_space_reply);
93: assert(kr == KERN_SUCCESS);
94:
95: /* initialize modules with hidden data structures */
96:
97: ipc_table_init();
98: ipc_notify_init();
99: ipc_marequest_init();
100: }
101:
102: /*
103: * Routine: ipc_init
104: * Purpose:
105: * Final initialization of the IPC system.
106: */
107:
108: void
1.1.1.5 root 109: ipc_init(void)
1.1 root 110: {
111: vm_offset_t min, max;
112:
1.1.1.4 root 113: kmem_submap(ipc_kernel_map, kernel_map, &min, &max,
1.1.1.8 ! root 114: ipc_kernel_map_size);
1.1 root 115:
116: ipc_host_init();
117: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.