windows-nt/Source/XPSP1/NT/base/boot/efi/ia64/pioflush.c
2020-09-26 16:20:57 +08:00

34 lines
712 B
C

#define IcacheLineSize 32
void __fc (__int64);
#pragma intrinsic (__fc)
void
PioICacheFlush (
unsigned char *BaseAddress,
unsigned int Length
)
{
unsigned char *EndAddress;
unsigned long NumberOfLines;
if (Length < IcacheLineSize) {
Length = IcacheLineSize;
}
NumberOfLines = Length / IcacheLineSize;
if (Length % IcacheLineSize != 0) {
NumberOfLines = NumberOfLines+1;
}
EndAddress = (unsigned char *)(BaseAddress)+(NumberOfLines * IcacheLineSize);
do {
__fc((__int64)BaseAddress);
BaseAddress += IcacheLineSize;
} while (BaseAddress < EndAddress);
__synci();
__isrlz();
}