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 #ifndef __gc_hal_kernel_context_h_
25 #define __gc_hal_kernel_context_h_
27 #include "gc_hal_kernel_buffer.h"
33 /* Maps state locations within the context buffer. */
34 typedef struct _gcsSTATE_MAP
* gcsSTATE_MAP_PTR
;
35 typedef struct _gcsSTATE_MAP
37 /* Index of the state in the context buffer. */
46 typedef struct _gcsCONTEXT
* gcsCONTEXT_PTR
;
47 typedef struct _gcsCONTEXT
49 /* For debugging: the number of context buffer in the order of creation. */
50 #if gcmIS_DEBUG(gcdDEBUG_CODE)
54 /* Pointer to gckEVENT object. */
57 /* Context busy signal. */
60 /* Physical address of the context buffer. */
61 gctPHYS_ADDR physical
;
63 /* Logical address of the context buffer. */
64 gctUINT32_PTR logical
;
66 /* Pointer to the LINK commands. */
70 /* The number of pending state deltas. */
73 /* Pointer to the first delta to be applied. */
74 gcsSTATE_DELTA_PTR delta
;
76 /* Next context buffer. */
81 /* gckCONTEXT structure that hold the current context. */
87 /* Pointer to gckOS object. */
90 /* Pointer to gckHARDWARE object. */
93 /* Command buffer alignment. */
95 gctSIZE_T reservedHead
;
96 gctSIZE_T reservedTail
;
98 /* Context buffer metrics. */
101 gctSIZE_T bufferSize
;
102 gctUINT32 linkIndex2D
;
103 gctUINT32 linkIndex3D
;
104 gctUINT32 linkIndexXD
;
105 gctUINT32 entryOffset3D
;
106 gctUINT32 entryOffsetXDFrom2D
;
107 gctUINT32 entryOffsetXDFrom3D
;
113 gcsCONTEXT_PTR dirtyBuffer
;
116 gcsSTATE_MAP_PTR map
;
118 /* List of context buffers. */
119 gcsCONTEXT_PTR buffer
;
121 /* A copy of the user record array. */
122 gctUINT recordArraySize
;
123 gcsSTATE_DELTA_RECORD_PTR recordArray
;
125 /* Requested pipe select for context. */
126 gcePIPE_SELECT entryPipe
;
127 gcePIPE_SELECT exitPipe
;
129 /* Variables used for building state buffer. */
130 gctUINT32 lastAddress
;
145 #endif /* __gc_hal_kernel_context_h_ */