1 /* $Xorg: syncstr.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */
4 Copyright 1991, 1993, 1994, 1998 The Open Group
6 Permission to use, copy, modify, distribute, and sell this software and its
7 documentation for any purpose is hereby granted without fee, provided that
8 the above copyright notice appear in all copies and that both that
9 copyright notice and this permission notice appear in supporting
12 The above copyright notice and this permission notice shall be included in
13 all copies or substantial portions of the Software.
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 Except as contained in this notice, the name of The Open Group shall not be
23 used in advertising or otherwise to promote the sale, use or other dealings
24 in this Software without prior written authorization from The Open Group.
28 /***********************************************************
29 Copyright 1991,1993 by Digital Equipment Corporation, Maynard, Massachusetts,
30 and Olivetti Research Limited, Cambridge, England.
34 Permission to use, copy, modify, and distribute this software and its
35 documentation for any purpose and without fee is hereby granted,
36 provided that the above copyright notice appear in all copies and that
37 both that copyright notice and this permission notice appear in
38 supporting documentation, and that the names of Digital or Olivetti
39 not be used in advertising or publicity pertaining to distribution of the
40 software without specific, written prior permission.
42 DIGITAL AND OLIVETTI DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
43 SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
44 FITNESS, IN NO EVENT SHALL THEY BE LIABLE FOR ANY SPECIAL, INDIRECT OR
45 CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
46 USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
47 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
48 PERFORMANCE OF THIS SOFTWARE.
50 ******************************************************************/
51 /* $XFree86: xc/include/extensions/syncstr.h,v 1.3 2003/07/16 01:38:24 dawes Exp $ */
56 #include <X11/extensions/syncproto.h>
60 #define CARD64 XSyncValue /* XXX temporary! need real 64 bit values for Alpha */
62 typedef struct _SyncCounter {
63 ClientPtr client; /* Owning client. 0 for system counters */
64 XSyncCounter id; /* resource ID */
65 CARD64 value; /* counter value */
66 struct _SyncTriggerList *pTriglist; /* list of triggers */
67 Bool beingDestroyed; /* in process of going away */
68 struct _SysCounterInfo *pSysCounterInfo; /* NULL if not a system counter */
72 * The System Counter interface
76 XSyncCounterNeverChanges,
77 XSyncCounterNeverIncreases,
78 XSyncCounterNeverDecreases,
79 XSyncCounterUnrestricted
82 typedef struct _SysCounterInfo {
85 CARD64 bracket_greater;
87 SyncCounterType counterType; /* how can this counter change */
90 CARD64 * /*freshvalue*/
92 void (*BracketValues)(
94 CARD64 * /*lessthan*/,
95 CARD64 * /*greaterthan*/
101 typedef struct _SyncTrigger {
102 SyncCounter *pCounter;
103 CARD64 wait_value; /* wait value */
104 unsigned int value_type; /* Absolute or Relative */
105 unsigned int test_type; /* transition or Comparision type */
106 CARD64 test_value; /* trigger event threshold value */
107 Bool (*CheckTrigger)(
108 struct _SyncTrigger * /*pTrigger*/,
111 void (*TriggerFired)(
112 struct _SyncTrigger * /*pTrigger*/
114 void (*CounterDestroyed)(
115 struct _SyncTrigger * /*pTrigger*/
119 typedef struct _SyncTriggerList {
120 SyncTrigger *pTrigger;
121 struct _SyncTriggerList *next;
124 typedef struct _SyncAlarmClientList {
127 struct _SyncAlarmClientList *next;
128 } SyncAlarmClientList;
130 typedef struct _SyncAlarm {
137 SyncAlarmClientList *pEventClients;
143 int num_waitconditions;
148 CARD64 event_threshold;
149 SyncAwaitHeader *pHeader;
153 SyncAwaitHeader header;
158 extern pointer SyncCreateSystemCounter(
160 CARD64 /* inital_value */,
161 CARD64 /* resolution */,
162 SyncCounterType /* change characterization */,
163 void (* /*QueryValue*/ ) (
164 pointer /* pCounter */,
165 CARD64 * /* pValue_return */), /* XXX prototype */
166 void (* /*BracketValues*/) (
167 pointer /* pCounter */,
168 CARD64 * /* pbracket_less */,
169 CARD64 * /* pbracket_greater */)
172 extern void SyncChangeCounter(
173 SyncCounter * /* pCounter*/,
174 CARD64 /* new_value */
177 extern void SyncDestroySystemCounter(
180 extern void InitServertime(void);
182 #endif /* _SYNC_SERVER */
184 #endif /* _SYNCSTR_H_ */