1
/**********************************************************************
3
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
5
* This program is free software; you can redistribute it and/or modify it
6
* under the terms and conditions of the GNU General Public License,
7
* version 2, as published by the Free Software Foundation.
9
* This program is distributed in the hope it will be useful but, except
10
* as otherwise stated in writing, without any warranty; without even the
11
* implied warranty of merchantability or fitness for a particular purpose.
12
* See the GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License along with
15
* this program; if not, write to the Free Software Foundation, Inc.,
16
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
18
* The full GNU General Public License is included in this distribution in
19
* the file called "COPYING".
21
* Contact Information:
22
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
23
* Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
25
******************************************************************************/
31
#define MAX_SID_ENTRIES 8
33
typedef struct _SID_INFO
36
} SID_INFO, *PSID_INFO;
38
static SID_INFO gaSID_Xlat_Table[MAX_SID_ENTRIES];
40
IMG_SID PStream2SID(PDBG_STREAM psStream)
42
if (psStream != (PDBG_STREAM)IMG_NULL)
46
for (iIdx = 0; iIdx < MAX_SID_ENTRIES; iIdx++)
48
if (psStream == gaSID_Xlat_Table[iIdx].psStream)
51
return (IMG_SID)iIdx+1;
60
PDBG_STREAM SID2PStream(IMG_SID hStream)
63
IMG_INT32 iIdx = (IMG_INT32)hStream-1;
65
if (iIdx >= 0 && iIdx < MAX_SID_ENTRIES)
67
return gaSID_Xlat_Table[iIdx].psStream;
71
return (PDBG_STREAM)IMG_NULL;
76
IMG_BOOL AddSIDEntry(PDBG_STREAM psStream)
78
if (psStream != (PDBG_STREAM)IMG_NULL)
82
for (iIdx = 0; iIdx < MAX_SID_ENTRIES; iIdx++)
84
if (psStream == gaSID_Xlat_Table[iIdx].psStream)
90
if (gaSID_Xlat_Table[iIdx].psStream == (PDBG_STREAM)IMG_NULL)
93
gaSID_Xlat_Table[iIdx].psStream = psStream;
102
IMG_BOOL RemoveSIDEntry(PDBG_STREAM psStream)
104
if (psStream != (PDBG_STREAM)IMG_NULL)
108
for (iIdx = 0; iIdx < MAX_SID_ENTRIES; iIdx++)
110
if (psStream == gaSID_Xlat_Table[iIdx].psStream)
112
gaSID_Xlat_Table[iIdx].psStream = (PDBG_STREAM)IMG_NULL;