Cache Functions

General

enum CCM_OP_FINFO

Values:

enumerator CCM_OP_SUCCESS
enumerator CCM_OP_EXCEED_ERR
enumerator CCM_OP_PERM_CHECK_ERR
enumerator CCM_OP_REFILL_BUS_ERR
enumerator CCM_OP_ECC_ERR
enum CCM_CMD

Values:

enumerator CCM_DC_INVAL
enumerator CCM_DC_WB
enumerator CCM_DC_WBINVAL
enumerator CCM_DC_LOCK
enumerator CCM_DC_UNLOCK
enumerator CCM_DC_WBINVAL_ALL
enumerator CCM_DC_WB_ALL
enumerator CCM_DC_INVAL_ALL
enumerator CCM_IC_INVAL
enumerator CCM_IC_LOCK
enumerator CCM_IC_UNLOCK
enumerator CCM_IC_INVAL_ALL
__STATIC_FORCEINLINE void EnableSUCCM (void)
__STATIC_FORCEINLINE void DisableSUCCM (void)
__STATIC_FORCEINLINE void FlushPipeCCM (void)
CCM_SUEN_SUEN_Msk (0xFFFFFFFFFFFFFFFFUL)
struct CacheInfo
group NMSIS_Core_Cache

Functions that configure Instruction and Data Cache.

Nuclei provide Cache Control and Maintainence(CCM) for software to control and maintain the internal L1 I/D Cache of the RISC-V Core, software can manage the cache flexibly to meet the actual application scenarios.

The CCM operations have 3 types: by single address, by all and flush pipeline. The CCM operations are done via CSR registers, M/S/U mode has its own CSR registers to do CCM operations. By default, CCM operations are not allowed in S/U mode, you can execute EnableSUCCM in M-Mode to enable it.

  • API names started with M<operations>, such as MInvalICacheLine must be called in M-Mode only.

  • API names started with S<operations>, such as SInvalICacheLine should be called in S-Mode.

  • API names started with U<operations>, such as UInvalICacheLine should be called in U-Mode.

Defines

CCM_SUEN_SUEN_Msk (0xFFFFFFFFFFFFFFFFUL)

CSR CCM_SUEN: SUEN Mask.

Enums

enum CCM_OP_FINFO

Cache CCM Operation Fail Info.

Values:

enumerator CCM_OP_SUCCESS

Lock Succeed.

enumerator CCM_OP_EXCEED_ERR

Exceed the the number of lockable ways(N-Way I/D-Cache, lockable is N-1)

enumerator CCM_OP_PERM_CHECK_ERR

PMP/sPMP/Page-Table X(I-Cache)/R(D-Cache) permission check failed, or belong to Device/Non-Cacheable address range.

enumerator CCM_OP_REFILL_BUS_ERR

Refill has Bus Error.

enumerator CCM_OP_ECC_ERR

Deprecated, ECC Error, this error code is removed in later Nuclei CCM RTL design, please don’t use it.

enum CCM_CMD

Cache CCM Command Types.

Values:

enumerator CCM_DC_INVAL

Unlock and invalidate D-Cache line specified by CSR CCM_XBEGINADDR.

enumerator CCM_DC_WB

Flush the specific D-Cache line specified by CSR CCM_XBEGINADDR.

enumerator CCM_DC_WBINVAL

Unlock, flush and invalidate the specific D-Cache line specified by CSR CCM_XBEGINADDR.

enumerator CCM_DC_LOCK

Lock the specific D-Cache line specified by CSR CCM_XBEGINADDR.

enumerator CCM_DC_UNLOCK

Unlock the specific D-Cache line specified by CSR CCM_XBEGINADDR.

enumerator CCM_DC_WBINVAL_ALL

Unlock and flush and invalidate all the valid and dirty D-Cache lines.

enumerator CCM_DC_WB_ALL

Flush all the valid and dirty D-Cache lines.

enumerator CCM_DC_INVAL_ALL

Unlock and invalidate all the D-Cache lines.

enumerator CCM_IC_INVAL

Unlock and invalidate I-Cache line specified by CSR CCM_XBEGINADDR.

enumerator CCM_IC_LOCK

Lock the specific I-Cache line specified by CSR CCM_XBEGINADDR.

enumerator CCM_IC_UNLOCK

Unlock the specific I-Cache line specified by CSR CCM_XBEGINADDR.

enumerator CCM_IC_INVAL_ALL

Unlock and invalidate all the I-Cache lines.

Functions

__STATIC_FORCEINLINE void EnableSUCCM (void)

Enable CCM operation in Supervisor/User Mode.

This function enable CCM operation in Supervisor/User Mode. If enabled, CCM operations in supervisor/user mode will be allowed.

Remark

  • This function can be called in M-Mode only.

See also

  • DisableSUCCM

__STATIC_FORCEINLINE void DisableSUCCM (void)

Disable CCM operation in Supervisor/User Mode.

This function disable CCM operation in Supervisor/User Mode. If not enabled, CCM operations in supervisor/user mode will trigger a illegal intruction exception.

Remark

  • This function can be called in M-Mode only.

See also

  • EnableSUCCM

__STATIC_FORCEINLINE void FlushPipeCCM (void)

Flush pipeline after CCM operation.

This function is used to flush pipeline after CCM operations on Cache, it will ensure latest instructions or data can be seen by pipeline.

Remark

  • This function can be called in M/S/U-Mode only.

struct CacheInfo
#include <core_feature_cache.h>

Cache Information Type.

I-Cache Functions

__STATIC_FORCEINLINE int32_t ICachePresent (void)
__STATIC_FORCEINLINE void EnableICache (void)
__STATIC_FORCEINLINE void DisableICache (void)
__STATIC_FORCEINLINE void EnableICacheECC (void)
__STATIC_FORCEINLINE void DisableICacheECC (void)
__STATIC_FORCEINLINE int32_t GetICacheInfo (CacheInfo_Type *info)
__STATIC_FORCEINLINE void MInvalICacheLine (unsigned long addr)
__STATIC_FORCEINLINE void MInvalICacheLines (unsigned long addr, unsigned long cnt)
__STATIC_FORCEINLINE void SInvalICacheLine (unsigned long addr)
__STATIC_FORCEINLINE void SInvalICacheLines (unsigned long addr, unsigned long cnt)
__STATIC_FORCEINLINE void UInvalICacheLine (unsigned long addr)
__STATIC_FORCEINLINE void UInvalICacheLines (unsigned long addr, unsigned long cnt)
__STATIC_FORCEINLINE unsigned long MLockICacheLine (unsigned long addr)
__STATIC_FORCEINLINE unsigned long MLockICacheLines (unsigned long addr, unsigned long cnt)
__STATIC_FORCEINLINE unsigned long SLockICacheLine (unsigned long addr)
__STATIC_FORCEINLINE unsigned long SLockICacheLines (unsigned long addr, unsigned long cnt)
__STATIC_FORCEINLINE unsigned long ULockICacheLine (unsigned long addr)
__STATIC_FORCEINLINE unsigned long ULockICacheLines (unsigned long addr, unsigned long cnt)
__STATIC_FORCEINLINE void MUnlockICacheLine (unsigned long addr)
__STATIC_FORCEINLINE void MUnlockICacheLines (unsigned long addr, unsigned long cnt)
__STATIC_FORCEINLINE void SUnlockICacheLine (unsigned long addr)
__STATIC_FORCEINLINE void SUnlockICacheLines (unsigned long addr, unsigned long cnt)
__STATIC_FORCEINLINE void UUnlockICacheLine (unsigned long addr)
__STATIC_FORCEINLINE void UUnlockICacheLines (unsigned long addr, unsigned long cnt)
__STATIC_FORCEINLINE void MInvalICache (void)
__STATIC_FORCEINLINE void SInvalICache (void)
__STATIC_FORCEINLINE void UInvalICache (void)
group NMSIS_Core_ICache

Functions that configure Instruction Cache.

Functions

__STATIC_FORCEINLINE int32_t ICachePresent (void)

Check ICache Unit Present or Not.

This function check icache unit present or not via mcfg_info csr

Remark

  • This function might not work for some old nuclei processors

  • Please make sure the version of your nuclei processor contain ICACHE bit in mcfg_info

Returns

1 if present otherwise 0

__STATIC_FORCEINLINE void EnableICache (void)

Enable ICache.

This function enable I-Cache

Remark

  • This function can be called in M-Mode only.

  • This CSR_MCACHE_CTL register control I Cache enable.

See also

  • DisableICache

__STATIC_FORCEINLINE void DisableICache (void)

Disable ICache.

This function Disable I-Cache

Remark

  • This function can be called in M-Mode only.

  • This CSR_MCACHE_CTL register control I Cache enable.

See also

  • EnableICache

__STATIC_FORCEINLINE void EnableICacheECC (void)

Enable ICache ECC.

This function enable I-Cache ECC

Remark

  • This function can be called in M-Mode only.

  • This CSR_MCACHE_CTL register control I Cache ECC enable.

See also

  • DisableICacheECC

__STATIC_FORCEINLINE void DisableICacheECC (void)

Disable ICache ECC.

This function disable I-Cache ECC

Remark

  • This function can be called in M-Mode only.

  • This CSR_MCACHE_CTL register control I Cache ECC enable.

See also

  • EnableICacheECC

__STATIC_FORCEINLINE int32_t GetICacheInfo (CacheInfo_Type *info)

Get I-Cache Information.

This function get I-Cache Information

Remark

  • This function can be called in M-Mode only.

  • You can use this function in combination with cache lines operations

See also

  • GetDCacheInfo

__STATIC_FORCEINLINE void MInvalICacheLine (unsigned long addr)

Invalidate one I-Cache line specified by address in M-Mode.

This function unlock and invalidate one I-Cache line specified by the address. Command CCM_IC_INVAL is written to CSR CSR_CCM_MCOMMAND.

Remark

This function must be executed in M-Mode only.

Parameters

addr[in] start address to be invalidated

__STATIC_FORCEINLINE void MInvalICacheLines (unsigned long addr, unsigned long cnt)

Invalidate several I-Cache lines specified by address in M-Mode.

This function unlock and invalidate several I-Cache lines specified by the address and line count. Command CCM_IC_INVAL is written to CSR CSR_CCM_MCOMMAND.

Remark

This function must be executed in M-Mode only.

Parameters
  • addr[in] start address to be invalidated

  • cnt[in] count of cache lines to be invalidated

__STATIC_FORCEINLINE void SInvalICacheLine (unsigned long addr)

Invalidate one I-Cache line specified by address in S-Mode.

This function unlock and invalidate one I-Cache line specified by the address. Command CCM_IC_INVAL is written to CSR CSR_CCM_SCOMMAND.

Remark

This function must be executed in M/S-Mode only.

Parameters

addr[in] start address to be invalidated

__STATIC_FORCEINLINE void SInvalICacheLines (unsigned long addr, unsigned long cnt)

Invalidate several I-Cache lines specified by address in S-Mode.

This function unlock and invalidate several I-Cache lines specified by the address and line count. Command CCM_IC_INVAL is written to CSR CSR_CCM_SCOMMAND.

Remark

This function must be executed in M/S-Mode only.

Parameters
  • addr[in] start address to be invalidated

  • cnt[in] count of cache lines to be invalidated

__STATIC_FORCEINLINE void UInvalICacheLine (unsigned long addr)

Invalidate one I-Cache line specified by address in U-Mode.

This function unlock and invalidate one I-Cache line specified by the address. Command CCM_IC_INVAL is written to CSR CSR_CCM_UCOMMAND.

Remark

This function must be executed in M/S/U-Mode only.

Parameters

addr[in] start address to be invalidated

__STATIC_FORCEINLINE void UInvalICacheLines (unsigned long addr, unsigned long cnt)

Invalidate several I-Cache lines specified by address in U-Mode.

This function unlock and invalidate several I-Cache lines specified by the address and line count. Command CCM_IC_INVAL is written to CSR CSR_CCM_UCOMMAND.

Remark

This function must be executed in M/S/U-Mode only.

Parameters
  • addr[in] start address to be invalidated

  • cnt[in] count of cache lines to be invalidated

__STATIC_FORCEINLINE unsigned long MLockICacheLine (unsigned long addr)

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

This function lock one I-Cache line specified by the address. Command CCM_IC_LOCK is written to CSR CSR_CCM_MCOMMAND.

Remark

This function must be executed in M-Mode only.

Parameters

addr[in] start address to be locked

Returns

result of CCM lock operation, see enum CCM_OP_FINFO

__STATIC_FORCEINLINE unsigned long MLockICacheLines (unsigned long addr, unsigned long cnt)

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

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

Remark

This function must be executed in M-Mode only.

Parameters
  • addr[in] start address to be locked

  • cnt[in] count of cache lines to be locked

Returns

result of CCM lock operation, see enum CCM_OP_FINFO

__STATIC_FORCEINLINE unsigned long SLockICacheLine (unsigned long addr)

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

This function lock one I-Cache line specified by the address. Command CCM_IC_LOCK is written to CSR CSR_CCM_SCOMMAND.

Remark

This function must be executed in M/S-Mode only.

Parameters

addr[in] start address to be locked

Returns

result of CCM lock operation, see enum CCM_OP_FINFO

__STATIC_FORCEINLINE unsigned long SLockICacheLines (unsigned long addr, unsigned long cnt)

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

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

Remark

This function must be executed in M/S-Mode only.

Parameters
  • addr[in] start address to be locked

  • cnt[in] count of cache lines to be locked

Returns

result of CCM lock operation, see enum CCM_OP_FINFO

__STATIC_FORCEINLINE unsigned long ULockICacheLine (unsigned long addr)

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

This function lock one I-Cache line specified by the address. Command CCM_IC_LOCK is written to CSR CSR_CCM_UCOMMAND.

Remark

This function must be executed in M/S/U-Mode only.

Parameters

addr[in] start address to be locked

Returns

result of CCM lock operation, see enum CCM_OP_FINFO

__STATIC_FORCEINLINE unsigned long ULockICacheLines (unsigned long addr, unsigned long cnt)

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

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

Remark

This function must be executed in M/S/U-Mode only.

Parameters
  • addr[in] start address to be locked

  • cnt[in] count of cache lines to be locked

Returns

result of CCM lock operation, see enum CCM_OP_FINFO

__STATIC_FORCEINLINE void MUnlockICacheLine (unsigned long addr)

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

This function unlock one I-Cache line specified by the address. Command CCM_IC_UNLOCK is written to CSR CSR_CCM_MCOMMAND.

Remark

This function must be executed in M-Mode only.

Parameters

addr[in] start address to be unlocked

__STATIC_FORCEINLINE void MUnlockICacheLines (unsigned long addr, unsigned long cnt)

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

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

Remark

This function must be executed in M-Mode only.

Parameters
  • addr[in] start address to be unlocked

  • cnt[in] count of cache lines to be unlocked

__STATIC_FORCEINLINE void SUnlockICacheLine (unsigned long addr)

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

This function unlock one I-Cache line specified by the address. Command CCM_IC_UNLOCK is written to CSR CSR_CCM_SCOMMAND.

Remark

This function must be executed in M/S-Mode only.

Parameters

addr[in] start address to be unlocked

__STATIC_FORCEINLINE void SUnlockICacheLines (unsigned long addr, unsigned long cnt)

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

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

Remark

This function must be executed in M/S-Mode only.

Parameters
  • addr[in] start address to be unlocked

  • cnt[in] count of cache lines to be unlocked

__STATIC_FORCEINLINE void UUnlockICacheLine (unsigned long addr)

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

This function unlock one I-Cache line specified by the address. Command CCM_IC_UNLOCK is written to CSR CSR_CCM_UCOMMAND.

Remark

This function must be executed in M/S/U-Mode only.

Parameters

addr[in] start address to be unlocked

__STATIC_FORCEINLINE void UUnlockICacheLines (unsigned long addr, unsigned long cnt)

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

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

Remark

This function must be executed in M/S/U-Mode only.

Parameters
  • addr[in] start address to be unlocked

  • cnt[in] count of cache lines to be unlocked

__STATIC_FORCEINLINE void MInvalICache (void)

Invalidate all I-Cache lines in M-Mode.

This function invalidate all I-Cache lines. Command CCM_IC_INVAL_ALL is written to CSR CSR_CCM_MCOMMAND.

Remark

This function must be executed in M-Mode only.

Parameters

addr[in] start address to be invalidated

__STATIC_FORCEINLINE void SInvalICache (void)

Invalidate all I-Cache lines in S-Mode.

This function invalidate all I-Cache lines. Command CCM_IC_INVAL_ALL is written to CSR CSR_CCM_SCOMMAND.

Remark

This function must be executed in M/S-Mode only.

Parameters

addr[in] start address to be invalidated

__STATIC_FORCEINLINE void UInvalICache (void)

Invalidate all I-Cache lines in U-Mode.

This function invalidate all I-Cache lines. Command CCM_IC_INVAL_ALL is written to CSR CSR_CCM_UCOMMAND.

Remark

This function must be executed in M/S/U-Mode only.

Parameters

addr[in] start address to be invalidated

D-Cache Functions

__STATIC_FORCEINLINE int32_t DCachePresent (void)
__STATIC_FORCEINLINE void EnableDCache (void)
__STATIC_FORCEINLINE void DisableDCache (void)
__STATIC_FORCEINLINE void EnableDCacheECC (void)
__STATIC_FORCEINLINE void DisableDCacheECC (void)
__STATIC_FORCEINLINE int32_t GetDCacheInfo (CacheInfo_Type *info)
__STATIC_FORCEINLINE void MInvalDCacheLine (unsigned long addr)
__STATIC_FORCEINLINE void MInvalDCacheLines (unsigned long addr, unsigned long cnt)
__STATIC_FORCEINLINE void SInvalDCacheLine (unsigned long addr)
__STATIC_FORCEINLINE void SInvalDCacheLines (unsigned long addr, unsigned long cnt)
__STATIC_FORCEINLINE void UInvalDCacheLine (unsigned long addr)
__STATIC_FORCEINLINE void UInvalDCacheLines (unsigned long addr, unsigned long cnt)
__STATIC_FORCEINLINE void MFlushDCacheLine (unsigned long addr)
__STATIC_FORCEINLINE void MFlushDCacheLines (unsigned long addr, unsigned long cnt)
__STATIC_FORCEINLINE void SFlushDCacheLine (unsigned long addr)
__STATIC_FORCEINLINE void SFlushDCacheLines (unsigned long addr, unsigned long cnt)
__STATIC_FORCEINLINE void UFlushDCacheLine (unsigned long addr)
__STATIC_FORCEINLINE void UFlushDCacheLines (unsigned long addr, unsigned long cnt)
__STATIC_FORCEINLINE void MFlushInvalDCacheLine (unsigned long addr)
__STATIC_FORCEINLINE void MFlushInvalDCacheLines (unsigned long addr, unsigned long cnt)
__STATIC_FORCEINLINE void SFlushInvalDCacheLine (unsigned long addr)
__STATIC_FORCEINLINE void SFlushInvalDCacheLines (unsigned long addr, unsigned long cnt)
__STATIC_FORCEINLINE void UFlushInvalDCacheLine (unsigned long addr)
__STATIC_FORCEINLINE void UFlushInvalDCacheLines (unsigned long addr, unsigned long cnt)
__STATIC_FORCEINLINE unsigned long MLockDCacheLine (unsigned long addr)
__STATIC_FORCEINLINE unsigned long MLockDCacheLines (unsigned long addr, unsigned long cnt)
__STATIC_FORCEINLINE unsigned long SLockDCacheLine (unsigned long addr)
__STATIC_FORCEINLINE unsigned long SLockDCacheLines (unsigned long addr, unsigned long cnt)
__STATIC_FORCEINLINE unsigned long ULockDCacheLine (unsigned long addr)
__STATIC_FORCEINLINE unsigned long ULockDCacheLines (unsigned long addr, unsigned long cnt)
__STATIC_FORCEINLINE void MUnlockDCacheLine (unsigned long addr)
__STATIC_FORCEINLINE void MUnlockDCacheLines (unsigned long addr, unsigned long cnt)
__STATIC_FORCEINLINE void SUnlockDCacheLine (unsigned long addr)
__STATIC_FORCEINLINE void SUnlockDCacheLines (unsigned long addr, unsigned long cnt)
__STATIC_FORCEINLINE void UUnlockDCacheLine (unsigned long addr)
__STATIC_FORCEINLINE void UUnlockDCacheLines (unsigned long addr, unsigned long cnt)
__STATIC_FORCEINLINE void MInvalDCache (void)
__STATIC_FORCEINLINE void SInvalDCache (void)
__STATIC_FORCEINLINE void UInvalDCache (void)
__STATIC_FORCEINLINE void MFlushDCache (void)
__STATIC_FORCEINLINE void SFlushDCache (void)
__STATIC_FORCEINLINE void UFlushDCache (void)
__STATIC_FORCEINLINE void MFlushInvalDCache (void)
__STATIC_FORCEINLINE void SFlushInvalDCache (void)
__STATIC_FORCEINLINE void UFlushInvalDCache (void)
group NMSIS_Core_DCache

Functions that configure Data Cache.

Functions

__STATIC_FORCEINLINE int32_t DCachePresent (void)

Check DCache Unit Present or Not.

This function check dcache unit present or not via mcfg_info csr

Remark

  • This function might not work for some old nuclei processors

  • Please make sure the version of your nuclei processor contain DCACHE bit in mcfg_info

Returns

1 if present otherwise 0

__STATIC_FORCEINLINE void EnableDCache (void)

Enable DCache.

This function enable D-Cache

Remark

  • This function can be called in M-Mode only.

  • This CSR_MCACHE_CTL register control D Cache enable.

See also

  • DisableDCache

__STATIC_FORCEINLINE void DisableDCache (void)

Disable DCache.

This function Disable D-Cache

Remark

  • This function can be called in M-Mode only.

  • This CSR_MCACHE_CTL register control D Cache enable.

See also

  • EnableDCache

__STATIC_FORCEINLINE void EnableDCacheECC (void)

Enable DCache ECC.

This function enable D-Cache ECC

Remark

  • This function can be called in M-Mode only.

  • This CSR_MCACHE_CTL register control D Cache ECC enable.

See also

  • DisableDCacheECC

__STATIC_FORCEINLINE void DisableDCacheECC (void)

Disable DCache ECC.

This function disable D-Cache ECC

Remark

  • This function can be called in M-Mode only.

  • This CSR_MCACHE_CTL register control D Cache ECC enable.

See also

  • EnableDCacheECC

__STATIC_FORCEINLINE int32_t GetDCacheInfo (CacheInfo_Type *info)

Get D-Cache Information.

This function get D-Cache Information

Remark

  • This function can be called in M-Mode only.

  • You can use this function in combination with cache lines operations

See also

  • GetICacheInfo

__STATIC_FORCEINLINE void MInvalDCacheLine (unsigned long addr)

Invalidate one D-Cache line specified by address in M-Mode.

This function unlock and invalidate one D-Cache line specified by the address. Command CCM_DC_INVAL is written to CSR CSR_CCM_MCOMMAND.

Remark

This function must be executed in M-Mode only.

Parameters

addr[in] start address to be invalidated

__STATIC_FORCEINLINE void MInvalDCacheLines (unsigned long addr, unsigned long cnt)

Invalidate several D-Cache lines specified by address in M-Mode.

This function unlock and invalidate several D-Cache lines specified by the address and line count. Command CCM_DC_INVAL is written to CSR CSR_CCM_MCOMMAND.

Remark

This function must be executed in M-Mode only.

Parameters
  • addr[in] start address to be invalidated

  • cnt[in] count of cache lines to be invalidated

__STATIC_FORCEINLINE void SInvalDCacheLine (unsigned long addr)

Invalidate one D-Cache line specified by address in S-Mode.

This function unlock and invalidate one D-Cache line specified by the address. Command CCM_DC_INVAL is written to CSR CSR_CCM_MCOMMAND.

Remark

This function must be executed in M/S-Mode only.

Parameters

addr[in] start address to be invalidated

__STATIC_FORCEINLINE void SInvalDCacheLines (unsigned long addr, unsigned long cnt)

Invalidate several D-Cache lines specified by address in S-Mode.

This function unlock and invalidate several D-Cache lines specified by the address and line count. Command CCM_DC_INVAL is written to CSR CSR_CCM_SCOMMAND.

Remark

This function must be executed in M/S-Mode only.

Parameters
  • addr[in] start address to be invalidated

  • cnt[in] count of cache lines to be invalidated

__STATIC_FORCEINLINE void UInvalDCacheLine (unsigned long addr)

Invalidate one D-Cache line specified by address in U-Mode.

This function unlock and invalidate one D-Cache line specified by the address. Command CCM_DC_INVAL is written to CSR CSR_CCM_UCOMMAND.

Remark

This function must be executed in M/S/U-Mode only.

Parameters

addr[in] start address to be invalidated

__STATIC_FORCEINLINE void UInvalDCacheLines (unsigned long addr, unsigned long cnt)

Invalidate several D-Cache lines specified by address in U-Mode.

This function unlock and invalidate several D-Cache lines specified by the address and line count. Command CCM_DC_INVAL is written to CSR CSR_CCM_UCOMMAND.

Remark

This function must be executed in M/S/U-Mode only.

Parameters
  • addr[in] start address to be invalidated

  • cnt[in] count of cache lines to be invalidated

__STATIC_FORCEINLINE void MFlushDCacheLine (unsigned long addr)

Flush one D-Cache line specified by address in M-Mode.

This function flush one D-Cache line specified by the address. Command CCM_DC_WB is written to CSR CSR_CCM_MCOMMAND.

Remark

This function must be executed in M-Mode only.

Parameters

addr[in] start address to be flushed

__STATIC_FORCEINLINE void MFlushDCacheLines (unsigned long addr, unsigned long cnt)

Flush several D-Cache lines specified by address in M-Mode.

This function flush several D-Cache lines specified by the address and line count. Command CCM_DC_WB is written to CSR CSR_CCM_MCOMMAND.

Remark

This function must be executed in M-Mode only.

Parameters
  • addr[in] start address to be flushed

  • cnt[in] count of cache lines to be flushed

__STATIC_FORCEINLINE void SFlushDCacheLine (unsigned long addr)

Flush one D-Cache line specified by address in S-Mode.

This function flush one D-Cache line specified by the address. Command CCM_DC_WB is written to CSR CSR_CCM_SCOMMAND.

Remark

This function must be executed in M/S-Mode only.

Parameters

addr[in] start address to be flushed

__STATIC_FORCEINLINE void SFlushDCacheLines (unsigned long addr, unsigned long cnt)

Flush several D-Cache lines specified by address in S-Mode.

This function flush several D-Cache lines specified by the address and line count. Command CCM_DC_WB is written to CSR CSR_CCM_SCOMMAND.

Remark

This function must be executed in M/S-Mode only.

Parameters
  • addr[in] start address to be flushed

  • cnt[in] count of cache lines to be flushed

__STATIC_FORCEINLINE void UFlushDCacheLine (unsigned long addr)

Flush one D-Cache line specified by address in U-Mode.

This function flush one D-Cache line specified by the address. Command CCM_DC_WB is written to CSR CSR_CCM_UCOMMAND.

Remark

This function must be executed in M/S/U-Mode only.

Parameters

addr[in] start address to be flushed

__STATIC_FORCEINLINE void UFlushDCacheLines (unsigned long addr, unsigned long cnt)

Flush several D-Cache lines specified by address in U-Mode.

This function flush several D-Cache lines specified by the address and line count. Command CCM_DC_WB is written to CSR CSR_CCM_UCOMMAND.

Remark

This function must be executed in M/S/U-Mode only.

Parameters
  • addr[in] start address to be flushed

  • cnt[in] count of cache lines to be flushed

__STATIC_FORCEINLINE void MFlushInvalDCacheLine (unsigned long addr)

Flush and invalidate one D-Cache line specified by address in M-Mode.

This function flush and invalidate one D-Cache line specified by the address. Command CCM_DC_WBINVAL is written to CSR CSR_CCM_MCOMMAND.

Remark

This function must be executed in M-Mode only.

Parameters

addr[in] start address to be flushed and invalidated

__STATIC_FORCEINLINE void MFlushInvalDCacheLines (unsigned long addr, unsigned long cnt)

Flush and invalidate several D-Cache lines specified by address in M-Mode.

This function flush and invalidate several D-Cache lines specified by the address and line count. Command CCM_DC_WBINVAL is written to CSR CSR_CCM_MCOMMAND.

Remark

This function must be executed in M-Mode only.

Parameters
  • addr[in] start address to be flushed and invalidated

  • cnt[in] count of cache lines to be flushed and invalidated

__STATIC_FORCEINLINE void SFlushInvalDCacheLine (unsigned long addr)

Flush and invalidate one D-Cache line specified by address in S-Mode.

This function flush and invalidate one D-Cache line specified by the address. Command CCM_DC_WBINVAL is written to CSR CSR_CCM_SCOMMAND.

Remark

This function must be executed in M/S-Mode only.

Parameters

addr[in] start address to be flushed and invalidated

__STATIC_FORCEINLINE void SFlushInvalDCacheLines (unsigned long addr, unsigned long cnt)

Flush and invalidate several D-Cache lines specified by address in S-Mode.

This function flush and invalidate several D-Cache lines specified by the address and line count. Command CCM_DC_WBINVAL is written to CSR CSR_CCM_SCOMMAND.

Remark

This function must be executed in M/S-Mode only.

Parameters
  • addr[in] start address to be flushed and invalidated

  • cnt[in] count of cache lines to be flushed and invalidated

__STATIC_FORCEINLINE void UFlushInvalDCacheLine (unsigned long addr)

Flush and invalidate one D-Cache line specified by address in U-Mode.

This function flush and invalidate one D-Cache line specified by the address. Command CCM_DC_WBINVAL is written to CSR CSR_CCM_UCOMMAND.

Remark

This function must be executed in M/S/U-Mode only.

Parameters

addr[in] start address to be flushed and invalidated

__STATIC_FORCEINLINE void UFlushInvalDCacheLines (unsigned long addr, unsigned long cnt)

Flush and invalidate several D-Cache lines specified by address in U-Mode.

This function flush and invalidate several D-Cache lines specified by the address and line count. Command CCM_DC_WBINVAL is written to CSR CSR_CCM_UCOMMAND.

Remark

This function must be executed in M/S/U-Mode only.

Parameters
  • addr[in] start address to be flushed and invalidated

  • cnt[in] count of cache lines to be flushed and invalidated

__STATIC_FORCEINLINE unsigned long MLockDCacheLine (unsigned long addr)

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

This function lock one D-Cache line specified by the address. Command CCM_DC_LOCK is written to CSR CSR_CCM_MCOMMAND.

Remark

This function must be executed in M-Mode only.

Parameters

addr[in] start address to be locked

Returns

result of CCM lock operation, see enum CCM_OP_FINFO

__STATIC_FORCEINLINE unsigned long MLockDCacheLines (unsigned long addr, unsigned long cnt)

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

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

Remark

This function must be executed in M-Mode only.

Parameters
  • addr[in] start address to be locked

  • cnt[in] count of cache lines to be locked

Returns

result of CCM lock operation, see enum CCM_OP_FINFO

__STATIC_FORCEINLINE unsigned long SLockDCacheLine (unsigned long addr)

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

This function lock one D-Cache line specified by the address. Command CCM_DC_LOCK is written to CSR CSR_CCM_SCOMMAND.

Remark

This function must be executed in M/S-Mode only.

Parameters

addr[in] start address to be locked

Returns

result of CCM lock operation, see enum CCM_OP_FINFO

__STATIC_FORCEINLINE unsigned long SLockDCacheLines (unsigned long addr, unsigned long cnt)

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

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

Remark

This function must be executed in M/S-Mode only.

Parameters
  • addr[in] start address to be locked

  • cnt[in] count of cache lines to be locked

Returns

result of CCM lock operation, see enum CCM_OP_FINFO

__STATIC_FORCEINLINE unsigned long ULockDCacheLine (unsigned long addr)

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

This function lock one D-Cache line specified by the address. Command CCM_DC_LOCK is written to CSR CSR_CCM_UCOMMAND.

Remark

This function must be executed in M/S/U-Mode only.

Parameters

addr[in] start address to be locked

Returns

result of CCM lock operation, see enum CCM_OP_FINFO

__STATIC_FORCEINLINE unsigned long ULockDCacheLines (unsigned long addr, unsigned long cnt)

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

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

Remark

This function must be executed in M/S/U-Mode only.

Parameters
  • addr[in] start address to be locked

  • cnt[in] count of cache lines to be locked

Returns

result of CCM lock operation, see enum CCM_OP_FINFO

__STATIC_FORCEINLINE void MUnlockDCacheLine (unsigned long addr)

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

This function unlock one D-Cache line specified by the address. Command CCM_DC_UNLOCK is written to CSR CSR_CCM_MCOMMAND.

Remark

This function must be executed in M-Mode only.

Parameters

addr[in] start address to be unlocked

__STATIC_FORCEINLINE void MUnlockDCacheLines (unsigned long addr, unsigned long cnt)

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

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

Remark

This function must be executed in M-Mode only.

Parameters
  • addr[in] start address to be unlocked

  • cnt[in] count of cache lines to be unlocked

__STATIC_FORCEINLINE void SUnlockDCacheLine (unsigned long addr)

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

This function unlock one D-Cache line specified by the address. Command CCM_DC_UNLOCK is written to CSR CSR_CCM_SCOMMAND.

Remark

This function must be executed in M/S-Mode only.

Parameters

addr[in] start address to be unlocked

__STATIC_FORCEINLINE void SUnlockDCacheLines (unsigned long addr, unsigned long cnt)

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

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

Remark

This function must be executed in M/S-Mode only.

Parameters
  • addr[in] start address to be unlocked

  • cnt[in] count of cache lines to be unlocked

__STATIC_FORCEINLINE void UUnlockDCacheLine (unsigned long addr)

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

This function unlock one D-Cache line specified by the address. Command CCM_DC_UNLOCK is written to CSR CSR_CCM_UCOMMAND.

Remark

This function must be executed in M/S/U-Mode only.

Parameters

addr[in] start address to be unlocked

__STATIC_FORCEINLINE void UUnlockDCacheLines (unsigned long addr, unsigned long cnt)

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

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

Remark

This function must be executed in M/S/U-Mode only.

Parameters
  • addr[in] start address to be unlocked

  • cnt[in] count of cache lines to be unlocked

__STATIC_FORCEINLINE void MInvalDCache (void)

Invalidate all D-Cache lines in M-Mode.

This function invalidate all D-Cache lines. Command CCM_DC_INVAL_ALL is written to CSR CSR_CCM_MCOMMAND.

Remark

This function must be executed in M-Mode only.

Parameters

addr[in] start address to be invalidated

__STATIC_FORCEINLINE void SInvalDCache (void)

Invalidate all D-Cache lines in S-Mode.

This function invalidate all D-Cache lines. Command CCM_DC_INVAL_ALL is written to CSR CSR_CCM_SCOMMAND.

Remark

This function must be executed in M/S-Mode only.

Parameters

addr[in] start address to be invalidated

__STATIC_FORCEINLINE void UInvalDCache (void)

Invalidate all D-Cache lines in U-Mode.

This function invalidate all D-Cache lines. In U-Mode, this operation will be automatically translated to flush and invalidate operations by hardware. Command CCM_DC_INVAL_ALL is written to CSR CSR_CCM_UCOMMAND.

Remark

This function must be executed in M/S/U-Mode only.

Parameters

addr[in] start address to be invalidated

__STATIC_FORCEINLINE void MFlushDCache (void)

Flush all D-Cache lines in M-Mode.

This function flush all D-Cache lines. Command CCM_DC_WB_ALL is written to CSR CSR_CCM_MCOMMAND.

Remark

This function must be executed in M-Mode only.

Parameters

addr[in] start address to be flushed

__STATIC_FORCEINLINE void SFlushDCache (void)

Flush all D-Cache lines in S-Mode.

This function flush all D-Cache lines. Command CCM_DC_WB_ALL is written to CSR CSR_CCM_SCOMMAND.

Remark

This function must be executed in M/S-Mode only.

Parameters

addr[in] start address to be flushed

__STATIC_FORCEINLINE void UFlushDCache (void)

Flush all D-Cache lines in U-Mode.

This function flush all D-Cache lines. Command CCM_DC_WB_ALL is written to CSR CSR_CCM_UCOMMAND.

Remark

This function must be executed in M/S/U-Mode only.

Parameters

addr[in] start address to be flushed

__STATIC_FORCEINLINE void MFlushInvalDCache (void)

Flush and invalidate all D-Cache lines in M-Mode.

This function flush and invalidate all D-Cache lines. Command CCM_DC_WBINVAL_ALL is written to CSR CSR_CCM_MCOMMAND.

Remark

This function must be executed in M-Mode only.

Parameters

addr[in] start address to be flushed and locked

__STATIC_FORCEINLINE void SFlushInvalDCache (void)

Flush and invalidate all D-Cache lines in S-Mode.

This function flush and invalidate all D-Cache lines. Command CCM_DC_WBINVAL_ALL is written to CSR CSR_CCM_SCOMMAND.

Remark

This function must be executed in M/S-Mode only.

Parameters

addr[in] start address to be flushed and locked

__STATIC_FORCEINLINE void UFlushInvalDCache (void)

Flush and invalidate all D-Cache lines in U-Mode.

This function flush and invalidate all D-Cache lines. Command CCM_DC_WBINVAL_ALL is written to CSR CSR_CCM_UCOMMAND.

Remark

This function must be executed in M/S/U-Mode only.

Parameters

addr[in] start address to be flushed and locked