]> git.saurik.com Git - apple/xnu.git/blob - osfmk/kern/call_entry.h
xnu-792.17.14.tar.gz
[apple/xnu.git] / osfmk / kern / call_entry.h
1 /*
2 * Copyright (c) 1993-1995, 1999-2000 Apple Computer, Inc.
3 * All rights reserved.
4 *
5 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 *
7 * This file contains Original Code and/or Modifications of Original Code
8 * as defined in and that are subject to the Apple Public Source License
9 * Version 2.0 (the 'License'). You may not use this file except in
10 * compliance with the License. The rights granted to you under the License
11 * may not be used to create, or enable the creation or redistribution of,
12 * unlawful or unlicensed copies of an Apple operating system, or to
13 * circumvent, violate, or enable the circumvention or violation of, any
14 * terms of an Apple operating system software license agreement.
15 *
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 *
19 * The Original Code and all software distributed under the License are
20 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
21 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
22 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
23 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
24 * Please see the License for the specific language governing rights and
25 * limitations under the License.
26 *
27 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
28 */
29 /*
30 * Private declarations for thread-based callouts.
31 *
32 * HISTORY
33 *
34 * 10 July 1999 (debo)
35 * Pulled into Mac OS X (microkernel).
36 *
37 * 3 July 1993 (debo)
38 * Created.
39 */
40
41 #ifndef _KERN_CALL_ENTRY_H_
42 #define _KERN_CALL_ENTRY_H_
43
44 #ifdef MACH_KERNEL_PRIVATE
45 #include <kern/queue.h>
46
47 typedef void *call_entry_param_t;
48 typedef void (*call_entry_func_t)(
49 call_entry_param_t param0,
50 call_entry_param_t param1);
51
52 typedef struct call_entry {
53 queue_chain_t q_link;
54 call_entry_func_t func;
55 call_entry_param_t param0;
56 call_entry_param_t param1;
57 uint64_t deadline;
58 enum {
59 IDLE,
60 PENDING,
61 DELAYED } state;
62 } call_entry_data_t;
63
64 #define call_entry_setup(entry, pfun, p0) \
65 MACRO_BEGIN \
66 (entry)->func = (call_entry_func_t)(pfun); \
67 (entry)->param0 = (call_entry_param_t)(p0); \
68 (entry)->state = IDLE; \
69 MACRO_END
70
71 #endif /* MACH_KERNEL_PRIVATE */
72
73 #endif /* _KERN_CALL_ENTRY_H_ */