]> git.saurik.com Git - apple/xnu.git/blame - osfmk/mach/sync.defs
xnu-344.49.tar.gz
[apple/xnu.git] / osfmk / mach / sync.defs
CommitLineData
1c79356b
A
1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
43866e37 6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
1c79356b 7 *
43866e37
A
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * file.
14 *
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
1c79356b
A
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
43866e37
A
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
1c79356b
A
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25/*
26 * @OSF_COPYRIGHT@
27 *
28 */
29/*
30 * File: mach/sync.defs
31 * Author: Joseph CaraDonna
32 *
33 * Exported kernel calls
34 *
35 */
36
37subsystem
38#if KERNEL_SERVER
39 KernelServer
40#endif /* KERNEL_SERVER */
41 sync 617000;
42
43#include <mach/std_types.defs>
44#include <mach/mach_types.defs>
45#include <mach/clock_types.defs>
46
47#if KERNEL_SERVER
48import <kern/sync_lock.h>;
49import <kern/sync_sema.h>;
50import <kern/ipc_sync.h>;
51#endif /* KERNEL_SERVER */
52
53
54type semaphore_t = mach_port_t
55 ctype: mach_port_t
56#if KERNEL_SERVER
57 intran: semaphore_t convert_port_to_semaphore(mach_port_t)
58 outtran: mach_port_t convert_semaphore_to_port(semaphore_t)
59 destructor: semaphore_dereference(semaphore_t)
60#endif /* KERNEL_SERVER */
61 ;
62
63type semaphore_consume_ref_t = mach_port_move_send_t
64 ctype: mach_port_t
65#if KERNEL_SERVER
66 intran: semaphore_t convert_port_to_semaphore(mach_port_t)
67 destructor: semaphore_dereference(semaphore_t)
68#endif /* KERNEL_SERVER */
69 ;
70
71type lock_set_t = mach_port_t
72 ctype: mach_port_t
73#if KERNEL_SERVER
74 intran: lock_set_t convert_port_to_lock_set(mach_port_t)
75 outtran: mach_port_t convert_lock_set_to_port(lock_set_t)
76 destructor: lock_set_dereference(lock_set_t)
77#endif /* KERNEL_SERVER */
78 ;
79
80
81routine semaphore_create(
82 task : task_t;
83 out semaphore : semaphore_t;
84 policy : int;
85 value : int);
86
87routine semaphore_destroy(
88 task : task_t;
89 semaphore : semaphore_consume_ref_t);
90
91routine semaphore_signal(
92 semaphore : semaphore_t);
93
94routine semaphore_signal_all(
95 semaphore : semaphore_t);
96
97routine semaphore_wait(
98 semaphore : semaphore_t);
99
100routine lock_set_create(
101 task : task_t;
102 out new_lock_set : lock_set_t;
103 n_ulocks : int;
104 policy : int);
105
106routine lock_set_destroy(
107 task : task_t;
108 lock_set : lock_set_t);
109
110routine lock_acquire(
111 lock_set : lock_set_t;
112 lock_id : int);
113
114routine lock_release(
115 lock_set : lock_set_t;
116 lock_id : int);
117
118routine lock_try(
119 lock_set : lock_set_t;
120 lock_id : int);
121
122routine lock_make_stable(
123 lock_set : lock_set_t;
124 lock_id : int);
125
126routine lock_handoff(
127 lock_set : lock_set_t;
128 lock_id : int);
129
130routine lock_handoff_accept(
131 lock_set : lock_set_t;
132 lock_id : int);
133
134routine semaphore_signal_thread(
135 semaphore : semaphore_t;
136 thread : thread_act_t);
137
138routine semaphore_timedwait(
139 semaphore : semaphore_t;
140 wait_time : mach_timespec_t);