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.

85 lines
1.6 KiB

  1. #include "ksia64.h"
  2. //++
  3. //
  4. // VOID
  5. // KiPurgeTranslationCache (
  6. // ULONGLONG Base,
  7. // ULONGLONG Stride1,
  8. // ULONGLONG Stride2,
  9. // ULONGLONG Count1,
  10. // ULONGLONG Count2
  11. // )
  12. //
  13. // Routine Description:
  14. //
  15. // This function flushes the entire translation cache from the current processor.
  16. //
  17. // Arguments:
  18. //
  19. // r32 - base
  20. // r33 - stride1
  21. // r34 - stride2
  22. // r35 - count1
  23. // r36 - count2
  24. //
  25. // Return Value:
  26. //
  27. // None.
  28. //
  29. // Algorithm:
  30. //
  31. // for (i = 0; i < count1; i++) {
  32. // for (j = 0; j < count2; j++) {
  33. // ptc.e addr;
  34. // addr += stride2;
  35. // }
  36. // addr += stride1;
  37. // }
  38. //
  39. //--
  40. LEAF_ENTRY(KiPurgeTranslationCache)
  41. PROLOGUE_BEGIN
  42. alloc r31 = 5, 0, 0, 0
  43. cmp.ge p14,p15=r0, r35
  44. rsm 1 << PSR_I
  45. .save ar.lc, r30
  46. mov.i r30=ar.lc
  47. (p14) br.cond.dpnt.few $L150#;;
  48. PROLOGUE_END
  49. $L148:
  50. cmp.ge p14,p15=r0, r36
  51. adds r31=-1, r36
  52. (p14) br.cond.dpnt.few $L153#;;
  53. nop.m 0
  54. nop.f 0
  55. mov.i ar.lc=r31
  56. ;;
  57. $L151:
  58. ptc.e r32
  59. add r32=r32, r34
  60. br.cloop.dptk.many $L151#;;
  61. $L153:
  62. adds r35=-1, r35
  63. add r32=r32, r33;;
  64. cmp.ltu p14,p15=r0, r35
  65. nop.m 0
  66. nop.f 0
  67. (p14) br.cond.dptk.few $L148#;;
  68. $L150:
  69. srlz.i
  70. ssm 1 << PSR_I
  71. mov.i ar.lc=r30
  72. br.ret.sptk.few b0;;
  73. LEAF_EXIT(KiPurgeTranslationCache)