2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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
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.
21 * @APPLE_LICENSE_HEADER_END@
28 * File: mach/sync.defs
29 * Author: Joseph CaraDonna
31 * Exported kernel calls
38 #endif /* KERNEL_SERVER */
41 #include <mach/std_types.defs>
42 #include <mach/mach_types.defs>
43 #include <mach/clock_types.defs>
46 import <kern/sync_lock.h>;
47 import <kern/sync_sema.h>;
48 import <kern/ipc_sync.h>;
49 #endif /* KERNEL_SERVER */
52 type semaphore_t = mach_port_t
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 */
61 type semaphore_consume_ref_t = mach_port_move_send_t
64 intran: semaphore_t convert_port_to_semaphore(mach_port_t)
65 destructor: semaphore_dereference(semaphore_t)
66 #endif /* KERNEL_SERVER */
69 type lock_set_t = mach_port_t
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 */
79 routine semaphore_create(
81 out semaphore : semaphore_t;
85 routine semaphore_destroy(
87 semaphore : semaphore_consume_ref_t);
89 routine semaphore_signal(
90 semaphore : semaphore_t);
92 routine semaphore_signal_all(
93 semaphore : semaphore_t);
95 routine semaphore_wait(
96 semaphore : semaphore_t);
98 routine lock_set_create(
100 out new_lock_set : lock_set_t;
104 routine lock_set_destroy(
106 lock_set : lock_set_t);
108 routine lock_acquire(
109 lock_set : lock_set_t;
112 routine lock_release(
113 lock_set : lock_set_t;
117 lock_set : lock_set_t;
120 routine lock_make_stable(
121 lock_set : lock_set_t;
124 routine lock_handoff(
125 lock_set : lock_set_t;
128 routine lock_handoff_accept(
129 lock_set : lock_set_t;
132 routine semaphore_signal_thread(
133 semaphore : semaphore_t;
134 thread : thread_act_t);
136 routine semaphore_timedwait(
137 semaphore : semaphore_t;
138 wait_time : mach_timespec_t);