]> git.saurik.com Git - apple/xnu.git/blob - osfmk/mach/sync.defs
2c919be543d91fdec1ceeb6df1a4b3ffafedbb01
[apple/xnu.git] / osfmk / mach / sync.defs
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The 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, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23 /*
24 * @OSF_COPYRIGHT@
25 *
26 */
27 /*
28 * File: mach/sync.defs
29 * Author: Joseph CaraDonna
30 *
31 * Exported kernel calls
32 *
33 */
34
35 subsystem
36 #if KERNEL_SERVER
37 KernelServer
38 #endif /* KERNEL_SERVER */
39 sync 617000;
40
41 #include <mach/std_types.defs>
42 #include <mach/mach_types.defs>
43 #include <mach/clock_types.defs>
44
45 #if KERNEL_SERVER
46 import <kern/sync_lock.h>;
47 import <kern/sync_sema.h>;
48 import <kern/ipc_sync.h>;
49 #endif /* KERNEL_SERVER */
50
51
52 type semaphore_t = mach_port_t
53 ctype: mach_port_t
54 #if KERNEL_SERVER
55 intran: semaphore_t convert_port_to_semaphore(mach_port_t)
56 outtran: mach_port_t convert_semaphore_to_port(semaphore_t)
57 destructor: semaphore_dereference(semaphore_t)
58 #endif /* KERNEL_SERVER */
59 ;
60
61 type semaphore_consume_ref_t = mach_port_move_send_t
62 ctype: mach_port_t
63 #if KERNEL_SERVER
64 intran: semaphore_t convert_port_to_semaphore(mach_port_t)
65 destructor: semaphore_dereference(semaphore_t)
66 #endif /* KERNEL_SERVER */
67 ;
68
69 type lock_set_t = mach_port_t
70 ctype: mach_port_t
71 #if KERNEL_SERVER
72 intran: lock_set_t convert_port_to_lock_set(mach_port_t)
73 outtran: mach_port_t convert_lock_set_to_port(lock_set_t)
74 destructor: lock_set_dereference(lock_set_t)
75 #endif /* KERNEL_SERVER */
76 ;
77
78
79 routine semaphore_create(
80 task : task_t;
81 out semaphore : semaphore_t;
82 policy : int;
83 value : int);
84
85 routine semaphore_destroy(
86 task : task_t;
87 semaphore : semaphore_consume_ref_t);
88
89 routine semaphore_signal(
90 semaphore : semaphore_t);
91
92 routine semaphore_signal_all(
93 semaphore : semaphore_t);
94
95 routine semaphore_wait(
96 semaphore : semaphore_t);
97
98 routine lock_set_create(
99 task : task_t;
100 out new_lock_set : lock_set_t;
101 n_ulocks : int;
102 policy : int);
103
104 routine lock_set_destroy(
105 task : task_t;
106 lock_set : lock_set_t);
107
108 routine lock_acquire(
109 lock_set : lock_set_t;
110 lock_id : int);
111
112 routine lock_release(
113 lock_set : lock_set_t;
114 lock_id : int);
115
116 routine lock_try(
117 lock_set : lock_set_t;
118 lock_id : int);
119
120 routine lock_make_stable(
121 lock_set : lock_set_t;
122 lock_id : int);
123
124 routine lock_handoff(
125 lock_set : lock_set_t;
126 lock_id : int);
127
128 routine lock_handoff_accept(
129 lock_set : lock_set_t;
130 lock_id : int);
131
132 routine semaphore_signal_thread(
133 semaphore : semaphore_t;
134 thread : thread_act_t);
135
136 routine semaphore_timedwait(
137 semaphore : semaphore_t;
138 wait_time : mach_timespec_t);