VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.9.0/syncsrv.h@ 61386

最後變更 在這個檔案從61386是 32163,由 vboxsync 提交於 14 年 前

Additions/x11/x11include: additional headers for building drivers for X.Org Server 1.9

  • 屬性 svn:eol-style 設為 native
檔案大小: 5.4 KB
 
1/*
2
3Copyright 1991, 1993, 1994, 1998 The Open Group
4
5Permission to use, copy, modify, distribute, and sell this software and its
6documentation for any purpose is hereby granted without fee, provided that
7the above copyright notice appear in all copies and that both that
8copyright notice and this permission notice appear in supporting
9documentation.
10
11The above copyright notice and this permission notice shall be included in
12all copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
21Except as contained in this notice, the name of The Open Group shall not be
22used in advertising or otherwise to promote the sale, use or other dealings
23in this Software without prior written authorization from The Open Group.
24
25*/
26
27/***********************************************************
28Copyright 1991,1993 by Digital Equipment Corporation, Maynard, Massachusetts,
29and Olivetti Research Limited, Cambridge, England.
30
31 All Rights Reserved
32
33Permission to use, copy, modify, and distribute this software and its
34documentation for any purpose and without fee is hereby granted,
35provided that the above copyright notice appear in all copies and that
36both that copyright notice and this permission notice appear in
37supporting documentation, and that the names of Digital or Olivetti
38not be used in advertising or publicity pertaining to distribution of the
39software without specific, written prior permission.
40
41DIGITAL AND OLIVETTI DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
42SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
43FITNESS, IN NO EVENT SHALL THEY BE LIABLE FOR ANY SPECIAL, INDIRECT OR
44CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
45USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
46OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
47PERFORMANCE OF THIS SOFTWARE.
48
49******************************************************************/
50
51#ifndef _SYNCSRV_H_
52#define _SYNCSRV_H_
53
54#define CARD64 XSyncValue /* XXX temporary! need real 64 bit values for Alpha */
55
56typedef struct _SyncCounter {
57 ClientPtr client; /* Owning client. 0 for system counters */
58 XSyncCounter id; /* resource ID */
59 CARD64 value; /* counter value */
60 struct _SyncTriggerList *pTriglist; /* list of triggers */
61 Bool beingDestroyed; /* in process of going away */
62 struct _SysCounterInfo *pSysCounterInfo; /* NULL if not a system counter */
63} SyncCounter;
64
65/*
66 * The System Counter interface
67 */
68
69typedef enum {
70 XSyncCounterNeverChanges,
71 XSyncCounterNeverIncreases,
72 XSyncCounterNeverDecreases,
73 XSyncCounterUnrestricted
74} SyncCounterType;
75
76typedef struct _SysCounterInfo {
77 char *name;
78 CARD64 resolution;
79 CARD64 bracket_greater;
80 CARD64 bracket_less;
81 SyncCounterType counterType; /* how can this counter change */
82 void (*QueryValue)(
83 pointer /*pCounter*/,
84 CARD64 * /*freshvalue*/
85);
86 void (*BracketValues)(
87 pointer /*pCounter*/,
88 CARD64 * /*lessthan*/,
89 CARD64 * /*greaterthan*/
90);
91} SysCounterInfo;
92
93
94
95typedef struct _SyncTrigger {
96 SyncCounter *pCounter;
97 CARD64 wait_value; /* wait value */
98 unsigned int value_type; /* Absolute or Relative */
99 unsigned int test_type; /* transition or Comparision type */
100 CARD64 test_value; /* trigger event threshold value */
101 Bool (*CheckTrigger)(
102 struct _SyncTrigger * /*pTrigger*/,
103 CARD64 /*newval*/
104 );
105 void (*TriggerFired)(
106 struct _SyncTrigger * /*pTrigger*/
107 );
108 void (*CounterDestroyed)(
109 struct _SyncTrigger * /*pTrigger*/
110 );
111} SyncTrigger;
112
113typedef struct _SyncTriggerList {
114 SyncTrigger *pTrigger;
115 struct _SyncTriggerList *next;
116} SyncTriggerList;
117
118typedef struct _SyncAlarmClientList {
119 ClientPtr client;
120 XID delete_id;
121 struct _SyncAlarmClientList *next;
122} SyncAlarmClientList;
123
124typedef struct _SyncAlarm {
125 SyncTrigger trigger;
126 ClientPtr client;
127 XSyncAlarm alarm_id;
128 CARD64 delta;
129 int events;
130 int state;
131 SyncAlarmClientList *pEventClients;
132} SyncAlarm;
133
134typedef struct {
135 ClientPtr client;
136 CARD32 delete_id;
137 int num_waitconditions;
138} SyncAwaitHeader;
139
140typedef struct {
141 SyncTrigger trigger;
142 CARD64 event_threshold;
143 SyncAwaitHeader *pHeader;
144} SyncAwait;
145
146typedef union {
147 SyncAwaitHeader header;
148 SyncAwait await;
149} SyncAwaitUnion;
150
151
152extern pointer SyncCreateSystemCounter(
153 char * /* name */,
154 CARD64 /* inital_value */,
155 CARD64 /* resolution */,
156 SyncCounterType /* change characterization */,
157 void (* /*QueryValue*/ ) (
158 pointer /* pCounter */,
159 CARD64 * /* pValue_return */), /* XXX prototype */
160 void (* /*BracketValues*/) (
161 pointer /* pCounter */,
162 CARD64 * /* pbracket_less */,
163 CARD64 * /* pbracket_greater */)
164);
165
166extern void SyncChangeCounter(
167 SyncCounter * /* pCounter*/,
168 CARD64 /* new_value */
169);
170
171extern void SyncDestroySystemCounter(
172 pointer pCounter
173);
174extern void InitServertime(void);
175
176extern void SyncExtensionInit(void);
177#endif /* _SYNCSRV_H_ */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette