2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
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
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
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
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.
23 * @APPLE_LICENSE_HEADER_END@
30 * File: mach/sync.defs
31 * Author: Joseph CaraDonna
33 * Exported kernel calls
40 #endif /* KERNEL_SERVER */
43 #include <mach/std_types.defs>
44 #include <mach/mach_types.defs>
45 #include <mach/clock_types.defs>
48 import <kern/sync_lock.h>;
49 import <kern/sync_sema.h>;
50 import <kern/ipc_sync.h>;
51 #endif /* KERNEL_SERVER */
54 type semaphore_t = mach_port_t
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 */
63 type semaphore_consume_ref_t = mach_port_move_send_t
66 intran: semaphore_t convert_port_to_semaphore(mach_port_t)
67 destructor: semaphore_dereference(semaphore_t)
68 #endif /* KERNEL_SERVER */
71 type lock_set_t = mach_port_t
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 */
81 routine semaphore_create(
83 out semaphore : semaphore_t;
87 routine semaphore_destroy(
89 semaphore : semaphore_consume_ref_t);
91 routine semaphore_signal(
92 semaphore : semaphore_t);
94 routine semaphore_signal_all(
95 semaphore : semaphore_t);
97 routine semaphore_wait(
98 semaphore : semaphore_t);
100 routine lock_set_create(
102 out new_lock_set : lock_set_t;
106 routine lock_set_destroy(
108 lock_set : lock_set_t);
110 routine lock_acquire(
111 lock_set : lock_set_t;
114 routine lock_release(
115 lock_set : lock_set_t;
119 lock_set : lock_set_t;
122 routine lock_make_stable(
123 lock_set : lock_set_t;
126 routine lock_handoff(
127 lock_set : lock_set_t;
130 routine lock_handoff_accept(
131 lock_set : lock_set_t;
134 routine semaphore_signal_thread(
135 semaphore : semaphore_t;
136 thread : thread_act_t);
138 routine semaphore_timedwait(
139 semaphore : semaphore_t;
140 wait_time : mach_timespec_t);