2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
33 * File: mach/sync.defs
34 * Author: Joseph CaraDonna
36 * Exported kernel calls
43 #endif /* KERNEL_SERVER */
46 #include <mach/std_types.defs>
47 #include <mach/mach_types.defs>
48 #include <mach/clock_types.defs>
51 import <kern/sync_lock.h>;
52 import <kern/sync_sema.h>;
53 import <kern/ipc_sync.h>;
54 #endif /* KERNEL_SERVER */
57 type semaphore_t = mach_port_t
60 intran: semaphore_t convert_port_to_semaphore(mach_port_t)
61 outtran: mach_port_t convert_semaphore_to_port(semaphore_t)
62 destructor: semaphore_dereference(semaphore_t)
63 #endif /* KERNEL_SERVER */
66 type semaphore_consume_ref_t = mach_port_move_send_t
69 intran: semaphore_t convert_port_to_semaphore(mach_port_t)
70 destructor: semaphore_dereference(semaphore_t)
71 #endif /* KERNEL_SERVER */
74 type lock_set_t = mach_port_t
77 intran: lock_set_t convert_port_to_lock_set(mach_port_t)
78 outtran: mach_port_t convert_lock_set_to_port(lock_set_t)
79 destructor: lock_set_dereference(lock_set_t)
80 #endif /* KERNEL_SERVER */
84 routine semaphore_create(
86 out semaphore : semaphore_t;
90 routine semaphore_destroy(
92 semaphore : semaphore_consume_ref_t);
94 routine semaphore_signal(
95 semaphore : semaphore_t);
97 routine semaphore_signal_all(
98 semaphore : semaphore_t);
100 routine semaphore_wait(
101 semaphore : semaphore_t);
103 routine lock_set_create(
105 out new_lock_set : lock_set_t;
109 routine lock_set_destroy(
111 lock_set : lock_set_t);
113 routine lock_acquire(
114 lock_set : lock_set_t;
117 routine lock_release(
118 lock_set : lock_set_t;
122 lock_set : lock_set_t;
125 routine lock_make_stable(
126 lock_set : lock_set_t;
129 routine lock_handoff(
130 lock_set : lock_set_t;
133 routine lock_handoff_accept(
134 lock_set : lock_set_t;
137 routine semaphore_signal_thread(
138 semaphore : semaphore_t;
139 thread : thread_act_t);
141 routine semaphore_timedwait(
142 semaphore : semaphore_t;
143 wait_time : mach_timespec_t);
145 /* vim: set ft=c : */