2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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
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
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
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.
21 * @APPLE_LICENSE_HEADER_END@
24 * Mach Operating System
25 * Copyright (c) 1991,1990,1989,1988,1987,1986 Carnegie Mellon University
26 * All Rights Reserved.
28 * Permission to use, copy, modify and distribute this software and its
29 * documentation is hereby granted, provided that both the copyright
30 * notice and this permission notice appear in all copies of the
31 * software, derivative works or modified versions, and any portions
32 * thereof, and that both notices appear in supporting documentation.
34 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
35 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
36 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
38 * Carnegie Mellon requests users of this software to return to
40 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
41 * School of Computer Science
42 * Carnegie Mellon University
43 * Pittsburgh PA 15213-3890
45 * any improvements or extensions that they make and grant Carnegie Mellon
46 * the rights to redistribute these changes.
50 * Items provided by the Mach environment initialization.
56 #include <mach/mach_types.h>
59 #include <sys/cdefs.h>
63 * Kernel-related ports; how a task/thread controls itself
66 extern mach_port_t mach_task_self_
;
68 extern mach_port_t
mach_task_self(void);
69 extern mach_port_t
mach_host_self(void);
70 extern mach_port_t
mach_thread_self(void);
72 #define mach_task_self() mach_task_self_
74 #define current_task() mach_task_self()
76 #include <mach/mach_traps.h>
78 * Other important ports in the Mach user environment
81 extern mach_port_t bootstrap_port
;
82 extern mach_port_t name_server_port
;
83 extern mach_port_t environment_port
;
84 extern mach_port_t service_port
;
87 * Where these ports occur in the "mach_ports_register"
88 * collection... only servers or the runtime library need know.
91 #define NAME_SERVER_SLOT 0
92 #define ENVIRONMENT_SLOT 1
93 #define SERVICE_SLOT 2
95 #define MACH_PORTS_SLOTS_USED 3
98 * Globally interesting numbers.
99 * These macros assume vm_page_size is a power-of-2.
102 extern vm_size_t vm_page_size
;
104 #define trunc_page(x) ((x) & (~(vm_page_size - 1)))
105 #define round_page(x) trunc_page((x) + (vm_page_size - 1))
108 * fprintf_stderr uses vprintf_stderr_func to produce
109 * error messages, this can be overridden by a user
110 * application to point to a user-specified output function
113 extern int (*vprintf_stderr_func
)(const char *format
, va_list ap
);
116 #endif /* _MACH_INIT_ */