Home | History | Annotate | Download | only in extensions
      1 /*
      2 
      3 Copyright 1991, 1993, 1994, 1998  The Open Group
      4 
      5 Permission to use, copy, modify, distribute, and sell this software and its
      6 documentation for any purpose is hereby granted without fee, provided that
      7 the above copyright notice appear in all copies and that both that
      8 copyright notice and this permission notice appear in supporting
      9 documentation.
     10 
     11 The above copyright notice and this permission notice shall be included in
     12 all copies or substantial portions of the Software.
     13 
     14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
     17 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
     18 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
     19 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     20 
     21 Except as contained in this notice, the name of The Open Group shall not be
     22 used in advertising or otherwise to promote the sale, use or other dealings
     23 in this Software without prior written authorization from The Open Group.
     24 
     25 */
     26 
     27 /***********************************************************
     28 Copyright 1991,1993 by Digital Equipment Corporation, Maynard, Massachusetts,
     29 and Olivetti Research Limited, Cambridge, England.
     30 
     31                         All Rights Reserved
     32 
     33 Permission to use, copy, modify, and distribute this software and its
     34 documentation for any purpose and without fee is hereby granted,
     35 provided that the above copyright notice appear in all copies and that
     36 both that copyright notice and this permission notice appear in
     37 supporting documentation, and that the names of Digital or Olivetti
     38 not be used in advertising or publicity pertaining to distribution of the
     39 software without specific, written prior permission.
     40 
     41 DIGITAL AND OLIVETTI DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
     42 SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
     43 FITNESS, IN NO EVENT SHALL THEY BE LIABLE FOR ANY SPECIAL, INDIRECT OR
     44 CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
     45 USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
     46 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
     47 PERFORMANCE OF THIS SOFTWARE.
     48 
     49 ******************************************************************/
     50 
     51 #ifndef _SYNCPROTO_H_
     52 #define _SYNCPROTO_H_
     53 
     54 #include <X11/extensions/syncconst.h>
     55 
     56 #define X_SyncInitialize		0
     57 #define X_SyncListSystemCounters	1
     58 #define X_SyncCreateCounter		2
     59 #define X_SyncSetCounter		3
     60 #define X_SyncChangeCounter		4
     61 #define X_SyncQueryCounter              5
     62 #define X_SyncDestroyCounter		6
     63 #define X_SyncAwait			7
     64 #define X_SyncCreateAlarm               8
     65 #define X_SyncChangeAlarm	        9
     66 #define X_SyncQueryAlarm	       10
     67 #define X_SyncDestroyAlarm	       11
     68 #define X_SyncSetPriority   	       12
     69 #define X_SyncGetPriority   	       13
     70 #define X_SyncCreateFence	       14
     71 #define X_SyncTriggerFence	       15
     72 #define X_SyncResetFence	       16
     73 #define X_SyncDestroyFence	       17
     74 #define X_SyncQueryFence	       18
     75 #define X_SyncAwaitFence	       19
     76 
     77 /* cover up types from sync.h to make sure they're the right size for
     78  * protocol packaging.  These will be undef'ed after all the protocol
     79  * structures are defined.
     80  */
     81 #define XSyncCounter CARD32
     82 #define XSyncAlarm   CARD32
     83 #define XSyncFence   CARD32
     84 #define Drawable     CARD32
     85 
     86 /*
     87  * Initialize
     88  */
     89 typedef struct _xSyncInitialize {
     90     CARD8	reqType;
     91     CARD8	syncReqType;
     92     CARD16	length B16;
     93     CARD8	majorVersion;
     94     CARD8	minorVersion;
     95     CARD16	pad B16;
     96 } xSyncInitializeReq;
     97 #define sz_xSyncInitializeReq		8
     98 
     99 typedef struct {
    100     BYTE	type;
    101     CARD8	unused;
    102     CARD16	sequenceNumber B16;
    103     CARD32	length B32;
    104     CARD8	majorVersion;
    105     CARD8	minorVersion;
    106     CARD16	pad B16;
    107     CARD32	pad0 B32;
    108     CARD32	pad1 B32;
    109     CARD32	pad2 B32;
    110     CARD32	pad3 B32;
    111     CARD32	pad4 B32;
    112 } xSyncInitializeReply;
    113 #define sz_xSyncInitializeReply	32
    114 
    115 /*
    116  * ListSystemCounters
    117  */
    118 typedef struct _xSyncListSystemCounters
    119 {
    120     CARD8	reqType;
    121     CARD8	syncReqType;
    122     CARD16	length B16;
    123 } xSyncListSystemCountersReq;
    124 #define sz_xSyncListSystemCountersReq	4
    125 
    126 typedef struct {
    127     BYTE	type;
    128     CARD8	unused;
    129     CARD16	sequenceNumber B16;
    130     CARD32	length B32;
    131     INT32	nCounters B32;
    132     CARD32	pad0 B32;
    133     CARD32	pad1 B32;
    134     CARD32	pad2 B32;
    135     CARD32	pad3 B32;
    136     CARD32	pad4 B32;
    137 } xSyncListSystemCountersReply;
    138 #define sz_xSyncListSystemCountersReply	32
    139 
    140 typedef struct {
    141     XSyncCounter counter B32;
    142     INT32	resolution_hi B32;
    143     CARD32	resolution_lo B32;
    144     CARD16	name_length B16;
    145 } xSyncSystemCounter;
    146 #define sz_xSyncSystemCounter 14
    147 
    148 /*
    149  * Create Counter
    150  */
    151 typedef struct _xSyncCreateCounterReq {
    152     CARD8	reqType;
    153     CARD8	syncReqType;
    154     CARD16	length B16;
    155     XSyncCounter cid B32;
    156     INT32       initial_value_hi B32;
    157     CARD32	initial_value_lo B32;
    158 } xSyncCreateCounterReq;
    159 #define sz_xSyncCreateCounterReq	16
    160 
    161 /*
    162  * Change Counter
    163  */
    164 typedef struct _xSyncChangeCounterReq {
    165     CARD8	reqType;
    166     CARD8	syncReqType;
    167     CARD16	length B16;
    168     XSyncCounter cid B32;
    169     INT32       value_hi B32;
    170     CARD32	value_lo B32;
    171 } xSyncChangeCounterReq;
    172 #define sz_xSyncChangeCounterReq	16
    173 
    174 /*
    175  * Set Counter
    176  */
    177 typedef struct _xSyncSetCounterReq {
    178     CARD8	reqType;
    179     CARD8	syncReqType;
    180     CARD16	length B16;
    181     XSyncCounter cid B32;
    182     INT32       value_hi B32;
    183     CARD32	value_lo B32;
    184 } xSyncSetCounterReq;
    185 #define sz_xSyncSetCounterReq	16
    186 
    187 /*
    188  * Destroy Counter
    189  */
    190 typedef struct _xSyncDestroyCounterReq {
    191     CARD8	reqType;
    192     CARD8	syncReqType;
    193     CARD16	length B16;
    194     XSyncCounter counter B32;
    195 } xSyncDestroyCounterReq;
    196 #define sz_xSyncDestroyCounterReq	8
    197 
    198 /*
    199  * Query Counter
    200  */
    201 typedef struct _xSyncQueryCounterReq {
    202     CARD8	reqType;
    203     CARD8	syncReqType;
    204     CARD16	length B16;
    205     XSyncCounter counter B32;
    206 } xSyncQueryCounterReq;
    207 #define sz_xSyncQueryCounterReq		8
    208 
    209 
    210 typedef struct {
    211     BYTE	type;
    212     CARD8	unused;
    213     CARD16	sequenceNumber B16;
    214     CARD32	length B32;
    215     INT32	value_hi B32;
    216     CARD32	value_lo B32;
    217     CARD32	pad0 B32;
    218     CARD32	pad1 B32;
    219     CARD32	pad2 B32;
    220     CARD32	pad3 B32;
    221 } xSyncQueryCounterReply;
    222 #define sz_xSyncQueryCounterReply	32
    223 
    224 /*
    225  * Await
    226  */
    227 typedef struct _xSyncAwaitReq {
    228     CARD8	reqType;
    229     CARD8	syncReqType;
    230     CARD16	length B16;
    231 } xSyncAwaitReq;
    232 #define sz_xSyncAwaitReq		4
    233 
    234 typedef struct _xSyncWaitCondition {
    235     XSyncCounter counter B32;
    236     CARD32	value_type B32;
    237     INT32       wait_value_hi B32;
    238     CARD32      wait_value_lo B32;
    239     CARD32	test_type B32;
    240     INT32	event_threshold_hi B32;
    241     CARD32	event_threshold_lo B32;
    242 } xSyncWaitCondition;
    243 #define sz_xSyncWaitCondition		28
    244 
    245 /*
    246  * Create Alarm
    247  */
    248 typedef struct _xSyncCreateAlarmReq {
    249     CARD8	reqType;
    250     CARD8	syncReqType;
    251     CARD16	length B16;
    252     XSyncAlarm	id B32;
    253     CARD32      valueMask B32;
    254 } xSyncCreateAlarmReq;
    255 #define sz_xSyncCreateAlarmReq		12
    256 
    257 /*
    258  * Destroy Alarm
    259  */
    260 typedef struct _xSyncDestroyAlarmReq {
    261     CARD8	reqType;
    262     CARD8	syncReqType;
    263     CARD16	length B16;
    264     XSyncAlarm	alarm B32;
    265 } xSyncDestroyAlarmReq;
    266 #define sz_xSyncDestroyAlarmReq		8
    267 
    268 /*
    269  * Query Alarm
    270  */
    271 typedef struct _xSyncQueryAlarmReq {
    272     CARD8	reqType;
    273     CARD8	syncReqType;
    274     CARD16	length B16;
    275     XSyncAlarm	alarm B32;
    276 } xSyncQueryAlarmReq;
    277 #define sz_xSyncQueryAlarmReq		8
    278 
    279 typedef struct {
    280     BYTE	type;
    281     CARD8	unused;
    282     CARD16	sequenceNumber B16;
    283     CARD32	length B32;
    284     XSyncCounter counter B32;
    285     CARD32	value_type B32;
    286     INT32	wait_value_hi B32;
    287     CARD32	wait_value_lo B32;
    288     CARD32	test_type      B32;
    289     INT32	delta_hi B32;
    290     CARD32	delta_lo B32;
    291     BOOL        events;
    292     BYTE        state;
    293     BYTE	pad0;
    294     BYTE	pad1;
    295 } xSyncQueryAlarmReply;
    296 #define sz_xSyncQueryAlarmReply		40
    297 
    298 /*
    299  * Change Alarm
    300  */
    301 typedef struct _xSyncChangeAlarmReq {
    302     CARD8	reqType;
    303     CARD8	syncReqType;
    304     CARD16	length B16;
    305     XSyncAlarm	alarm B32;
    306     CARD32	valueMask B32;
    307 } xSyncChangeAlarmReq;
    308 #define sz_xSyncChangeAlarmReq		12
    309 
    310 /*
    311  * SetPriority
    312  */
    313 typedef struct _xSyncSetPriority{
    314     CARD8   	reqType;
    315     CARD8   	syncReqType;
    316     CARD16  	length B16;
    317     CARD32  	id B32;
    318     INT32  	priority B32;
    319 } xSyncSetPriorityReq;
    320 #define sz_xSyncSetPriorityReq	    	12
    321 
    322 /*
    323  * Get Priority
    324  */
    325 typedef struct _xSyncGetPriority{
    326     CARD8   	reqType;
    327     CARD8   	syncReqType;
    328     CARD16  	length B16;
    329     CARD32  	id B32; /*XXX XID? */
    330 } xSyncGetPriorityReq;
    331 #define sz_xSyncGetPriorityReq	    	 8
    332 
    333 typedef struct {
    334     BYTE	type;
    335     CARD8	unused;
    336     CARD16	sequenceNumber B16;
    337     CARD32	length B32;
    338     INT32  	priority B32;
    339     CARD32  	pad0 B32;
    340     CARD32  	pad1 B32;
    341     CARD32  	pad2 B32;
    342     CARD32  	pad3 B32;
    343     CARD32  	pad4 B32;
    344 } xSyncGetPriorityReply;
    345 #define sz_xSyncGetPriorityReply	32
    346 
    347 /*
    348  * Create Fence
    349  */
    350 typedef struct _xSyncCreateFenceReq {
    351     CARD8	reqType;
    352     CARD8	syncReqType;
    353     CARD16	length B16;
    354     Drawable	d B32;
    355     XSyncFence	fid B32;
    356     BOOL	initially_triggered;
    357     CARD8	pad0;
    358     CARD16	pad1;
    359 } xSyncCreateFenceReq;
    360 #define sz_xSyncCreateFenceReq		16
    361 
    362 /*
    363  * Put a fence object in the "triggered" state.
    364  */
    365 typedef struct _xSyncTriggerFenceReq {
    366     CARD8	reqType;
    367     CARD8	syncReqType;
    368     CARD16	length B16;
    369     XSyncFence	fid B32;
    370 } xSyncTriggerFenceReq;
    371 #define sz_xSyncTriggerFenceReq		8
    372 
    373 /*
    374  * Put a fence in the "untriggered" state.
    375  */
    376 typedef struct _xSyncResetFenceReq {
    377     CARD8	reqType;
    378     CARD8	syncReqType;
    379     CARD16	length B16;
    380     XSyncFence	fid B32;
    381 } xSyncResetFenceReq;
    382 #define sz_xSyncResetFenceReq		8
    383 
    384 /*
    385  * Destroy a fence object
    386  */
    387 typedef struct _xSyncDestroyFenceReq {
    388     CARD8	reqType;
    389     CARD8	syncReqType;
    390     CARD16	length B16;
    391     XSyncFence	fid B32;
    392 } xSyncDestroyFenceReq;
    393 #define sz_xSyncDestroyFenceReq		8
    394 
    395 /*
    396  * Query a fence object
    397  */
    398 typedef struct _xSyncQueryFenceReq {
    399     CARD8	reqType;
    400     CARD8	syncReqType;
    401     CARD16	length B16;
    402     XSyncFence	fid B32;
    403 } xSyncQueryFenceReq;
    404 #define sz_xSyncQueryFenceReq		8
    405 
    406 /*
    407  * Wait for any of a list of fence sync objects
    408  * to reach the "triggered" state.
    409  */
    410 typedef struct _xSyncAwaitFenceReq {
    411     CARD8	reqType;
    412     CARD8	syncReqType;
    413     CARD16	length B16;
    414 } xSyncAwaitFenceReq;
    415 #define sz_xSyncAwaitFenceReq		4
    416 
    417 typedef struct {
    418     BYTE	type;
    419     CARD8	unused;
    420     CARD16	sequenceNumber B16;
    421     CARD32	length B32;
    422     BOOL	triggered;
    423     BYTE	pad0;
    424     CARD16	pad1 B16;
    425     CARD32	pad2 B32;
    426     CARD32	pad3 B32;
    427     CARD32	pad4 B32;
    428     CARD32	pad5 B32;
    429     CARD32	pad6 B32;
    430 } xSyncQueryFenceReply;
    431 #define sz_xSyncQueryFenceReply		32
    432 
    433 /*
    434  * Events
    435  */
    436 
    437 typedef struct _xSyncCounterNotifyEvent {
    438     BYTE	type;
    439     BYTE	kind;
    440     CARD16	sequenceNumber B16;
    441     XSyncCounter counter B32;
    442     INT32	wait_value_hi B32;
    443     CARD32	wait_value_lo B32;
    444     INT32	counter_value_hi B32;
    445     CARD32	counter_value_lo B32;
    446     CARD32	time B32;
    447     CARD16	count B16;
    448     BOOL	destroyed;
    449     BYTE        pad0;
    450 } xSyncCounterNotifyEvent;
    451 
    452 typedef struct _xSyncAlarmNotifyEvent {
    453     BYTE	type;
    454     BYTE	kind;
    455     CARD16	sequenceNumber B16;
    456     XSyncAlarm	alarm B32;
    457     INT32	counter_value_hi B32;
    458     CARD32	counter_value_lo B32;
    459     INT32	alarm_value_hi B32;
    460     CARD32	alarm_value_lo B32;
    461     CARD32	time B32;
    462     CARD8       state;
    463     BYTE        pad0;
    464     BYTE        pad1;
    465     BYTE        pad2;
    466 } xSyncAlarmNotifyEvent;
    467 
    468 #undef XSyncCounter
    469 #undef XSyncAlarm
    470 #undef XSyncFence
    471 #undef Drawable
    472 
    473 
    474 #endif /* _SYNCPROTO_H_ */
    475