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