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