1209ff23fSmrg/*
2209ff23fSmrg * Copyright 2006-2007 Advanced Micro Devices, Inc.
3209ff23fSmrg *
4209ff23fSmrg * Permission is hereby granted, free of charge, to any person obtaining a
5209ff23fSmrg * copy of this software and associated documentation files (the "Software"),
6209ff23fSmrg * to deal in the Software without restriction, including without limitation
7209ff23fSmrg * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8209ff23fSmrg * and/or sell copies of the Software, and to permit persons to whom the
9209ff23fSmrg * Software is furnished to do so, subject to the following conditions:
10209ff23fSmrg *
11209ff23fSmrg * The above copyright notice and this permission notice shall be included in
12209ff23fSmrg * all copies or substantial portions of the Software.
13209ff23fSmrg *
14209ff23fSmrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15209ff23fSmrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16209ff23fSmrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17209ff23fSmrg * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18209ff23fSmrg * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19209ff23fSmrg * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20209ff23fSmrg * OTHER DEALINGS IN THE SOFTWARE.
21209ff23fSmrg */
22209ff23fSmrg
23209ff23fSmrg/**
24209ff23fSmrg
25209ff23fSmrgModule Name:
26209ff23fSmrg
27209ff23fSmrg    CD_Operations.c
28209ff23fSmrg
29209ff23fSmrgAbstract:
30209ff23fSmrg
31209ff23fSmrg		Functions Implementing Command Operations and other common functions
32209ff23fSmrg
33209ff23fSmrgRevision History:
34209ff23fSmrg
35209ff23fSmrg	NEG:27.09.2002	Initiated.
36209ff23fSmrg--*/
37209ff23fSmrg#define __SW_4
38209ff23fSmrg
39209ff23fSmrg#ifdef HAVE_CONFIG_H
40209ff23fSmrg#include "config.h"
41209ff23fSmrg#endif
42209ff23fSmrg
43209ff23fSmrg#include <X11/Xos.h>
44209ff23fSmrg#include "xorg-server.h"
45ad43ddacSmrg#include "compiler.h"
46209ff23fSmrg
47209ff23fSmrg#include "Decoder.h"
48209ff23fSmrg
49209ff23fSmrgVOID PutDataRegister(PARSER_TEMP_DATA STACK_BASED * pParserTempData);
50209ff23fSmrgVOID PutDataPS(PARSER_TEMP_DATA STACK_BASED * pParserTempData);
51209ff23fSmrgVOID PutDataWS(PARSER_TEMP_DATA STACK_BASED * pParserTempData);
52209ff23fSmrgVOID PutDataFB(PARSER_TEMP_DATA STACK_BASED * pParserTempData);
53209ff23fSmrgVOID PutDataPLL(PARSER_TEMP_DATA STACK_BASED * pParserTempData);
54209ff23fSmrgVOID PutDataMC(PARSER_TEMP_DATA STACK_BASED * pParserTempData);
55209ff23fSmrg
56209ff23fSmrgUINT32 GetParametersDirect32(PARSER_TEMP_DATA STACK_BASED *	pParserTempData);
57209ff23fSmrgUINT32 GetParametersDirect16(PARSER_TEMP_DATA STACK_BASED *	pParserTempData);
58209ff23fSmrgUINT32 GetParametersDirect8(PARSER_TEMP_DATA STACK_BASED *	pParserTempData);
59209ff23fSmrg
60209ff23fSmrgUINT32 GetParametersRegister(PARSER_TEMP_DATA STACK_BASED *	pParserTempData);
61209ff23fSmrgUINT32 GetParametersPS(PARSER_TEMP_DATA STACK_BASED *	pParserTempData);
62209ff23fSmrgUINT32 GetParametersWS(PARSER_TEMP_DATA STACK_BASED *	pParserTempData);
63209ff23fSmrgUINT32 GetParametersFB(PARSER_TEMP_DATA STACK_BASED *	pParserTempData);
64209ff23fSmrgUINT32 GetParametersPLL(PARSER_TEMP_DATA STACK_BASED *	pParserTempData);
65209ff23fSmrgUINT32 GetParametersMC(PARSER_TEMP_DATA STACK_BASED *	pParserTempData);
66209ff23fSmrg
67209ff23fSmrgVOID SkipParameters16(PARSER_TEMP_DATA STACK_BASED *	pParserTempData);
68209ff23fSmrgVOID SkipParameters8(PARSER_TEMP_DATA STACK_BASED *	pParserTempData);
69209ff23fSmrg
70209ff23fSmrgUINT32 GetParametersIndirect(PARSER_TEMP_DATA STACK_BASED *	pParserTempData);
71209ff23fSmrgUINT32 GetParametersDirect(PARSER_TEMP_DATA STACK_BASED *	pParserTempData);
72209ff23fSmrg
73209ff23fSmrgUINT16* GetDataMasterTablePointer(DEVICE_DATA STACK_BASED*  pDeviceData);
74209ff23fSmrgUINT8 GetTrueIndexInMasterTable(PARSER_TEMP_DATA STACK_BASED * pParserTempData, UINT8 IndexInMasterTable);
75209ff23fSmrg
76209ff23fSmrg
77209ff23fSmrgWRITE_IO_FUNCTION WritePCIFunctions[8] =   {
78209ff23fSmrg    WritePCIReg32,
79209ff23fSmrg    WritePCIReg16, WritePCIReg16, WritePCIReg16,
80209ff23fSmrg    WritePCIReg8,WritePCIReg8,WritePCIReg8,WritePCIReg8
81209ff23fSmrg};
82209ff23fSmrgWRITE_IO_FUNCTION WriteIOFunctions[8] =    {
83209ff23fSmrg    WriteSysIOReg32,
84209ff23fSmrg    WriteSysIOReg16,WriteSysIOReg16,WriteSysIOReg16,
85209ff23fSmrg    WriteSysIOReg8,WriteSysIOReg8,WriteSysIOReg8,WriteSysIOReg8
86209ff23fSmrg};
87209ff23fSmrgREAD_IO_FUNCTION ReadPCIFunctions[8] =      {
88209ff23fSmrg    (READ_IO_FUNCTION)ReadPCIReg32,
89209ff23fSmrg    (READ_IO_FUNCTION)ReadPCIReg16,
90209ff23fSmrg    (READ_IO_FUNCTION)ReadPCIReg16,
91209ff23fSmrg    (READ_IO_FUNCTION)ReadPCIReg16,
92209ff23fSmrg    (READ_IO_FUNCTION)ReadPCIReg8,
93209ff23fSmrg    (READ_IO_FUNCTION)ReadPCIReg8,
94209ff23fSmrg    (READ_IO_FUNCTION)ReadPCIReg8,
95209ff23fSmrg    (READ_IO_FUNCTION)ReadPCIReg8
96209ff23fSmrg};
97209ff23fSmrgREAD_IO_FUNCTION ReadIOFunctions[8] =       {
98209ff23fSmrg    (READ_IO_FUNCTION)ReadSysIOReg32,
99209ff23fSmrg    (READ_IO_FUNCTION)ReadSysIOReg16,
100209ff23fSmrg    (READ_IO_FUNCTION)ReadSysIOReg16,
101209ff23fSmrg    (READ_IO_FUNCTION)ReadSysIOReg16,
102209ff23fSmrg    (READ_IO_FUNCTION)ReadSysIOReg8,
103209ff23fSmrg    (READ_IO_FUNCTION)ReadSysIOReg8,
104209ff23fSmrg    (READ_IO_FUNCTION)ReadSysIOReg8,
105209ff23fSmrg    (READ_IO_FUNCTION)ReadSysIOReg8
106209ff23fSmrg};
107209ff23fSmrgREAD_IO_FUNCTION GetParametersDirectArray[8]={
108209ff23fSmrg    GetParametersDirect32,
109209ff23fSmrg    GetParametersDirect16,GetParametersDirect16,GetParametersDirect16,
110209ff23fSmrg    GetParametersDirect8,GetParametersDirect8,GetParametersDirect8,
111209ff23fSmrg    GetParametersDirect8
112209ff23fSmrg};
113209ff23fSmrg
114209ff23fSmrgCOMMANDS_DECODER PutDataFunctions[6]   =     {
115209ff23fSmrg    PutDataRegister,
116209ff23fSmrg    PutDataPS,
117209ff23fSmrg    PutDataWS,
118209ff23fSmrg    PutDataFB,
119209ff23fSmrg    PutDataPLL,
120209ff23fSmrg    PutDataMC
121209ff23fSmrg};
122209ff23fSmrgCD_GET_PARAMETERS GetDestination[6]   =     {
123209ff23fSmrg    GetParametersRegister,
124209ff23fSmrg    GetParametersPS,
125209ff23fSmrg    GetParametersWS,
126209ff23fSmrg    GetParametersFB,
127209ff23fSmrg    GetParametersPLL,
128209ff23fSmrg    GetParametersMC
129209ff23fSmrg};
130209ff23fSmrg
131209ff23fSmrgCOMMANDS_DECODER SkipDestination[6]   =     {
132209ff23fSmrg    SkipParameters16,
133209ff23fSmrg    SkipParameters8,
134209ff23fSmrg    SkipParameters8,
135209ff23fSmrg    SkipParameters8,
136209ff23fSmrg    SkipParameters8,
137209ff23fSmrg    SkipParameters8
138209ff23fSmrg};
139209ff23fSmrg
140209ff23fSmrgCD_GET_PARAMETERS GetSource[8]   =          {
141209ff23fSmrg    GetParametersRegister,
142209ff23fSmrg    GetParametersPS,
143209ff23fSmrg    GetParametersWS,
144209ff23fSmrg    GetParametersFB,
145209ff23fSmrg    GetParametersIndirect,
146209ff23fSmrg    GetParametersDirect,
147209ff23fSmrg    GetParametersPLL,
148209ff23fSmrg    GetParametersMC
149209ff23fSmrg};
150209ff23fSmrg
151209ff23fSmrgUINT32 AlignmentMask[8] =                   {0xFFFFFFFF,0xFFFF,0xFFFF,0xFFFF,0xFF,0xFF,0xFF,0xFF};
152209ff23fSmrgUINT8  SourceAlignmentShift[8] =            {0,0,8,16,0,8,16,24};
153209ff23fSmrgUINT8  DestinationAlignmentShift[4] =       {0,8,16,24};
154209ff23fSmrg
155209ff23fSmrg#define INDIRECTIO_ID         1
156209ff23fSmrg#define INDIRECTIO_END_OF_ID  9
157209ff23fSmrg
158209ff23fSmrgVOID IndirectIOCommand(PARSER_TEMP_DATA STACK_BASED * pParserTempData);
159209ff23fSmrgVOID IndirectIOCommand_MOVE(PARSER_TEMP_DATA STACK_BASED * pParserTempData, UINT32 temp);
160209ff23fSmrgVOID IndirectIOCommand_MOVE_INDEX(PARSER_TEMP_DATA STACK_BASED * pParserTempData);
161209ff23fSmrgVOID IndirectIOCommand_MOVE_ATTR(PARSER_TEMP_DATA STACK_BASED * pParserTempData);
162209ff23fSmrgVOID IndirectIOCommand_MOVE_DATA(PARSER_TEMP_DATA STACK_BASED * pParserTempData);
163209ff23fSmrgVOID IndirectIOCommand_SET(PARSER_TEMP_DATA STACK_BASED * pParserTempData);
164209ff23fSmrgVOID IndirectIOCommand_CLEAR(PARSER_TEMP_DATA STACK_BASED * pParserTempData);
165209ff23fSmrg
166209ff23fSmrg
167209ff23fSmrgINDIRECT_IO_PARSER_COMMANDS  IndirectIOParserCommands[10]={
168209ff23fSmrg    {IndirectIOCommand,1},
169209ff23fSmrg    {IndirectIOCommand,2},
170209ff23fSmrg    {ReadIndReg32,3},
171209ff23fSmrg    {WriteIndReg32,3},
172209ff23fSmrg    {IndirectIOCommand_CLEAR,3},
173209ff23fSmrg    {IndirectIOCommand_SET,3},
174209ff23fSmrg    {IndirectIOCommand_MOVE_INDEX,4},
175209ff23fSmrg    {IndirectIOCommand_MOVE_ATTR,4},
176209ff23fSmrg    {IndirectIOCommand_MOVE_DATA,4},
177209ff23fSmrg    {IndirectIOCommand,3}
178209ff23fSmrg};
179209ff23fSmrg
180209ff23fSmrg
181209ff23fSmrgVOID IndirectIOCommand(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
182209ff23fSmrg{
183209ff23fSmrg}
184209ff23fSmrg
185209ff23fSmrg
186209ff23fSmrgVOID IndirectIOCommand_MOVE_INDEX(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
187209ff23fSmrg{
188209ff23fSmrg    pParserTempData->IndirectData &= ~((0xFFFFFFFF >> (32-pParserTempData->IndirectIOTablePointer[1])) << pParserTempData->IndirectIOTablePointer[3]);
189209ff23fSmrg    pParserTempData->IndirectData |=(((pParserTempData->Index >> pParserTempData->IndirectIOTablePointer[2]) &
190209ff23fSmrg				      (0xFFFFFFFF >> (32-pParserTempData->IndirectIOTablePointer[1]))) << pParserTempData->IndirectIOTablePointer[3]);
191209ff23fSmrg}
192209ff23fSmrg
193209ff23fSmrgVOID IndirectIOCommand_MOVE_ATTR(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
194209ff23fSmrg{
195209ff23fSmrg    pParserTempData->IndirectData &= ~((0xFFFFFFFF >> (32-pParserTempData->IndirectIOTablePointer[1])) << pParserTempData->IndirectIOTablePointer[3]);
196209ff23fSmrg    pParserTempData->IndirectData |=(((pParserTempData->AttributesData >> pParserTempData->IndirectIOTablePointer[2])
197209ff23fSmrg				      & (0xFFFFFFFF >> (32-pParserTempData->IndirectIOTablePointer[1]))) << pParserTempData->IndirectIOTablePointer[3]);
198209ff23fSmrg}
199209ff23fSmrg
200209ff23fSmrgVOID IndirectIOCommand_MOVE_DATA(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
201209ff23fSmrg{
202209ff23fSmrg    pParserTempData->IndirectData &= ~((0xFFFFFFFF >> (32-pParserTempData->IndirectIOTablePointer[1])) << pParserTempData->IndirectIOTablePointer[3]);
203209ff23fSmrg    pParserTempData->IndirectData |=(((pParserTempData->DestData32 >> pParserTempData->IndirectIOTablePointer[2])
204209ff23fSmrg				      & (0xFFFFFFFF >> (32-pParserTempData->IndirectIOTablePointer[1]))) << pParserTempData->IndirectIOTablePointer[3]);
205209ff23fSmrg}
206209ff23fSmrg
207209ff23fSmrg
208209ff23fSmrgVOID IndirectIOCommand_SET(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
209209ff23fSmrg{
210209ff23fSmrg    pParserTempData->IndirectData |= ((0xFFFFFFFF >> (32-pParserTempData->IndirectIOTablePointer[1])) << pParserTempData->IndirectIOTablePointer[2]);
211209ff23fSmrg}
212209ff23fSmrg
213209ff23fSmrgVOID IndirectIOCommand_CLEAR(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
214209ff23fSmrg{
215209ff23fSmrg    pParserTempData->IndirectData &= ~((0xFFFFFFFF >> (32-pParserTempData->IndirectIOTablePointer[1])) << pParserTempData->IndirectIOTablePointer[2]);
216209ff23fSmrg}
217209ff23fSmrg
218a81462e9Smrg/* from xorg-server 1.18 compiler.h */
219a81462e9Smrgstruct local__una_u32 { uint32_t x __attribute__((packed)); };
2201f80ba64Schristos
221a81462e9Smrg/* Avoid conflicts with older versions of compiler.h */
2221f80ba64Schristos#define ldw_u xldw_u
2231f80ba64Schristos#define ldl_u xldl_u
2241f80ba64Schristos#define stl_u xstl_u
225a7722d20Schristos
226a7722d20Schristosstatic __inline__ uint16_t ldw_u(uint16_t *p)
227a7722d20Schristos{
228a7722d20Schristos	uint16_t ret;
229a81462e9Smrg	memmove(&ret, p, sizeof(*p));
230a7722d20Schristos	return ret;
231a7722d20Schristos}
232a7722d20Schristos
233a7722d20Schristosstatic __inline__ uint32_t ldl_u(uint32_t *p)
234a7722d20Schristos{
235a7722d20Schristos	uint32_t ret;
236a81462e9Smrg	memmove(&ret, p, sizeof(*p));
237a7722d20Schristos	return ret;
238a7722d20Schristos}
239a7722d20Schristos
240a7722d20Schristosstatic __inline__ void stl_u(uint32_t val, uint32_t *p)
241a7722d20Schristos{
242a81462e9Smrg	struct local__una_u32 *ptr = (struct local__una_u32 *) p;
243a81462e9Smrg	ptr->x = val;
244a7722d20Schristos}
245a7722d20Schristos
246209ff23fSmrgUINT32 IndirectInputOutput(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
247209ff23fSmrg{
248209ff23fSmrg    // if ((pParserTempData->IndirectData & 0x7f)==INDIRECT_IO_MM) pParserTempData->IndirectData|=pParserTempData->CurrentPortID;
249209ff23fSmrg//  pParserTempData->IndirectIOTablePointer=pParserTempData->IndirectIOTable;
250209ff23fSmrg    while (*pParserTempData->IndirectIOTablePointer)
251209ff23fSmrg    {
252209ff23fSmrg	if ((pParserTempData->IndirectIOTablePointer[0] == INDIRECTIO_ID) &&
253209ff23fSmrg            (pParserTempData->IndirectIOTablePointer[1] == pParserTempData->IndirectData))
254209ff23fSmrg	{
255209ff23fSmrg	    pParserTempData->IndirectIOTablePointer+=IndirectIOParserCommands[*pParserTempData->IndirectIOTablePointer].csize;
256209ff23fSmrg	    while (*pParserTempData->IndirectIOTablePointer != INDIRECTIO_END_OF_ID)
257209ff23fSmrg	    {
258209ff23fSmrg		IndirectIOParserCommands[*pParserTempData->IndirectIOTablePointer].func(pParserTempData);
259209ff23fSmrg		pParserTempData->IndirectIOTablePointer+=IndirectIOParserCommands[*pParserTempData->IndirectIOTablePointer].csize;
260209ff23fSmrg	    }
261ad43ddacSmrg	    pParserTempData->IndirectIOTablePointer-=UINT16LE_TO_CPU(ldw_u((uint16_t *)(pParserTempData->IndirectIOTablePointer+1)));
262209ff23fSmrg	    pParserTempData->IndirectIOTablePointer++;
263209ff23fSmrg	    return pParserTempData->IndirectData;
264209ff23fSmrg	} else pParserTempData->IndirectIOTablePointer+=IndirectIOParserCommands[*pParserTempData->IndirectIOTablePointer].csize;
265209ff23fSmrg    }
266209ff23fSmrg    return 0;
267209ff23fSmrg}
268209ff23fSmrg
269209ff23fSmrg
270209ff23fSmrg
271209ff23fSmrgVOID PutDataRegister(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
272209ff23fSmrg{
273b7e1c893Smrg    pParserTempData->Index=(UINT32)UINT16LE_TO_CPU(pParserTempData->pCmd->Parameters.WordXX.PA_Destination);
274209ff23fSmrg    pParserTempData->Index+=pParserTempData->CurrentRegBlock;
275209ff23fSmrg    switch(pParserTempData->Multipurpose.CurrentPort){
276209ff23fSmrg	case ATI_RegsPort:
277209ff23fSmrg	    if (pParserTempData->CurrentPortID == INDIRECT_IO_MM)
278209ff23fSmrg	    {
279209ff23fSmrg		if (pParserTempData->Index==0) pParserTempData->DestData32 <<= 2;
280209ff23fSmrg		WriteReg32( pParserTempData);
281209ff23fSmrg	    } else
282209ff23fSmrg	    {
283209ff23fSmrg		pParserTempData->IndirectData=pParserTempData->CurrentPortID+INDIRECT_IO_WRITE;
284209ff23fSmrg		IndirectInputOutput(pParserTempData);
285209ff23fSmrg	    }
286209ff23fSmrg	    break;
287209ff23fSmrg	case PCI_Port:
288209ff23fSmrg	    WritePCIFunctions[pParserTempData->pCmd->Header.Attribute.SourceAlignment](pParserTempData);
289209ff23fSmrg	    break;
290209ff23fSmrg	case SystemIO_Port:
291209ff23fSmrg	    WriteIOFunctions[pParserTempData->pCmd->Header.Attribute.SourceAlignment](pParserTempData);
292209ff23fSmrg	    break;
293209ff23fSmrg    }
294209ff23fSmrg}
295209ff23fSmrg
296209ff23fSmrgVOID PutDataPS(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
297209ff23fSmrg{
298ad43ddacSmrg    stl_u(CPU_TO_UINT32LE(pParserTempData->DestData32),
299ad43ddacSmrg	  pParserTempData->pDeviceData->pParameterSpace+pParserTempData->pCmd->Parameters.ByteXX.PA_Destination);
300209ff23fSmrg}
301209ff23fSmrg
302209ff23fSmrgVOID PutDataWS(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
303209ff23fSmrg{
304209ff23fSmrg    if (pParserTempData->pCmd->Parameters.ByteXX.PA_Destination < WS_QUOTIENT_C)
305b7e1c893Smrg      *(pParserTempData->pWorkingTableData->pWorkSpace+pParserTempData->pCmd->Parameters.ByteXX.PA_Destination) = pParserTempData->DestData32;
306209ff23fSmrg    else
307b7e1c893Smrg	  switch (pParserTempData->pCmd->Parameters.ByteXX.PA_Destination)
308b7e1c893Smrg	  {
309209ff23fSmrg	    case WS_REMINDER_C:
310209ff23fSmrg		pParserTempData->MultiplicationOrDivision.Division.Reminder32=pParserTempData->DestData32;
311209ff23fSmrg		break;
312209ff23fSmrg	    case WS_QUOTIENT_C:
313209ff23fSmrg		pParserTempData->MultiplicationOrDivision.Division.Quotient32=pParserTempData->DestData32;
314209ff23fSmrg		break;
315209ff23fSmrg	    case WS_DATAPTR_C:
316209ff23fSmrg#ifndef		UEFI_BUILD
317209ff23fSmrg		pParserTempData->CurrentDataBlock=(UINT16)pParserTempData->DestData32;
318209ff23fSmrg#else
319209ff23fSmrg		pParserTempData->CurrentDataBlock=(UINTN)pParserTempData->DestData32;
320209ff23fSmrg#endif
321209ff23fSmrg		break;
322209ff23fSmrg	    case WS_SHIFT_C:
323209ff23fSmrg		pParserTempData->Shift2MaskConverter=(UINT8)pParserTempData->DestData32;
324209ff23fSmrg		break;
325209ff23fSmrg	    case WS_FB_WINDOW_C:
326209ff23fSmrg		pParserTempData->CurrentFB_Window=pParserTempData->DestData32;
327209ff23fSmrg		break;
328209ff23fSmrg	    case WS_ATTRIBUTES_C:
329209ff23fSmrg		pParserTempData->AttributesData=(UINT16)pParserTempData->DestData32;
330209ff23fSmrg		break;
331ad43ddacSmrg	    case WS_REGPTR_C:
332ad43ddacSmrg		pParserTempData->CurrentRegBlock=(UINT16)pParserTempData->DestData32;
333ad43ddacSmrg		break;
334209ff23fSmrg	}
335209ff23fSmrg
336209ff23fSmrg}
337209ff23fSmrg
338209ff23fSmrgVOID PutDataFB(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
339209ff23fSmrg{
340209ff23fSmrg    pParserTempData->Index=(UINT32)pParserTempData->pCmd->Parameters.ByteXX.PA_Destination;
341209ff23fSmrg    //Make an Index from address first, then add to the Index
342209ff23fSmrg    pParserTempData->Index+=(pParserTempData->CurrentFB_Window>>2);
343209ff23fSmrg    WriteFrameBuffer32(pParserTempData);
344209ff23fSmrg}
345209ff23fSmrg
346209ff23fSmrgVOID PutDataPLL(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
347209ff23fSmrg{
348209ff23fSmrg    pParserTempData->Index=(UINT32)pParserTempData->pCmd->Parameters.ByteXX.PA_Destination;
349209ff23fSmrg    WritePLL32( pParserTempData );
350209ff23fSmrg}
351209ff23fSmrg
352209ff23fSmrgVOID PutDataMC(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
353209ff23fSmrg{
354209ff23fSmrg    pParserTempData->Index=(UINT32)pParserTempData->pCmd->Parameters.ByteXX.PA_Destination;
355209ff23fSmrg    WriteMC32( pParserTempData );
356209ff23fSmrg}
357209ff23fSmrg
358209ff23fSmrg
359209ff23fSmrgVOID SkipParameters8(PARSER_TEMP_DATA STACK_BASED *	pParserTempData)
360209ff23fSmrg{
361209ff23fSmrg    pParserTempData->pWorkingTableData->IP+=sizeof(UINT8);
362209ff23fSmrg}
363209ff23fSmrg
364209ff23fSmrgVOID SkipParameters16(PARSER_TEMP_DATA STACK_BASED *	pParserTempData)
365209ff23fSmrg{
366209ff23fSmrg    pParserTempData->pWorkingTableData->IP+=sizeof(UINT16);
367209ff23fSmrg}
368209ff23fSmrg
369209ff23fSmrg
370209ff23fSmrgUINT32 GetParametersRegister(PARSER_TEMP_DATA STACK_BASED *	pParserTempData)
371209ff23fSmrg{
372ad43ddacSmrg    pParserTempData->Index=UINT16LE_TO_CPU(ldw_u((uint16_t *)pParserTempData->pWorkingTableData->IP));
373209ff23fSmrg    pParserTempData->pWorkingTableData->IP+=sizeof(UINT16);
374209ff23fSmrg    pParserTempData->Index+=pParserTempData->CurrentRegBlock;
375209ff23fSmrg    switch(pParserTempData->Multipurpose.CurrentPort)
376209ff23fSmrg    {
377209ff23fSmrg	case PCI_Port:
378209ff23fSmrg	    return ReadPCIFunctions[pParserTempData->pCmd->Header.Attribute.SourceAlignment](pParserTempData);
379209ff23fSmrg	case SystemIO_Port:
380209ff23fSmrg	    return ReadIOFunctions[pParserTempData->pCmd->Header.Attribute.SourceAlignment](pParserTempData);
381209ff23fSmrg	case ATI_RegsPort:
382209ff23fSmrg	default:
383209ff23fSmrg	    if (pParserTempData->CurrentPortID == INDIRECT_IO_MM) return ReadReg32( pParserTempData );
384209ff23fSmrg	    else
385209ff23fSmrg	    {
386209ff23fSmrg		pParserTempData->IndirectData=pParserTempData->CurrentPortID+INDIRECT_IO_READ;
387209ff23fSmrg		return IndirectInputOutput(pParserTempData);
388209ff23fSmrg	    }
389209ff23fSmrg    }
390209ff23fSmrg}
391209ff23fSmrg
392209ff23fSmrgUINT32 GetParametersPS(PARSER_TEMP_DATA STACK_BASED *	pParserTempData)
393209ff23fSmrg{
394b7e1c893Smrg    UINT32 data;
395209ff23fSmrg    pParserTempData->Index=*pParserTempData->pWorkingTableData->IP;
396209ff23fSmrg    pParserTempData->pWorkingTableData->IP+=sizeof(UINT8);
39769d0ef43Smrg    data = UINT32LE_TO_CPU(ldl_u(pParserTempData->pDeviceData->pParameterSpace+pParserTempData->Index));
398b7e1c893Smrg    return data;
399209ff23fSmrg}
400209ff23fSmrg
401209ff23fSmrgUINT32 GetParametersWS(PARSER_TEMP_DATA STACK_BASED *	pParserTempData)
402209ff23fSmrg{
403209ff23fSmrg    pParserTempData->Index=*pParserTempData->pWorkingTableData->IP;
404209ff23fSmrg    pParserTempData->pWorkingTableData->IP+=sizeof(UINT8);
405209ff23fSmrg    if (pParserTempData->Index < WS_QUOTIENT_C)
406209ff23fSmrg	return *(pParserTempData->pWorkingTableData->pWorkSpace+pParserTempData->Index);
407209ff23fSmrg    else
408209ff23fSmrg	switch (pParserTempData->Index)
409209ff23fSmrg	{
410209ff23fSmrg	    case WS_REMINDER_C:
411209ff23fSmrg		return pParserTempData->MultiplicationOrDivision.Division.Reminder32;
412209ff23fSmrg	    case WS_QUOTIENT_C:
413209ff23fSmrg		return pParserTempData->MultiplicationOrDivision.Division.Quotient32;
414209ff23fSmrg	    case WS_DATAPTR_C:
415209ff23fSmrg		return (UINT32)pParserTempData->CurrentDataBlock;
416209ff23fSmrg	    case WS_OR_MASK_C:
417209ff23fSmrg		return ((UINT32)1) << pParserTempData->Shift2MaskConverter;
418209ff23fSmrg	    case WS_AND_MASK_C:
419209ff23fSmrg		return ~(((UINT32)1) << pParserTempData->Shift2MaskConverter);
420209ff23fSmrg	    case WS_FB_WINDOW_C:
421209ff23fSmrg		return pParserTempData->CurrentFB_Window;
422209ff23fSmrg	    case WS_ATTRIBUTES_C:
423209ff23fSmrg		return pParserTempData->AttributesData;
424ad43ddacSmrg	    case WS_REGPTR_C:
425ad43ddacSmrg		return (UINT32)pParserTempData->CurrentRegBlock;
426209ff23fSmrg	}
427209ff23fSmrg    return 0;
428209ff23fSmrg
429209ff23fSmrg}
430209ff23fSmrg
431209ff23fSmrgUINT32 GetParametersFB(PARSER_TEMP_DATA STACK_BASED *	pParserTempData)
432209ff23fSmrg{
433209ff23fSmrg    pParserTempData->Index=*pParserTempData->pWorkingTableData->IP;
434209ff23fSmrg    pParserTempData->pWorkingTableData->IP+=sizeof(UINT8);
435209ff23fSmrg    pParserTempData->Index+=(pParserTempData->CurrentFB_Window>>2);
436209ff23fSmrg    return ReadFrameBuffer32(pParserTempData);
437209ff23fSmrg}
438209ff23fSmrg
439209ff23fSmrgUINT32 GetParametersPLL(PARSER_TEMP_DATA STACK_BASED *	pParserTempData)
440209ff23fSmrg{
441209ff23fSmrg    pParserTempData->Index=*pParserTempData->pWorkingTableData->IP;
442209ff23fSmrg    pParserTempData->pWorkingTableData->IP+=sizeof(UINT8);
443209ff23fSmrg    return ReadPLL32( pParserTempData );
444209ff23fSmrg}
445209ff23fSmrg
446209ff23fSmrgUINT32 GetParametersMC(PARSER_TEMP_DATA STACK_BASED *	pParserTempData)
447209ff23fSmrg{
448209ff23fSmrg    pParserTempData->Index=*pParserTempData->pWorkingTableData->IP;
449209ff23fSmrg    pParserTempData->pWorkingTableData->IP+=sizeof(UINT8);
450209ff23fSmrg    return ReadMC32( pParserTempData );
451209ff23fSmrg}
452209ff23fSmrg
453209ff23fSmrg
454209ff23fSmrgUINT32 GetParametersIndirect(PARSER_TEMP_DATA STACK_BASED *	pParserTempData)
455209ff23fSmrg{
456ad43ddacSmrg    UINT32 ret;
457b7e1c893Smrg
458ad43ddacSmrg    pParserTempData->Index=UINT16LE_TO_CPU(ldw_u((uint16_t *)pParserTempData->pWorkingTableData->IP));
459209ff23fSmrg    pParserTempData->pWorkingTableData->IP+=sizeof(UINT16);
46069d0ef43Smrg    ret = UINT32LE_TO_CPU(ldl_u((UINT32*)(RELATIVE_TO_BIOS_IMAGE(pParserTempData->Index)+pParserTempData->CurrentDataBlock)));
461b7e1c893Smrg    return ret;
462209ff23fSmrg}
463209ff23fSmrg
464209ff23fSmrgUINT32 GetParametersDirect8(PARSER_TEMP_DATA STACK_BASED *	pParserTempData)
465209ff23fSmrg{
466209ff23fSmrg    pParserTempData->CD_Mask.SrcAlignment=alignmentByte0;
467209ff23fSmrg    pParserTempData->Index=*(UINT8*)pParserTempData->pWorkingTableData->IP;
468209ff23fSmrg    pParserTempData->pWorkingTableData->IP+=sizeof(UINT8);
469209ff23fSmrg    return pParserTempData->Index;
470209ff23fSmrg}
471209ff23fSmrg
472209ff23fSmrgUINT32 GetParametersDirect16(PARSER_TEMP_DATA STACK_BASED *	pParserTempData)
473209ff23fSmrg{
474209ff23fSmrg    pParserTempData->CD_Mask.SrcAlignment=alignmentLowerWord;
475ad43ddacSmrg    pParserTempData->Index=UINT16LE_TO_CPU(ldw_u((uint16_t *)pParserTempData->pWorkingTableData->IP));
476209ff23fSmrg    pParserTempData->pWorkingTableData->IP+=sizeof(UINT16);
477209ff23fSmrg    return pParserTempData->Index;
478209ff23fSmrg}
479209ff23fSmrg
480209ff23fSmrgUINT32 GetParametersDirect32(PARSER_TEMP_DATA STACK_BASED *	pParserTempData)
481209ff23fSmrg{
482209ff23fSmrg    pParserTempData->CD_Mask.SrcAlignment=alignmentDword;
48369d0ef43Smrg    pParserTempData->Index=UINT32LE_TO_CPU(ldl_u((UINT32*)pParserTempData->pWorkingTableData->IP));
484209ff23fSmrg    pParserTempData->pWorkingTableData->IP+=sizeof(UINT32);
485209ff23fSmrg    return pParserTempData->Index;
486209ff23fSmrg}
487209ff23fSmrg
488209ff23fSmrg
489209ff23fSmrgUINT32 GetParametersDirect(PARSER_TEMP_DATA STACK_BASED *	pParserTempData)
490209ff23fSmrg{
491209ff23fSmrg    return GetParametersDirectArray[pParserTempData->pCmd->Header.Attribute.SourceAlignment](pParserTempData);
492209ff23fSmrg}
493209ff23fSmrg
494209ff23fSmrg
495209ff23fSmrgVOID CommonSourceDataTransformation(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
496209ff23fSmrg{
497209ff23fSmrg    pParserTempData->SourceData32 >>= SourceAlignmentShift[pParserTempData->CD_Mask.SrcAlignment];
498209ff23fSmrg    pParserTempData->SourceData32 &=  AlignmentMask[pParserTempData->CD_Mask.SrcAlignment];
499209ff23fSmrg    pParserTempData->SourceData32 <<= DestinationAlignmentShift[pParserTempData->CD_Mask.DestAlignment];
500209ff23fSmrg}
501209ff23fSmrg
502209ff23fSmrgVOID CommonOperationDataTransformation(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
503209ff23fSmrg{
504209ff23fSmrg    pParserTempData->SourceData32 >>= SourceAlignmentShift[pParserTempData->CD_Mask.SrcAlignment];
505209ff23fSmrg    pParserTempData->SourceData32 &= AlignmentMask[pParserTempData->CD_Mask.SrcAlignment];
506209ff23fSmrg    pParserTempData->DestData32   >>= DestinationAlignmentShift[pParserTempData->CD_Mask.DestAlignment];
507209ff23fSmrg    pParserTempData->DestData32   &= AlignmentMask[pParserTempData->CD_Mask.SrcAlignment];
508209ff23fSmrg}
509209ff23fSmrg
510209ff23fSmrgVOID ProcessMove(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
511209ff23fSmrg{
512209ff23fSmrg    if (pParserTempData->CD_Mask.SrcAlignment!=alignmentDword)
513209ff23fSmrg    {
514b7e1c893Smrg				pParserTempData->DestData32=GetDestination[pParserTempData->ParametersType.Destination](pParserTempData);
515209ff23fSmrg    } else
516209ff23fSmrg    {
517209ff23fSmrg	SkipDestination[pParserTempData->ParametersType.Destination](pParserTempData);
518209ff23fSmrg    }
519209ff23fSmrg    pParserTempData->SourceData32=GetSource[pParserTempData->ParametersType.Source](pParserTempData);
520209ff23fSmrg
521209ff23fSmrg    if (pParserTempData->CD_Mask.SrcAlignment!=alignmentDword)
522209ff23fSmrg    {
523209ff23fSmrg	pParserTempData->DestData32 &= ~(AlignmentMask[pParserTempData->CD_Mask.SrcAlignment] << DestinationAlignmentShift[pParserTempData->CD_Mask.DestAlignment]);
524209ff23fSmrg	CommonSourceDataTransformation(pParserTempData);
525209ff23fSmrg	pParserTempData->DestData32 |= pParserTempData->SourceData32;
526209ff23fSmrg    } else
527209ff23fSmrg    {
528209ff23fSmrg	pParserTempData->DestData32=pParserTempData->SourceData32;
529209ff23fSmrg    }
530209ff23fSmrg    PutDataFunctions[pParserTempData->ParametersType.Destination](pParserTempData);
531209ff23fSmrg}
532209ff23fSmrg
533209ff23fSmrgVOID ProcessMask(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
534209ff23fSmrg{
53507c49eabSmrg    UINT8 src;
536209ff23fSmrg
537209ff23fSmrg    pParserTempData->DestData32=GetDestination[pParserTempData->ParametersType.Destination](pParserTempData);
53807c49eabSmrg    src = pParserTempData->CD_Mask.SrcAlignment;
539209ff23fSmrg    pParserTempData->SourceData32=GetParametersDirect(pParserTempData);
540ad43ddacSmrg    pParserTempData->Index=GetSource[pParserTempData->ParametersType.Source](pParserTempData);
541209ff23fSmrg    pParserTempData->SourceData32 <<= DestinationAlignmentShift[pParserTempData->CD_Mask.DestAlignment];
542209ff23fSmrg    pParserTempData->SourceData32 |= ~(AlignmentMask[pParserTempData->CD_Mask.SrcAlignment] << DestinationAlignmentShift[pParserTempData->CD_Mask.DestAlignment]);
543209ff23fSmrg    pParserTempData->DestData32   &= pParserTempData->SourceData32;
54407c49eabSmrg    pParserTempData->Index        >>= SourceAlignmentShift[src];
545209ff23fSmrg    pParserTempData->Index        &= AlignmentMask[pParserTempData->CD_Mask.SrcAlignment];
546209ff23fSmrg    pParserTempData->Index        <<= DestinationAlignmentShift[pParserTempData->CD_Mask.DestAlignment];
547209ff23fSmrg    pParserTempData->DestData32   |= pParserTempData->Index;
548209ff23fSmrg    PutDataFunctions[pParserTempData->ParametersType.Destination](pParserTempData);
549209ff23fSmrg}
550209ff23fSmrg
551209ff23fSmrgVOID ProcessAnd(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
552209ff23fSmrg{
553209ff23fSmrg    pParserTempData->DestData32=GetDestination[pParserTempData->ParametersType.Destination](pParserTempData);
554209ff23fSmrg    pParserTempData->SourceData32=GetSource[pParserTempData->ParametersType.Source](pParserTempData);
555209ff23fSmrg    pParserTempData->SourceData32 >>= SourceAlignmentShift[pParserTempData->CD_Mask.SrcAlignment];
556209ff23fSmrg    pParserTempData->SourceData32 <<= DestinationAlignmentShift[pParserTempData->CD_Mask.DestAlignment];
557209ff23fSmrg    pParserTempData->SourceData32 |= ~(AlignmentMask[pParserTempData->CD_Mask.SrcAlignment] << DestinationAlignmentShift[pParserTempData->CD_Mask.DestAlignment]);
558209ff23fSmrg    pParserTempData->DestData32   &= pParserTempData->SourceData32;
559209ff23fSmrg    PutDataFunctions[pParserTempData->ParametersType.Destination](pParserTempData);
560209ff23fSmrg}
561209ff23fSmrg
562209ff23fSmrgVOID ProcessOr(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
563209ff23fSmrg{
564209ff23fSmrg    pParserTempData->DestData32=GetDestination[pParserTempData->ParametersType.Destination](pParserTempData);
565209ff23fSmrg    pParserTempData->SourceData32=GetSource[pParserTempData->ParametersType.Source](pParserTempData);
566209ff23fSmrg    CommonSourceDataTransformation(pParserTempData);
567209ff23fSmrg    pParserTempData->DestData32 |= pParserTempData->SourceData32;
568209ff23fSmrg    PutDataFunctions[pParserTempData->ParametersType.Destination](pParserTempData);
569209ff23fSmrg}
570209ff23fSmrg
571209ff23fSmrgVOID ProcessXor(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
572209ff23fSmrg{
573209ff23fSmrg    pParserTempData->DestData32=GetDestination[pParserTempData->ParametersType.Destination](pParserTempData);
574209ff23fSmrg    pParserTempData->SourceData32=GetSource[pParserTempData->ParametersType.Source](pParserTempData);
575209ff23fSmrg    CommonSourceDataTransformation(pParserTempData);
576209ff23fSmrg    pParserTempData->DestData32 ^= pParserTempData->SourceData32;
577209ff23fSmrg    PutDataFunctions[pParserTempData->ParametersType.Destination](pParserTempData);
578209ff23fSmrg}
579209ff23fSmrg
580209ff23fSmrgVOID ProcessShl(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
581209ff23fSmrg{
582209ff23fSmrg    pParserTempData->DestData32=GetDestination[pParserTempData->ParametersType.Destination](pParserTempData);
583209ff23fSmrg    pParserTempData->SourceData32=GetSource[pParserTempData->ParametersType.Source](pParserTempData);
584209ff23fSmrg    CommonSourceDataTransformation(pParserTempData);
585209ff23fSmrg    pParserTempData->DestData32 <<= pParserTempData->SourceData32;
586209ff23fSmrg    PutDataFunctions[pParserTempData->ParametersType.Destination](pParserTempData);
587209ff23fSmrg}
588209ff23fSmrg
589209ff23fSmrgVOID ProcessShr(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
590209ff23fSmrg{
591209ff23fSmrg    pParserTempData->DestData32=GetDestination[pParserTempData->ParametersType.Destination](pParserTempData);
592209ff23fSmrg    pParserTempData->SourceData32=GetSource[pParserTempData->ParametersType.Source](pParserTempData);
593209ff23fSmrg    CommonSourceDataTransformation(pParserTempData);
594209ff23fSmrg    pParserTempData->DestData32 >>= pParserTempData->SourceData32;
595209ff23fSmrg    PutDataFunctions[pParserTempData->ParametersType.Destination](pParserTempData);
596209ff23fSmrg}
597209ff23fSmrg
598209ff23fSmrg
599209ff23fSmrgVOID ProcessADD(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
600209ff23fSmrg{
601209ff23fSmrg    pParserTempData->DestData32=GetDestination[pParserTempData->ParametersType.Destination](pParserTempData);
602209ff23fSmrg    pParserTempData->SourceData32=GetSource[pParserTempData->ParametersType.Source](pParserTempData);
603209ff23fSmrg    CommonSourceDataTransformation(pParserTempData);
604209ff23fSmrg    pParserTempData->DestData32 += pParserTempData->SourceData32;
605209ff23fSmrg    PutDataFunctions[pParserTempData->ParametersType.Destination](pParserTempData);
606209ff23fSmrg}
607209ff23fSmrg
608209ff23fSmrgVOID ProcessSUB(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
609209ff23fSmrg{
610209ff23fSmrg    pParserTempData->DestData32=GetDestination[pParserTempData->ParametersType.Destination](pParserTempData);
611209ff23fSmrg    pParserTempData->SourceData32=GetSource[pParserTempData->ParametersType.Source](pParserTempData);
612209ff23fSmrg    CommonSourceDataTransformation(pParserTempData);
613209ff23fSmrg    pParserTempData->DestData32 -= pParserTempData->SourceData32;
614209ff23fSmrg    PutDataFunctions[pParserTempData->ParametersType.Destination](pParserTempData);
615209ff23fSmrg}
616209ff23fSmrg
617209ff23fSmrgVOID ProcessMUL(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
618209ff23fSmrg{
619209ff23fSmrg    pParserTempData->DestData32=GetDestination[pParserTempData->ParametersType.Destination](pParserTempData);
620209ff23fSmrg    pParserTempData->SourceData32=GetSource[pParserTempData->ParametersType.Source](pParserTempData);
621209ff23fSmrg    CommonOperationDataTransformation(pParserTempData);
622209ff23fSmrg    pParserTempData->MultiplicationOrDivision.Multiplication.Low32Bit=pParserTempData->DestData32 * pParserTempData->SourceData32;
623209ff23fSmrg}
624209ff23fSmrg
625209ff23fSmrgVOID ProcessDIV(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
626209ff23fSmrg{
627209ff23fSmrg    pParserTempData->DestData32=GetDestination[pParserTempData->ParametersType.Destination](pParserTempData);
628209ff23fSmrg    pParserTempData->SourceData32=GetSource[pParserTempData->ParametersType.Source](pParserTempData);
629209ff23fSmrg
630209ff23fSmrg    CommonOperationDataTransformation(pParserTempData);
631209ff23fSmrg    pParserTempData->MultiplicationOrDivision.Division.Quotient32=
632209ff23fSmrg	pParserTempData->DestData32 / pParserTempData->SourceData32;
633209ff23fSmrg    pParserTempData->MultiplicationOrDivision.Division.Reminder32=
634209ff23fSmrg	pParserTempData->DestData32 % pParserTempData->SourceData32;
635209ff23fSmrg}
636209ff23fSmrg
637209ff23fSmrg
638209ff23fSmrgVOID ProcessCompare(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
639209ff23fSmrg{
640209ff23fSmrg    pParserTempData->DestData32=GetDestination[pParserTempData->ParametersType.Destination](pParserTempData);
641209ff23fSmrg    pParserTempData->SourceData32=GetSource[pParserTempData->ParametersType.Source](pParserTempData);
642209ff23fSmrg
643209ff23fSmrg    CommonOperationDataTransformation(pParserTempData);
644209ff23fSmrg
645209ff23fSmrg    // Here we just set flags based on evaluation
646209ff23fSmrg    if (pParserTempData->DestData32==pParserTempData->SourceData32)
647209ff23fSmrg	pParserTempData->CompareFlags = Equal;
648209ff23fSmrg    else
649209ff23fSmrg	pParserTempData->CompareFlags =
650209ff23fSmrg	    (UINT8)((pParserTempData->DestData32<pParserTempData->SourceData32) ? Below : Above);
651209ff23fSmrg
652209ff23fSmrg}
653209ff23fSmrg
654209ff23fSmrgVOID ProcessClear(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
655209ff23fSmrg{
656209ff23fSmrg    pParserTempData->DestData32=GetDestination[pParserTempData->ParametersType.Destination](pParserTempData);
657b7e1c893Smrg
658b7e1c893Smrg    if (pParserTempData->ParametersType.Destination == 0 &&
659b7e1c893Smrg	pParserTempData->Multipurpose.CurrentPort == ATI_RegsPort &&
660b7e1c893Smrg	pParserTempData->Index == 0) {
661b7e1c893Smrg        pParserTempData->DestData32 = 0;
662b7e1c893Smrg    } else
663b7e1c893Smrg        pParserTempData->DestData32 &= ~(AlignmentMask[pParserTempData->CD_Mask.SrcAlignment] << SourceAlignmentShift[pParserTempData->CD_Mask.SrcAlignment]);
664209ff23fSmrg    PutDataFunctions[pParserTempData->ParametersType.Destination](pParserTempData);
665209ff23fSmrg
666209ff23fSmrg}
667209ff23fSmrg
668209ff23fSmrgVOID ProcessShift(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
669209ff23fSmrg{
670209ff23fSmrg    UINT32 mask = AlignmentMask[pParserTempData->CD_Mask.SrcAlignment] << SourceAlignmentShift[pParserTempData->CD_Mask.SrcAlignment];
671209ff23fSmrg    pParserTempData->DestData32=GetDestination[pParserTempData->ParametersType.Destination](pParserTempData);
672209ff23fSmrg    pParserTempData->SourceData32=GetParametersDirect8(pParserTempData);
673209ff23fSmrg
674209ff23fSmrg    // save original value of the destination
675209ff23fSmrg    pParserTempData->Index = pParserTempData->DestData32 & ~mask;
676209ff23fSmrg    pParserTempData->DestData32 &= mask;
677209ff23fSmrg
678209ff23fSmrg    if (pParserTempData->pCmd->Header.Opcode < SHIFT_RIGHT_REG_OPCODE)
679209ff23fSmrg	pParserTempData->DestData32 <<= pParserTempData->SourceData32; else
680209ff23fSmrg	    pParserTempData->DestData32 >>= pParserTempData->SourceData32;
681209ff23fSmrg
682209ff23fSmrg    // Clear any bits shifted out of masked area...
683209ff23fSmrg    pParserTempData->DestData32 &= mask;
684209ff23fSmrg    // ... and restore the area outside of masked with original values
685209ff23fSmrg    pParserTempData->DestData32 |= pParserTempData->Index;
686209ff23fSmrg
687209ff23fSmrg    // write data back
688209ff23fSmrg    PutDataFunctions[pParserTempData->ParametersType.Destination](pParserTempData);
689209ff23fSmrg}
690209ff23fSmrg
691209ff23fSmrgVOID ProcessTest(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
692209ff23fSmrg{
693209ff23fSmrg    pParserTempData->DestData32=GetDestination[pParserTempData->ParametersType.Destination](pParserTempData);
694209ff23fSmrg    pParserTempData->SourceData32=GetSource[pParserTempData->ParametersType.Source](pParserTempData);
695209ff23fSmrg    CommonOperationDataTransformation(pParserTempData);
696209ff23fSmrg    pParserTempData->CompareFlags =
697209ff23fSmrg	(UINT8)((pParserTempData->DestData32 & pParserTempData->SourceData32) ? NotEqual : Equal);
698209ff23fSmrg
699209ff23fSmrg}
700209ff23fSmrg
701209ff23fSmrgVOID ProcessSetFB_Base(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
702209ff23fSmrg{
703209ff23fSmrg    pParserTempData->SourceData32=GetSource[pParserTempData->ParametersType.Source](pParserTempData);
704209ff23fSmrg    pParserTempData->SourceData32 >>= SourceAlignmentShift[pParserTempData->CD_Mask.SrcAlignment];
705209ff23fSmrg    pParserTempData->SourceData32 &= AlignmentMask[pParserTempData->CD_Mask.SrcAlignment];
706209ff23fSmrg    pParserTempData->CurrentFB_Window=pParserTempData->SourceData32;
707209ff23fSmrg}
708209ff23fSmrg
709209ff23fSmrgVOID ProcessSwitch(PARSER_TEMP_DATA STACK_BASED * pParserTempData){
710209ff23fSmrg    pParserTempData->SourceData32=GetSource[pParserTempData->ParametersType.Source](pParserTempData);
711209ff23fSmrg    pParserTempData->SourceData32 >>= SourceAlignmentShift[pParserTempData->CD_Mask.SrcAlignment];
712209ff23fSmrg    pParserTempData->SourceData32 &= AlignmentMask[pParserTempData->CD_Mask.SrcAlignment];
713b7e1c893Smrg
714ad43ddacSmrg    while ( UINT16LE_TO_CPU(ldw_u((uint16_t *)pParserTempData->pWorkingTableData->IP)) != (((UINT16)NOP_OPCODE << 8)+NOP_OPCODE))
715209ff23fSmrg    {
716209ff23fSmrg	if (*pParserTempData->pWorkingTableData->IP == 'c')
717209ff23fSmrg	{
718209ff23fSmrg	    pParserTempData->pWorkingTableData->IP++;
719209ff23fSmrg	    pParserTempData->DestData32=GetParametersDirect(pParserTempData);
720209ff23fSmrg	    pParserTempData->Index=GetParametersDirect16(pParserTempData);
721209ff23fSmrg	    if (pParserTempData->SourceData32 == pParserTempData->DestData32)
722209ff23fSmrg	    {
723b7e1c893Smrg 	        pParserTempData->pWorkingTableData->IP= RELATIVE_TO_TABLE(pParserTempData->Index);
724209ff23fSmrg		return;
725209ff23fSmrg	    }
726209ff23fSmrg	}
727209ff23fSmrg    }
728209ff23fSmrg    pParserTempData->pWorkingTableData->IP+=sizeof(UINT16);
729209ff23fSmrg}
730209ff23fSmrg
731209ff23fSmrg
732209ff23fSmrgVOID	cmdSetDataBlock(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
733209ff23fSmrg{
734209ff23fSmrg    UINT8 value;
735209ff23fSmrg    UINT16* pMasterDataTable;
736209ff23fSmrg    value=((COMMAND_TYPE_1*)pParserTempData->pWorkingTableData->IP)->Parameters.ByteXX.PA_Destination;
737209ff23fSmrg    if (value == 0) pParserTempData->CurrentDataBlock=0; else
738209ff23fSmrg    {
739209ff23fSmrg	if (value == DB_CURRENT_COMMAND_TABLE)
740209ff23fSmrg        {
741209ff23fSmrg	    pParserTempData->CurrentDataBlock= (UINT16)(pParserTempData->pWorkingTableData->pTableHead-pParserTempData->pDeviceData->pBIOS_Image);
742209ff23fSmrg        } else
743209ff23fSmrg	{
744209ff23fSmrg	    pMasterDataTable = GetDataMasterTablePointer(pParserTempData->pDeviceData);
745b7e1c893Smrg	    pParserTempData->CurrentDataBlock= UINT16LE_TO_CPU((TABLE_UNIT_TYPE)((PTABLE_UNIT_TYPE)pMasterDataTable)[value]);
746209ff23fSmrg	}
747209ff23fSmrg    }
748209ff23fSmrg    pParserTempData->pWorkingTableData->IP+=sizeof(COMMAND_TYPE_OPCODE_VALUE_BYTE);
749209ff23fSmrg}
750209ff23fSmrg
751209ff23fSmrgVOID	cmdSet_ATI_Port(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
752209ff23fSmrg{
753209ff23fSmrg    pParserTempData->Multipurpose.CurrentPort=ATI_RegsPort;
754b7e1c893Smrg    pParserTempData->CurrentPortID = (UINT8)UINT16LE_TO_CPU(((COMMAND_TYPE_1*)pParserTempData->pWorkingTableData->IP)->Parameters.WordXX.PA_Destination);
755209ff23fSmrg    pParserTempData->pWorkingTableData->IP+=sizeof(COMMAND_TYPE_OPCODE_OFFSET16);
756209ff23fSmrg}
757209ff23fSmrg
758209ff23fSmrgVOID	cmdSet_Reg_Block(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
759209ff23fSmrg{
760b7e1c893Smrg    pParserTempData->CurrentRegBlock = UINT16LE_TO_CPU(((COMMAND_TYPE_1*)pParserTempData->pWorkingTableData->IP)->Parameters.WordXX.PA_Destination);
761209ff23fSmrg    pParserTempData->pWorkingTableData->IP+=sizeof(COMMAND_TYPE_OPCODE_OFFSET16);
762209ff23fSmrg}
763209ff23fSmrg
764209ff23fSmrg
765209ff23fSmrg//Atavism!!! Review!!!
766209ff23fSmrgVOID	cmdSet_X_Port(PARSER_TEMP_DATA STACK_BASED * pParserTempData){
767209ff23fSmrg    pParserTempData->Multipurpose.CurrentPort=pParserTempData->ParametersType.Destination;
768209ff23fSmrg    pParserTempData->pWorkingTableData->IP+=sizeof(COMMAND_TYPE_OPCODE_ONLY);
769209ff23fSmrg
770209ff23fSmrg}
771209ff23fSmrg
772209ff23fSmrgVOID	cmdDelay_Millisec(PARSER_TEMP_DATA STACK_BASED * pParserTempData){
773209ff23fSmrg    pParserTempData->SourceData32 =
774209ff23fSmrg	((COMMAND_TYPE_1*)pParserTempData->pWorkingTableData->IP)->Parameters.ByteXX.PA_Destination;
775209ff23fSmrg    DelayMilliseconds(pParserTempData);
776209ff23fSmrg    pParserTempData->pWorkingTableData->IP+=sizeof(COMMAND_TYPE_OPCODE_VALUE_BYTE);
777209ff23fSmrg}
778209ff23fSmrgVOID	cmdDelay_Microsec(PARSER_TEMP_DATA STACK_BASED * pParserTempData){
779209ff23fSmrg    pParserTempData->SourceData32 =
780209ff23fSmrg	((COMMAND_TYPE_1*)pParserTempData->pWorkingTableData->IP)->Parameters.ByteXX.PA_Destination;
781209ff23fSmrg    DelayMicroseconds(pParserTempData);
782209ff23fSmrg    pParserTempData->pWorkingTableData->IP+=sizeof(COMMAND_TYPE_OPCODE_VALUE_BYTE);
783209ff23fSmrg}
784209ff23fSmrg
785209ff23fSmrgVOID ProcessPostChar(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
786209ff23fSmrg{
787209ff23fSmrg    pParserTempData->SourceData32 =
788209ff23fSmrg	((COMMAND_TYPE_1*)pParserTempData->pWorkingTableData->IP)->Parameters.ByteXX.PA_Destination;
789209ff23fSmrg    PostCharOutput(pParserTempData);
790209ff23fSmrg    pParserTempData->pWorkingTableData->IP+=sizeof(COMMAND_TYPE_OPCODE_VALUE_BYTE);
791209ff23fSmrg}
792209ff23fSmrg
793209ff23fSmrgVOID ProcessDebug(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
794209ff23fSmrg{
795209ff23fSmrg    pParserTempData->SourceData32 =
796209ff23fSmrg	((COMMAND_TYPE_1*)pParserTempData->pWorkingTableData->IP)->Parameters.ByteXX.PA_Destination;
797209ff23fSmrg    CallerDebugFunc(pParserTempData);
798209ff23fSmrg    pParserTempData->pWorkingTableData->IP+=sizeof(COMMAND_TYPE_OPCODE_VALUE_BYTE);
799209ff23fSmrg}
800209ff23fSmrg
801209ff23fSmrg
802209ff23fSmrgVOID ProcessDS(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
803209ff23fSmrg{
804b7e1c893Smrg    pParserTempData->pWorkingTableData->IP+=UINT16LE_TO_CPU(((COMMAND_TYPE_1*)pParserTempData->pWorkingTableData->IP)->Parameters.WordXX.PA_Destination)+sizeof(COMMAND_TYPE_OPCODE_OFFSET16);
805209ff23fSmrg}
806209ff23fSmrg
807209ff23fSmrg
808b7e1c893SmrgVOID	cmdCall_Table(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
809b7e1c893Smrg{
810209ff23fSmrg    UINT16*	MasterTableOffset;
811209ff23fSmrg    pParserTempData->pWorkingTableData->IP+=sizeof(COMMAND_TYPE_OPCODE_VALUE_BYTE);
812209ff23fSmrg    MasterTableOffset = GetCommandMasterTablePointer(pParserTempData->pDeviceData);
813209ff23fSmrg    if(((PTABLE_UNIT_TYPE)MasterTableOffset)[((COMMAND_TYPE_OPCODE_VALUE_BYTE*)pParserTempData->pCmd)->Value]!=0 )  // if the offset is not ZERO
814209ff23fSmrg    {
815b7e1c893Smrg	ATOM_TABLE_ATTRIBUTE lTableAttr;
816b7e1c893Smrg
817209ff23fSmrg	pParserTempData->CommandSpecific.IndexInMasterTable=GetTrueIndexInMasterTable(pParserTempData,((COMMAND_TYPE_OPCODE_VALUE_BYTE*)pParserTempData->pCmd)->Value);
818b7e1c893Smrg
819b7e1c893Smrg	lTableAttr = GetCommandTableAttribute(pParserTempData->pWorkingTableData->pTableHead);
820b7e1c893Smrg	pParserTempData->Multipurpose.PS_SizeInDwordsUsedByCallingTable = (lTableAttr.PS_SizeInBytes >>2);
821209ff23fSmrg	pParserTempData->pDeviceData->pParameterSpace+=
822209ff23fSmrg	    pParserTempData->Multipurpose.PS_SizeInDwordsUsedByCallingTable;
823209ff23fSmrg	pParserTempData->Status=CD_CALL_TABLE;
824209ff23fSmrg	pParserTempData->pCmd=(GENERIC_ATTRIBUTE_COMMAND*)MasterTableOffset;
825209ff23fSmrg    }
826209ff23fSmrg}
827209ff23fSmrg
828209ff23fSmrg
829209ff23fSmrgVOID	cmdNOP_(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
830209ff23fSmrg{
831209ff23fSmrg}
832209ff23fSmrg
833209ff23fSmrg
834209ff23fSmrgstatic VOID NotImplemented(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
835209ff23fSmrg{
836209ff23fSmrg    pParserTempData->Status = CD_NOT_IMPLEMENTED;
837209ff23fSmrg}
838209ff23fSmrg
839209ff23fSmrg
840209ff23fSmrgVOID ProcessJump(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
841209ff23fSmrg{
842209ff23fSmrg    if ((pParserTempData->ParametersType.Destination == NoCondition) ||
843209ff23fSmrg	(pParserTempData->ParametersType.Destination == pParserTempData->CompareFlags ))
844209ff23fSmrg    {
845209ff23fSmrg
846b7e1c893Smrg      pParserTempData->pWorkingTableData->IP= RELATIVE_TO_TABLE(UINT16LE_TO_CPU(((COMMAND_TYPE_OPCODE_OFFSET16*)pParserTempData->pWorkingTableData->IP)->CD_Offset16));
847209ff23fSmrg    } else
848209ff23fSmrg    {
849209ff23fSmrg	pParserTempData->pWorkingTableData->IP+=sizeof(COMMAND_TYPE_OPCODE_OFFSET16);
850209ff23fSmrg    }
851209ff23fSmrg}
852209ff23fSmrg
853209ff23fSmrgVOID ProcessJumpE(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
854209ff23fSmrg{
855209ff23fSmrg    if ((pParserTempData->CompareFlags == Equal) ||
856209ff23fSmrg	(pParserTempData->CompareFlags == pParserTempData->ParametersType.Destination))
857209ff23fSmrg    {
858209ff23fSmrg
859b7e1c893Smrg      pParserTempData->pWorkingTableData->IP= RELATIVE_TO_TABLE(UINT16LE_TO_CPU(((COMMAND_TYPE_OPCODE_OFFSET16*)pParserTempData->pWorkingTableData->IP)->CD_Offset16));
860209ff23fSmrg    } else
861209ff23fSmrg    {
862209ff23fSmrg	pParserTempData->pWorkingTableData->IP+=sizeof(COMMAND_TYPE_OPCODE_OFFSET16);
863209ff23fSmrg    }
864209ff23fSmrg}
865209ff23fSmrg
866209ff23fSmrgVOID ProcessJumpNE(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
867209ff23fSmrg{
868209ff23fSmrg    if (pParserTempData->CompareFlags != Equal)
869209ff23fSmrg    {
870209ff23fSmrg
871b7e1c893Smrg      pParserTempData->pWorkingTableData->IP= RELATIVE_TO_TABLE(UINT16LE_TO_CPU(((COMMAND_TYPE_OPCODE_OFFSET16*)pParserTempData->pWorkingTableData->IP)->CD_Offset16));
872209ff23fSmrg    } else
873209ff23fSmrg    {
874209ff23fSmrg	pParserTempData->pWorkingTableData->IP+=sizeof(COMMAND_TYPE_OPCODE_OFFSET16);
875209ff23fSmrg    }
876209ff23fSmrg}
877209ff23fSmrg
878209ff23fSmrg
879209ff23fSmrg
880209ff23fSmrgCOMMANDS_PROPERTIES CallTable[] =
881209ff23fSmrg{
882209ff23fSmrg    { NULL, 0,0},
883209ff23fSmrg    { ProcessMove,      destRegister,     sizeof(COMMAND_HEADER)},
884209ff23fSmrg    { ProcessMove,      destParamSpace,   sizeof(COMMAND_HEADER)},
885209ff23fSmrg    { ProcessMove,      destWorkSpace,    sizeof(COMMAND_HEADER)},
886209ff23fSmrg    { ProcessMove,      destFrameBuffer,  sizeof(COMMAND_HEADER)},
887209ff23fSmrg    { ProcessMove,      destPLL,          sizeof(COMMAND_HEADER)},
888209ff23fSmrg    { ProcessMove,      destMC,           sizeof(COMMAND_HEADER)},
889209ff23fSmrg    { ProcessAnd,       destRegister,     sizeof(COMMAND_HEADER)},
890209ff23fSmrg    { ProcessAnd,       destParamSpace,   sizeof(COMMAND_HEADER)},
891209ff23fSmrg    { ProcessAnd,       destWorkSpace,    sizeof(COMMAND_HEADER)},
892209ff23fSmrg    { ProcessAnd,       destFrameBuffer,  sizeof(COMMAND_HEADER)},
893209ff23fSmrg    { ProcessAnd,       destPLL,          sizeof(COMMAND_HEADER)},
894209ff23fSmrg    { ProcessAnd,       destMC,           sizeof(COMMAND_HEADER)},
895209ff23fSmrg    { ProcessOr,        destRegister,     sizeof(COMMAND_HEADER)},
896209ff23fSmrg    { ProcessOr,        destParamSpace,   sizeof(COMMAND_HEADER)},
897209ff23fSmrg    { ProcessOr,        destWorkSpace,    sizeof(COMMAND_HEADER)},
898209ff23fSmrg    { ProcessOr,        destFrameBuffer,  sizeof(COMMAND_HEADER)},
899209ff23fSmrg    { ProcessOr,        destPLL,          sizeof(COMMAND_HEADER)},
900209ff23fSmrg    { ProcessOr,        destMC,           sizeof(COMMAND_HEADER)},
901209ff23fSmrg    { ProcessShift,     destRegister,     sizeof(COMMAND_HEADER)},
902209ff23fSmrg    { ProcessShift,     destParamSpace,   sizeof(COMMAND_HEADER)},
903209ff23fSmrg    { ProcessShift,     destWorkSpace,    sizeof(COMMAND_HEADER)},
904209ff23fSmrg    { ProcessShift,     destFrameBuffer,  sizeof(COMMAND_HEADER)},
905209ff23fSmrg    { ProcessShift,     destPLL,          sizeof(COMMAND_HEADER)},
906209ff23fSmrg    { ProcessShift,     destMC,           sizeof(COMMAND_HEADER)},
907209ff23fSmrg    { ProcessShift,     destRegister,     sizeof(COMMAND_HEADER)},
908209ff23fSmrg    { ProcessShift,     destParamSpace,   sizeof(COMMAND_HEADER)},
909209ff23fSmrg    { ProcessShift,     destWorkSpace,    sizeof(COMMAND_HEADER)},
910209ff23fSmrg    { ProcessShift,     destFrameBuffer,  sizeof(COMMAND_HEADER)},
911209ff23fSmrg    { ProcessShift,     destPLL,          sizeof(COMMAND_HEADER)},
912209ff23fSmrg    { ProcessShift,     destMC,           sizeof(COMMAND_HEADER)},
913209ff23fSmrg    { ProcessMUL,       destRegister,     sizeof(COMMAND_HEADER)},
914209ff23fSmrg    { ProcessMUL,       destParamSpace,   sizeof(COMMAND_HEADER)},
915209ff23fSmrg    { ProcessMUL,       destWorkSpace,    sizeof(COMMAND_HEADER)},
916209ff23fSmrg    { ProcessMUL,       destFrameBuffer,  sizeof(COMMAND_HEADER)},
917209ff23fSmrg    { ProcessMUL,       destPLL,          sizeof(COMMAND_HEADER)},
918209ff23fSmrg    { ProcessMUL,       destMC,           sizeof(COMMAND_HEADER)},
919209ff23fSmrg    { ProcessDIV,       destRegister,     sizeof(COMMAND_HEADER)},
920209ff23fSmrg    { ProcessDIV,       destParamSpace,   sizeof(COMMAND_HEADER)},
921209ff23fSmrg    { ProcessDIV,       destWorkSpace,    sizeof(COMMAND_HEADER)},
922209ff23fSmrg    { ProcessDIV,       destFrameBuffer,  sizeof(COMMAND_HEADER)},
923209ff23fSmrg    { ProcessDIV,       destPLL,          sizeof(COMMAND_HEADER)},
924209ff23fSmrg    { ProcessDIV,       destMC,           sizeof(COMMAND_HEADER)},
925209ff23fSmrg    { ProcessADD,       destRegister,     sizeof(COMMAND_HEADER)},
926209ff23fSmrg    { ProcessADD,       destParamSpace,   sizeof(COMMAND_HEADER)},
927209ff23fSmrg    { ProcessADD,       destWorkSpace,    sizeof(COMMAND_HEADER)},
928209ff23fSmrg    { ProcessADD,       destFrameBuffer,  sizeof(COMMAND_HEADER)},
929209ff23fSmrg    { ProcessADD,       destPLL,          sizeof(COMMAND_HEADER)},
930209ff23fSmrg    { ProcessADD,       destMC,           sizeof(COMMAND_HEADER)},
931209ff23fSmrg    { ProcessSUB,       destRegister,     sizeof(COMMAND_HEADER)},
932209ff23fSmrg    { ProcessSUB,       destParamSpace,   sizeof(COMMAND_HEADER)},
933209ff23fSmrg    { ProcessSUB,       destWorkSpace,    sizeof(COMMAND_HEADER)},
934209ff23fSmrg    { ProcessSUB,       destFrameBuffer,  sizeof(COMMAND_HEADER)},
935209ff23fSmrg    { ProcessSUB,       destPLL,          sizeof(COMMAND_HEADER)},
936209ff23fSmrg    { ProcessSUB,       destMC,           sizeof(COMMAND_HEADER)},
937209ff23fSmrg    { cmdSet_ATI_Port,  ATI_RegsPort,     0},
938209ff23fSmrg    { cmdSet_X_Port,    PCI_Port,         0},
939209ff23fSmrg    { cmdSet_X_Port,    SystemIO_Port,    0},
940209ff23fSmrg    { cmdSet_Reg_Block,	0,                0},
941209ff23fSmrg    { ProcessSetFB_Base,0,                sizeof(COMMAND_HEADER)},
942209ff23fSmrg    { ProcessCompare,   destRegister,     sizeof(COMMAND_HEADER)},
943209ff23fSmrg    { ProcessCompare,   destParamSpace,   sizeof(COMMAND_HEADER)},
944209ff23fSmrg    { ProcessCompare,   destWorkSpace,    sizeof(COMMAND_HEADER)},
945209ff23fSmrg    { ProcessCompare,   destFrameBuffer,  sizeof(COMMAND_HEADER)},
946209ff23fSmrg    { ProcessCompare,   destPLL,          sizeof(COMMAND_HEADER)},
947209ff23fSmrg    { ProcessCompare,   destMC,           sizeof(COMMAND_HEADER)},
948209ff23fSmrg    { ProcessSwitch,    0,              	sizeof(COMMAND_HEADER)},
949209ff23fSmrg    { ProcessJump,			NoCondition,      0},
950209ff23fSmrg    { ProcessJump,	    Equal,            0},
951209ff23fSmrg    { ProcessJump,      Below,	          0},
952209ff23fSmrg    { ProcessJump,      Above,	          0},
953209ff23fSmrg    { ProcessJumpE,     Below,            0},
954209ff23fSmrg    { ProcessJumpE,     Above,            0},
955209ff23fSmrg    { ProcessJumpNE,		0,                0},
956209ff23fSmrg    { ProcessTest,      destRegister,     sizeof(COMMAND_HEADER)},
957209ff23fSmrg    { ProcessTest,      destParamSpace,   sizeof(COMMAND_HEADER)},
958209ff23fSmrg    { ProcessTest,      destWorkSpace,    sizeof(COMMAND_HEADER)},
959209ff23fSmrg    { ProcessTest,      destFrameBuffer,  sizeof(COMMAND_HEADER)},
960209ff23fSmrg    { ProcessTest,      destPLL,          sizeof(COMMAND_HEADER)},
961209ff23fSmrg    { ProcessTest,      destMC,           sizeof(COMMAND_HEADER)},
962209ff23fSmrg    { cmdDelay_Millisec,0,                0},
963209ff23fSmrg    { cmdDelay_Microsec,0,                0},
964209ff23fSmrg    { cmdCall_Table,		0,                0},
965209ff23fSmrg    /*cmdRepeat*/	    { NotImplemented,   0,                0},
966209ff23fSmrg    { ProcessClear,     destRegister,     sizeof(COMMAND_HEADER)},
967209ff23fSmrg    { ProcessClear,     destParamSpace,   sizeof(COMMAND_HEADER)},
968209ff23fSmrg    { ProcessClear,     destWorkSpace,    sizeof(COMMAND_HEADER)},
969209ff23fSmrg    { ProcessClear,     destFrameBuffer,  sizeof(COMMAND_HEADER)},
970209ff23fSmrg    { ProcessClear,     destPLL,          sizeof(COMMAND_HEADER)},
971209ff23fSmrg    { ProcessClear,     destMC,           sizeof(COMMAND_HEADER)},
972209ff23fSmrg    { cmdNOP_,		      0,                sizeof(COMMAND_TYPE_OPCODE_ONLY)},
973209ff23fSmrg    /*cmdEOT*/        { cmdNOP_,		      0,                sizeof(COMMAND_TYPE_OPCODE_ONLY)},
974209ff23fSmrg    { ProcessMask,      destRegister,     sizeof(COMMAND_HEADER)},
975209ff23fSmrg    { ProcessMask,      destParamSpace,   sizeof(COMMAND_HEADER)},
976209ff23fSmrg    { ProcessMask,      destWorkSpace,    sizeof(COMMAND_HEADER)},
977209ff23fSmrg    { ProcessMask,      destFrameBuffer,  sizeof(COMMAND_HEADER)},
978209ff23fSmrg    { ProcessMask,      destPLL,          sizeof(COMMAND_HEADER)},
979209ff23fSmrg    { ProcessMask,      destMC,           sizeof(COMMAND_HEADER)},
980209ff23fSmrg    /*cmdPost_Card*/	{ ProcessPostChar,  0,                0},
981209ff23fSmrg    /*cmdBeep*/		    { NotImplemented,   0,                0},
982209ff23fSmrg    /*cmdSave_Reg*/	  { NotImplemented,   0,                0},
983209ff23fSmrg    /*cmdRestore_Reg*/{ NotImplemented,   0,                0},
984209ff23fSmrg    { cmdSetDataBlock,  0,                0},
985209ff23fSmrg    { ProcessXor,        destRegister,     sizeof(COMMAND_HEADER)},
986209ff23fSmrg    { ProcessXor,        destParamSpace,   sizeof(COMMAND_HEADER)},
987209ff23fSmrg    { ProcessXor,        destWorkSpace,    sizeof(COMMAND_HEADER)},
988209ff23fSmrg    { ProcessXor,        destFrameBuffer,  sizeof(COMMAND_HEADER)},
989209ff23fSmrg    { ProcessXor,        destPLL,          sizeof(COMMAND_HEADER)},
990209ff23fSmrg    { ProcessXor,        destMC,           sizeof(COMMAND_HEADER)},
991209ff23fSmrg
992209ff23fSmrg    { ProcessShl,        destRegister,     sizeof(COMMAND_HEADER)},
993209ff23fSmrg    { ProcessShl,        destParamSpace,   sizeof(COMMAND_HEADER)},
994209ff23fSmrg    { ProcessShl,        destWorkSpace,    sizeof(COMMAND_HEADER)},
995209ff23fSmrg    { ProcessShl,        destFrameBuffer,  sizeof(COMMAND_HEADER)},
996209ff23fSmrg    { ProcessShl,        destPLL,          sizeof(COMMAND_HEADER)},
997209ff23fSmrg    { ProcessShl,        destMC,           sizeof(COMMAND_HEADER)},
998209ff23fSmrg
999209ff23fSmrg    { ProcessShr,        destRegister,     sizeof(COMMAND_HEADER)},
1000209ff23fSmrg    { ProcessShr,        destParamSpace,   sizeof(COMMAND_HEADER)},
1001209ff23fSmrg    { ProcessShr,        destWorkSpace,    sizeof(COMMAND_HEADER)},
1002209ff23fSmrg    { ProcessShr,        destFrameBuffer,  sizeof(COMMAND_HEADER)},
1003209ff23fSmrg    { ProcessShr,        destPLL,          sizeof(COMMAND_HEADER)},
1004209ff23fSmrg    { ProcessShr,        destMC,           sizeof(COMMAND_HEADER)},
1005209ff23fSmrg    /*cmdDebug*/		{ ProcessDebug,  0,                0},
1006209ff23fSmrg    { ProcessDS,  0,                0},
1007209ff23fSmrg
1008209ff23fSmrg};
1009209ff23fSmrg
1010209ff23fSmrg// EOF
1011