outs.S 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. ENTRY(_outsl)
  13. CC = R2 == 0;
  14. IF CC JUMP 1f;
  15. P0 = R0; /* P0 = port */
  16. P1 = R1; /* P1 = address */
  17. P2 = R2; /* P2 = count */
  18. LSETUP( .Llong_loop_s, .Llong_loop_e) LC0 = P2;
  19. .Llong_loop_s: R0 = [P1++];
  20. .Llong_loop_e: [P0] = R0;
  21. 1: RTS;
  22. ENDPROC(_outsl)
  23. ENTRY(_outsw)
  24. CC = R2 == 0;
  25. IF CC JUMP 1f;
  26. P0 = R0; /* P0 = port */
  27. P1 = R1; /* P1 = address */
  28. P2 = R2; /* P2 = count */
  29. LSETUP( .Lword_loop_s, .Lword_loop_e) LC0 = P2;
  30. .Lword_loop_s: R0 = W[P1++];
  31. .Lword_loop_e: W[P0] = R0;
  32. 1: RTS;
  33. ENDPROC(_outsw)
  34. ENTRY(_outsb)
  35. CC = R2 == 0;
  36. IF CC JUMP 1f;
  37. P0 = R0; /* P0 = port */
  38. P1 = R1; /* P1 = address */
  39. P2 = R2; /* P2 = count */
  40. LSETUP( .Lbyte_loop_s, .Lbyte_loop_e) LC0 = P2;
  41. .Lbyte_loop_s: R0 = B[P1++];
  42. .Lbyte_loop_e: B[P0] = R0;
  43. 1: RTS;
  44. ENDPROC(_outsb)
  45. ENTRY(_outsw_8)
  46. CC = R2 == 0;
  47. IF CC JUMP 1f;
  48. P0 = R0; /* P0 = port */
  49. P1 = R1; /* P1 = address */
  50. P2 = R2; /* P2 = count */
  51. LSETUP( .Lword8_loop_s, .Lword8_loop_e) LC0 = P2;
  52. .Lword8_loop_s: R1 = B[P1++];
  53. R0 = B[P1++];
  54. R0 = R0 << 8;
  55. R0 = R0 + R1;
  56. .Lword8_loop_e: W[P0] = R0;
  57. 1: RTS;
  58. ENDPROC(_outsw_8)