ENGR00156850 gpu-viv: add gpu-viv driver source
[wandboard.git] / drivers / mxc / gpu-viv / hal / kernel / inc / gc_hal_vg.h
blob55cc74c6012f1c0f6653f43febaa6083cabc7c32
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 *****************************************************************************/
26 #ifndef __gc_hal_vg_h_
27 #define __gc_hal_vg_h_
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
34 #include "gc_hal_rename.h"
35 #include "gc_hal_types.h"
36 #include "gc_hal_enum.h"
37 #include "gc_hal_base.h"
39 #if gcdENABLE_VG
41 /* Thread routine type. */
42 #if defined(LINUX)
43 typedef gctINT gctTHREADFUNCRESULT;
44 typedef gctPOINTER gctTHREADFUNCPARAMETER;
45 # define gctTHREADFUNCTYPE
46 #elif defined(WIN32)
47 typedef gctUINT gctTHREADFUNCRESULT;
48 typedef gctPOINTER gctTHREADFUNCPARAMETER;
49 # define gctTHREADFUNCTYPE __stdcall
50 #endif
52 typedef gctTHREADFUNCRESULT (gctTHREADFUNCTYPE * gctTHREADFUNC) (
53 gctTHREADFUNCPARAMETER ThreadParameter
57 #if defined(gcvDEBUG)
58 # undef gcvDEBUG
59 #endif
61 #define gcdFORCE_DEBUG 0
62 #define gcdFORCE_MESSAGES 0
65 #if DBG || defined(DEBUG) || defined(_DEBUG) || gcdFORCE_DEBUG
66 # define gcvDEBUG 1
67 #else
68 # define gcvDEBUG 0
69 #endif
71 #define _gcmERROR_RETURN(prefix, func) \
72 status = func; \
73 if (gcmIS_ERROR(status)) \
74 { \
75 prefix##PRINT_VERSION(); \
76 prefix##TRACE(gcvLEVEL_ERROR, \
77 #prefix "ERR_RETURN: status=%d(%s) @ %s(%d)", \
78 status, gcoOS_DebugStatus2Name(status), __FUNCTION__, __LINE__); \
79 return status; \
80 } \
81 do { } while (gcvFALSE)
83 #define gcmERROR_RETURN(func) _gcmERROR_RETURN(gcm, func)
85 #define gcmLOG_LOCATION()
87 #define gcmkIS_ERROR(status) (status < 0)
89 #define gcmALIGNDOWN(n, align) \
90 ( \
91 (n) & ~((align) - 1) \
94 #define gcmIS_VALID_INDEX(Index, Array) \
95 (((gctUINT) (Index)) < gcmCOUNTOF(Array))
98 #define gcmIS_NAN(x) \
99 ( \
100 ((* (gctUINT32_PTR) &(x)) & 0x7FFFFFFF) == 0x7FFFFFFF \
103 #define gcmLERP(v1, v2, w) \
104 ((v1) * (w) + (v2) * (1.0f - (w)))
106 #define gcmINTERSECT(Start1, Start2, Length) \
107 (gcmABS((Start1) - (Start2)) < (Length))
109 /*******************************************************************************
111 ** gcmERR_GOTO
113 ** Prints a message and terminates the current loop on error.
115 ** ASSUMPTIONS:
117 ** 'status' variable of gceSTATUS type must be defined.
119 ** ARGUMENTS:
121 ** Function
122 ** Function to evaluate.
125 #define gcmERR_GOTO(Function) \
126 status = Function; \
127 if (gcmIS_ERROR(status)) \
129 gcmTRACE( \
130 gcvLEVEL_ERROR, \
131 "gcmERR_GOTO: status=%d @ line=%d in function %s.\n", \
132 status, __LINE__, __FUNCTION__ \
133 ); \
134 goto ErrorHandler; \
137 #if gcvDEBUG || gcdFORCE_MESSAGES
138 # define gcmVERIFY_BOOLEAN(Expression) \
139 gcmASSERT( \
140 ( (Expression) == gcvFALSE ) || \
141 ( (Expression) == gcvTRUE ) \
143 #else
144 # define gcmVERIFY_BOOLEAN(Expression)
145 #endif
147 /*******************************************************************************
149 ** gcmVERIFYFIELDFIT
151 ** Verify whether the value fits in the field.
153 ** ARGUMENTS:
155 ** data Data value.
156 ** reg Name of register.
157 ** field Name of field within register.
158 ** value Value for field.
160 #define gcmVERIFYFIELDFIT(reg, field, value) \
161 gcmASSERT( \
162 (value) <= gcmFIELDMAX(reg, field) \
164 /*******************************************************************************
166 ** gcmFIELDMAX
168 ** Get field maximum value.
170 ** ARGUMENTS:
172 ** reg Name of register.
173 ** field Name of field within register.
175 #define gcmFIELDMAX(reg, field) \
177 (gctUINT32) \
179 (__gcmGETSIZE(reg##_##field) == 32) \
180 ? ~0 \
181 : (~(~0 << __gcmGETSIZE(reg##_##field))) \
186 /* ANSI C does not have the 'f' functions, define replacements here. */
187 #define gcmSINF(x) ((gctFLOAT) sin(x))
188 #define gcmCOSF(x) ((gctFLOAT) cos(x))
189 #define gcmASINF(x) ((gctFLOAT) asin(x))
190 #define gcmACOSF(x) ((gctFLOAT) acos(x))
191 #define gcmSQRTF(x) ((gctFLOAT) sqrt(x))
192 #define gcmFABSF(x) ((gctFLOAT) fabs(x))
193 #define gcmFMODF(x, y) ((gctFLOAT) fmod((x), (y)))
194 #define gcmCEILF(x) ((gctFLOAT) ceil(x))
195 #define gcmFLOORF(x) ((gctFLOAT) floor(x))
199 /* Fixed point constants. */
200 #define gcvZERO_X ((gctFIXED_POINT) 0x00000000)
201 #define gcvHALF_X ((gctFIXED_POINT) 0x00008000)
202 #define gcvONE_X ((gctFIXED_POINT) 0x00010000)
203 #define gcvNEGONE_X ((gctFIXED_POINT) 0xFFFF0000)
204 #define gcvTWO_X ((gctFIXED_POINT) 0x00020000)
206 /* Integer constants. */
207 #define gcvMAX_POS_INT ((gctINT) 0x7FFFFFFF)
208 #define gcvMAX_NEG_INT ((gctINT) 0x80000000)
210 /* Float constants. */
211 #define gcvMAX_POS_FLOAT ((gctFLOAT) 3.4028235e+038)
212 #define gcvMAX_NEG_FLOAT ((gctFLOAT) -3.4028235e+038)
214 /******************************************************************************\
215 ***************************** Miscellaneous Macro ******************************
216 \******************************************************************************/
218 #define gcmKB2BYTES(Kilobyte) \
220 (Kilobyte) << 10 \
223 #define gcmMB2BYTES(Megabyte) \
225 (Megabyte) << 20 \
228 #define gcmMAT(Matrix, Row, Column) \
230 (Matrix) [(Row) * 3 + (Column)] \
233 #define gcmMAKE2CHAR(Char1, Char2) \
235 ((gctUINT16) (gctUINT8) (Char1) << 0) | \
236 ((gctUINT16) (gctUINT8) (Char2) << 8) \
239 #define gcmMAKE4CHAR(Char1, Char2, Char3, Char4) \
241 ((gctUINT32)(gctUINT8) (Char1) << 0) | \
242 ((gctUINT32)(gctUINT8) (Char2) << 8) | \
243 ((gctUINT32)(gctUINT8) (Char3) << 16) | \
244 ((gctUINT32)(gctUINT8) (Char4) << 24) \
247 /* some platforms need to fix the physical address for HW to access*/
248 #define gcmFIXADDRESS(address) \
250 (address)\
252 /******************************************************************************\
253 ****************************** Kernel Debug Macro ******************************
254 \******************************************************************************/
256 /* Set signal to signaled state for specified process. */
257 gceSTATUS
258 gckOS_SetSignal(
259 IN gckOS Os,
260 IN gctHANDLE Process,
261 IN gctSIGNAL Signal
264 /* Return the kernel logical pointer for the given physical one. */
265 gceSTATUS
266 gckOS_GetKernelLogical(
267 IN gckOS Os,
268 IN gctUINT32 Address,
269 OUT gctPOINTER * KernelPointer
272 /* Return the kernel logical pointer for the given physical one. */
273 gceSTATUS
274 gckOS_GetKernelLogicalEx(
275 IN gckOS Os,
276 IN gceCORE Core,
277 IN gctUINT32 Address,
278 OUT gctPOINTER * KernelPointer
281 /*----------------------------------------------------------------------------*/
282 /*----------------------------- Semaphore Object -----------------------------*/
284 /* Increment the value of a semaphore. */
285 gceSTATUS
286 gckOS_IncrementSemaphore(
287 IN gckOS Os,
288 IN gctSEMAPHORE Semaphore
291 /* Decrement the value of a semaphore (waiting might occur). */
292 gceSTATUS
293 gckOS_DecrementSemaphore(
294 IN gckOS Os,
295 IN gctSEMAPHORE Semaphore
299 /*----------------------------------------------------------------------------*/
300 /*------------------------------- Thread Object ------------------------------*/
302 /* Start a thread. */
303 gceSTATUS
304 gckOS_StartThread(
305 IN gckOS Os,
306 IN gctTHREADFUNC ThreadFunction,
307 IN gctPOINTER ThreadParameter,
308 OUT gctTHREAD * Thread
311 /* Stop a thread. */
312 gceSTATUS
313 gckOS_StopThread(
314 IN gckOS Os,
315 IN gctTHREAD Thread
318 /* Verify whether the thread is still running. */
319 gceSTATUS
320 gckOS_VerifyThread(
321 IN gckOS Os,
322 IN gctTHREAD Thread
326 /* Construct a new gckVGKERNEL object. */
327 gceSTATUS
328 gckVGKERNEL_Construct(
329 IN gckOS Os,
330 IN gctPOINTER Context,
331 IN gckKERNEL inKernel,
332 OUT gckVGKERNEL * Kernel
335 /* Destroy an gckVGKERNEL object. */
336 gceSTATUS
337 gckVGKERNEL_Destroy(
338 IN gckVGKERNEL Kernel
341 /* Allocate linear video memory. */
342 gceSTATUS
343 gckKERNEL_AllocateLinearMemory(
344 IN gckKERNEL Kernel,
345 IN OUT gcePOOL * Pool,
346 IN gctSIZE_T Bytes,
347 IN gctSIZE_T Alignment,
348 IN gceSURF_TYPE Type,
349 OUT gcuVIDMEM_NODE_PTR * Node
352 /* Unmap memory. */
353 gceSTATUS
354 gckKERNEL_UnmapMemory(
355 IN gckKERNEL Kernel,
356 IN gctPHYS_ADDR Physical,
357 IN gctSIZE_T Bytes,
358 IN gctPOINTER Logical
361 /* Dispatch a user-level command. */
362 gceSTATUS
363 gckVGKERNEL_Dispatch(
364 IN gckKERNEL Kernel,
365 IN gctBOOL FromUser,
366 IN OUT struct _gcsHAL_INTERFACE * Interface
369 /* Query command buffer requirements. */
370 gceSTATUS
371 gckKERNEL_QueryCommandBuffer(
372 IN gckKERNEL Kernel,
373 OUT gcsCOMMAND_BUFFER_INFO_PTR Information
376 /******************************************************************************\
377 ******************************* gckVGHARDWARE Object ******************************
378 \******************************************************************************/
380 /* Construct a new gckVGHARDWARE object. */
381 gceSTATUS
382 gckVGHARDWARE_Construct(
383 IN gckOS Os,
384 OUT gckVGHARDWARE * Hardware
387 /* Destroy an gckVGHARDWARE object. */
388 gceSTATUS
389 gckVGHARDWARE_Destroy(
390 IN gckVGHARDWARE Hardware
393 /* Query system memory requirements. */
394 gceSTATUS
395 gckVGHARDWARE_QuerySystemMemory(
396 IN gckVGHARDWARE Hardware,
397 OUT gctSIZE_T * SystemSize,
398 OUT gctUINT32 * SystemBaseAddress
401 /* Build virtual address. */
402 gceSTATUS
403 gckVGHARDWARE_BuildVirtualAddress(
404 IN gckVGHARDWARE Hardware,
405 IN gctUINT32 Index,
406 IN gctUINT32 Offset,
407 OUT gctUINT32 * Address
410 /* Kickstart the command processor. */
411 gceSTATUS
412 gckVGHARDWARE_Execute(
413 IN gckVGHARDWARE Hardware,
414 IN gctUINT32 Address,
415 IN gctSIZE_T Count
418 /* Query the available memory. */
419 gceSTATUS
420 gckVGHARDWARE_QueryMemory(
421 IN gckVGHARDWARE Hardware,
422 OUT gctSIZE_T * InternalSize,
423 OUT gctUINT32 * InternalBaseAddress,
424 OUT gctUINT32 * InternalAlignment,
425 OUT gctSIZE_T * ExternalSize,
426 OUT gctUINT32 * ExternalBaseAddress,
427 OUT gctUINT32 * ExternalAlignment,
428 OUT gctUINT32 * HorizontalTileSize,
429 OUT gctUINT32 * VerticalTileSize
432 /* Query the identity of the hardware. */
433 gceSTATUS
434 gckVGHARDWARE_QueryChipIdentity(
435 IN gckVGHARDWARE Hardware,
436 OUT gceCHIPMODEL* ChipModel,
437 OUT gctUINT32* ChipRevision,
438 OUT gctUINT32* ChipFeatures,
439 OUT gctUINT32* ChipMinorFeatures,
440 OUT gctUINT32* ChipMinorFeatures1
443 /* Convert an API format. */
444 gceSTATUS
445 gckVGHARDWARE_ConvertFormat(
446 IN gckVGHARDWARE Hardware,
447 IN gceSURF_FORMAT Format,
448 OUT gctUINT32 * BitsPerPixel,
449 OUT gctUINT32 * BytesPerTile
452 /* Split a harwdare specific address into API stuff. */
453 gceSTATUS
454 gckVGHARDWARE_SplitMemory(
455 IN gckVGHARDWARE Hardware,
456 IN gctUINT32 Address,
457 OUT gcePOOL * Pool,
458 OUT gctUINT32 * Offset
461 /* Align size to tile boundary. */
462 gceSTATUS
463 gckVGHARDWARE_AlignToTile(
464 IN gckVGHARDWARE Hardware,
465 IN gceSURF_TYPE Type,
466 IN OUT gctUINT32_PTR Width,
467 IN OUT gctUINT32_PTR Height
470 /* Convert logical address to hardware specific address. */
471 gceSTATUS
472 gckVGHARDWARE_ConvertLogical(
473 IN gckVGHARDWARE Hardware,
474 IN gctPOINTER Logical,
475 OUT gctUINT32 * Address
478 /* Program MMU. */
479 gceSTATUS
480 gckVGHARDWARE_SetMMU(
481 IN gckVGHARDWARE Hardware,
482 IN gctPOINTER Logical
485 /* Flush the MMU. */
486 gceSTATUS
487 gckVGHARDWARE_FlushMMU(
488 IN gckVGHARDWARE Hardware
491 /* Get idle register. */
492 gceSTATUS
493 gckVGHARDWARE_GetIdle(
494 IN gckVGHARDWARE Hardware,
495 OUT gctUINT32 * Data
498 /* Flush the caches. */
499 gceSTATUS
500 gckVGHARDWARE_Flush(
501 IN gckVGHARDWARE Hardware,
502 IN gceKERNEL_FLUSH Flush,
503 IN gctPOINTER Logical,
504 IN OUT gctSIZE_T * Bytes
507 /* Enable/disable fast clear. */
508 gceSTATUS
509 gckVGHARDWARE_SetFastClear(
510 IN gckVGHARDWARE Hardware,
511 IN gctINT Enable
514 gceSTATUS
515 gckVGHARDWARE_ReadInterrupt(
516 IN gckVGHARDWARE Hardware,
517 OUT gctUINT32_PTR IDs
521 /******************************************************************************\
522 *************************** Command Buffer Structures **************************
523 \******************************************************************************/
525 /* Vacant command buffer marker. */
526 #define gcvVACANT_BUFFER ((gcsCOMPLETION_SIGNAL_PTR) (1))
528 /* Command buffer header. */
529 typedef struct _gcsCMDBUFFER * gcsCMDBUFFER_PTR;
530 typedef struct _gcsCMDBUFFER
532 /* Pointer to the completion signal. */
533 gcsCOMPLETION_SIGNAL_PTR completion;
535 /* The user sets this to the node of the container buffer whitin which
536 this particular command buffer resides. The kernel sets this to the
537 node of the internally allocated buffer. */
538 gcuVIDMEM_NODE_PTR node;
540 /* Command buffer hardware address. */
541 gctUINT32 address;
543 /* The offset of the buffer from the beginning of the header. */
544 gctUINT32 bufferOffset;
546 /* Size of the area allocated for the data portion of this particular
547 command buffer (headers and tail reserves are excluded). */
548 gctSIZE_T size;
550 /* Offset into the buffer [0..size]; reflects exactly how much data has
551 been put into the command buffer. */
552 gctUINT offset;
554 /* The number of command units in the buffer for the hardware to
555 execute. */
556 gctSIZE_T dataCount;
558 /* MANAGED BY : user HAL (gcoBUFFER object).
559 USED BY : user HAL (gcoBUFFER object).
560 Points to the immediate next allocated command buffer. */
561 gcsCMDBUFFER_PTR nextAllocated;
563 /* MANAGED BY : user layers (HAL and drivers).
564 USED BY : kernel HAL (gcoBUFFER object).
565 Points to the next subbuffer if any. A family of subbuffers are chained
566 together and are meant to be executed inseparably as a unit. Meaning
567 that context switching cannot occur while a chain of subbuffers is being
568 executed. */
569 gcsCMDBUFFER_PTR nextSubBuffer;
571 gcsCMDBUFFER;
573 /* Command queue element. */
574 typedef struct _gcsVGCMDQUEUE
576 /* Pointer to the command buffer header. */
577 gcsCMDBUFFER_PTR commandBuffer;
579 /* Dynamic vs. static command buffer state. */
580 gctBOOL dynamic;
582 gcsVGCMDQUEUE;
584 /* Context map entry. */
585 typedef struct _gcsVGCONTEXT_MAP
587 /* State index. */
588 gctUINT32 index;
590 /* New state value. */
591 gctUINT32 data;
593 /* Points to the next entry in the mod list. */
594 gcsVGCONTEXT_MAP_PTR next;
596 gcsVGCONTEXT_MAP;
598 /* gcsVGCONTEXT structure that holds the current context. */
599 typedef struct _gcsVGCONTEXT
601 /* Context ID. */
602 gctUINT64 id;
604 /* State caching ebable flag. */
605 gctBOOL stateCachingEnabled;
607 /* Current pipe. */
608 gctUINT32 currentPipe;
610 /* State map/mod buffer. */
611 gctSIZE_T mapFirst;
612 gctSIZE_T mapLast;
613 gcsVGCONTEXT_MAP_PTR mapContainer;
614 gcsVGCONTEXT_MAP_PTR mapPrev;
615 gcsVGCONTEXT_MAP_PTR mapCurr;
616 gcsVGCONTEXT_MAP_PTR firstPrevMap;
617 gcsVGCONTEXT_MAP_PTR firstCurrMap;
619 /* Main context buffer. */
620 gcsCMDBUFFER_PTR header;
621 gctUINT32_PTR buffer;
623 /* Completion signal. */
624 gctHANDLE process;
625 gctSIGNAL signal;
627 gcsVGCONTEXT;
629 /* User space task header. */
630 typedef struct _gcsTASK * gcsTASK_PTR;
631 typedef struct _gcsTASK
633 /* Pointer to the next task for the same interrupt in user space. */
634 gcsTASK_PTR next;
636 /* Size of the task data that immediately follows the structure. */
637 gctUINT size;
639 /* Task data starts here. */
640 /* ... */
642 gcsTASK;
644 /* User space task master table entry. */
645 typedef struct _gcsTASK_MASTER_ENTRY * gcsTASK_MASTER_ENTRY_PTR;
646 typedef struct _gcsTASK_MASTER_ENTRY
648 /* Pointers to the head and to the tail of the task chain. */
649 gcsTASK_PTR head;
650 gcsTASK_PTR tail;
652 gcsTASK_MASTER_ENTRY;
654 /* User space task master table entry. */
655 typedef struct _gcsTASK_MASTER_TABLE
657 /* Table with one entry per block. */
658 gcsTASK_MASTER_ENTRY table[gcvBLOCK_COUNT];
660 /* The total number of tasks sckeduled. */
661 gctUINT count;
663 /* The total size of event data in bytes. */
664 gctUINT size;
666 gcsTASK_MASTER_TABLE;
668 /******************************************************************************\
669 ***************************** gckVGINTERRUPT Object ******************************
670 \******************************************************************************/
672 typedef struct _gckVGINTERRUPT * gckVGINTERRUPT;
674 typedef gceSTATUS (* gctINTERRUPT_HANDLER)(
675 IN gckVGKERNEL Kernel
678 gceSTATUS
679 gckVGINTERRUPT_Construct(
680 IN gckVGKERNEL Kernel,
681 OUT gckVGINTERRUPT * Interrupt
684 gceSTATUS
685 gckVGINTERRUPT_Destroy(
686 IN gckVGINTERRUPT Interrupt
689 gceSTATUS
690 gckVGINTERRUPT_Enable(
691 IN gckVGINTERRUPT Interrupt,
692 IN OUT gctINT32_PTR Id,
693 IN gctINTERRUPT_HANDLER Handler
696 gceSTATUS
697 gckVGINTERRUPT_Disable(
698 IN gckVGINTERRUPT Interrupt,
699 IN gctINT32 Id
702 gceSTATUS
703 gckVGINTERRUPT_Enque(
704 IN gckVGINTERRUPT Interrupt
707 gceSTATUS
708 gckVGINTERRUPT_DumpState(
709 IN gckVGINTERRUPT Interrupt
713 /******************************************************************************\
714 ******************************* gckVGCOMMAND Object *******************************
715 \******************************************************************************/
717 typedef struct _gckVGCOMMAND * gckVGCOMMAND;
719 /* Construct a new gckVGCOMMAND object. */
720 gceSTATUS
721 gckVGCOMMAND_Construct(
722 IN gckVGKERNEL Kernel,
723 IN gctUINT TaskGranularity,
724 IN gctUINT QueueSize,
725 OUT gckVGCOMMAND * Command
728 /* Destroy an gckVGCOMMAND object. */
729 gceSTATUS
730 gckVGCOMMAND_Destroy(
731 IN gckVGCOMMAND Command
734 /* Query command buffer attributes. */
735 gceSTATUS
736 gckVGCOMMAND_QueryCommandBuffer(
737 IN gckVGCOMMAND Command,
738 OUT gcsCOMMAND_BUFFER_INFO_PTR Information
741 /* Allocate a command queue. */
742 gceSTATUS
743 gckVGCOMMAND_Allocate(
744 IN gckVGCOMMAND Command,
745 IN gctSIZE_T Size,
746 OUT gcsCMDBUFFER_PTR * CommandBuffer,
747 OUT gctPOINTER * Data
750 /* Release memory held by the command queue. */
751 gceSTATUS
752 gckVGCOMMAND_Free(
753 IN gckVGCOMMAND Command,
754 IN gcsCMDBUFFER_PTR CommandBuffer
757 /* Schedule the command queue for execution. */
758 gceSTATUS
759 gckVGCOMMAND_Execute(
760 IN gckVGCOMMAND Command,
761 IN gcsCMDBUFFER_PTR CommandBuffer
764 /* Commit a buffer to the command queue. */
765 gceSTATUS
766 gckVGCOMMAND_Commit(
767 IN gckVGCOMMAND Command,
768 IN gcsVGCONTEXT_PTR Context,
769 IN gcsVGCMDQUEUE_PTR Queue,
770 IN gctUINT EntryCount,
771 IN gcsTASK_MASTER_TABLE_PTR TaskTable
774 /******************************************************************************\
775 ********************************* gckVGMMU Object ********************************
776 \******************************************************************************/
778 typedef struct _gckVGMMU * gckVGMMU;
780 /* Construct a new gckVGMMU object. */
781 gceSTATUS
782 gckVGMMU_Construct(
783 IN gckVGKERNEL Kernel,
784 IN gctSIZE_T MmuSize,
785 OUT gckVGMMU * Mmu
788 /* Destroy an gckVGMMU object. */
789 gceSTATUS
790 gckVGMMU_Destroy(
791 IN gckVGMMU Mmu
794 /* Allocate pages inside the MMU. */
795 gceSTATUS
796 gckVGMMU_AllocatePages(
797 IN gckVGMMU Mmu,
798 IN gctSIZE_T PageCount,
799 OUT gctPOINTER * PageTable,
800 OUT gctUINT32 * Address
803 /* Remove a page table from the MMU. */
804 gceSTATUS
805 gckVGMMU_FreePages(
806 IN gckVGMMU Mmu,
807 IN gctPOINTER PageTable,
808 IN gctSIZE_T PageCount
811 /* Set the MMU page with info. */
812 gceSTATUS
813 gckVGMMU_SetPage(
814 IN gckVGMMU Mmu,
815 IN gctUINT32 PageAddress,
816 IN gctUINT32 *PageEntry
819 #endif /* gcdENABLE_VG */
821 #ifdef __cplusplus
822 } /* extern "C" */
823 #endif
825 #endif /* __gc_hal_h_ */