2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
26 * Mach Operating System
27 * Copyright (c) 1991,1990,1989,1988,1987,1986 Carnegie Mellon University
28 * All Rights Reserved.
30 * Permission to use, copy, modify and distribute this software and its
31 * documentation is hereby granted, provided that both the copyright
32 * notice and this permission notice appear in all copies of the
33 * software, derivative works or modified versions, and any portions
34 * thereof, and that both notices appear in supporting documentation.
36 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
37 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
38 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
40 * Carnegie Mellon requests users of this software to return to
42 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
43 * School of Computer Science
44 * Carnegie Mellon University
45 * Pittsburgh PA 15213-3890
47 * any improvements or extensions that they make and grant Carnegie Mellon
48 * the rights to redistribute these changes.
52 * Items provided by the Mach environment initialization.
58 #include <mach/mach_types.h>
62 * Kernel-related ports; how a task/thread controls itself
65 extern mach_port_t mach_task_self_
;
67 extern mach_port_t
mach_task_self(void);
68 extern mach_port_t
mach_host_self(void);
69 extern mach_port_t
mach_thread_self(void);
71 #define mach_task_self() mach_task_self_
73 #define current_task() mach_task_self()
75 #include <mach/mach_traps.h>
77 * Other important ports in the Mach user environment
80 extern mach_port_t bootstrap_port
;
81 extern mach_port_t name_server_port
;
82 extern mach_port_t environment_port
;
83 extern mach_port_t service_port
;
86 * Where these ports occur in the "mach_ports_register"
87 * collection... only servers or the runtime library need know.
90 #define NAME_SERVER_SLOT 0
91 #define ENVIRONMENT_SLOT 1
92 #define SERVICE_SLOT 2
94 #define MACH_PORTS_SLOTS_USED 3
97 * Globally interesting numbers.
98 * These macros assume vm_page_size is a power-of-2.
101 extern vm_size_t vm_page_size
;
103 #define trunc_page(x) ((x) & (~(vm_page_size - 1)))
104 #define round_page(x) trunc_page((x) + (vm_page_size - 1))
107 * fprintf_stderr uses vprintf_stderr_func to produce
108 * error messages, this can be overridden by a user
109 * application to point to a user-specified output function
112 extern int (*vprintf_stderr_func
)(const char *format
, va_list ap
);
115 #endif /* _MACH_INIT_ */