outs.S 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Implementation of outs{bwl} for BlackFin processors using zero overhead loops.
  3. *
  4. * Copyright 2005-2009 Analog Devices Inc.
  5. * 2005 BuyWays BV
  6. * Bas Vermeulen <bas@buyways.nl>
  7. *
  8. * Licensed under the GPL-2.
  9. */
  10. #include <linux/linkage.h>
  11. .align 2
  12. .section .text._outsl
  13. ENTRY(_outsl)
  14. P0 = R0; /* P0 = port */
  15. P1 = R1; /* P1 = address */
  16. P2 = R2; /* P2 = count */
  17. LSETUP( .Llong_loop_s, .Llong_loop_e) LC0 = P2;
  18. .Llong_loop_s: R0 = [P1++];
  19. .Llong_loop_e: [P0] = R0;
  20. RTS;
  21. ENDPROC(_outsl)
  22. .section .text._outsw
  23. ENTRY(_outsw)
  24. P0 = R0; /* P0 = port */
  25. P1 = R1; /* P1 = address */
  26. P2 = R2; /* P2 = count */
  27. LSETUP( .Lword_loop_s, .Lword_loop_e) LC0 = P2;
  28. .Lword_loop_s: R0 = W[P1++];
  29. .Lword_loop_e: W[P0] = R0;
  30. RTS;
  31. ENDPROC(_outsw)
  32. .section .text._outsb
  33. ENTRY(_outsb)
  34. P0 = R0; /* P0 = port */
  35. P1 = R1; /* P1 = address */
  36. P2 = R2; /* P2 = count */
  37. LSETUP( .Lbyte_loop_s, .Lbyte_loop_e) LC0 = P2;
  38. .Lbyte_loop_s: R0 = B[P1++];
  39. .Lbyte_loop_e: B[P0] = R0;
  40. RTS;
  41. ENDPROC(_outsb)
  42. .section .text._outsw_8
  43. ENTRY(_outsw_8)
  44. P0 = R0; /* P0 = port */
  45. P1 = R1; /* P1 = address */
  46. P2 = R2; /* P2 = count */
  47. LSETUP( .Lword8_loop_s, .Lword8_loop_e) LC0 = P2;
  48. .Lword8_loop_s: R1 = B[P1++];
  49. R0 = B[P1++];
  50. R0 = R0 << 8;
  51. R0 = R0 + R1;
  52. .Lword8_loop_e: W[P0] = R0;
  53. RTS;
  54. ENDPROC(_outsw_8)