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
/* SPDX-License-Identifier: GPL-2.0 */
 
/*  --------------------------------------------------------------------------------------------------------
 *  File:   psync_checkpoint.h
 *  --------------------------------------------------------------------------------------------------------
 */
 
 
#ifndef __PSYNC_CHECKPOINT_H__
#define __PSYNC_CHECKPOINT_H__
 
#ifdef __cplusplus
extern "C" {
#endif
 
/* ---------------------------------------------------------------------------------------------------------
 *  Include Files
 * ---------------------------------------------------------------------------------------------------------
 */
#include "psync_checkpoint_context.h"
#include "sync_checkpoint_internal_fw.h"
 
/* ---------------------------------------------------------------------------------------------------------
 *  Macros Definition
 * ---------------------------------------------------------------------------------------------------------
 */
 
 
/* ---------------------------------------------------------------------------------------------------------
 *  Types and Structures Definition
 * ---------------------------------------------------------------------------------------------------------
 */
 
typedef struct _SYNC_CHECKPOINT_BLOCK_ {
   ATOMIC_T                  hRefCount;                  /*!< Ref count for this sync block */
   _SYNC_CHECKPOINT_CONTEXT  *psContext;                 /*!< Our copy of the services connection */
   PVRSRV_DEVICE_NODE        *psDevNode;
   IMG_UINT32                ui32SyncBlockSize;          /*!< Size of the sync checkpoint block */
   IMG_UINT32                ui32FirmwareAddr;           /*!< Firmware address */
   DEVMEM_MEMDESC            *hMemDesc;                  /*!< DevMem allocation for block */
   volatile IMG_UINT32       *pui32LinAddr;              /*!< Server-code CPU mapping */
   IMG_UINT64                uiSpanBase;                 /*!< Base of this import (FW DevMem) in the span RA */
   DLLIST_NODE               sListNode;                  /*!< List node for the sync chkpt block list */
} SYNC_CHECKPOINT_BLOCK;
 
// .CP :
typedef struct _SYNC_CHECKPOINT_ {
   /* A sync checkpoint is assigned a unique ID, to avoid any confusion should
    * the same memory be re-used later for a different checkpoint
    */
   IMG_UINT32                      ui32UID;                /*!< Unique ID assigned to sync checkpoint (to distinguish checkpoints if memory is re-used)*/
   ATOMIC_T                        hRefCount;              /*!< Ref count for this sync */
   ATOMIC_T                        hEnqueuedCCBCount;      /*!< Num times sync has been put in CCBs */
   SYNC_CHECKPOINT_BLOCK           *psSyncCheckpointBlock; /*!< Synchronisation block this checkpoint is allocated on */
   IMG_UINT64                      uiSpanAddr;             /*!< Span address of the sync */
   volatile _SYNC_CHECKPOINT_FW_OBJ *psSyncCheckpointFwObj; /*!< CPU view of the data held in the sync block */
   IMG_CHAR                        azName[SYNC_CHECKPOINT_NAME_SIZE]; /*!< Name of the checkpoint */
#if defined(PVRSRV_ENABLE_FULL_SYNC_TRACKING)
   PSYNC_CHECKPOINT_RECORD_HANDLE  hRecord;                /*!< Sync record handle */
#endif
   DLLIST_NODE                     sListNode;              /*!< List node for the sync chkpt list */
} _SYNC_CHECKPOINT;
typedef struct _SYNC_CHECKPOINT *PSYNC_CHECKPOINT;
 
/* ---------------------------------------------------------------------------------------------------------
 *  Global Functions' Prototype
 * ---------------------------------------------------------------------------------------------------------
 */
 
 
/* ---------------------------------------------------------------------------------------------------------
 *  Inline Functions Implementation
 * ---------------------------------------------------------------------------------------------------------
 */
 
#ifdef __cplusplus
}
#endif
 
#endif /* __PSYNC_CHECKPOINT_H__ */