22#define RISCV_CACHE_BLOCK_SIZE 64
23#define RISCV_CPU_FEATURE_CMO_BITMASK 0x1
44 return ((
PcdGet64 (PcdRiscVFeatureOverride) & RISCV_CPU_FEATURE_CMO_BITMASK) != 0);
78 if ((Op != CacheOpInvld) && (Op != CacheOpFlush) && (Op != CacheOpClean)) {
84 CacheLineSize = RISCV_CACHE_BLOCK_SIZE;
86 Start = (
UINTN)Address;
90 End = (Start + Length + (CacheLineSize - 1)) & ~(CacheLineSize - 1);
91 Start &= ~((
UINTN)CacheLineSize - 1);
95 "CacheOpCacheRange: Performing Cache Management Operation %d \n", Op)
101 RiscVCpuCacheInvalCmoAsm (Start);
104 RiscVCpuCacheFlushCmoAsm (Start);
107 RiscVCpuCacheCleanCmoAsm (Start);
113 Start = Start + CacheLineSize;
114 }
while (Start != End);
131 RiscVInvalidateInstCacheFenceAsm ();
162 "InvalidateInstructionCacheRange: RISC-V unsupported function.\n"
163 "Invalidating the whole instruction cache instead.\n"
189 "WriteBackInvalidateDataCache: RISC-V unsupported function.\n"
309 RiscVInvalidateDataCacheFenceAsm ();
348 "InvalidateDataCacheRange: Zicbom not supported.\n"
349 "Invalidating the whole Data cache instead.\n")
#define DEBUG(Expression)
#define PcdGet64(TokenName)
VOID EFIAPI InvalidateDataCache(VOID)
VOID *EFIAPI WriteBackDataCacheRange(IN VOID *Address, IN UINTN Length)
VOID *EFIAPI InvalidateDataCacheRange(IN VOID *Address, IN UINTN Length)
VOID *EFIAPI WriteBackInvalidateDataCacheRange(IN VOID *Address, IN UINTN Length)
VOID EFIAPI InvalidateInstructionCache(VOID)
VOID EFIAPI WriteBackInvalidateDataCache(VOID)
VOID EFIAPI WriteBackDataCache(VOID)
STATIC BOOLEAN RiscVIsCMOEnabled(VOID)
STATIC VOID CacheOpCacheRange(IN VOID *Address, IN UINTN Length, IN CACHE_OP Op)
VOID *EFIAPI InvalidateInstructionCacheRange(IN VOID *Address, IN UINTN Length)