Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
745 B

  1. #define IcacheLineSize 32
  2. void __fc (__int64);
  3. #pragma intrinsic (__fc)
  4. void
  5. PioICacheFlush (
  6. unsigned char *BaseAddress,
  7. unsigned int Length
  8. )
  9. {
  10. unsigned char *EndAddress;
  11. unsigned long NumberOfLines;
  12. if (Length < IcacheLineSize) {
  13. Length = IcacheLineSize;
  14. }
  15. NumberOfLines = Length / IcacheLineSize;
  16. if (Length % IcacheLineSize != 0) {
  17. NumberOfLines = NumberOfLines+1;
  18. }
  19. EndAddress = (unsigned char *)(BaseAddress)+(NumberOfLines * IcacheLineSize);
  20. do {
  21. __fc((__int64)BaseAddress);
  22. BaseAddress += IcacheLineSize;
  23. } while (BaseAddress < EndAddress);
  24. __synci();
  25. __isrlz();
  26. }