FreeBSD/Linux Kernel Cross Reference
sys/kern/eventcount.h
1 /*
2 * Mach Operating System
3 * Copyright (c) 1993-1987 Carnegie Mellon University
4 * All Rights Reserved.
5 *
6 * Permission to use, copy, modify and distribute this software and its
7 * documentation is hereby granted, provided that both the copyright
8 * notice and this permission notice appear in all copies of the
9 * software, derivative works or modified versions, and any portions
10 * thereof, and that both notices appear in supporting documentation.
11 *
12 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15 *
16 * Carnegie Mellon requests users of this software to return to
17 *
18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 * School of Computer Science
20 * Carnegie Mellon University
21 * Pittsburgh PA 15213-3890
22 *
23 * any improvements or extensions that they make and grant Carnegie Mellon
24 * the rights to redistribute these changes.
25 */
26 /*
27 * HISTORY
28 * $Log: eventcount.h,v $
29 * Revision 2.6 93/08/10 15:12:05 mrt
30 * Changed ev_id to natural_t to match the changes in
31 * eventcount.c
32 * [93/08/03 mrt]
33 *
34 * Revision 2.5 93/01/24 13:18:53 danner
35 * Prototypes, evc_notify_abort.
36 * [93/01/22 danner]
37 *
38 * Revision 2.4 93/01/14 17:34:03 danner
39 * Allow count to go negative.
40 * [92/12/15 af]
41 *
42 * Revision 2.3 92/01/03 20:40:10 dbg
43 * Added id field to make user-safe. Since we have not
44 * decided what the user-interface will look like (and
45 * we are using it nonetheless) do not define anything.
46 * [91/12/27 af]
47 *
48 * Revision 2.2 91/12/13 14:54:47 jsb
49 * Created.
50 * [91/11/01 af]
51 *
52 */
53 /*
54 * File: eventcount.c
55 * Author: Alessandro Forin
56 * Date: 10/91
57 *
58 * Eventcounters, for user-level drivers synchronization
59 *
60 */
61
62 #ifndef _KERN_EVENTCOUNT_H_
63 #define _KERN_EVENTCOUNT_H_ 1
64
65 /* kernel visible only */
66
67 typedef struct evc {
68 int count;
69 thread_t waiting_thread;
70 natural_t ev_id;
71 struct evc *sanity;
72 decl_simple_lock_data(, lock)
73 } *evc_t;
74
75 extern void evc_init(evc_t ev),
76 evc_destroy(evc_t ev),
77 evc_signal(evc_t ev),
78 evc_notify_abort(thread_t thread);
79
80 /* kernel and user visible */
81
82 extern kern_return_t evc_wait(natural_t ev_id);
83
84 #endif /* _KERN_EVENTCOUNT_H_ */
Cache object: c14fbf61a5d0f8e8a97dbfaeb7a53e25
|