2 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_OSREFERENCE_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. The rights granted to you under the
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
34 #ifndef _KERN_KERN_TYPES_H_
35 #define _KERN_KERN_TYPES_H_
38 #include <mach/mach_types.h>
39 #include <mach/machine/vm_types.h>
43 #ifndef MACH_KERNEL_PRIVATE
47 struct wait_queue
{ unsigned int opaque
[2]; uintptr_t opaquep
[2]; } ;
49 #endif /* MACH_KERNEL_PRIVATE */
51 typedef struct zone
*zone_t
;
52 #define ZONE_NULL ((zone_t) 0)
54 typedef struct wait_queue
*wait_queue_t
;
55 #define WAIT_QUEUE_NULL ((wait_queue_t) 0)
56 #define SIZEOF_WAITQUEUE sizeof(struct wait_queue)
58 typedef vm_offset_t ipc_kobject_t
;
59 #define IKO_NULL ((ipc_kobject_t) 0)
61 #endif /* KERNEL_PRIVATE */
63 typedef void *event_t
; /* wait event */
64 #define NO_EVENT ((event_t) 0)
66 typedef uint64_t event64_t
; /* 64 bit wait event */
67 #define NO_EVENT64 ((event64_t) 0)
70 * Possible wait_result_t values.
72 typedef int wait_result_t
;
73 #define THREAD_WAITING -1 /* thread is waiting */
74 #define THREAD_AWAKENED 0 /* normal wakeup */
75 #define THREAD_TIMED_OUT 1 /* timeout expired */
76 #define THREAD_INTERRUPTED 2 /* aborted/interrupted */
77 #define THREAD_RESTART 3 /* restart operation entirely */
80 typedef void (*thread_continue_t
)(void *, wait_result_t
);
81 #define THREAD_CONTINUE_NULL ((thread_continue_t) 0)
84 * Interruptible flag for waits.
86 typedef int wait_interrupt_t
;
87 #define THREAD_UNINT 0 /* not interruptible */
88 #define THREAD_INTERRUPTIBLE 1 /* may not be restartable */
89 #define THREAD_ABORTSAFE 2 /* abortable safely */
93 #ifdef MACH_KERNEL_PRIVATE
95 #include <kern/misc_protos.h>
96 typedef struct clock
*clock_t;
98 typedef struct mig_object
*mig_object_t
;
99 #define MIG_OBJECT_NULL ((mig_object_t) 0)
101 typedef struct mig_notify
*mig_notify_t
;
102 #define MIG_NOTIFY_NULL ((mig_notify_t) 0)
104 typedef boolean_t (*thread_roust_t
)(thread_t
, wait_result_t
);
105 #define THREAD_ROUST_NULL ((thread_roust_t) 0)
107 #else /* MACH_KERNEL_PRIVATE */
109 struct wait_queue_set
;
110 struct wait_queue_link
;
112 #endif /* MACH_KERNEL_PRIVATE */
114 typedef struct wait_queue_set
*wait_queue_set_t
;
115 #define WAIT_QUEUE_SET_NULL ((wait_queue_set_t)0)
116 #define SIZEOF_WAITQUEUE_SET wait_queue_set_size()
118 typedef struct wait_queue_link
*wait_queue_link_t
;
119 #define WAIT_QUEUE_LINK_NULL ((wait_queue_link_t)0)
120 #define SIZEOF_WAITQUEUE_LINK wait_queue_link_size()
122 /* legacy definitions - going away */
123 struct wait_queue_sub
;
124 typedef struct wait_queue_sub
*wait_queue_sub_t
;
125 #define WAIT_QUEUE_SUB_NULL ((wait_queue_sub_t)0)
126 #define SIZEOF_WAITQUEUE_SUB wait_queue_set_size()
128 #endif /* KERNEL_PRIVATE */
130 #endif /* _KERN_KERN_TYPES_H_ */