// Invalidates an instruction cache for the specified region. _Use_decl_annotations_ EXTERN_C void UtilInvalidateInstructionCache( void *BaseAddress, SIZE_T Length) { #ifdef _AMD64_ UNREFERENCED_PARAMETER(BaseAddress); UNREFERENCED_PARAMETER(Length); __faststorefence(); #else KeSweepIcacheRange(TRUE, BaseAddress, Length); #endif }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - static void FullBarrier() { #if defined(PLATFORM_WINDOWS) #if defined(PLATFORM_64) __faststorefence(); #else MemoryBarrier(); #endif #else static_assert(false, "Not yet implemented."); #endif }
// Invalidates an instruction cache for the specified region. _Use_decl_annotations_ static void MmonpInvalidateInstructionCache(void *base_address, SIZE_T length) { #if defined(_AMD64_) UNREFERENCED_PARAMETER(base_address); UNREFERENCED_PARAMETER(length); __faststorefence(); #elif defined(_X86_) UNREFERENCED_PARAMETER(base_address); UNREFERENCED_PARAMETER(length); _ReadBarrier(); #endif }