hc
2023-05-26 a23f51ed7a39e452c1037343a84d7db1ca2c5bd7
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
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
/*************************************************************************/ /*!
@File
@Title          pdump functions
@Copyright      Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description    Main APIs for pdump functions
@License        Dual MIT/GPLv2
 
The contents of this file are subject to the MIT license as set out below.
 
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
 
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
 
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
 
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
 
This License is also included in this distribution in the file called
"MIT-COPYING".
 
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
 
#ifndef _PDUMP_KM_H_
#define _PDUMP_KM_H_
 
#if defined(PDUMP)
#include <stdarg.h>
#endif
 
/* services/srvkm/include/ */
#include "device.h"
 
/* include/ */
#include "pvrsrv_error.h"
 
 
#if defined(__KERNEL__) && defined(LINUX) && !defined(__GENKSYMS__)
#define __pvrsrv_defined_struct_enum__
#include <services_kernel_client.h>
#endif
 
#include "connection_server.h"
#include "sync_server.h"
/*
 *    Pull in pdump flags from services include
 */
#include "pdump.h"
#include "pdumpdefs.h"
 
/* Define this to enable the PDUMP_HERE trace in the server */
#undef PDUMP_TRACE
 
#if defined(PDUMP_TRACE)
#define PDUMP_HERE(a)    if (ui32Flags & PDUMP_FLAGS_DEBUG) PVR_DPF((PVR_DBG_WARNING, "HERE %d", (a)))
#define PDUMP_HEREA(a)    PVR_DPF((PVR_DBG_WARNING, "HERE ALWAYS %d", (a)))
#else
#define PDUMP_HERE(a)    (void)(a);
#define PDUMP_HEREA(a)    (void)(a);
#endif
 
#define PDUMP_PD_UNIQUETAG    (IMG_HANDLE)0
#define PDUMP_PT_UNIQUETAG    (IMG_HANDLE)0
 
 
#if defined(PDUMP_DEBUG_OUTFILES)
/* counter increments each time debug write is called */
extern IMG_UINT32 g_ui32EveryLineCounter;
#endif
 
typedef struct _PDUMP_CONNECTION_DATA_ PDUMP_CONNECTION_DATA;
typedef PVRSRV_ERROR (*PFN_PDUMP_TRANSITION)(void **pvData, IMG_BOOL bInto, IMG_UINT32 ui32PDumpFlags);
 
#ifdef PDUMP
 
/*! Macro used to record a panic in the PDump script stream */
#define PDUMP_PANIC(_id, _msg) do \
       { PVRSRV_ERROR _eE;\
           _eE = PDumpPanic(((RGX_PDUMP_PANIC_ ## _id) & 0xFFFF), _msg, __FUNCTION__, __LINE__);    \
           PVR_LOG_IF_ERROR(_eE, "PDumpPanic");\
       MSC_SUPPRESS_4127\
       } while (0)
 
/*! Macro used to record a driver error in the PDump script stream to invalidate the capture */
#define PDUMP_ERROR(_err, _msg) do \
       {   (void) PDumpCaptureError((_err), (_msg), __FUNCTION__, __LINE__);\
       MSC_SUPPRESS_4127\
       } while (0)
 
   /* Shared across pdump_x files */
   PVRSRV_ERROR PDumpInitCommon(void);
   void PDumpDeInitCommon(void);
   IMG_BOOL PDumpReady(void);
   void PDumpGetParameterZeroPageInfo(PDUMP_FILEOFFSET_T *puiZeroPageOffset,
                                   size_t *puiZeroPageSize,
                                   const IMG_CHAR **ppszZeroPageFilename);
 
   void PDumpConnectionNotify(void);
   void PDumpDisconnectionNotify(void);
 
   void PDumpStopInitPhase(IMG_BOOL bPDumpClient, IMG_BOOL bInitClient);
   PVRSRV_ERROR PDumpSetFrameKM(CONNECTION_DATA *psConnection,
                             PVRSRV_DEVICE_NODE * psDeviceNode,
                             IMG_UINT32 ui32Frame);
   PVRSRV_ERROR PDumpGetFrameKM(CONNECTION_DATA *psConnection,
                             PVRSRV_DEVICE_NODE * psDeviceNode,
                             IMG_UINT32* pui32Frame);
   PVRSRV_ERROR PDumpCommentKM(IMG_CHAR *pszComment, IMG_UINT32 ui32Flags);
 
   PVRSRV_ERROR PDumpSetDefaultCaptureParamsKM(IMG_UINT32 ui32Mode,
                                              IMG_UINT32 ui32Start,
                                              IMG_UINT32 ui32End,
                                              IMG_UINT32 ui32Interval,
                                              IMG_UINT32 ui32MaxParamFileSize);
 
 
   PVRSRV_ERROR PDumpReg32(IMG_CHAR    *pszPDumpRegName,
                           IMG_UINT32    ui32RegAddr,
                           IMG_UINT32    ui32RegValue,
                           IMG_UINT32    ui32Flags);
 
   PVRSRV_ERROR PDumpReg64(IMG_CHAR    *pszPDumpRegName,
                           IMG_UINT32    ui32RegAddr,
                           IMG_UINT64    ui64RegValue,
                           IMG_UINT32    ui32Flags);
 
   PVRSRV_ERROR PDumpRegLabelToReg64(IMG_CHAR *pszPDumpRegName,
                                          IMG_UINT32 ui32RegDst,
                                          IMG_UINT32 ui32RegSrc,
                                          IMG_UINT32 ui32Flags);
 
   PVRSRV_ERROR PDumpMemLabelToInternalVar(IMG_CHAR *pszInternalVar,
                                                PMR *psPMR,
                                                IMG_DEVMEM_OFFSET_T uiLogicalOffset,
                                                IMG_UINT32 ui32Flags);
 
   PVRSRV_ERROR PDumpWriteVarORValueOp (const IMG_CHAR *pszInternalVariable,
                                             const IMG_UINT64 ui64Value,
                                             const IMG_UINT32 ui32PDumpFlags);
 
   PVRSRV_ERROR PDumpWriteVarANDValueOp (const IMG_CHAR *pszInternalVariable,
                                              const IMG_UINT64 ui64Value,
                                              const IMG_UINT32 ui32PDumpFlags);
 
   PVRSRV_ERROR PDumpWriteVarSHRValueOp (const IMG_CHAR *pszInternalVariable,
                                              const IMG_UINT64 ui64Value,
                                              const IMG_UINT32 ui32PDumpFlags);
 
   PVRSRV_ERROR PDumpInternalVarToReg32(IMG_CHAR *pszPDumpRegName,
                                             IMG_UINT32    ui32Reg,
                                             IMG_CHAR *pszInternalVar,
                                             IMG_UINT32    ui32Flags);
 
   PVRSRV_ERROR PDumpInternalVarToReg64(IMG_CHAR *pszPDumpRegName,
                                             IMG_UINT32    ui32Reg,
                                             IMG_CHAR *pszInternalVar,
                                             IMG_UINT32    ui32Flags);
 
   PVRSRV_ERROR PDumpMemLabelToMem32(PMR *psPMRSource,
                                          PMR *psPMRDest,
                                          IMG_DEVMEM_OFFSET_T uiLogicalOffsetSource,
                                          IMG_DEVMEM_OFFSET_T uiLogicalOffsetDest,
                                          IMG_UINT32 ui32Flags);
 
   PVRSRV_ERROR PDumpMemLabelToMem64(PMR *psPMRSource,
                                          PMR *psPMRDest,
                                          IMG_DEVMEM_OFFSET_T uiLogicalOffsetSource,
                                          IMG_DEVMEM_OFFSET_T uiLogicalOffsetDest,
                                          IMG_UINT32    ui32Flags);
 
   PVRSRV_ERROR PDumpRegLabelToMem32(IMG_CHAR *pszPDumpRegName,
                                          IMG_UINT32 ui32Reg,
                                          PMR *psPMR,
                                     IMG_DEVMEM_OFFSET_T uiLogicalOffset,
                                          IMG_UINT32 ui32Flags);
 
   PVRSRV_ERROR PDumpRegLabelToMem64(IMG_CHAR *pszPDumpRegName,
                                     IMG_UINT32 ui32Reg,
                                     PMR *psPMR,
                                     IMG_DEVMEM_OFFSET_T uiLogicalOffset,
                                     IMG_UINT32 ui32Flags);
 
   PVRSRV_ERROR PDumpRegLabelToInternalVar(IMG_CHAR *pszPDumpRegName,
                                                IMG_UINT32 ui32Reg,
                                                IMG_CHAR *pszInternalVar,
                                                IMG_UINT32 ui32Flags);
 
   PVRSRV_ERROR PDumpSAW(IMG_CHAR      *pszDevSpaceName,
                         IMG_UINT32    ui32HPOffsetBytes,
                         IMG_UINT32    ui32NumSaveBytes,
                         IMG_CHAR      *pszOutfileName,
                         IMG_UINT32    ui32OutfileOffsetByte,
                         PDUMP_FLAGS_T uiPDumpFlags);
 
   PVRSRV_ERROR PDumpRegPolKM(IMG_CHAR                *pszPDumpRegName,
                              IMG_UINT32            ui32RegAddr,
                              IMG_UINT32            ui32RegValue,
                              IMG_UINT32            ui32Mask,
                              IMG_UINT32            ui32Flags,
                              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_UINT32 ui32MMUContextID,
                                         IMG_UINT32 ui32Size,
                                         PDUMP_PIXEL_FORMAT ePixelFormat,
                                         IMG_UINT32 ui32AddrMode,
                                         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 PDumpCommentWithFlags(IMG_UINT32    ui32Flags,
                                      IMG_CHAR*    pszFormat,
                                      ...) __printf(2, 3);
 
   PVRSRV_ERROR PDumpCommentWithFlagsVA(IMG_UINT32 ui32Flags,
                                       const IMG_CHAR * pszFormat,
                                       va_list args);
 
   PVRSRV_ERROR PDumpPanic(IMG_UINT32      ui32PanicNo,
                           IMG_CHAR*       pszPanicMsg,
                           const IMG_CHAR* pszPPFunc,
                           IMG_UINT32      ui32PPline);
 
   PVRSRV_ERROR PDumpCaptureError(PVRSRV_ERROR    ui32ErrorNo,
                                  IMG_CHAR*       pszErrorMsg,
                                  const IMG_CHAR* pszPPFunc,
                                  IMG_UINT32      ui32PPline);
 
   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);
 
   PVRSRV_ERROR PDumpIsLastCaptureFrameKM(IMG_BOOL *pbIsLastCaptureFrame);
 
   PVRSRV_ERROR PDumpIsCaptureFrameKM(IMG_BOOL *bIsCapturing);
 
   PVRSRV_ERROR PDumpRegRead32(IMG_CHAR *pszPDumpRegName,
                               const IMG_UINT32 dwRegOffset,
                               IMG_UINT32    ui32Flags);
   PVRSRV_ERROR PDumpRegRead64(IMG_CHAR *pszPDumpRegName,
                               const IMG_UINT32 dwRegOffset,
                               IMG_UINT32    ui32Flags);
 
   PVRSRV_ERROR PDumpIDLWithFlags(IMG_UINT32 ui32Clocks, IMG_UINT32 ui32Flags);
   PVRSRV_ERROR PDumpIDL(IMG_UINT32 ui32Clocks);
 
   PVRSRV_ERROR PDumpRegBasedCBP(IMG_CHAR        *pszPDumpRegName,
                                 IMG_UINT32    ui32RegOffset,
                                 IMG_UINT32    ui32WPosVal,
                                 IMG_UINT32    ui32PacketSize,
                                 IMG_UINT32    ui32BufferSize,
                                 IMG_UINT32    ui32Flags);
 
   PVRSRV_ERROR PDumpTRG(IMG_CHAR *pszMemSpace,
                         IMG_UINT32 ui32MMUCtxID,
                         IMG_UINT32 ui32RegionID,
                         IMG_BOOL bEnable,
                         IMG_UINT64 ui64VAddr,
                         IMG_UINT64 ui64LenBytes,
                         IMG_UINT32 ui32XStride,
                         IMG_UINT32 ui32Flags);
 
   PVRSRV_ERROR PDumpCreateLockKM(void);
   void PDumpDestroyLockKM(void);
   void PDumpLock(void);
   void PDumpUnlock(void);
 
   PVRSRV_ERROR PDumpIfKM(IMG_CHAR        *pszPDumpCond);
   PVRSRV_ERROR PDumpElseKM(IMG_CHAR    *pszPDumpCond);
   PVRSRV_ERROR PDumpFiKM(IMG_CHAR        *pszPDumpCond);
 
   void PDumpPowerTransitionStart(void);
   void PDumpPowerTransitionEnd(void);
   IMG_BOOL PDumpInPowerTransition(void);
   IMG_BOOL PDumpIsDumpSuspended(void);
 
   /*!
    * @name    PDumpWriteParameter
    * @brief    General function for writing to PDump stream. Used
    *          mainly for memory dumps to parameter stream.
    *             Usually more convenient to use PDumpWriteScript below
    *             for the script stream.
    * @param    psui8Data - data to write
    * @param    ui32Size - size of write
    * @param    ui32Flags - PDump flags
    * @param   pui32FileOffset - on return contains the file offset to
    *                            the start of the parameter data
    * @param   aszFilenameStr - pointer to at least a 20 char buffer to
    *                           return the parameter filename
    * @return    error
    */
   PVRSRV_ERROR PDumpWriteParameter(IMG_UINT8 *psui8Data, IMG_UINT32 ui32Size,
           IMG_UINT32 ui32Flags, IMG_UINT32* pui32FileOffset,
           IMG_CHAR* aszFilenameStr);
 
   /*!
    * @name    PDumpWriteScript
    * @brief    Write an PDumpOS created string to the "script" output stream
    * @param    hString - PDump OS layer handle of string buffer to write
    * @param    ui32Flags - PDump flags
    * @return    IMG_TRUE on success.
    */
   IMG_BOOL PDumpWriteScript(IMG_HANDLE hString, IMG_UINT32 ui32Flags);
 
    /*
      PDumpWriteShiftedMaskedValue():
 
      loads the "reference" address into an internal PDump register,
      optionally shifts it right,
      optionally shifts it left,
      optionally masks it
      then finally writes the computed value to the given destination address
 
      i.e. it emits pdump language equivalent to this expression:
 
      dest = ((&ref) >> SHRamount << SHLamount) & MASK
    */
extern PVRSRV_ERROR
PDumpWriteShiftedMaskedValue(const IMG_CHAR *pszDestRegspaceName,
                             const IMG_CHAR *pszDestSymbolicName,
                             IMG_DEVMEM_OFFSET_T uiDestOffset,
                             const IMG_CHAR *pszRefRegspaceName,
                             const IMG_CHAR *pszRefSymbolicName,
                             IMG_DEVMEM_OFFSET_T uiRefOffset,
                             IMG_UINT32 uiSHRAmount,
                             IMG_UINT32 uiSHLAmount,
                             IMG_UINT32 uiMask,
                             IMG_DEVMEM_SIZE_T uiWordSize,
                             IMG_UINT32 uiPDumpFlags);
 
    /*
      PDumpWriteSymbAddress():
 
      writes the address of the "reference" to the offset given
    */
extern PVRSRV_ERROR
PDumpWriteSymbAddress(const IMG_CHAR *pszDestSpaceName,
                      IMG_DEVMEM_OFFSET_T uiDestOffset,
                      const IMG_CHAR *pszRefSymbolicName,
                      IMG_DEVMEM_OFFSET_T uiRefOffset,
                      const IMG_CHAR *pszPDumpDevName,
                      IMG_UINT32 ui32WordSize,
                      IMG_UINT32 ui32AlignShift,
                      IMG_UINT32 ui32Shift,
                      IMG_UINT32 uiPDumpFlags);
 
/* Register the connection with the PDump subsystem */
extern PVRSRV_ERROR PDumpRegisterConnection(SYNC_CONNECTION_DATA *psSyncConnectionData,
                                           PDUMP_CONNECTION_DATA **ppsPDumpConnectionData);
 
/* Unregister the connection with the PDump subsystem */
extern void PDumpUnregisterConnection(PDUMP_CONNECTION_DATA *psPDumpConnectionData);
 
/* Register for notification of PDump Transition into/out of capture range */
extern PVRSRV_ERROR PDumpRegisterTransitionCallback(PDUMP_CONNECTION_DATA *psPDumpConnectionData,
                                                    PFN_PDUMP_TRANSITION pfnCallback,
                                                    void *hPrivData,
                                                    void **ppvHandle);
 
/* Unregister notification of PDump Transition */
extern void PDumpUnregisterTransitionCallback(void *pvHandle);
 
/* Notify PDump of a Transition into/out of capture range */
extern PVRSRV_ERROR PDumpTransition(PDUMP_CONNECTION_DATA *psPDumpConnectionData, IMG_BOOL bInto, IMG_UINT32 ui32PDumpFlags);
 
/* Wires-up a MIPS TLB in the page table*/
extern PVRSRV_ERROR PdumpWireUpMipsTLB(PMR *psPMRSource,
                       PMR *psPMRDest,
                       IMG_DEVMEM_OFFSET_T uiLogicalOffsetSource,
                       IMG_DEVMEM_OFFSET_T uiLogicalOffsetDest,
                       IMG_UINT32 ui32AllocationFlags,
                       IMG_UINT32 ui32Flags);
 
/*Invalidate a MIPS TLB in the page table */
PVRSRV_ERROR PdumpInvalidateMipsTLB(PMR *psPMRDest,
                                   IMG_DEVMEM_OFFSET_T uiLogicalOffsetDest,
                                   IMG_UINT32 ui32MipsTLBValidClearMask,
                                   IMG_UINT32 ui32Flags);
 
 
 
   #define PDUMP_LOCK                PDumpLock
   #define PDUMP_UNLOCK            PDumpUnlock
 
   #define PDUMPINIT                PDumpInitCommon
   #define PDUMPDEINIT                PDumpDeInitCommon
   #define PDUMPREG32                PDumpReg32
   #define PDUMPREG64                PDumpReg64
   #define PDUMPREGREAD32            PDumpRegRead32
   #define PDUMPREGREAD64            PDumpRegRead64
   #define PDUMPCOMMENT(...)        PDumpCommentWithFlags(PDUMP_FLAGS_CONTINUOUS, __VA_ARGS__)
   #define PDUMPCOMMENTWITHFLAGS    PDumpCommentWithFlags
   #define PDUMPREGPOL                PDumpRegPolKM
   #define PDUMPPDREG                PDumpPDReg
   #define PDUMPPDREGWITHFLAGS        PDumpPDRegWithFlags
   #define PDUMPREGBASEDCBP        PDumpRegBasedCBP
   #define PDUMPENDINITPHASE        PDumpStopInitPhase
   #define PDUMPIDLWITHFLAGS        PDumpIDLWithFlags
   #define PDUMPIDL                PDumpIDL
   #define PDUMPPOWCMDSTART        PDumpPowerTransitionStart
   #define PDUMPPOWCMDEND            PDumpPowerTransitionEnd
   #define PDUMPPOWCMDINTRANS        PDumpInPowerTransition
   #define PDUMPIF                    PDumpIfKM
   #define PDUMPELSE                PDumpElseKM
   #define PDUMPFI                    PDumpFiKM
#else
   /*
       We should be clearer about which functions can be called
       across the bridge as this looks rather unbalanced
   */
 
/*! Macro used to record a panic in the PDump script stream */
#define PDUMP_PANIC(_id, _msg)  ((void)0);
 
/*! Macro used to record a driver error in the PDump script stream to invalidate the capture */
#define PDUMP_ERROR(_err, _msg) ((void)0);
 
#ifdef INLINE_IS_PRAGMA
#pragma inline(PDumpInitCommon)
#endif
static INLINE PVRSRV_ERROR
PDumpInitCommon(void)
{
   return PVRSRV_OK;
}
 
#ifdef INLINE_IS_PRAGMA
#pragma inline(PDumpConnectionNotify)
#endif
static INLINE void
PDumpConnectionNotify(void)
{
   return;
}
 
#ifdef INLINE_IS_PRAGMA
#pragma inline(PDumpDisconnectionNotify)
#endif
static INLINE void
PDumpDisconnectionNotify(void)
{
   return;
}
 
#ifdef INLINE_IS_PRAGMA
#pragma inline(PDumpCreateLockKM)
#endif
static INLINE PVRSRV_ERROR
PDumpCreateLockKM(void)
{
   return PVRSRV_OK;
}
 
#ifdef INLINE_IS_PRAGMA
#pragma inline(PDumpDestroyLockKM)
#endif
static INLINE void
PDumpDestroyLockKM(void)
{
}
 
#ifdef INLINE_IS_PRAGMA
#pragma inline(PDumpLock)
#endif
static INLINE void
PDumpLock(void)
{
}
 
#ifdef INLINE_IS_PRAGMA
#pragma inline(PDumpUnlock)
#endif
static INLINE void
PDumpUnlock(void)
{
}
 
#ifdef INLINE_IS_PRAGMA
#pragma inline(PDumpStopInitPhase)
#endif
static INLINE void
PDumpStopInitPhase(IMG_BOOL bPDumpClient, IMG_BOOL bInitClient)
{
   PVR_UNREFERENCED_PARAMETER(bPDumpClient);
   PVR_UNREFERENCED_PARAMETER(bInitClient);
}
 
#ifdef INLINE_IS_PRAGMA
#pragma inline(PDumpSetFrameKM)
#endif
static INLINE PVRSRV_ERROR
PDumpSetFrameKM(CONNECTION_DATA *psConnection,
                PVRSRV_DEVICE_NODE *psDevNode,
                IMG_UINT32 ui32Frame)
{
   PVR_UNREFERENCED_PARAMETER(psConnection);
   PVR_UNREFERENCED_PARAMETER(ui32Frame);
   return PVRSRV_OK;
}
 
#ifdef INLINE_IS_PRAGMA
#pragma inline(PDumpGetFrameKM)
#endif
static INLINE PVRSRV_ERROR
PDumpGetFrameKM(CONNECTION_DATA *psConnection,
                PVRSRV_DEVICE_NODE *psDeviceNode,
                IMG_UINT32* pui32Frame)
{
   PVR_UNREFERENCED_PARAMETER(psConnection);
   PVR_UNREFERENCED_PARAMETER(pui32Frame);
   return PVRSRV_OK;
}
 
#ifdef INLINE_IS_PRAGMA
#pragma inline(PDumpCommentKM)
#endif
static INLINE PVRSRV_ERROR
PDumpCommentKM(IMG_CHAR *pszComment, IMG_UINT32 ui32Flags)
{
   PVR_UNREFERENCED_PARAMETER(pszComment);
   PVR_UNREFERENCED_PARAMETER(ui32Flags);
   return PVRSRV_OK;
}
 
 
#ifdef INLINE_IS_PRAGMA
#pragma inline(PDumpCommentKM)
#endif
static INLINE PVRSRV_ERROR
PDumpSetDefaultCaptureParamsKM(IMG_UINT32 ui32Mode,
                              IMG_UINT32 ui32Start,
                              IMG_UINT32 ui32End,
                              IMG_UINT32 ui32Interval,
                              IMG_UINT32 ui32MaxParamFileSize)
{
   PVR_UNREFERENCED_PARAMETER(ui32Mode);
   PVR_UNREFERENCED_PARAMETER(ui32Start);
   PVR_UNREFERENCED_PARAMETER(ui32End);
   PVR_UNREFERENCED_PARAMETER(ui32Interval);
   PVR_UNREFERENCED_PARAMETER(ui32MaxParamFileSize);
 
   return PVRSRV_OK;
}
 
 
#ifdef INLINE_IS_PRAGMA
#pragma inline(PDumpPanic)
#endif
static INLINE PVRSRV_ERROR
PDumpPanic(IMG_UINT32      ui32PanicNo,
          IMG_CHAR*       pszPanicMsg,
          const IMG_CHAR* pszPPFunc,
          IMG_UINT32      ui32PPline)
{
   PVR_UNREFERENCED_PARAMETER(ui32PanicNo);
   PVR_UNREFERENCED_PARAMETER(pszPanicMsg);
   PVR_UNREFERENCED_PARAMETER(pszPPFunc);
   PVR_UNREFERENCED_PARAMETER(ui32PPline);
   return PVRSRV_OK;
}
 
#ifdef INLINE_IS_PRAGMA
#pragma inline(PDumpCaptureError)
#endif
static INLINE PVRSRV_ERROR
PDumpCaptureError(PVRSRV_ERROR    ui32ErrorNo,
                  IMG_CHAR*       pszErrorMsg,
                  const IMG_CHAR* pszPPFunc,
                  IMG_UINT32      ui32PPline)
{
   PVR_UNREFERENCED_PARAMETER(ui32ErrorNo);
   PVR_UNREFERENCED_PARAMETER(pszErrorMsg);
   PVR_UNREFERENCED_PARAMETER(pszPPFunc);
   PVR_UNREFERENCED_PARAMETER(ui32PPline);
   return PVRSRV_OK;
}
 
#ifdef INLINE_IS_PRAGMA
#pragma inline(PDumpIsLastCaptureFrameKM)
#endif
static INLINE PVRSRV_ERROR
PDumpIsLastCaptureFrameKM(IMG_BOOL *pbIsLastCaptureFrame)
{
   *pbIsLastCaptureFrame = IMG_FALSE;
   return PVRSRV_OK;
}
 
#ifdef INLINE_IS_PRAGMA
#pragma inline(PDumpIsCaptureFrameKM)
#endif
static INLINE PVRSRV_ERROR
PDumpIsCaptureFrameKM(IMG_BOOL *bIsCapturing)
{
   *bIsCapturing = IMG_FALSE;
   return PVRSRV_OK;
}
 
#ifdef INLINE_IS_PRAGMA
#pragma inline(PDumpBitmapKM)
#endif
static INLINE 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_UINT32 ui32MMUContextID,
                                         IMG_UINT32 ui32Size,
                                         PDUMP_PIXEL_FORMAT ePixelFormat,
                                         IMG_UINT32 ui32AddrMode,
                                         IMG_UINT32 ui32PDumpFlags)
{
   PVR_UNREFERENCED_PARAMETER(psDeviceNode);
   PVR_UNREFERENCED_PARAMETER(pszFileName);
   PVR_UNREFERENCED_PARAMETER(ui32FileOffset);
   PVR_UNREFERENCED_PARAMETER(ui32Width);
   PVR_UNREFERENCED_PARAMETER(ui32Height);
   PVR_UNREFERENCED_PARAMETER(ui32StrideInBytes);
   PVR_UNREFERENCED_PARAMETER(sDevBaseAddr);
   PVR_UNREFERENCED_PARAMETER(ui32MMUContextID);
   PVR_UNREFERENCED_PARAMETER(ui32Size);
   PVR_UNREFERENCED_PARAMETER(ePixelFormat);
   PVR_UNREFERENCED_PARAMETER(ui32AddrMode);
   PVR_UNREFERENCED_PARAMETER(ui32PDumpFlags);
   return PVRSRV_OK;
}
 
#ifdef INLINE_IS_PRAGMA
#pragma inline(PDumpRegisterConnection)
#endif
static INLINE PVRSRV_ERROR
PDumpRegisterConnection(SYNC_CONNECTION_DATA *psSyncConnectionData,
                       PDUMP_CONNECTION_DATA **ppsPDumpConnectionData)
{
   PVR_UNREFERENCED_PARAMETER(psSyncConnectionData);
   PVR_UNREFERENCED_PARAMETER(ppsPDumpConnectionData);
 
   return PVRSRV_OK;
}
 
#ifdef INLINE_IS_PRAGMA
#pragma inline(PDumpUnregisterConnection)
#endif
static INLINE
void PDumpUnregisterConnection(PDUMP_CONNECTION_DATA *psPDumpConnectionData)
{
   PVR_UNREFERENCED_PARAMETER(psPDumpConnectionData);
}
 
#ifdef INLINE_IS_PRAGMA
#pragma inline(PDumpRegisterTransitionCallback)
#endif
static INLINE
PVRSRV_ERROR PDumpRegisterTransitionCallback(PDUMP_CONNECTION_DATA *psPDumpConnectionData,
                                             PFN_PDUMP_TRANSITION pfnCallback,
                                             void *hPrivData,
                                             void **ppvHandle)
{
   PVR_UNREFERENCED_PARAMETER(psPDumpConnectionData);
   PVR_UNREFERENCED_PARAMETER(pfnCallback);
   PVR_UNREFERENCED_PARAMETER(hPrivData);
   PVR_UNREFERENCED_PARAMETER(ppvHandle);
 
   return PVRSRV_OK;
}
 
#ifdef INLINE_IS_PRAGMA
#pragma inline(PDumpUnregisterTransitionCallback)
#endif
static INLINE
void PDumpUnregisterTransitionCallback(void *pvHandle)
{
   PVR_UNREFERENCED_PARAMETER(pvHandle);
}
 
#ifdef INLINE_IS_PRAGMA
#pragma inline(PDumpTransition)
#endif
static INLINE
PVRSRV_ERROR PDumpTransition(PDUMP_CONNECTION_DATA *psPDumpConnectionData, IMG_BOOL bInto, IMG_UINT32 ui32PDumpFlags)
{
   PVR_UNREFERENCED_PARAMETER(psPDumpConnectionData);
   PVR_UNREFERENCED_PARAMETER(bInto);
   PVR_UNREFERENCED_PARAMETER(ui32PDumpFlags);
   return PVRSRV_OK;
}
 
   #if defined WIN32
       #define PDUMPINIT            PDumpInitCommon
       #define PDUMPDEINIT(...)        / ## * PDUMPDEINIT(__VA_ARGS__) * ## /
       #define PDUMPREG32(...)            / ## * PDUMPREG32(__VA_ARGS__) * ## /
       #define PDUMPREG64(...)            / ## * PDUMPREG64(__VA_ARGS__) * ## /
       #define PDUMPREGREAD32(...)            / ## * PDUMPREGREAD32(__VA_ARGS__) * ## /
       #define PDUMPREGREAD64(...)            / ## * PDUMPREGREAD64(__VA_ARGS__) * ## /
       #define PDUMPCOMMENT(...)        / ## * PDUMPCOMMENT(__VA_ARGS__) * ## /
       #define PDUMPREGPOL(...)        / ## * PDUMPREGPOL(__VA_ARGS__) * ## /
       #define PDUMPPDREG(...)            / ## * PDUMPPDREG(__VA_ARGS__) * ## /
       #define PDUMPPDREGWITHFLAGS(...)    / ## * PDUMPPDREGWITHFLAGS(__VA_ARGS__) * ## /
       #define PDUMPSYNC(...)            / ## * PDUMPSYNC(__VA_ARGS__) * ## /
       #define PDUMPCOPYTOMEM(...)        / ## * PDUMPCOPYTOMEM(__VA_ARGS__) * ## /
       #define PDUMPWRITE(...)            / ## * PDUMPWRITE(__VA_ARGS__) * ## /
       #define PDUMPCBP(...)            / ## * PDUMPCBP(__VA_ARGS__) * ## /
       #define    PDUMPREGBASEDCBP(...)        / ## * PDUMPREGBASEDCBP(__VA_ARGS__) * ## /
       #define PDUMPCOMMENTWITHFLAGS(...)    / ## * PDUMPCOMMENTWITHFLAGS(__VA_ARGS__) * ## /
       #define PDUMPMALLOCPAGESPHYS(...)    / ## * PDUMPMALLOCPAGESPHYS(__VA_ARGS__) * ## /
       #define PDUMPENDINITPHASE(...)        / ## * PDUMPENDINITPHASE(__VA_ARGS__) * ## /
       #define PDUMPMSVDXREG(...)        / ## * PDUMPMSVDXREG(__VA_ARGS__) * ## /
       #define PDUMPMSVDXREGWRITE(...)        / ## * PDUMPMSVDXREGWRITE(__VA_ARGS__) * ## /
       #define PDUMPMSVDXREGREAD(...)        / ## * PDUMPMSVDXREGREAD(__VA_ARGS__) * ## /
       #define PDUMPMSVDXPOLEQ(...)        / ## * PDUMPMSVDXPOLEQ(__VA_ARGS__) * ## /
       #define PDUMPMSVDXPOL(...)        / ## * PDUMPMSVDXPOL(__VA_ARGS__) * ## /
       #define PDUMPIDLWITHFLAGS(...)        / ## * PDUMPIDLWITHFLAGS(__VA_ARGS__) * ## /
       #define PDUMPIDL(...)            / ## * PDUMPIDL(__VA_ARGS__) * ## /
       #define PDUMPPOWCMDSTART(...)        / ## * PDUMPPOWCMDSTART(__VA_ARGS__) * ## /
       #define PDUMPPOWCMDEND(...)        / ## * PDUMPPOWCMDEND(__VA_ARGS__) * ## /
       #define PDUMP_LOCK            / ## * PDUMP_LOCK(__VA_ARGS__) * ## /
       #define PDUMP_UNLOCK            / ## * PDUMP_UNLOCK(__VA_ARGS__) * ## /
   #else
       #if defined LINUX || defined GCC_IA32 || defined GCC_ARM || defined __QNXNTO__ || defined(INTEGRITY_OS)
           #define PDUMPINIT    PDumpInitCommon
           #define PDUMPDEINIT(args...)
           #define PDUMPREG32(args...)
           #define PDUMPREG64(args...)
           #define PDUMPREGREAD32(args...)
           #define PDUMPREGREAD64(args...)
           #define PDUMPCOMMENT(args...)
           #define PDUMPREGPOL(args...)
           #define PDUMPPDREG(args...)
           #define PDUMPPDREGWITHFLAGS(args...)
           #define PDUMPSYNC(args...)
           #define PDUMPCOPYTOMEM(args...)
           #define PDUMPWRITE(args...)
           #define PDUMPREGBASEDCBP(args...)
           #define PDUMPCOMMENTWITHFLAGS(args...)
           #define PDUMPENDINITPHASE(args...)
           #define PDUMPIDLWITHFLAGS(args...)
           #define PDUMPIDL(args...)
           #define PDUMPPOWCMDSTART(args...)
           #define PDUMPPOWCMDEND(args...)
           #define PDUMP_LOCK(args...)
           #define PDUMP_UNLOCK(args...)
 
       #else
           #error Compiler not specified
       #endif
   #endif
#endif
 
 
#endif /* _PDUMP_KM_H_ */
 
/******************************************************************************
 End of file (pdump_km.h)
******************************************************************************/