io.S 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /*
  2. * Copyright (C) 1998 Dan Malek <dmalek@jlc.net>
  3. * Copyright (C) 1999 Magnus Damm <kieraypc01.p.y.kie.era.ericsson.se>
  4. * Copyright (C) 2001 Sysgo Real-Time Solutions, GmbH <www.elinos.com>
  5. * Andreas Heppel <aheppel@sysgo.de>
  6. * Copyright (C) 2003 Wolfgang Denk <wd@denx.de>
  7. *
  8. * See file CREDITS for list of people who contributed to this
  9. * project.
  10. *
  11. * This program is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU General Public License as
  13. * published by the Free Software Foundation; either version 2 of
  14. * the License, or (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  24. * MA 02111-1307 USA
  25. */
  26. #include <config.h>
  27. #include <ppc_asm.tmpl>
  28. /* ------------------------------------------------------------------------------- */
  29. /* Function: in8 */
  30. /* Description: Input 8 bits */
  31. /* ------------------------------------------------------------------------------- */
  32. .globl in8
  33. in8:
  34. lbz r3,0(r3)
  35. sync
  36. blr
  37. /* ------------------------------------------------------------------------------- */
  38. /* Function: in16 */
  39. /* Description: Input 16 bits */
  40. /* ------------------------------------------------------------------------------- */
  41. .globl in16
  42. in16:
  43. lhz r3,0(r3)
  44. sync
  45. blr
  46. /* ------------------------------------------------------------------------------- */
  47. /* Function: in16r */
  48. /* Description: Input 16 bits and byte reverse */
  49. /* ------------------------------------------------------------------------------- */
  50. .globl in16r
  51. in16r:
  52. lhbrx r3,0,r3
  53. sync
  54. blr
  55. /* ------------------------------------------------------------------------------- */
  56. /* Function: in32 */
  57. /* Description: Input 32 bits */
  58. /* ------------------------------------------------------------------------------- */
  59. .globl in32
  60. in32:
  61. lwz 3,0(3)
  62. sync
  63. blr
  64. /* ------------------------------------------------------------------------------- */
  65. /* Function: in32r */
  66. /* Description: Input 32 bits and byte reverse */
  67. /* ------------------------------------------------------------------------------- */
  68. .globl in32r
  69. in32r:
  70. lwbrx r3,0,r3
  71. sync
  72. blr
  73. /* ------------------------------------------------------------------------------- */
  74. /* Function: out8 */
  75. /* Description: Output 8 bits */
  76. /* ------------------------------------------------------------------------------- */
  77. .globl out8
  78. out8:
  79. stb r4,0(r3)
  80. sync
  81. blr
  82. /* ------------------------------------------------------------------------------- */
  83. /* Function: out16 */
  84. /* Description: Output 16 bits */
  85. /* ------------------------------------------------------------------------------- */
  86. .globl out16
  87. out16:
  88. sth r4,0(r3)
  89. sync
  90. blr
  91. /* ------------------------------------------------------------------------------- */
  92. /* Function: out16r */
  93. /* Description: Byte reverse and output 16 bits */
  94. /* ------------------------------------------------------------------------------- */
  95. .globl out16r
  96. out16r:
  97. sthbrx r4,0,r3
  98. sync
  99. blr
  100. /* ------------------------------------------------------------------------------- */
  101. /* Function: out32 */
  102. /* Description: Output 32 bits */
  103. /* ------------------------------------------------------------------------------- */
  104. .globl out32
  105. out32:
  106. stw r4,0(r3)
  107. sync
  108. blr
  109. /* ------------------------------------------------------------------------------- */
  110. /* Function: out32r */
  111. /* Description: Byte reverse and output 32 bits */
  112. /* ------------------------------------------------------------------------------- */
  113. .globl out32r
  114. out32r:
  115. stwbrx r4,0,r3
  116. sync
  117. blr