1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
|
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful but, except
* as otherwise stated in writing, without any warranty; without even the
* implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
*
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
* Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#ifndef _PDUMP_KM_H_
#define _PDUMP_KM_H_
#include "pdump_osfunc.h"
#if defined(__cplusplus)
extern "C" {
#endif
#include "pdump.h"
#define PDUMP_PD_UNIQUETAG (IMG_HANDLE)0
#define PDUMP_PT_UNIQUETAG (IMG_HANDLE)0
#define PDUMP_STREAM_PARAM2 0
#define PDUMP_STREAM_SCRIPT2 1
#define PDUMP_STREAM_DRIVERINFO 2
#define PDUMP_NUM_STREAMS 3
#if defined(PDUMP_DEBUG_OUTFILES)
extern IMG_UINT32 g_ui32EveryLineCounter;
#endif
#ifndef PDUMP
#define MAKEUNIQUETAG(hMemInfo) (0)
#endif
#ifdef PDUMP
#define MAKEUNIQUETAG(hMemInfo) (((BM_BUF *)(((PVRSRV_KERNEL_MEM_INFO *)(hMemInfo))->sMemBlk.hBuffer))->pMapping)
IMG_IMPORT PVRSRV_ERROR PDumpMemPolKM(PVRSRV_KERNEL_MEM_INFO *psMemInfo,
IMG_UINT32 ui32Offset,
IMG_UINT32 ui32Value,
IMG_UINT32 ui32Mask,
PDUMP_POLL_OPERATOR eOperator,
IMG_UINT32 ui32Flags,
IMG_HANDLE hUniqueTag);
IMG_IMPORT PVRSRV_ERROR PDumpMemUM(PVRSRV_PER_PROCESS_DATA *psProcData,
IMG_PVOID pvAltLinAddr,
IMG_PVOID pvLinAddr,
PVRSRV_KERNEL_MEM_INFO *psMemInfo,
IMG_UINT32 ui32Offset,
IMG_UINT32 ui32Bytes,
IMG_UINT32 ui32Flags,
IMG_HANDLE hUniqueTag);
IMG_IMPORT PVRSRV_ERROR PDumpMemKM(IMG_PVOID pvAltLinAddr,
PVRSRV_KERNEL_MEM_INFO *psMemInfo,
IMG_UINT32 ui32Offset,
IMG_UINT32 ui32Bytes,
IMG_UINT32 ui32Flags,
IMG_HANDLE hUniqueTag);
PVRSRV_ERROR PDumpMemPagesKM(PVRSRV_DEVICE_IDENTIFIER *psDevID,
IMG_DEV_PHYADDR *pPages,
IMG_UINT32 ui32NumPages,
IMG_DEV_VIRTADDR sDevAddr,
IMG_UINT32 ui32Start,
IMG_UINT32 ui32Length,
IMG_UINT32 ui32Flags,
IMG_HANDLE hUniqueTag);
PVRSRV_ERROR PDumpMemPDEntriesKM(PDUMP_MMU_ATTRIB *psMMUAttrib,
IMG_HANDLE hOSMemHandle,
IMG_CPU_VIRTADDR pvLinAddr,
IMG_UINT32 ui32Bytes,
IMG_UINT32 ui32Flags,
IMG_BOOL bInitialisePages,
IMG_HANDLE hUniqueTag1,
IMG_HANDLE hUniqueTag2);
PVRSRV_ERROR PDumpMemPTEntriesKM(PDUMP_MMU_ATTRIB *psMMUAttrib,
IMG_HANDLE hOSMemHandle,
IMG_CPU_VIRTADDR pvLinAddr,
IMG_UINT32 ui32Bytes,
IMG_UINT32 ui32Flags,
IMG_BOOL bInitialisePages,
IMG_HANDLE hUniqueTag1,
IMG_HANDLE hUniqueTag2);
IMG_VOID PDumpInitCommon(IMG_VOID);
IMG_VOID PDumpDeInitCommon(IMG_VOID);
IMG_VOID PDumpInit(IMG_VOID);
IMG_VOID PDumpDeInit(IMG_VOID);
IMG_BOOL PDumpIsSuspended(IMG_VOID);
PVRSRV_ERROR PDumpStartInitPhaseKM(IMG_VOID);
PVRSRV_ERROR PDumpStopInitPhaseKM(IMG_VOID);
IMG_IMPORT PVRSRV_ERROR PDumpSetFrameKM(IMG_UINT32 ui32Frame);
IMG_IMPORT PVRSRV_ERROR PDumpCommentKM(IMG_CHAR *pszComment, IMG_UINT32 ui32Flags);
IMG_IMPORT PVRSRV_ERROR PDumpDriverInfoKM(IMG_CHAR *pszString, IMG_UINT32 ui32Flags);
PVRSRV_ERROR PDumpRegWithFlagsKM(IMG_CHAR *pszPDumpRegName,
IMG_UINT32 ui32RegAddr,
IMG_UINT32 ui32RegValue,
IMG_UINT32 ui32Flags);
PVRSRV_ERROR PDumpRegPolWithFlagsKM(IMG_CHAR *pszPDumpRegName,
IMG_UINT32 ui32RegAddr,
IMG_UINT32 ui32RegValue,
IMG_UINT32 ui32Mask,
IMG_UINT32 ui32Flags,
PDUMP_POLL_OPERATOR eOperator);
PVRSRV_ERROR PDumpRegPolKM(IMG_CHAR *pszPDumpRegName,
IMG_UINT32 ui32RegAddr,
IMG_UINT32 ui32RegValue,
IMG_UINT32 ui32Mask,
PDUMP_POLL_OPERATOR eOperator);
IMG_IMPORT PVRSRV_ERROR PDumpBitmapKM(PVRSRV_DEVICE_NODE *psDeviceNode,
IMG_CHAR *pszFileName,
IMG_UINT32 ui32FileOffset,
IMG_UINT32 ui32Width,
IMG_UINT32 ui32Height,
IMG_UINT32 ui32StrideInBytes,
IMG_DEV_VIRTADDR sDevBaseAddr,
IMG_HANDLE hDevMemContext,
IMG_UINT32 ui32Size,
PDUMP_PIXEL_FORMAT ePixelFormat,
PDUMP_MEM_FORMAT eMemFormat,
IMG_UINT32 ui32PDumpFlags);
IMG_IMPORT PVRSRV_ERROR PDumpReadRegKM(IMG_CHAR *pszPDumpRegName,
IMG_CHAR *pszFileName,
IMG_UINT32 ui32FileOffset,
IMG_UINT32 ui32Address,
IMG_UINT32 ui32Size,
IMG_UINT32 ui32PDumpFlags);
PVRSRV_ERROR PDumpRegKM(IMG_CHAR* pszPDumpRegName,
IMG_UINT32 dwReg,
IMG_UINT32 dwData);
PVRSRV_ERROR PDumpComment(IMG_CHAR* pszFormat, ...) IMG_FORMAT_PRINTF(1, 2);
PVRSRV_ERROR PDumpCommentWithFlags(IMG_UINT32 ui32Flags,
IMG_CHAR* pszFormat,
...) IMG_FORMAT_PRINTF(2, 3);
PVRSRV_ERROR PDumpPDReg(PDUMP_MMU_ATTRIB *psMMUAttrib,
IMG_UINT32 ui32Reg,
IMG_UINT32 ui32dwData,
IMG_HANDLE hUniqueTag);
PVRSRV_ERROR PDumpPDRegWithFlags(PDUMP_MMU_ATTRIB *psMMUAttrib,
IMG_UINT32 ui32Reg,
IMG_UINT32 ui32Data,
IMG_UINT32 ui32Flags,
IMG_HANDLE hUniqueTag);
IMG_BOOL PDumpIsLastCaptureFrameKM(IMG_VOID);
IMG_IMPORT IMG_BOOL PDumpIsCaptureFrameKM(IMG_VOID);
IMG_VOID PDumpMallocPagesPhys(PVRSRV_DEVICE_IDENTIFIER *psDevID,
IMG_UINT32 ui32DevVAddr,
IMG_PUINT32 pui32PhysPages,
IMG_UINT32 ui32NumPages,
IMG_HANDLE hUniqueTag);
PVRSRV_ERROR PDumpSetMMUContext(PVRSRV_DEVICE_TYPE eDeviceType,
IMG_CHAR *pszMemSpace,
IMG_UINT32 *pui32MMUContextID,
IMG_UINT32 ui32MMUType,
IMG_HANDLE hUniqueTag1,
IMG_HANDLE hOSMemHandle,
IMG_VOID *pvPDCPUAddr);
PVRSRV_ERROR PDumpClearMMUContext(PVRSRV_DEVICE_TYPE eDeviceType,
IMG_CHAR *pszMemSpace,
IMG_UINT32 ui32MMUContextID,
IMG_UINT32 ui32MMUType);
PVRSRV_ERROR PDumpPDDevPAddrKM(PVRSRV_KERNEL_MEM_INFO *psMemInfo,
IMG_UINT32 ui32Offset,
IMG_DEV_PHYADDR sPDDevPAddr,
IMG_HANDLE hUniqueTag1,
IMG_HANDLE hUniqueTag2);
IMG_BOOL PDumpTestNextFrame(IMG_UINT32 ui32CurrentFrame);
PVRSRV_ERROR PDumpSaveMemKM (PVRSRV_DEVICE_IDENTIFIER *psDevId,
IMG_CHAR *pszFileName,
IMG_UINT32 ui32FileOffset,
IMG_DEV_VIRTADDR sDevBaseAddr,
IMG_UINT32 ui32Size,
IMG_UINT32 ui32DataMaster,
IMG_UINT32 ui32PDumpFlags);
PVRSRV_ERROR PDumpTASignatureRegisters(PVRSRV_DEVICE_IDENTIFIER *psDevId,
IMG_UINT32 ui32DumpFrameNum,
IMG_UINT32 ui32TAKickCount,
IMG_BOOL bLastFrame,
IMG_UINT32 *pui32Registers,
IMG_UINT32 ui32NumRegisters);
PVRSRV_ERROR PDump3DSignatureRegisters(PVRSRV_DEVICE_IDENTIFIER *psDevId,
IMG_UINT32 ui32DumpFrameNum,
IMG_BOOL bLastFrame,
IMG_UINT32 *pui32Registers,
IMG_UINT32 ui32NumRegisters);
PVRSRV_ERROR PDumpCounterRegisters(PVRSRV_DEVICE_IDENTIFIER *psDevId,
IMG_UINT32 ui32DumpFrameNum,
IMG_BOOL bLastFrame,
IMG_UINT32 *pui32Registers,
IMG_UINT32 ui32NumRegisters);
PVRSRV_ERROR PDumpRegRead(IMG_CHAR *pszPDumpRegName,
const IMG_UINT32 dwRegOffset,
IMG_UINT32 ui32Flags);
PVRSRV_ERROR PDumpCycleCountRegRead(PVRSRV_DEVICE_IDENTIFIER *psDevId,
const IMG_UINT32 dwRegOffset,
IMG_BOOL bLastFrame);
PVRSRV_ERROR PDumpIDLWithFlags(IMG_UINT32 ui32Clocks, IMG_UINT32 ui32Flags);
PVRSRV_ERROR PDumpIDL(IMG_UINT32 ui32Clocks);
PVRSRV_ERROR PDumpMallocPages(PVRSRV_DEVICE_IDENTIFIER *psDevID,
IMG_UINT32 ui32DevVAddr,
IMG_CPU_VIRTADDR pvLinAddr,
IMG_HANDLE hOSMemHandle,
IMG_UINT32 ui32NumBytes,
IMG_UINT32 ui32PageSize,
IMG_BOOL bShared,
IMG_HANDLE hUniqueTag);
PVRSRV_ERROR PDumpMallocPageTable(PVRSRV_DEVICE_IDENTIFIER *psDevId,
IMG_HANDLE hOSMemHandle,
IMG_UINT32 ui32Offset,
IMG_CPU_VIRTADDR pvLinAddr,
IMG_UINT32 ui32NumBytes,
IMG_UINT32 ui32Flags,
IMG_HANDLE hUniqueTag);
PVRSRV_ERROR PDumpFreePages(struct _BM_HEAP_ *psBMHeap,
IMG_DEV_VIRTADDR sDevVAddr,
IMG_UINT32 ui32NumBytes,
IMG_UINT32 ui32PageSize,
IMG_HANDLE hUniqueTag,
IMG_BOOL bInterleaved);
PVRSRV_ERROR PDumpFreePageTable(PVRSRV_DEVICE_IDENTIFIER *psDevID,
IMG_HANDLE hOSMemHandle,
IMG_CPU_VIRTADDR pvLinAddr,
IMG_UINT32 ui32NumBytes,
IMG_UINT32 ui32Flags,
IMG_HANDLE hUniqueTag);
IMG_IMPORT PVRSRV_ERROR PDumpHWPerfCBKM(PVRSRV_DEVICE_IDENTIFIER *psDevId,
IMG_CHAR *pszFileName,
IMG_UINT32 ui32FileOffset,
IMG_DEV_VIRTADDR sDevBaseAddr,
IMG_UINT32 ui32Size,
IMG_UINT32 ui32MMUContextID,
IMG_UINT32 ui32PDumpFlags);
PVRSRV_ERROR PDumpSignatureBuffer(PVRSRV_DEVICE_IDENTIFIER *psDevId,
IMG_CHAR *pszFileName,
IMG_CHAR *pszBufferType,
IMG_UINT32 ui32FileOffset,
IMG_DEV_VIRTADDR sDevBaseAddr,
IMG_UINT32 ui32Size,
IMG_UINT32 ui32MMUContextID,
IMG_UINT32 ui32PDumpFlags);
PVRSRV_ERROR PDumpCBP(PPVRSRV_KERNEL_MEM_INFO psROffMemInfo,
IMG_UINT32 ui32ROffOffset,
IMG_UINT32 ui32WPosVal,
IMG_UINT32 ui32PacketSize,
IMG_UINT32 ui32BufferSize,
IMG_UINT32 ui32Flags,
IMG_HANDLE hUniqueTag);
PVRSRV_ERROR PDumpRegBasedCBP(IMG_CHAR *pszPDumpRegName,
IMG_UINT32 ui32RegOffset,
IMG_UINT32 ui32WPosVal,
IMG_UINT32 ui32PacketSize,
IMG_UINT32 ui32BufferSize,
IMG_UINT32 ui32Flags);
IMG_VOID PDumpVGXMemToFile(IMG_CHAR *pszFileName,
IMG_UINT32 ui32FileOffset,
PVRSRV_KERNEL_MEM_INFO *psMemInfo,
IMG_UINT32 uiAddr,
IMG_UINT32 ui32Size,
IMG_UINT32 ui32PDumpFlags,
IMG_HANDLE hUniqueTag);
IMG_VOID PDumpSuspendKM(IMG_VOID);
IMG_VOID PDumpResumeKM(IMG_VOID);
PVRSRV_ERROR PDumpStoreMemToFile(PDUMP_MMU_ATTRIB *psMMUAttrib,
IMG_CHAR *pszFileName,
IMG_UINT32 ui32FileOffset,
PVRSRV_KERNEL_MEM_INFO *psMemInfo,
IMG_UINT32 uiAddr,
IMG_UINT32 ui32Size,
IMG_UINT32 ui32PDumpFlags,
IMG_HANDLE hUniqueTag);
#define PDUMPMEMPOL PDumpMemPolKM
#define PDUMPMEM PDumpMemKM
#define PDUMPMEMPTENTRIES PDumpMemPTEntriesKM
#define PDUMPPDENTRIES PDumpMemPDEntriesKM
#define PDUMPMEMUM PDumpMemUM
#define PDUMPINIT PDumpInitCommon
#define PDUMPDEINIT PDumpDeInitCommon
#define PDUMPISLASTFRAME PDumpIsLastCaptureFrameKM
#define PDUMPTESTFRAME PDumpIsCaptureFrameKM
#define PDUMPTESTNEXTFRAME PDumpTestNextFrame
#define PDUMPREGWITHFLAGS PDumpRegWithFlagsKM
#define PDUMPREG PDumpRegKM
#define PDUMPCOMMENT PDumpComment
#define PDUMPCOMMENTWITHFLAGS PDumpCommentWithFlags
#define PDUMPREGPOL PDumpRegPolKM
#define PDUMPREGPOLWITHFLAGS PDumpRegPolWithFlagsKM
#define PDUMPMALLOCPAGES PDumpMallocPages
#define PDUMPMALLOCPAGETABLE PDumpMallocPageTable
#define PDUMPSETMMUCONTEXT PDumpSetMMUContext
#define PDUMPCLEARMMUCONTEXT PDumpClearMMUContext
#define PDUMPPDDEVPADDR PDumpPDDevPAddrKM
#define PDUMPFREEPAGES PDumpFreePages
#define PDUMPFREEPAGETABLE PDumpFreePageTable
#define PDUMPPDREG PDumpPDReg
#define PDUMPPDREGWITHFLAGS PDumpPDRegWithFlags
#define PDUMPCBP PDumpCBP
#define PDUMPREGBASEDCBP PDumpRegBasedCBP
#define PDUMPMALLOCPAGESPHYS PDumpMallocPagesPhys
#define PDUMPENDINITPHASE PDumpStopInitPhaseKM
#define PDUMPBITMAPKM PDumpBitmapKM
#define PDUMPDRIVERINFO PDumpDriverInfoKM
#define PDUMPIDLWITHFLAGS PDumpIDLWithFlags
#define PDUMPIDL PDumpIDL
#define PDUMPSUSPEND PDumpSuspendKM
#define PDUMPRESUME PDumpResumeKM
#else
#if ((defined(LINUX) || defined(GCC_IA32)) || defined(GCC_ARM))
#define PDUMPMEMPOL(args...)
#define PDUMPMEM(args...)
#define PDUMPMEMPTENTRIES(args...)
#define PDUMPPDENTRIES(args...)
#define PDUMPMEMUM(args...)
#define PDUMPINIT(args...)
#define PDUMPDEINIT(args...)
#define PDUMPISLASTFRAME(args...)
#define PDUMPTESTFRAME(args...)
#define PDUMPTESTNEXTFRAME(args...)
#define PDUMPREGWITHFLAGS(args...)
#define PDUMPREG(args...)
#define PDUMPCOMMENT(args...)
#define PDUMPREGPOL(args...)
#define PDUMPREGPOLWITHFLAGS(args...)
#define PDUMPMALLOCPAGES(args...)
#define PDUMPMALLOCPAGETABLE(args...)
#define PDUMPSETMMUCONTEXT(args...)
#define PDUMPCLEARMMUCONTEXT(args...)
#define PDUMPPDDEVPADDR(args...)
#define PDUMPFREEPAGES(args...)
#define PDUMPFREEPAGETABLE(args...)
#define PDUMPPDREG(args...)
#define PDUMPPDREGWITHFLAGS(args...)
#define PDUMPSYNC(args...)
#define PDUMPCOPYTOMEM(args...)
#define PDUMPWRITE(args...)
#define PDUMPCBP(args...)
#define PDUMPREGBASEDCBP(args...)
#define PDUMPCOMMENTWITHFLAGS(args...)
#define PDUMPMALLOCPAGESPHYS(args...)
#define PDUMPENDINITPHASE(args...)
#define PDUMPMSVDXREG(args...)
#define PDUMPMSVDXREGWRITE(args...)
#define PDUMPMSVDXREGREAD(args...)
#define PDUMPMSVDXPOLEQ(args...)
#define PDUMPMSVDXPOL(args...)
#define PDUMPBITMAPKM(args...)
#define PDUMPDRIVERINFO(args...)
#define PDUMPIDLWITHFLAGS(args...)
#define PDUMPIDL(args...)
#define PDUMPSUSPEND(args...)
#define PDUMPRESUME(args...)
#define PDUMPMSVDXWRITEREF(args...)
#else
#error Compiler not specified
#endif
#endif
#if defined (__cplusplus)
}
#endif
#endif
|