|
|
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_hash.h>
51: #include <ipc/ipc_init.h>
52:
53:
54:
1.1.1.4 ! root 55: static struct vm_map ipc_kernel_map_store;
! 56: vm_map_t ipc_kernel_map = &ipc_kernel_map_store;
! 57: vm_size_t ipc_kernel_map_size = 8 * 1024 * 1024;
1.1 root 58:
59: /*
60: * Routine: ipc_bootstrap
61: * Purpose:
62: * Initialization needed before the kernel task
63: * can be created.
64: */
65:
66: void
67: ipc_bootstrap(void)
68: {
69: kern_return_t kr;
70:
71: ipc_port_multiple_lock_init();
72:
73: ipc_port_timestamp_lock_init();
74: ipc_port_timestamp_data = 0;
75:
1.1.1.4 ! root 76: kmem_cache_init(&ipc_space_cache, "ipc_space",
! 77: sizeof(struct ipc_space), 0, NULL, NULL, NULL, 0);
! 78:
! 79: kmem_cache_init(&ipc_tree_entry_cache, "ipc_tree_entry",
! 80: sizeof(struct ipc_tree_entry), 0, NULL, NULL, NULL, 0);
! 81:
! 82: kmem_cache_init(&ipc_object_caches[IOT_PORT], "ipc_port",
! 83: sizeof(struct ipc_port), 0, NULL, NULL, NULL, 0);
! 84:
! 85: kmem_cache_init(&ipc_object_caches[IOT_PORT_SET], "ipc_pset",
! 86: sizeof(struct ipc_pset), 0, NULL, NULL, NULL, 0);
1.1 root 87:
88: /* create special spaces */
89:
90: kr = ipc_space_create_special(&ipc_space_kernel);
91: assert(kr == KERN_SUCCESS);
92:
93: kr = ipc_space_create_special(&ipc_space_reply);
94: assert(kr == KERN_SUCCESS);
95:
96: /* initialize modules with hidden data structures */
97:
98: ipc_table_init();
99: ipc_notify_init();
100: ipc_hash_init();
101: ipc_marequest_init();
102: }
103:
104: /*
105: * Routine: ipc_init
106: * Purpose:
107: * Final initialization of the IPC system.
108: */
109:
110: void
111: ipc_init()
112: {
113: vm_offset_t min, max;
114:
1.1.1.4 ! root 115: kmem_submap(ipc_kernel_map, kernel_map, &min, &max,
! 116: ipc_kernel_map_size, TRUE);
1.1 root 117:
118: ipc_host_init();
119: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.