NMSIS-Core  Version 1.5.0
NMSIS-Core support for Nuclei processor-based devices
Cluster-Cache Functions

Functions that configure Cluster Cache by CCM. More...

Data Structures

struct  SMPCC_CMD_Type
 Cluster Cache Control and Command Registers. More...
 

Macros

#define SMPCC_CMD_CTRL_SUP_EN_Pos   9U
 SMPCC_CMD CC_CTRL SUP_EN Position. More...
 
#define SMPCC_CMD_CTRL_SUP_EN_Msk   (0x1UL << SMPCC_CMD_CTRL_SUP_EN_Pos)
 SMPCC_CMD CC_CTRL SUP_EN Mask. More...
 
#define SMPCC_CMD_CTRL_SUP_EN_ENABLE   1U
 SMPCC_CMD CC_CTRL SUP_EN Enable. More...
 
#define SMPCC_CMD_CTRL_SUP_EN_DISABLE   0U
 SMPCC_CMD CC_CTRL SUP_EN Disable. More...
 
#define SMPCC_CMD_CTRL_USE_EN_Pos   10U
 SMPCC_CMD CC_CTRL USE_EN Position. More...
 
#define SMPCC_CMD_CTRL_USE_EN_Msk   (0x1UL << SMPCC_CMD_CTRL_USE_EN_Pos)
 SMPCC_CMD CC_CTRL USE_EN Mask. More...
 
#define SMPCC_CMD_CTRL_USE_EN_ENABLE   1U
 SMPCC_CMD CC_CTRL USE_EN Enable. More...
 
#define SMPCC_CMD_CTRL_USE_EN_DISABLE   0U
 SMPCC_CMD CC_CTRL USE_EN Disable. More...
 
#define SMPCC_CMD_xCMD_CMD_Pos   0U
 SMPCC_CMD register xCMD field CMD Position. More...
 
#define SMPCC_CMD_xCMD_CMD_Msk   (0x1FUL << SMPCC_CMD_xCMD_CMD_Pos)
 SMPCC_CMD register xCMD field CMD Mask. More...
 
#define SMPCC_CMD_xCMD_CMD_WB_ALL   0x7U
 SMPCC_CMD xCMD CMD WB_ALL. More...
 
#define SMPCC_CMD_xCMD_CMD_WBINVAL_ALL   0x6U
 SMPCC_CMD xCMD CMD WBINVAL_ALL. More...
 
#define SMPCC_CMD_xCMD_RESULT_Pos   26U
 SMPCC_CMD xCMD RESULT Position. More...
 
#define SMPCC_CMD_xCMD_RESULT_Msk   (0x1FUL << SMPCC_CMD_xCMD_RESULT_Pos)
 SMPCC_CMD xCMD RESULT Mask. More...
 
#define SMPCC_CMD_xCMD_RESULT_SUCCESS   0x0U
 SMPCC_CMD xCMD RESULT Success. More...
 
#define SMPCC_CMD_xCMD_RESULT_ENTRY_EXCEED_LIMIT   0x1U
 SMPCC_CMD xCMD RESULT Exceed the upper entry num of lockable way. More...
 
#define SMPCC_CMD_xCMD_RESULT_REFILL_BUS_ERROR   0x3U
 SMPCC_CMD xCMD RESULT Refill Bus Error. More...
 
#define SMPCC_CMD_xCMD_RESULT_ECC_ERROR   0x4U
 SMPCC_CMD xCMD RESULT ECC Error. More...
 
#define SMPCC_CMD_xCMD_RESULT_CPBACK_BUS_ERROR   0x5U
 SMPCC_CMD xCMD RESULT Copy Back Bus Error. More...
 
#define SMPCC_CMD_xCMD_COMPLETE_Pos   31U
 SMPCC_CMD xCMD COMPLETE Position. More...
 
#define SMPCC_CMD_xCMD_COMPLETE_Msk   (0x1UL << SMPCC_CMD_xCMD_COMPLETE_Pos)
 SMPCC_CMD xCMD COMPLETE Mask. More...
 
#define SMPCC_CMD_INVALID_ALL_Pos   0U
 SMPCC_CMD INVALID_ALL Position. More...
 
#define SMPCC_CMD_INVALID_ALL_Msk   (0x1UL << SMPCC_CMD_INVALID_ALL_Pos)
 SMPCC_CMD INVALID_ALL Mask. More...
 
#define SMPCC_CMD_BASE   __SMPCC_BASEADDR
 SMPCC CMD Base Address. More...
 
#define SMPCC_CMD   ((SMPCC_CMD_Type *)SMPCC_CMD_BASE)
 SMPCC CMD configuration struct. More...
 
__STATIC_INLINE unsigned long MLockCCacheLine (unsigned long addr)
 Lock one Cluster Cache line specified by address in M-Mode. More...
 
__STATIC_INLINE unsigned long MLockCCacheLines (unsigned long addr, unsigned long cnt)
 Lock several Cluster Cache lines specified by address in M-Mode. More...
 
__STATIC_INLINE unsigned long SLockCCacheLine (unsigned long addr)
 Lock one Cluster Cache line specified by address in S-Mode. More...
 
__STATIC_INLINE unsigned long SLockCCacheLines (unsigned long addr, unsigned long cnt)
 Lock several Cluster Cache lines specified by address in S-Mode. More...
 
__STATIC_INLINE unsigned long ULockCCacheLine (unsigned long addr)
 Lock one Cluster Cache line specified by address in U-Mode. More...
 
__STATIC_INLINE unsigned long ULockCCacheLines (unsigned long addr, unsigned long cnt)
 Lock several Cluster Cache lines specified by address in U-Mode. More...
 
__STATIC_INLINE void MUnlockCCacheLine (unsigned long addr)
 Unlock one Cluster Cache line specified by address in M-Mode. More...
 
__STATIC_INLINE void MUnlockCCacheLines (unsigned long addr, unsigned long cnt)
 Unlock several Cluster Cache lines specified by address in M-Mode. More...
 
__STATIC_INLINE void SUnlockCCacheLine (unsigned long addr)
 Unlock one Cluster Cache line specified by address in S-Mode. More...
 
__STATIC_INLINE void SUnlockCCacheLines (unsigned long addr, unsigned long cnt)
 Unlock several Cluster Cache lines specified by address in S-Mode. More...
 
__STATIC_INLINE void UUnlockCCacheLine (unsigned long addr)
 Unlock one Cluster Cache line specified by address in U-Mode. More...
 
__STATIC_INLINE void UUnlockCCacheLines (unsigned long addr, unsigned long cnt)
 Unlock several Cluster Cache lines specified by address in U-Mode. More...
 

Detailed Description

Functions that configure Cluster Cache by CCM.

Macro Definition Documentation

◆ SMPCC_CMD

#define SMPCC_CMD   ((SMPCC_CMD_Type *)SMPCC_CMD_BASE)

SMPCC CMD configuration struct.

Definition at line 109 of file core_feature_cache.h.

◆ SMPCC_CMD_BASE

#define SMPCC_CMD_BASE   __SMPCC_BASEADDR

SMPCC CMD Base Address.

Definition at line 108 of file core_feature_cache.h.

◆ SMPCC_CMD_CTRL_SUP_EN_DISABLE

#define SMPCC_CMD_CTRL_SUP_EN_DISABLE   0U

SMPCC_CMD CC_CTRL SUP_EN Disable.

Definition at line 76 of file core_feature_cache.h.

◆ SMPCC_CMD_CTRL_SUP_EN_ENABLE

#define SMPCC_CMD_CTRL_SUP_EN_ENABLE   1U

SMPCC_CMD CC_CTRL SUP_EN Enable.

Definition at line 75 of file core_feature_cache.h.

◆ SMPCC_CMD_CTRL_SUP_EN_Msk

#define SMPCC_CMD_CTRL_SUP_EN_Msk   (0x1UL << SMPCC_CMD_CTRL_SUP_EN_Pos)

SMPCC_CMD CC_CTRL SUP_EN Mask.

Definition at line 74 of file core_feature_cache.h.

◆ SMPCC_CMD_CTRL_SUP_EN_Pos

#define SMPCC_CMD_CTRL_SUP_EN_Pos   9U

SMPCC_CMD CC_CTRL SUP_EN Position.

Definition at line 73 of file core_feature_cache.h.

◆ SMPCC_CMD_CTRL_USE_EN_DISABLE

#define SMPCC_CMD_CTRL_USE_EN_DISABLE   0U

SMPCC_CMD CC_CTRL USE_EN Disable.

Definition at line 81 of file core_feature_cache.h.

◆ SMPCC_CMD_CTRL_USE_EN_ENABLE

#define SMPCC_CMD_CTRL_USE_EN_ENABLE   1U

SMPCC_CMD CC_CTRL USE_EN Enable.

Definition at line 80 of file core_feature_cache.h.

◆ SMPCC_CMD_CTRL_USE_EN_Msk

#define SMPCC_CMD_CTRL_USE_EN_Msk   (0x1UL << SMPCC_CMD_CTRL_USE_EN_Pos)

SMPCC_CMD CC_CTRL USE_EN Mask.

Definition at line 79 of file core_feature_cache.h.

◆ SMPCC_CMD_CTRL_USE_EN_Pos

#define SMPCC_CMD_CTRL_USE_EN_Pos   10U

SMPCC_CMD CC_CTRL USE_EN Position.

Definition at line 78 of file core_feature_cache.h.

◆ SMPCC_CMD_INVALID_ALL_Msk

#define SMPCC_CMD_INVALID_ALL_Msk   (0x1UL << SMPCC_CMD_INVALID_ALL_Pos)

SMPCC_CMD INVALID_ALL Mask.

Definition at line 100 of file core_feature_cache.h.

◆ SMPCC_CMD_INVALID_ALL_Pos

#define SMPCC_CMD_INVALID_ALL_Pos   0U

SMPCC_CMD INVALID_ALL Position.

Definition at line 99 of file core_feature_cache.h.

◆ SMPCC_CMD_xCMD_CMD_Msk

#define SMPCC_CMD_xCMD_CMD_Msk   (0x1FUL << SMPCC_CMD_xCMD_CMD_Pos)

SMPCC_CMD register xCMD field CMD Mask.

Definition at line 84 of file core_feature_cache.h.

◆ SMPCC_CMD_xCMD_CMD_Pos

#define SMPCC_CMD_xCMD_CMD_Pos   0U

SMPCC_CMD register xCMD field CMD Position.

Definition at line 83 of file core_feature_cache.h.

◆ SMPCC_CMD_xCMD_CMD_WB_ALL

#define SMPCC_CMD_xCMD_CMD_WB_ALL   0x7U

SMPCC_CMD xCMD CMD WB_ALL.

Definition at line 85 of file core_feature_cache.h.

◆ SMPCC_CMD_xCMD_CMD_WBINVAL_ALL

#define SMPCC_CMD_xCMD_CMD_WBINVAL_ALL   0x6U

SMPCC_CMD xCMD CMD WBINVAL_ALL.

Definition at line 86 of file core_feature_cache.h.

◆ SMPCC_CMD_xCMD_COMPLETE_Msk

#define SMPCC_CMD_xCMD_COMPLETE_Msk   (0x1UL << SMPCC_CMD_xCMD_COMPLETE_Pos)

SMPCC_CMD xCMD COMPLETE Mask.

Definition at line 97 of file core_feature_cache.h.

◆ SMPCC_CMD_xCMD_COMPLETE_Pos

#define SMPCC_CMD_xCMD_COMPLETE_Pos   31U

SMPCC_CMD xCMD COMPLETE Position.

Definition at line 96 of file core_feature_cache.h.

◆ SMPCC_CMD_xCMD_RESULT_CPBACK_BUS_ERROR

#define SMPCC_CMD_xCMD_RESULT_CPBACK_BUS_ERROR   0x5U

SMPCC_CMD xCMD RESULT Copy Back Bus Error.

Definition at line 94 of file core_feature_cache.h.

◆ SMPCC_CMD_xCMD_RESULT_ECC_ERROR

#define SMPCC_CMD_xCMD_RESULT_ECC_ERROR   0x4U

SMPCC_CMD xCMD RESULT ECC Error.

Definition at line 93 of file core_feature_cache.h.

◆ SMPCC_CMD_xCMD_RESULT_ENTRY_EXCEED_LIMIT

#define SMPCC_CMD_xCMD_RESULT_ENTRY_EXCEED_LIMIT   0x1U

SMPCC_CMD xCMD RESULT Exceed the upper entry num of lockable way.

Definition at line 91 of file core_feature_cache.h.

◆ SMPCC_CMD_xCMD_RESULT_Msk

#define SMPCC_CMD_xCMD_RESULT_Msk   (0x1FUL << SMPCC_CMD_xCMD_RESULT_Pos)

SMPCC_CMD xCMD RESULT Mask.

Definition at line 89 of file core_feature_cache.h.

◆ SMPCC_CMD_xCMD_RESULT_Pos

#define SMPCC_CMD_xCMD_RESULT_Pos   26U

SMPCC_CMD xCMD RESULT Position.

Definition at line 88 of file core_feature_cache.h.

◆ SMPCC_CMD_xCMD_RESULT_REFILL_BUS_ERROR

#define SMPCC_CMD_xCMD_RESULT_REFILL_BUS_ERROR   0x3U

SMPCC_CMD xCMD RESULT Refill Bus Error.

Definition at line 92 of file core_feature_cache.h.

◆ SMPCC_CMD_xCMD_RESULT_SUCCESS

#define SMPCC_CMD_xCMD_RESULT_SUCCESS   0x0U

SMPCC_CMD xCMD RESULT Success.

Definition at line 90 of file core_feature_cache.h.

Function Documentation

◆ MLockCCacheLine()

__STATIC_INLINE unsigned long MLockCCacheLine ( unsigned long  addr)

Lock one Cluster Cache line specified by address in M-Mode.

This function lock one Cluster Cache line specified by the address. Command CCM_CC_LOCK is written to CSR CSR_CCM_MCOMMAND.

Remarks
This function must be executed in M-Mode only.
Parameters
[in]addrstart address to be locked
Returns
result of CCM lock operation, see enum CCM_OP_FINFO

Definition at line 256 of file core_feature_cache.h.

257 {
260  FlushPipeCCM();
261  __RWMB();
263 }
#define __RV_CSR_READ(csr)
CSR operation Macro for csrr instruction.
#define __RWMB()
Read & Write Memory barrier.
#define __RV_CSR_WRITE(csr, val)
CSR operation Macro for csrw instruction.
#define CSR_CCM_MCOMMAND
#define CSR_CCM_MBEGINADDR
#define CSR_CCM_MDATA
__STATIC_FORCEINLINE void FlushPipeCCM(void)
Flush pipeline after CCM operation.
@ CCM_CC_LOCK
Lock the specific Cluster Cache line specified by CSR CCM_XBEGINADDR.

References __RV_CSR_READ, __RV_CSR_WRITE, __RWMB, CCM_CC_LOCK, CSR_CCM_MBEGINADDR, CSR_CCM_MCOMMAND, CSR_CCM_MDATA, and FlushPipeCCM().

Referenced by SMPCC_CCacheDramErrInject(), SMPCC_CCacheErrRestore(), and SMPCC_CCacheTramErrInject().

◆ MLockCCacheLines()

__STATIC_INLINE unsigned long MLockCCacheLines ( unsigned long  addr,
unsigned long  cnt 
)

Lock several Cluster Cache lines specified by address in M-Mode.

This function lock several Cluster Cache lines specified by the address and line count. Command CCM_CC_LOCK is written to CSR CSR_CCM_MCOMMAND.

Remarks
This function must be executed in M-Mode only.
Parameters
[in]addrstart address to be locked
[in]cntcount of cache lines to be locked
Returns
result of CCM lock operation, see enum CCM_OP_FINFO

Definition at line 277 of file core_feature_cache.h.

278 {
279  if (cnt > 0) {
280  unsigned long i;
281  unsigned long fail_info = CCM_OP_SUCCESS;
283  for (i = 0; i < cnt; i++) {
285  FlushPipeCCM();
286  __RWMB();
287  fail_info = __RV_CSR_READ(CSR_CCM_MDATA);
288  if (CCM_OP_SUCCESS != fail_info) {
289  return fail_info;
290  }
291  }
292  }
293  return CCM_OP_SUCCESS;
294 }
@ CCM_OP_SUCCESS
Lock Succeed.

References __RV_CSR_READ, __RV_CSR_WRITE, __RWMB, CCM_CC_LOCK, CCM_OP_SUCCESS, CSR_CCM_MBEGINADDR, CSR_CCM_MCOMMAND, CSR_CCM_MDATA, and FlushPipeCCM().

◆ MUnlockCCacheLine()

__STATIC_INLINE void MUnlockCCacheLine ( unsigned long  addr)

Unlock one Cluster Cache line specified by address in M-Mode.

This function unlock one Cluster Cache line specified by the address. Command CCM_CC_UNLOCK is written to CSR CSR_CCM_MCOMMAND.

Remarks
This function must be executed in M-Mode only.
Parameters
[in]addrstart address to be unlocked

Definition at line 405 of file core_feature_cache.h.

406 {
409  FlushPipeCCM();
410  __RWMB();
411 }
@ CCM_CC_UNLOCK
Unlock the specific Cluster Cache line specified by CSR CCM_XBEGINADDR.

References __RV_CSR_WRITE, __RWMB, CCM_CC_UNLOCK, CSR_CCM_MBEGINADDR, CSR_CCM_MCOMMAND, and FlushPipeCCM().

◆ MUnlockCCacheLines()

__STATIC_INLINE void MUnlockCCacheLines ( unsigned long  addr,
unsigned long  cnt 
)

Unlock several Cluster Cache lines specified by address in M-Mode.

This function unlock several Cluster Cache lines specified by the address and line count. Command CCM_CC_UNLOCK is written to CSR CSR_CCM_MCOMMAND.

Remarks
This function must be executed in M-Mode only.
Parameters
[in]addrstart address to be unlocked
[in]cntcount of cache lines to be unlocked

Definition at line 424 of file core_feature_cache.h.

425 {
426  if (cnt > 0) {
427  unsigned long i;
429  for (i = 0; i < cnt; i++) {
431  }
432  FlushPipeCCM();
433  __RWMB();
434  }
435 }

References __RV_CSR_WRITE, __RWMB, CCM_CC_UNLOCK, CSR_CCM_MBEGINADDR, CSR_CCM_MCOMMAND, and FlushPipeCCM().

◆ SLockCCacheLine()

__STATIC_INLINE unsigned long SLockCCacheLine ( unsigned long  addr)

Lock one Cluster Cache line specified by address in S-Mode.

This function lock one Cluster Cache line specified by the address. Command CCM_CC_LOCK is written to CSR CSR_CCM_SCOMMAND.

Remarks
This function must be executed in M/S-Mode only.
Parameters
[in]addrstart address to be locked
Returns
result of CCM lock operation, see enum CCM_OP_FINFO

Definition at line 306 of file core_feature_cache.h.

307 {
310  FlushPipeCCM();
311  __RWMB();
313 }
#define CSR_CCM_SCOMMAND
#define CSR_CCM_SDATA
#define CSR_CCM_SBEGINADDR

References __RV_CSR_READ, __RV_CSR_WRITE, __RWMB, CCM_CC_LOCK, CSR_CCM_SBEGINADDR, CSR_CCM_SCOMMAND, CSR_CCM_SDATA, and FlushPipeCCM().

◆ SLockCCacheLines()

__STATIC_INLINE unsigned long SLockCCacheLines ( unsigned long  addr,
unsigned long  cnt 
)

Lock several Cluster Cache lines specified by address in S-Mode.

This function lock several Cluster Cache lines specified by the address and line count. Command CCM_CC_LOCK is written to CSR CSR_CCM_SCOMMAND.

Remarks
This function must be executed in M/S-Mode only.
Parameters
[in]addrstart address to be locked
[in]cntcount of cache lines to be locked
Returns
result of CCM lock operation, see enum CCM_OP_FINFO

Definition at line 327 of file core_feature_cache.h.

328 {
329  if (cnt > 0) {
330  unsigned long i;
331  unsigned long fail_info = CCM_OP_SUCCESS;
333  for (i = 0; i < cnt; i++) {
335  FlushPipeCCM();
336  __RWMB();
337  fail_info = __RV_CSR_READ(CSR_CCM_SDATA);
338  if (CCM_OP_SUCCESS != fail_info) {
339  return fail_info;
340  }
341  }
342  }
343  return CCM_OP_SUCCESS;
344 }

References __RV_CSR_READ, __RV_CSR_WRITE, __RWMB, CCM_CC_LOCK, CCM_OP_SUCCESS, CSR_CCM_SBEGINADDR, CSR_CCM_SCOMMAND, CSR_CCM_SDATA, and FlushPipeCCM().

◆ SUnlockCCacheLine()

__STATIC_INLINE void SUnlockCCacheLine ( unsigned long  addr)

Unlock one Cluster Cache line specified by address in S-Mode.

This function unlock one Cluster Cache line specified by the address. Command CCM_CC_UNLOCK is written to CSR CSR_CCM_SCOMMAND.

Remarks
This function must be executed in M/S-Mode only.
Parameters
[in]addrstart address to be unlocked

Definition at line 446 of file core_feature_cache.h.

447 {
450  FlushPipeCCM();
451  __RWMB();
452 }

References __RV_CSR_WRITE, __RWMB, CCM_CC_UNLOCK, CSR_CCM_SBEGINADDR, CSR_CCM_SCOMMAND, and FlushPipeCCM().

◆ SUnlockCCacheLines()

__STATIC_INLINE void SUnlockCCacheLines ( unsigned long  addr,
unsigned long  cnt 
)

Unlock several Cluster Cache lines specified by address in S-Mode.

This function unlock several Cluster Cache lines specified by the address and line count. Command CCM_CC_UNLOCK is written to CSR CSR_CCM_SCOMMAND.

Remarks
This function must be executed in M/S-Mode only.
Parameters
[in]addrstart address to be unlocked
[in]cntcount of cache lines to be unlocked

Definition at line 465 of file core_feature_cache.h.

466 {
467  if (cnt > 0) {
468  unsigned long i;
470  for (i = 0; i < cnt; i++) {
472  }
473  FlushPipeCCM();
474  __RWMB();
475  }
476 }

References __RV_CSR_WRITE, __RWMB, CCM_CC_UNLOCK, CSR_CCM_SBEGINADDR, CSR_CCM_SCOMMAND, and FlushPipeCCM().

◆ ULockCCacheLine()

__STATIC_INLINE unsigned long ULockCCacheLine ( unsigned long  addr)

Lock one Cluster Cache line specified by address in U-Mode.

This function lock one Cluster Cache line specified by the address. Command CCM_CC_LOCK is written to CSR CSR_CCM_UCOMMAND.

Remarks
This function must be executed in M/S/U-Mode only.
Parameters
[in]addrstart address to be locked
Returns
result of CCM lock operation, see enum CCM_OP_FINFO

Definition at line 356 of file core_feature_cache.h.

357 {
360  FlushPipeCCM();
361  __RWMB();
363 }
#define CSR_CCM_UCOMMAND
#define CSR_CCM_UBEGINADDR
#define CSR_CCM_UDATA

References __RV_CSR_READ, __RV_CSR_WRITE, __RWMB, CCM_CC_LOCK, CSR_CCM_UBEGINADDR, CSR_CCM_UCOMMAND, CSR_CCM_UDATA, and FlushPipeCCM().

◆ ULockCCacheLines()

__STATIC_INLINE unsigned long ULockCCacheLines ( unsigned long  addr,
unsigned long  cnt 
)

Lock several Cluster Cache lines specified by address in U-Mode.

This function lock several Cluster Cache lines specified by the address and line count. Command CCM_CC_LOCK is written to CSR CSR_CCM_UCOMMAND.

Remarks
This function must be executed in M/S/U-Mode only.
Parameters
[in]addrstart address to be locked
[in]cntcount of cache lines to be locked
Returns
result of CCM lock operation, see enum CCM_OP_FINFO

Definition at line 377 of file core_feature_cache.h.

378 {
379  if (cnt > 0) {
380  unsigned long i;
381  unsigned long fail_info = CCM_OP_SUCCESS;
383  for (i = 0; i < cnt; i++) {
385  FlushPipeCCM();
386  __RWMB();
387  fail_info = __RV_CSR_READ(CSR_CCM_UDATA);
388  if (CCM_OP_SUCCESS != fail_info) {
389  return fail_info;
390  }
391  }
392  }
393  return CCM_OP_SUCCESS;
394 }

References __RV_CSR_READ, __RV_CSR_WRITE, __RWMB, CCM_CC_LOCK, CCM_OP_SUCCESS, CSR_CCM_UBEGINADDR, CSR_CCM_UCOMMAND, CSR_CCM_UDATA, and FlushPipeCCM().

◆ UUnlockCCacheLine()

__STATIC_INLINE void UUnlockCCacheLine ( unsigned long  addr)

Unlock one Cluster Cache line specified by address in U-Mode.

This function unlock one Cluster Cache line specified by the address. Command CCM_CC_UNLOCK is written to CSR CSR_CCM_UCOMMAND.

Remarks
This function must be executed in M/S/U-Mode only.
Parameters
[in]addrstart address to be unlocked

Definition at line 487 of file core_feature_cache.h.

488 {
491  FlushPipeCCM();
492  __RWMB();
493 }

References __RV_CSR_WRITE, __RWMB, CCM_CC_UNLOCK, CSR_CCM_UBEGINADDR, CSR_CCM_UCOMMAND, and FlushPipeCCM().

◆ UUnlockCCacheLines()

__STATIC_INLINE void UUnlockCCacheLines ( unsigned long  addr,
unsigned long  cnt 
)

Unlock several Cluster Cache lines specified by address in U-Mode.

This function unlock several Cluster Cache lines specified by the address and line count. Command CCM_CC_UNLOCK is written to CSR CSR_CCM_UCOMMAND.

Remarks
This function must be executed in M/S/U-Mode only.
Parameters
[in]addrstart address to be unlocked
[in]cntcount of cache lines to be unlocked

Definition at line 506 of file core_feature_cache.h.

507 {
508  if (cnt > 0) {
509  unsigned long i;
511  for (i = 0; i < cnt; i++) {
513  }
514  FlushPipeCCM();
515  __RWMB();
516  }
517 }

References __RV_CSR_WRITE, __RWMB, CCM_CC_UNLOCK, CSR_CCM_UBEGINADDR, CSR_CCM_UCOMMAND, and FlushPipeCCM().