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