flush.S 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Cache flushing routines.
  3. *
  4. * Copyright (C) 1999-2001, 2005 Hewlett-Packard Co
  5. * David Mosberger-Tang <davidm@hpl.hp.com>
  6. *
  7. * 05/28/05 Zoltan Menyhart Dynamic stride size
  8. */
  9. #include <asm/asmmacro.h>
  10. /*
  11. * flush_icache_range(start,end)
  12. *
  13. * Make i-cache(s) coherent with d-caches.
  14. *
  15. * Must deal with range from start to end-1 but nothing else (need to
  16. * be careful not to touch addresses that may be unmapped).
  17. *
  18. * Note: "in0" and "in1" are preserved for debugging purposes.
  19. */
  20. .section .kprobes.text,"ax"
  21. GLOBAL_ENTRY(flush_icache_range)
  22. .prologue
  23. alloc r2=ar.pfs,2,0,0,0
  24. movl r3=ia64_i_cache_stride_shift
  25. mov r21=1
  26. ;;
  27. ld8 r20=[r3] // r20: stride shift
  28. sub r22=in1,r0,1 // last byte address
  29. ;;
  30. shr.u r23=in0,r20 // start / (stride size)
  31. shr.u r22=r22,r20 // (last byte address) / (stride size)
  32. shl r21=r21,r20 // r21: stride size of the i-cache(s)
  33. ;;
  34. sub r8=r22,r23 // number of strides - 1
  35. shl r24=r23,r20 // r24: addresses for "fc.i" =
  36. // "start" rounded down to stride boundary
  37. .save ar.lc,r3
  38. mov r3=ar.lc // save ar.lc
  39. ;;
  40. .body
  41. mov ar.lc=r8
  42. ;;
  43. /*
  44. * 32 byte aligned loop, even number of (actually 2) bundles
  45. */
  46. .Loop: fc.i r24 // issuable on M0 only
  47. add r24=r21,r24 // we flush "stride size" bytes per iteration
  48. nop.i 0
  49. br.cloop.sptk.few .Loop
  50. ;;
  51. sync.i
  52. ;;
  53. srlz.i
  54. ;;
  55. mov ar.lc=r3 // restore ar.lc
  56. br.ret.sptk.many rp
  57. END(flush_icache_range)