outs.S 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * File: arch/blackfin/lib/outs.S
  3. * Based on:
  4. * Author: Bas Vermeulen <bas@buyways.nl>
  5. *
  6. * Created: Tue Mar 22 15:27:24 CEST 2005
  7. * Description: Implementation of outs{bwl} for BlackFin processors using zero overhead loops.
  8. *
  9. * Modified: Copyright (C) 2005 Bas Vermeulen, BuyWays BV <bas@buyways.nl>
  10. * Copyright 2004-2008 Analog Devices Inc.
  11. *
  12. * Bugs: Enter bugs at http://blackfin.uclinux.org/
  13. *
  14. * This program is free software; you can redistribute it and/or modify
  15. * it under the terms of the GNU General Public License as published by
  16. * the Free Software Foundation; either version 2 of the License, or
  17. * (at your option) any later version.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License
  25. * along with this program; if not, see the file COPYING, or write
  26. * to the Free Software Foundation, Inc.,
  27. * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  28. */
  29. #include <linux/linkage.h>
  30. .align 2
  31. ENTRY(_outsl)
  32. P0 = R0; /* P0 = port */
  33. P1 = R1; /* P1 = address */
  34. P2 = R2; /* P2 = count */
  35. LSETUP( .Llong_loop_s, .Llong_loop_e) LC0 = P2;
  36. .Llong_loop_s: R0 = [P1++];
  37. .Llong_loop_e: [P0] = R0;
  38. RTS;
  39. ENDPROC(_outsl)
  40. ENTRY(_outsw)
  41. P0 = R0; /* P0 = port */
  42. P1 = R1; /* P1 = address */
  43. P2 = R2; /* P2 = count */
  44. LSETUP( .Lword_loop_s, .Lword_loop_e) LC0 = P2;
  45. .Lword_loop_s: R0 = W[P1++];
  46. .Lword_loop_e: W[P0] = R0;
  47. RTS;
  48. ENDPROC(_outsw)
  49. ENTRY(_outsb)
  50. P0 = R0; /* P0 = port */
  51. P1 = R1; /* P1 = address */
  52. P2 = R2; /* P2 = count */
  53. LSETUP( .Lbyte_loop_s, .Lbyte_loop_e) LC0 = P2;
  54. .Lbyte_loop_s: R0 = B[P1++];
  55. .Lbyte_loop_e: B[P0] = R0;
  56. RTS;
  57. ENDPROC(_outsb)
  58. ENTRY(_outsw_8)
  59. P0 = R0; /* P0 = port */
  60. P1 = R1; /* P1 = address */
  61. P2 = R2; /* P2 = count */
  62. LSETUP( .Lword8_loop_s, .Lword8_loop_e) LC0 = P2;
  63. .Lword8_loop_s: R1 = B[P1++];
  64. R0 = B[P1++];
  65. R0 = R0 << 8;
  66. R0 = R0 + R1;
  67. .Lword8_loop_e: W[P0] = R0;
  68. RTS;
  69. ENDPROC(_outsw_8)