|
|
1.1 root 1: /*
2: * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3: *
4: * @APPLE_LICENSE_HEADER_START@
5: *
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.
11: *
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
18: * under the License.
19: *
20: * @APPLE_LICENSE_HEADER_END@
21: */
22: /*
23: * @OSF_COPYRIGHT@
24: *
25: */
26: /*
27: * File: mach/sync.defs
28: * Author: Joseph CaraDonna
29: *
30: * Exported kernel calls
31: *
32: */
33:
34: subsystem
35: #if KERNEL_SERVER
36: KernelServer
37: #endif /* KERNEL_SERVER */
38: sync 617000;
39:
40: #include <mach/std_types.defs>
41: #include <mach/mach_types.defs>
42: #include <mach/clock_types.defs>
43:
44: #if KERNEL_SERVER
45: import <kern/sync_lock.h>;
46: import <kern/sync_sema.h>;
47: import <kern/ipc_sync.h>;
48: #endif /* KERNEL_SERVER */
49:
50:
51: type semaphore_t = mach_port_t
52: ctype: mach_port_t
53: #if KERNEL_SERVER
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 */
58: ;
59:
60: type semaphore_consume_ref_t = mach_port_move_send_t
61: ctype: mach_port_t
62: #if KERNEL_SERVER
63: intran: semaphore_t convert_port_to_semaphore(mach_port_t)
64: destructor: semaphore_dereference(semaphore_t)
65: #endif /* KERNEL_SERVER */
66: ;
67:
68: type lock_set_t = mach_port_t
69: ctype: mach_port_t
70: #if KERNEL_SERVER
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 */
75: ;
76:
77:
78: routine semaphore_create(
79: task : task_t;
80: out semaphore : semaphore_t;
81: policy : int;
82: value : int);
83:
84: routine semaphore_destroy(
85: task : task_t;
86: semaphore : semaphore_consume_ref_t);
87:
88: routine semaphore_signal(
89: semaphore : semaphore_t);
90:
91: routine semaphore_signal_all(
92: semaphore : semaphore_t);
93:
94: routine semaphore_wait(
95: semaphore : semaphore_t);
96:
97: routine lock_set_create(
98: task : task_t;
99: out new_lock_set : lock_set_t;
100: n_ulocks : int;
101: policy : int);
102:
103: routine lock_set_destroy(
104: task : task_t;
105: lock_set : lock_set_t);
106:
107: routine lock_acquire(
108: lock_set : lock_set_t;
109: lock_id : int);
110:
111: routine lock_release(
112: lock_set : lock_set_t;
113: lock_id : int);
114:
115: routine lock_try(
116: lock_set : lock_set_t;
117: lock_id : int);
118:
119: routine lock_make_stable(
120: lock_set : lock_set_t;
121: lock_id : int);
122:
123: routine lock_handoff(
124: lock_set : lock_set_t;
125: lock_id : int);
126:
127: routine lock_handoff_accept(
128: lock_set : lock_set_t;
129: lock_id : int);
130:
131: routine semaphore_signal_thread(
132: semaphore : semaphore_t;
133: thread : thread_act_t);
134:
135: routine semaphore_timedwait(
136: semaphore : semaphore_t;
137: wait_time : mach_timespec_t);
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.