|
|
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/mach_param.h> ! 39: #include <kern/ipc_host.h> ! 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: ! 55: vm_map_t ipc_kernel_map; ! 56: vm_size_t ipc_kernel_map_size = 1024 * 1024; ! 57: ! 58: int ipc_space_max = SPACE_MAX; ! 59: int ipc_tree_entry_max = ITE_MAX; ! 60: int ipc_port_max = PORT_MAX; ! 61: int ipc_pset_max = SET_MAX; ! 62: ! 63: /* ! 64: * Routine: ipc_bootstrap ! 65: * Purpose: ! 66: * Initialization needed before the kernel task ! 67: * can be created. ! 68: */ ! 69: ! 70: void ! 71: ipc_bootstrap(void) ! 72: { ! 73: kern_return_t kr; ! 74: ! 75: ipc_port_multiple_lock_init(); ! 76: ! 77: ipc_port_timestamp_lock_init(); ! 78: ipc_port_timestamp_data = 0; ! 79: ! 80: ipc_space_zone = zinit(sizeof(struct ipc_space), ! 81: ipc_space_max * sizeof(struct ipc_space), ! 82: sizeof(struct ipc_space), ! 83: IPC_ZONE_TYPE, "ipc spaces"); ! 84: ! 85: ipc_tree_entry_zone = ! 86: zinit(sizeof(struct ipc_tree_entry), ! 87: ipc_tree_entry_max * sizeof(struct ipc_tree_entry), ! 88: sizeof(struct ipc_tree_entry), ! 89: IPC_ZONE_TYPE, "ipc tree entries"); ! 90: ! 91: ipc_object_zones[IOT_PORT] = ! 92: zinit(sizeof(struct ipc_port), ! 93: ipc_port_max * sizeof(struct ipc_port), ! 94: sizeof(struct ipc_port), ! 95: 0, "ipc ports"); ! 96: ! 97: ipc_object_zones[IOT_PORT_SET] = ! 98: zinit(sizeof(struct ipc_pset), ! 99: ipc_pset_max * sizeof(struct ipc_pset), ! 100: sizeof(struct ipc_pset), ! 101: IPC_ZONE_TYPE, "ipc port sets"); ! 102: ! 103: /* create special spaces */ ! 104: ! 105: kr = ipc_space_create_special(&ipc_space_kernel); ! 106: assert(kr == KERN_SUCCESS); ! 107: ! 108: kr = ipc_space_create_special(&ipc_space_reply); ! 109: assert(kr == KERN_SUCCESS); ! 110: ! 111: #if NORMA_IPC ! 112: kr = ipc_space_create_special(&ipc_space_remote); ! 113: assert(kr == KERN_SUCCESS); ! 114: #endif /* NORMA_IPC */ ! 115: ! 116: /* initialize modules with hidden data structures */ ! 117: ! 118: ipc_table_init(); ! 119: ipc_notify_init(); ! 120: ipc_hash_init(); ! 121: ipc_marequest_init(); ! 122: } ! 123: ! 124: /* ! 125: * Routine: ipc_init ! 126: * Purpose: ! 127: * Final initialization of the IPC system. ! 128: */ ! 129: ! 130: void ! 131: ipc_init() ! 132: { ! 133: vm_offset_t min, max; ! 134: ! 135: ipc_kernel_map = kmem_suballoc(kernel_map, &min, &max, ! 136: ipc_kernel_map_size, TRUE); ! 137: ! 138: ipc_host_init(); ! 139: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.