1 /* $NetBSD: mach_types.h,v 1.22 2005/02/26 23:10:20 perry Exp $ */
2
3 /*-
4 * Copyright (c) 2001-2003 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Christos Zoulas and Emmanuel Dreyfus.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the NetBSD
21 * Foundation, Inc. and its contributors.
22 * 4. Neither the name of The NetBSD Foundation nor the names of its
23 * contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE.
37 */
38
39 #ifndef _MACH_TYPES_H_
40 #define _MACH_TYPES_H_
41
42 typedef int mach_port_t;
43 typedef int mach_port_name_t;
44 typedef int mach_port_type_t;
45 typedef register_t mach_kern_return_t;
46 typedef int mach_clock_res_t;
47 typedef int mach_clock_id_t;
48 typedef int mach_boolean_t;
49 typedef int mach_sleep_type_t;
50 typedef int mach_absolute_time_t;
51 typedef int mach_integer_t;
52 typedef int mach_cpu_type_t;
53 typedef int mach_cpu_subtype_t;
54 typedef int mach_port_right_t;
55 typedef register_t mach_vm_address_t;
56 typedef int mach_vm_inherit_t;
57 typedef int mach_vm_prot_t;
58 typedef int mach_thread_state_flavor_t;
59 typedef unsigned int mach_natural_t;
60 typedef unsigned long mach_vm_size_t;
61 typedef uint64_t mach_memory_object_size_t;
62 typedef unsigned long mach_vm_offset_t;
63 typedef uint64_t mach_memory_object_offset_t;
64 typedef int mach_vm_region_flavor_t;
65 typedef int mach_vm_behavior_t;
66 typedef int mach_vm_sync_t;
67 typedef int mach_exception_type_t;
68 typedef int mach_exception_behavior_t;
69 typedef unsigned int mach_exception_mask_t;
70 typedef int mach_port_flavor_t;
71 typedef mach_natural_t mach_port_seqno_t;
72 typedef mach_natural_t mach_port_mscount_t;
73 typedef mach_natural_t mach_port_msgcount_t;
74 typedef mach_natural_t mach_port_rights_t;
75 typedef mach_natural_t mach_task_flavor_t;
76 typedef mach_natural_t mach_thread_flavor_t;
77 typedef int mach_policy_t;
78 typedef int mach_vm_machine_attribute_val_t;
79 typedef unsigned int mach_vm_machine_attribute_t;
80 typedef mach_natural_t mach_port_urefs_t;
81 typedef int mach_port_delta_t;
82
83
84 /*
85 * This is called cproc_t in Mach (cthread_t in Darwin). It is a pointer to
86 * a struct cproc (struct cthread in Darwin), which is stored in userland and
87 * seems to be opaque to the kernel. The kernel just has to store and restore
88 * it with cthread_self() (pthread_self() in Darwin) and _cthread_set_self()
89 * (_pthread_set_self() in Darwin).
90 */
91 typedef void *mach_cproc_t;
92
93 typedef struct mach_timebase_info {
94 u_int32_t numer;
95 u_int32_t denom;
96 } *mach_timebase_info_t;
97
98 typedef struct {
99 u_int8_t mig_vers;
100 u_int8_t if_vers;
101 u_int8_t reserved1;
102 u_int8_t mig_encoding;
103 u_int8_t int_rep;
104 u_int8_t char_rep;
105 u_int8_t float_rep;
106 u_int8_t reserved2;
107 } mach_ndr_record_t;
108
109 typedef struct {
110 mach_integer_t seconds;
111 mach_integer_t microseconds;
112 } mach_time_value_t;
113
114 #ifdef DEBUG_MACH
115 #define DPRINTF(a) printf a
116 #else
117 #define DPRINTF(a)
118 #endif /* DEBUG_MACH */
119
120 #endif /* !_MACH_TYPES_H_ */
Cache object: 270d4fd1dba1f8a589b7f4b5365ed5b0
|