ENGR00156850 gpu-viv: add gpu-viv driver source
[wandboard.git] / drivers / mxc / gpu-viv / arch / GC350 / hal / kernel / gc_hal_kernel_hardware_command_vg.c
blob96ea0f14eeadea92bec986fa7e4f5dfd8693ccd8
1 /****************************************************************************
3 * Copyright (C) 2005 - 2011 by Vivante Corp.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the license, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 *****************************************************************************/
24 #include "gc_hal.h"
25 #include "gc_hal_kernel.h"
27 #if gcdENABLE_VG
29 #include "gc_hal_kernel_hardware_command_vg.h"
31 #define _GC_OBJ_ZONE gcvZONE_COMMAND
33 /******************************************************************************\
34 ****************************** gckVGCOMMAND API code *****************************
35 \******************************************************************************/
37 /*******************************************************************************
39 ** gckVGCOMMAND_InitializeInfo
41 ** Initialize architecture dependent command buffer information.
43 ** INPUT:
45 ** gckVGCOMMAND Command
46 ** Pointer to the Command object.
48 ** OUTPUT:
50 ** Nothing.
52 gceSTATUS
53 gckVGCOMMAND_InitializeInfo(
54 IN gckVGCOMMAND Command
57 gceSTATUS status;
58 gcmkHEADER_ARG("Command=0x%x", Command);
60 /* Verify the arguments. */
61 gcmkVERIFY_OBJECT(Command, gcvOBJ_COMMAND);
65 /* Reset interrupts. */
66 Command->info.feBufferInt = -1;
67 Command->info.tsOverflowInt = -1;
69 /* Set command buffer attributes. */
70 Command->info.addressAlignment = 64;
71 Command->info.commandAlignment = 8;
73 /* Determine command alignment address mask. */
74 Command->info.addressMask = ((((gctUINT32) (Command->info.addressAlignment - 1)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 1:0) - (0 ? 1:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 1:0) - (0 ? 1:0) + 1))))))) << (0 ? 1:0))) | (((gctUINT32) ((gctUINT32) (0 ) & ((gctUINT32) ((((1 ? 1:0) - (0 ? 1:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 1:0) - (0 ? 1:0) + 1))))))) << (0 ? 1:0)));
76 /* Query the number of bytes needed by the STATE command. */
77 gcmkERR_BREAK(gckVGCOMMAND_StateCommand(
78 Command, 0x0, gcvNULL, (gctUINT32)~0, 0,
79 &Command->info.stateCommandSize
80 ));
82 /* Query the number of bytes needed by the RESTART command. */
83 gcmkERR_BREAK(gckVGCOMMAND_RestartCommand(
84 Command, gcvNULL, (gctUINT32)~0, 0,
85 &Command->info.restartCommandSize
86 ));
88 /* Query the number of bytes needed by the FETCH command. */
89 gcmkERR_BREAK(gckVGCOMMAND_FetchCommand(
90 Command, gcvNULL, (gctUINT32)~0, 0,
91 &Command->info.fetchCommandSize
92 ));
94 /* Query the number of bytes needed by the CALL command. */
95 gcmkERR_BREAK(gckVGCOMMAND_CallCommand(
96 Command, gcvNULL, (gctUINT32)~0, 0,
97 &Command->info.callCommandSize
98 ));
100 /* Query the number of bytes needed by the RETURN command. */
101 gcmkERR_BREAK(gckVGCOMMAND_ReturnCommand(
102 Command, gcvNULL,
103 &Command->info.returnCommandSize
106 /* Query the number of bytes needed by the EVENT command. */
107 gcmkERR_BREAK(gckVGCOMMAND_EventCommand(
108 Command, gcvNULL, gcvBLOCK_PIXEL, -1,
109 &Command->info.eventCommandSize
112 /* Query the number of bytes needed by the END command. */
113 gcmkERR_BREAK(gckVGCOMMAND_EndCommand(
114 Command, gcvNULL, -1,
115 &Command->info.endCommandSize
118 /* Determine the tail reserve size. */
119 Command->info.staticTailSize = gcmMAX(
120 Command->info.fetchCommandSize,
121 gcmMAX(
122 Command->info.returnCommandSize,
123 Command->info.endCommandSize
127 /* Determine the maximum tail size. */
128 Command->info.dynamicTailSize
129 = Command->info.staticTailSize
130 + Command->info.eventCommandSize * gcvBLOCK_COUNT;
132 while (gcvFALSE);
134 gcmkFOOTER();
135 /* Return status. */
136 return status;
139 /*******************************************************************************
141 ** gckVGCOMMAND_StateCommand
143 ** Append a STATE command at the specified location in the command buffer.
145 ** INPUT:
147 ** gckVGCOMMAND Command
148 ** Pointer to an gckVGCOMMAND object.
150 ** gctUINT32 Pipe
151 ** Harwdare destination pipe.
153 ** gctPOINTER Logical
154 ** Pointer to the current location inside the command buffer to append
155 ** STATE command at or gcvNULL to query the size of the command.
157 ** gctUINT32 Address
158 ** Starting register address of the state buffer.
159 ** If 'Logical' is gcvNULL, this argument is ignored.
161 ** gctUINT32 Count
162 ** Number of states in state buffer.
163 ** If 'Logical' is gcvNULL, this argument is ignored.
165 ** gctSIZE_T * Bytes
166 ** Pointer to the number of bytes available for the STATE command.
167 ** If 'Logical' is gcvNULL, the value from this argument is ignored.
169 ** OUTPUT:
171 ** gctSIZE_T * Bytes
172 ** Pointer to a variable that will receive the number of bytes required
173 ** for the STATE command. If 'Bytes' is gcvNULL, nothing is returned.
175 gceSTATUS
176 gckVGCOMMAND_StateCommand(
177 IN gckVGCOMMAND Command,
178 IN gctUINT32 Pipe,
179 IN gctPOINTER Logical,
180 IN gctUINT32 Address,
181 IN gctSIZE_T Count,
182 IN OUT gctSIZE_T * Bytes
185 gcmkHEADER_ARG("Command=0x%x Pipe=0x%x Logical=0x%x Address=0x%x Count=0x%x Bytes = 0x%x",
186 Command, Pipe, Logical, Address, Count, Bytes);
188 /* Verify the arguments. */
189 gcmkVERIFY_OBJECT(Command, gcvOBJ_COMMAND);
191 if (Command->fe20)
193 if (Logical != gcvNULL)
195 gctUINT32_PTR buffer;
197 /* Cast the buffer pointer. */
198 buffer = (gctUINT32_PTR) Logical;
200 /* Append STATE. */
201 buffer[0]
202 = ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 31:28) - (0 ? 31:28) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 31:28) - (0 ? 31:28) + 1))))))) << (0 ? 31:28))) | (((gctUINT32) (0x3 & ((gctUINT32) ((((1 ? 31:28) - (0 ? 31:28) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 31:28) - (0 ? 31:28) + 1))))))) << (0 ? 31:28)))
203 | ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 11:0) - (0 ? 11:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 11:0) - (0 ? 11:0) + 1))))))) << (0 ? 11:0))) | (((gctUINT32) ((gctUINT32) (Address) & ((gctUINT32) ((((1 ? 11:0) - (0 ? 11:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 11:0) - (0 ? 11:0) + 1))))))) << (0 ? 11:0)))
204 | ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 27:16) - (0 ? 27:16) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 27:16) - (0 ? 27:16) + 1))))))) << (0 ? 27:16))) | (((gctUINT32) ((gctUINT32) (Count) & ((gctUINT32) ((((1 ? 27:16) - (0 ? 27:16) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 27:16) - (0 ? 27:16) + 1))))))) << (0 ? 27:16)))
205 | ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 13:12) - (0 ? 13:12) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 13:12) - (0 ? 13:12) + 1))))))) << (0 ? 13:12))) | (((gctUINT32) ((gctUINT32) (Pipe) & ((gctUINT32) ((((1 ? 13:12) - (0 ? 13:12) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 13:12) - (0 ? 13:12) + 1))))))) << (0 ? 13:12)));
208 if (Bytes != gcvNULL)
210 /* Return number of bytes required by the STATE command. */
211 *Bytes = 4 * (Count + 1);
214 else
216 if (Logical != gcvNULL)
218 gctUINT32_PTR buffer;
220 /* Cast the buffer pointer. */
221 buffer = (gctUINT32_PTR) Logical;
223 /* Append LOAD_STATE. */
224 buffer[0]
225 = ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 31:27) - (0 ? 31:27) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 31:27) - (0 ? 31:27) + 1))))))) << (0 ? 31:27))) | (((gctUINT32) (0x01 & ((gctUINT32) ((((1 ? 31:27) - (0 ? 31:27) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 31:27) - (0 ? 31:27) + 1))))))) << (0 ? 31:27)))
226 | ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 25:16) - (0 ? 25:16) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 25:16) - (0 ? 25:16) + 1))))))) << (0 ? 25:16))) | (((gctUINT32) ((gctUINT32) (Count) & ((gctUINT32) ((((1 ? 25:16) - (0 ? 25:16) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 25:16) - (0 ? 25:16) + 1))))))) << (0 ? 25:16)))
227 | ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 15:0) - (0 ? 15:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 15:0) - (0 ? 15:0) + 1))))))) << (0 ? 15:0))) | (((gctUINT32) ((gctUINT32) (Address) & ((gctUINT32) ((((1 ? 15:0) - (0 ? 15:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 15:0) - (0 ? 15:0) + 1))))))) << (0 ? 15:0)));
230 if (Bytes != gcvNULL)
232 /* Return number of bytes required by the STATE command. */
233 *Bytes = 4 * (Count + 1);
237 gcmkFOOTER_NO();
238 /* Success. */
239 return gcvSTATUS_OK;
242 /*******************************************************************************
244 ** gckVGCOMMAND_RestartCommand
246 ** Form a RESTART command at the specified location in the command buffer.
248 ** INPUT:
250 ** gckVGCOMMAND Command
251 ** Pointer to an gckVGCOMMAND object.
253 ** gctPOINTER Logical
254 ** Pointer to the current location inside the command buffer to append
255 ** RESTART command at or gcvNULL to query the size of the command.
257 ** gctUINT32 FetchAddress
258 ** The address of another command buffer to be executed by this RESTART
259 ** command. If 'Logical' is gcvNULL, this argument is ignored.
261 ** gctUINT FetchCount
262 ** The number of 64-bit data quantities in another command buffer to
263 ** be executed by this RESTART command. If 'Logical' is gcvNULL, this
264 ** argument is ignored.
266 ** gctSIZE_T * Bytes
267 ** Pointer to the number of bytes available for the RESTART command.
268 ** If 'Logical' is gcvNULL, the value from this argument is ignored.
270 ** OUTPUT:
272 ** gctSIZE_T * Bytes
273 ** Pointer to a variable that will receive the number of bytes required
274 ** for the RESTART command. If 'Bytes' is gcvNULL, nothing is returned.
276 gceSTATUS
277 gckVGCOMMAND_RestartCommand(
278 IN gckVGCOMMAND Command,
279 IN gctPOINTER Logical,
280 IN gctUINT32 FetchAddress,
281 IN gctUINT FetchCount,
282 IN OUT gctSIZE_T * Bytes
285 gcmkHEADER_ARG("Command=0x%x Logical=0x%x FetchAddress=0x%x FetchCount=0x%x Bytes = 0x%x",
286 Command, Logical, FetchAddress, FetchCount, Bytes);
287 /* Verify the arguments. */
288 gcmkVERIFY_OBJECT(Command, gcvOBJ_COMMAND);
290 if (Command->fe20)
292 if (Logical != gcvNULL)
294 gctUINT32_PTR buffer;
295 gctUINT32 beginEndMark;
297 /* Cast the buffer pointer. */
298 buffer = (gctUINT32_PTR) Logical;
300 /* Determine Begin/End flag. */
301 beginEndMark = (FetchCount > 0)
302 ? ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 24:24) - (0 ? 24:24) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 24:24) - (0 ? 24:24) + 1))))))) << (0 ? 24:24))) | (((gctUINT32) (0x0 & ((gctUINT32) ((((1 ? 24:24) - (0 ? 24:24) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 24:24) - (0 ? 24:24) + 1))))))) << (0 ? 24:24)))
303 : ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 24:24) - (0 ? 24:24) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 24:24) - (0 ? 24:24) + 1))))))) << (0 ? 24:24))) | (((gctUINT32) (0x1 & ((gctUINT32) ((((1 ? 24:24) - (0 ? 24:24) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 24:24) - (0 ? 24:24) + 1))))))) << (0 ? 24:24)));
305 /* Append RESTART. */
306 buffer[0]
307 = ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 31:28) - (0 ? 31:28) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 31:28) - (0 ? 31:28) + 1))))))) << (0 ? 31:28))) | (((gctUINT32) (0x9 & ((gctUINT32) ((((1 ? 31:28) - (0 ? 31:28) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 31:28) - (0 ? 31:28) + 1))))))) << (0 ? 31:28)))
308 | ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 20:0) - (0 ? 20:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 20:0) - (0 ? 20:0) + 1))))))) << (0 ? 20:0))) | (((gctUINT32) ((gctUINT32) (FetchCount) & ((gctUINT32) ((((1 ? 20:0) - (0 ? 20:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 20:0) - (0 ? 20:0) + 1))))))) << (0 ? 20:0)))
309 | beginEndMark;
311 buffer[1]
312 = FetchAddress;
315 if (Bytes != gcvNULL)
317 /* Return number of bytes required by the RESTART command. */
318 *Bytes = 8;
321 else
323 return gcvSTATUS_NOT_SUPPORTED;
327 gcmkFOOTER_NO();
328 /* Success. */
329 return gcvSTATUS_OK;
332 /*******************************************************************************
334 ** gckVGCOMMAND_FetchCommand
336 ** Form a FETCH command at the specified location in the command buffer.
338 ** INPUT:
340 ** gckVGCOMMAND Command
341 ** Pointer to an gckVGCOMMAND object.
343 ** gctPOINTER Logical
344 ** Pointer to the current location inside the command buffer to append
345 ** FETCH command at or gcvNULL to query the size of the command.
347 ** gctUINT32 FetchAddress
348 ** The address of another command buffer to be executed by this FETCH
349 ** command. If 'Logical' is gcvNULL, this argument is ignored.
351 ** gctUINT FetchCount
352 ** The number of 64-bit data quantities in another command buffer to
353 ** be executed by this FETCH command. If 'Logical' is gcvNULL, this
354 ** argument is ignored.
356 ** gctSIZE_T * Bytes
357 ** Pointer to the number of bytes available for the FETCH command.
358 ** If 'Logical' is gcvNULL, the value from this argument is ignored.
360 ** OUTPUT:
362 ** gctSIZE_T * Bytes
363 ** Pointer to a variable that will receive the number of bytes required
364 ** for the FETCH command. If 'Bytes' is gcvNULL, nothing is returned.
366 gceSTATUS
367 gckVGCOMMAND_FetchCommand(
368 IN gckVGCOMMAND Command,
369 IN gctPOINTER Logical,
370 IN gctUINT32 FetchAddress,
371 IN gctUINT FetchCount,
372 IN OUT gctSIZE_T * Bytes
375 gcmkHEADER_ARG("Command=0x%x Logical=0x%x FetchAddress=0x%x FetchCount=0x%x Bytes = 0x%x",
376 Command, Logical, FetchAddress, FetchCount, Bytes);
377 /* Verify the arguments. */
378 gcmkVERIFY_OBJECT(Command, gcvOBJ_COMMAND);
380 if (Command->fe20)
382 if (Logical != gcvNULL)
384 gctUINT32_PTR buffer;
386 /* Cast the buffer pointer. */
387 buffer = (gctUINT32_PTR) Logical;
389 /* Append FETCH. */
390 buffer[0]
391 = ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 31:28) - (0 ? 31:28) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 31:28) - (0 ? 31:28) + 1))))))) << (0 ? 31:28))) | (((gctUINT32) (0x5 & ((gctUINT32) ((((1 ? 31:28) - (0 ? 31:28) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 31:28) - (0 ? 31:28) + 1))))))) << (0 ? 31:28)))
392 | ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 20:0) - (0 ? 20:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 20:0) - (0 ? 20:0) + 1))))))) << (0 ? 20:0))) | (((gctUINT32) ((gctUINT32) (FetchCount) & ((gctUINT32) ((((1 ? 20:0) - (0 ? 20:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 20:0) - (0 ? 20:0) + 1))))))) << (0 ? 20:0)));
394 buffer[1]
395 = gcmFIXADDRESS(FetchAddress);
398 if (Bytes != gcvNULL)
400 /* Return number of bytes required by the FETCH command. */
401 *Bytes = 8;
404 else
406 if (Logical != gcvNULL)
408 gctUINT32_PTR buffer;
410 /* Cast the buffer pointer. */
411 buffer = (gctUINT32_PTR) Logical;
413 /* Append LINK. */
414 buffer[0]
415 = ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 31:27) - (0 ? 31:27) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 31:27) - (0 ? 31:27) + 1))))))) << (0 ? 31:27))) | (((gctUINT32) (0x08 & ((gctUINT32) ((((1 ? 31:27) - (0 ? 31:27) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 31:27) - (0 ? 31:27) + 1))))))) << (0 ? 31:27)))
416 | ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 15:0) - (0 ? 15:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 15:0) - (0 ? 15:0) + 1))))))) << (0 ? 15:0))) | (((gctUINT32) ((gctUINT32) (FetchCount) & ((gctUINT32) ((((1 ? 15:0) - (0 ? 15:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 15:0) - (0 ? 15:0) + 1))))))) << (0 ? 15:0)));
418 buffer[1]
419 = gcmFIXADDRESS(FetchAddress);
422 if (Bytes != gcvNULL)
424 /* Return number of bytes required by the LINK command. */
425 *Bytes = 8;
429 gcmkFOOTER_NO();
430 /* Success. */
431 return gcvSTATUS_OK;
434 /*******************************************************************************
436 ** gckVGCOMMAND_CallCommand
438 ** Append a CALL command at the specified location in the command buffer.
440 ** INPUT:
442 ** gckVGCOMMAND Command
443 ** Pointer to an gckVGCOMMAND object.
445 ** gctPOINTER Logical
446 ** Pointer to the current location inside the command buffer to append
447 ** CALL command at or gcvNULL to query the size of the command.
449 ** gctUINT32 FetchAddress
450 ** The address of another command buffer to be executed by this CALL
451 ** command. If 'Logical' is gcvNULL, this argument is ignored.
453 ** gctUINT FetchCount
454 ** The number of 64-bit data quantities in another command buffer to
455 ** be executed by this CALL command. If 'Logical' is gcvNULL, this
456 ** argument is ignored.
458 ** gctSIZE_T * Bytes
459 ** Pointer to the number of bytes available for the CALL command.
460 ** If 'Logical' is gcvNULL, the value from this argument is ignored.
462 ** OUTPUT:
464 ** gctSIZE_T * Bytes
465 ** Pointer to a variable that will receive the number of bytes required
466 ** for the CALL command. If 'Bytes' is gcvNULL, nothing is returned.
468 gceSTATUS
469 gckVGCOMMAND_CallCommand(
470 IN gckVGCOMMAND Command,
471 IN gctPOINTER Logical,
472 IN gctUINT32 FetchAddress,
473 IN gctUINT FetchCount,
474 IN OUT gctSIZE_T * Bytes
477 gcmkHEADER_ARG("Command=0x%x Logical=0x%x FetchAddress=0x%x FetchCount=0x%x Bytes = 0x%x",
478 Command, Logical, FetchAddress, FetchCount, Bytes);
479 /* Verify the arguments. */
480 gcmkVERIFY_OBJECT(Command, gcvOBJ_COMMAND);
482 if (Command->fe20)
484 if (Logical != gcvNULL)
486 gctUINT32_PTR buffer;
488 /* Cast the buffer pointer. */
489 buffer = (gctUINT32_PTR) Logical;
491 /* Append CALL. */
492 buffer[0]
493 = ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 31:28) - (0 ? 31:28) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 31:28) - (0 ? 31:28) + 1))))))) << (0 ? 31:28))) | (((gctUINT32) (0x6 & ((gctUINT32) ((((1 ? 31:28) - (0 ? 31:28) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 31:28) - (0 ? 31:28) + 1))))))) << (0 ? 31:28)))
494 | ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 20:0) - (0 ? 20:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 20:0) - (0 ? 20:0) + 1))))))) << (0 ? 20:0))) | (((gctUINT32) ((gctUINT32) (FetchCount) & ((gctUINT32) ((((1 ? 20:0) - (0 ? 20:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 20:0) - (0 ? 20:0) + 1))))))) << (0 ? 20:0)));
496 buffer[1]
497 = gcmFIXADDRESS(FetchAddress);
500 if (Bytes != gcvNULL)
502 /* Return number of bytes required by the CALL command. */
503 *Bytes = 8;
506 else
508 return gcvSTATUS_NOT_SUPPORTED;
511 gcmkFOOTER_NO();
512 /* Success. */
513 return gcvSTATUS_OK;
516 /*******************************************************************************
518 ** gckVGCOMMAND_ReturnCommand
520 ** Append a RETURN command at the specified location in the command buffer.
522 ** INPUT:
524 ** gckVGCOMMAND Command
525 ** Pointer to an gckVGCOMMAND object.
527 ** gctPOINTER Logical
528 ** Pointer to the current location inside the command buffer to append
529 ** RETURN command at or gcvNULL to query the size of the command.
531 ** gctSIZE_T * Bytes
532 ** Pointer to the number of bytes available for the RETURN command.
533 ** If 'Logical' is gcvNULL, the value from this argument is ignored.
535 ** OUTPUT:
537 ** gctSIZE_T * Bytes
538 ** Pointer to a variable that will receive the number of bytes required
539 ** for the RETURN command. If 'Bytes' is gcvNULL, nothing is returned.
541 gceSTATUS
542 gckVGCOMMAND_ReturnCommand(
543 IN gckVGCOMMAND Command,
544 IN gctPOINTER Logical,
545 IN OUT gctSIZE_T * Bytes
548 gcmkHEADER_ARG("Command=0x%x Logical=0x%x Bytes = 0x%x",
549 Command, Logical, Bytes);
550 /* Verify the arguments. */
551 gcmkVERIFY_OBJECT(Command, gcvOBJ_COMMAND);
553 if (Command->fe20)
555 if (Logical != gcvNULL)
557 gctUINT32_PTR buffer;
559 /* Cast the buffer pointer. */
560 buffer = (gctUINT32_PTR) Logical;
562 /* Append RETURN. */
563 buffer[0]
564 = ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 31:28) - (0 ? 31:28) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 31:28) - (0 ? 31:28) + 1))))))) << (0 ? 31:28))) | (((gctUINT32) (0x7 & ((gctUINT32) ((((1 ? 31:28) - (0 ? 31:28) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 31:28) - (0 ? 31:28) + 1))))))) << (0 ? 31:28)));
567 if (Bytes != gcvNULL)
569 /* Return number of bytes required by the RETURN command. */
570 *Bytes = 8;
573 else
575 gcmkFOOTER_NO();
576 return gcvSTATUS_NOT_SUPPORTED;
579 gcmkFOOTER_NO();
580 /* Success. */
581 return gcvSTATUS_OK;
584 /*******************************************************************************
586 ** gckVGCOMMAND_EventCommand
588 ** Form an EVENT command at the specified location in the command buffer.
590 ** INPUT:
592 ** gckVGCOMMAND Command
593 ** Pointer to the Command object.
595 ** gctPOINTER Logical
596 ** Pointer to the current location inside the command buffer to append
597 ** EVENT command at or gcvNULL to query the size of the command.
599 ** gctINT32 InterruptId
600 ** The ID of the interrupt to generate.
601 ** If 'Logical' is gcvNULL, this argument is ignored.
603 ** gceBLOCK Block
604 ** Block that will generate the interrupt.
606 ** gctSIZE_T * Bytes
607 ** Pointer to the number of bytes available for the EVENT command.
608 ** If 'Logical' is gcvNULL, the value from this argument is ignored.
610 ** OUTPUT:
612 ** gctSIZE_T * Bytes
613 ** Pointer to a variable that will receive the number of bytes required
614 ** for the END command. If 'Bytes' is gcvNULL, nothing is returned.
616 gceSTATUS
617 gckVGCOMMAND_EventCommand(
618 IN gckVGCOMMAND Command,
619 IN gctPOINTER Logical,
620 IN gceBLOCK Block,
621 IN gctINT32 InterruptId,
622 IN OUT gctSIZE_T * Bytes
625 gcmkHEADER_ARG("Command=0x%x Logical=0x%x Block=0x%x InterruptId=0x%x Bytes = 0x%x",
626 Command, Logical, Block, InterruptId, Bytes);
627 /* Verify the arguments. */
628 gcmkVERIFY_OBJECT(Command, gcvOBJ_COMMAND);
630 if (Command->fe20)
632 typedef struct _gcsEVENTSTATES
634 /* Chips before VG21 use these values. */
635 gctUINT eventFromFE;
636 gctUINT eventFromPE;
638 /* VG21 chips and later use SOURCE field. */
639 gctUINT eventSource;
641 gcsEVENTSTATES;
643 static gcsEVENTSTATES states[] =
645 /* gcvBLOCK_COMMAND */
647 (gctUINT)~0,
648 (gctUINT)~0,
649 (gctUINT)~0
652 /* gcvBLOCK_TESSELLATOR */
654 0x0,
655 0x1,
656 0x10
659 /* gcvBLOCK_TESSELLATOR2 */
661 0x0,
662 0x1,
663 0x12
666 /* gcvBLOCK_TESSELLATOR3 */
668 0x0,
669 0x1,
670 0x14
673 /* gcvBLOCK_RASTER */
675 0x0,
676 0x1,
677 0x07,
680 /* gcvBLOCK_VG */
682 0x0,
683 0x1,
684 0x0F
687 /* gcvBLOCK_VG2 */
689 0x0,
690 0x1,
691 0x11
694 /* gcvBLOCK_VG3 */
696 0x0,
697 0x1,
698 0x13
701 /* gcvBLOCK_PIXEL */
703 0x0,
704 0x1,
705 0x07
709 /* Verify block ID. */
710 gcmkVERIFY_ARGUMENT(gcmIS_VALID_INDEX(Block, states));
712 if (Logical != gcvNULL)
714 gctUINT32_PTR buffer;
716 /* Verify the event ID. */
717 gcmkVERIFY_ARGUMENT(InterruptId >= 0);
718 gcmkVERIFY_ARGUMENT(InterruptId <= ((gctUINT32) ((((1 ? 4:0) - (0 ? 4:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 4:0) - (0 ? 4:0) + 1))))));
720 /* Cast the buffer pointer. */
721 buffer = (gctUINT32_PTR) Logical;
723 /* Append EVENT. */
724 buffer[0]
725 = ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 31:28) - (0 ? 31:28) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 31:28) - (0 ? 31:28) + 1))))))) << (0 ? 31:28))) | (((gctUINT32) (0x3 & ((gctUINT32) ((((1 ? 31:28) - (0 ? 31:28) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 31:28) - (0 ? 31:28) + 1))))))) << (0 ? 31:28)))
726 | ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 11:0) - (0 ? 11:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 11:0) - (0 ? 11:0) + 1))))))) << (0 ? 11:0))) | (((gctUINT32) ((gctUINT32) (0x0E01) & ((gctUINT32) ((((1 ? 11:0) - (0 ? 11:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 11:0) - (0 ? 11:0) + 1))))))) << (0 ? 11:0)))
727 | ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 27:16) - (0 ? 27:16) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 27:16) - (0 ? 27:16) + 1))))))) << (0 ? 27:16))) | (((gctUINT32) ((gctUINT32) (1) & ((gctUINT32) ((((1 ? 27:16) - (0 ? 27:16) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 27:16) - (0 ? 27:16) + 1))))))) << (0 ? 27:16)))
728 | ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 13:12) - (0 ? 13:12) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 13:12) - (0 ? 13:12) + 1))))))) << (0 ? 13:12))) | (((gctUINT32) (0x0 & ((gctUINT32) ((((1 ? 13:12) - (0 ? 13:12) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 13:12) - (0 ? 13:12) + 1))))))) << (0 ? 13:12)));
730 /* Determine chip version. */
731 if (Command->vg21)
733 /* Get the event source for the block. */
734 gctUINT eventSource = states[Block].eventSource;
736 /* Supported? */
737 if (eventSource == ~0)
739 return gcvSTATUS_NOT_SUPPORTED;
742 buffer[1]
743 = ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 4:0) - (0 ? 4:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 4:0) - (0 ? 4:0) + 1))))))) << (0 ? 4:0))) | (((gctUINT32) ((gctUINT32) (InterruptId) & ((gctUINT32) ((((1 ? 4:0) - (0 ? 4:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 4:0) - (0 ? 4:0) + 1))))))) << (0 ? 4:0)))
744 | ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 12:8) - (0 ? 12:8) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 12:8) - (0 ? 12:8) + 1))))))) << (0 ? 12:8))) | (((gctUINT32) ((gctUINT32) (eventSource) & ((gctUINT32) ((((1 ? 12:8) - (0 ? 12:8) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 12:8) - (0 ? 12:8) + 1))))))) << (0 ? 12:8)));
746 else
748 /* Get the event source for the block. */
749 gctUINT eventFromFE = states[Block].eventFromFE;
750 gctUINT eventFromPE = states[Block].eventFromPE;
752 /* Supported? */
753 if (eventFromFE == ~0)
755 return gcvSTATUS_NOT_SUPPORTED;
758 buffer[1]
759 = ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 4:0) - (0 ? 4:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 4:0) - (0 ? 4:0) + 1))))))) << (0 ? 4:0))) | (((gctUINT32) ((gctUINT32) (InterruptId) & ((gctUINT32) ((((1 ? 4:0) - (0 ? 4:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 4:0) - (0 ? 4:0) + 1))))))) << (0 ? 4:0)))
760 | ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 5:5) - (0 ? 5:5) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 5:5) - (0 ? 5:5) + 1))))))) << (0 ? 5:5))) | (((gctUINT32) ((gctUINT32) (eventFromFE) & ((gctUINT32) ((((1 ? 5:5) - (0 ? 5:5) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 5:5) - (0 ? 5:5) + 1))))))) << (0 ? 5:5)))
761 | ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 6:6) - (0 ? 6:6) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 6:6) - (0 ? 6:6) + 1))))))) << (0 ? 6:6))) | (((gctUINT32) ((gctUINT32) (eventFromPE) & ((gctUINT32) ((((1 ? 6:6) - (0 ? 6:6) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 6:6) - (0 ? 6:6) + 1))))))) << (0 ? 6:6)));
765 if (Bytes != gcvNULL)
767 /* Make sure the events are directly supported for the block. */
768 if (states[Block].eventSource == ~0)
770 return gcvSTATUS_NOT_SUPPORTED;
773 /* Return number of bytes required by the END command. */
774 *Bytes = 8;
777 else
779 if (Logical != gcvNULL)
781 gctUINT32_PTR buffer;
783 /* Verify the event ID. */
784 gcmkVERIFY_ARGUMENT(InterruptId >= 0);
785 gcmkVERIFY_ARGUMENT(InterruptId <= ((gctUINT32) ((((1 ? 4:0) - (0 ? 4:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 4:0) - (0 ? 4:0) + 1))))));
787 /* Cast the buffer pointer. */
788 buffer = (gctUINT32_PTR) Logical;
790 /* Append EVENT. */
791 buffer[0]
792 = ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 31:27) - (0 ? 31:27) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 31:27) - (0 ? 31:27) + 1))))))) << (0 ? 31:27))) | (((gctUINT32) (0x01 & ((gctUINT32) ((((1 ? 31:27) - (0 ? 31:27) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 31:27) - (0 ? 31:27) + 1))))))) << (0 ? 31:27)))
793 | ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 15:0) - (0 ? 15:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 15:0) - (0 ? 15:0) + 1))))))) << (0 ? 15:0))) | (((gctUINT32) ((gctUINT32) (0x0E01) & ((gctUINT32) ((((1 ? 15:0) - (0 ? 15:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 15:0) - (0 ? 15:0) + 1))))))) << (0 ? 15:0)))
794 | ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 25:16) - (0 ? 25:16) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 25:16) - (0 ? 25:16) + 1))))))) << (0 ? 25:16))) | (((gctUINT32) ((gctUINT32) (1) & ((gctUINT32) ((((1 ? 25:16) - (0 ? 25:16) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 25:16) - (0 ? 25:16) + 1))))))) << (0 ? 25:16)));
796 /* Determine event source. */
797 if (Block == gcvBLOCK_COMMAND)
799 buffer[1]
800 = ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 4:0) - (0 ? 4:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 4:0) - (0 ? 4:0) + 1))))))) << (0 ? 4:0))) | (((gctUINT32) ((gctUINT32) (InterruptId) & ((gctUINT32) ((((1 ? 4:0) - (0 ? 4:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 4:0) - (0 ? 4:0) + 1))))))) << (0 ? 4:0)))
801 | ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 5:5) - (0 ? 5:5) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 5:5) - (0 ? 5:5) + 1))))))) << (0 ? 5:5))) | (((gctUINT32) (0x1 & ((gctUINT32) ((((1 ? 5:5) - (0 ? 5:5) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 5:5) - (0 ? 5:5) + 1))))))) << (0 ? 5:5)));
803 else
805 buffer[1]
806 = ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 4:0) - (0 ? 4:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 4:0) - (0 ? 4:0) + 1))))))) << (0 ? 4:0))) | (((gctUINT32) ((gctUINT32) (InterruptId) & ((gctUINT32) ((((1 ? 4:0) - (0 ? 4:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 4:0) - (0 ? 4:0) + 1))))))) << (0 ? 4:0)))
807 | ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 6:6) - (0 ? 6:6) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 6:6) - (0 ? 6:6) + 1))))))) << (0 ? 6:6))) | (((gctUINT32) (0x1 & ((gctUINT32) ((((1 ? 6:6) - (0 ? 6:6) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 6:6) - (0 ? 6:6) + 1))))))) << (0 ? 6:6)));
811 if (Bytes != gcvNULL)
813 /* Return number of bytes required by the EVENT and END commands. */
814 *Bytes = 8;
818 gcmkFOOTER_NO();
819 /* Success. */
820 return gcvSTATUS_OK;
823 /*******************************************************************************
825 ** gckVGCOMMAND_EndCommand
827 ** Form an END command at the specified location in the command buffer.
829 ** INPUT:
831 ** gckVGCOMMAND Command
832 ** Pointer to the Command object.
834 ** gctPOINTER Logical
835 ** Pointer to the current location inside the command buffer to append
836 ** END command at or gcvNULL to query the size of the command.
838 ** gctINT32 InterruptId
839 ** The ID of the interrupt to generate.
840 ** If 'Logical' is gcvNULL, this argument will be ignored.
842 ** gctSIZE_T * Bytes
843 ** Pointer to the number of bytes available for the END command.
844 ** If 'Logical' is gcvNULL, the value from this argument is ignored.
846 ** OUTPUT:
848 ** gctSIZE_T * Bytes
849 ** Pointer to a variable that will receive the number of bytes required
850 ** for the END command. If 'Bytes' is gcvNULL, nothing is returned.
852 gceSTATUS
853 gckVGCOMMAND_EndCommand(
854 IN gckVGCOMMAND Command,
855 IN gctPOINTER Logical,
856 IN gctINT32 InterruptId,
857 IN OUT gctSIZE_T * Bytes
860 gcmkHEADER_ARG("Command=0x%x Logical=0x%x InterruptId=0x%x Bytes = 0x%x",
861 Command, Logical, InterruptId, Bytes);
862 /* Verify the arguments. */
863 gcmkVERIFY_OBJECT(Command, gcvOBJ_COMMAND);
865 if (Command->fe20)
867 if (Logical != gcvNULL)
869 gctUINT32_PTR buffer;
871 /* Verify the event ID. */
872 gcmkVERIFY_ARGUMENT(InterruptId >= 0);
874 /* Cast the buffer pointer. */
875 buffer = (gctUINT32_PTR) Logical;
877 /* Append END. */
878 buffer[0]
879 = ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 31:28) - (0 ? 31:28) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 31:28) - (0 ? 31:28) + 1))))))) << (0 ? 31:28))) | (((gctUINT32) (0x0 & ((gctUINT32) ((((1 ? 31:28) - (0 ? 31:28) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 31:28) - (0 ? 31:28) + 1))))))) << (0 ? 31:28)))
880 | ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 4:0) - (0 ? 4:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 4:0) - (0 ? 4:0) + 1))))))) << (0 ? 4:0))) | (((gctUINT32) ((gctUINT32) (InterruptId) & ((gctUINT32) ((((1 ? 4:0) - (0 ? 4:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 4:0) - (0 ? 4:0) + 1))))))) << (0 ? 4:0)));
883 if (Bytes != gcvNULL)
885 /* Return number of bytes required by the END command. */
886 *Bytes = 8;
889 else
891 if (Logical != gcvNULL)
893 gctUINT32_PTR memory;
895 /* Verify the event ID. */
896 gcmkVERIFY_ARGUMENT(InterruptId >= 0);
898 /* Cast the buffer pointer. */
899 memory = (gctUINT32_PTR) Logical;
901 /* Append EVENT. */
902 memory[0]
903 = ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 31:27) - (0 ? 31:27) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 31:27) - (0 ? 31:27) + 1))))))) << (0 ? 31:27))) | (((gctUINT32) (0x01 & ((gctUINT32) ((((1 ? 31:27) - (0 ? 31:27) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 31:27) - (0 ? 31:27) + 1))))))) << (0 ? 31:27)))
904 | ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 15:0) - (0 ? 15:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 15:0) - (0 ? 15:0) + 1))))))) << (0 ? 15:0))) | (((gctUINT32) ((gctUINT32) (0x0E01) & ((gctUINT32) ((((1 ? 15:0) - (0 ? 15:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 15:0) - (0 ? 15:0) + 1))))))) << (0 ? 15:0)))
905 | ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 25:16) - (0 ? 25:16) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 25:16) - (0 ? 25:16) + 1))))))) << (0 ? 25:16))) | (((gctUINT32) ((gctUINT32) (1) & ((gctUINT32) ((((1 ? 25:16) - (0 ? 25:16) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 25:16) - (0 ? 25:16) + 1))))))) << (0 ? 25:16)));
907 memory[1]
908 = ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 4:0) - (0 ? 4:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 4:0) - (0 ? 4:0) + 1))))))) << (0 ? 4:0))) | (((gctUINT32) ((gctUINT32) (InterruptId) & ((gctUINT32) ((((1 ? 4:0) - (0 ? 4:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 4:0) - (0 ? 4:0) + 1))))))) << (0 ? 4:0)))
909 | ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 6:6) - (0 ? 6:6) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 6:6) - (0 ? 6:6) + 1))))))) << (0 ? 6:6))) | (((gctUINT32) (0x1 & ((gctUINT32) ((((1 ? 6:6) - (0 ? 6:6) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 6:6) - (0 ? 6:6) + 1))))))) << (0 ? 6:6)));
911 /* Append END. */
912 memory[2]
913 = ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 31:27) - (0 ? 31:27) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 31:27) - (0 ? 31:27) + 1))))))) << (0 ? 31:27))) | (((gctUINT32) (0x02 & ((gctUINT32) ((((1 ? 31:27) - (0 ? 31:27) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 31:27) - (0 ? 31:27) + 1))))))) << (0 ? 31:27)));
916 if (Bytes != gcvNULL)
918 /* Return number of bytes required by the EVENT and END commands. */
919 *Bytes = 16;
923 gcmkFOOTER_NO();
924 /* Success. */
925 return gcvSTATUS_OK;
928 #endif /* gcdENABLE_VG */