2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
27 * File: mach/sync.defs
28 * Author: Joseph CaraDonna
30 * Exported kernel calls
37 #endif /* KERNEL_SERVER */
40 #include <mach/std_types.defs>
41 #include <mach/mach_types.defs>
42 #include <mach/clock_types.defs>
45 import <kern/sync_lock.h>;
46 import <kern/sync_sema.h>;
47 import <kern/ipc_sync.h>;
48 #endif /* KERNEL_SERVER */
51 type semaphore_t = mach_port_t
54 intran: semaphore_t convert_port_to_semaphore(mach_port_t)
55 outtran: mach_port_t convert_semaphore_to_port(semaphore_t)
56 destructor: semaphore_dereference(semaphore_t)
57 #endif /* KERNEL_SERVER */
60 type semaphore_consume_ref_t = mach_port_move_send_t
63 intran: semaphore_t convert_port_to_semaphore(mach_port_t)
64 destructor: semaphore_dereference(semaphore_t)
65 #endif /* KERNEL_SERVER */
68 type lock_set_t = mach_port_t
71 intran: lock_set_t convert_port_to_lock_set(mach_port_t)
72 outtran: mach_port_t convert_lock_set_to_port(lock_set_t)
73 destructor: lock_set_dereference(lock_set_t)
74 #endif /* KERNEL_SERVER */
78 routine semaphore_create(
80 out semaphore : semaphore_t;
84 routine semaphore_destroy(
86 semaphore : semaphore_consume_ref_t);
88 routine semaphore_signal(
89 semaphore : semaphore_t);
91 routine semaphore_signal_all(
92 semaphore : semaphore_t);
94 routine semaphore_wait(
95 semaphore : semaphore_t);
97 routine lock_set_create(
99 out new_lock_set : lock_set_t;
103 routine lock_set_destroy(
105 lock_set : lock_set_t);
107 routine lock_acquire(
108 lock_set : lock_set_t;
111 routine lock_release(
112 lock_set : lock_set_t;
116 lock_set : lock_set_t;
119 routine lock_make_stable(
120 lock_set : lock_set_t;
123 routine lock_handoff(
124 lock_set : lock_set_t;
127 routine lock_handoff_accept(
128 lock_set : lock_set_t;
131 routine semaphore_signal_thread(
132 semaphore : semaphore_t;
133 thread : thread_act_t);
135 routine semaphore_timedwait(
136 semaphore : semaphore_t;
137 wait_time : mach_timespec_t);