insl_ns.S 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* insl_ns.S: input array of 4b words from device port without byte swapping
  2. *
  3. * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved.
  4. * Written by David Howells (dhowells@redhat.com)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the License, or (at your option) any later version.
  10. */
  11. .text
  12. .p2align 4
  13. ###############################################################################
  14. #
  15. # void __insl_ns(unsigned int port, void *buf, int n)
  16. #
  17. ###############################################################################
  18. .globl __insl_ns
  19. .type __insl_ns,@function
  20. __insl_ns:
  21. andicc.p gr9,#3,gr0,icc0
  22. setlos #4,gr4
  23. bne icc0,#0,__insl_ns_misaligned
  24. subi gr9,#4,gr9
  25. 0:
  26. ldi.p @(gr8,#0),gr5
  27. subicc gr10,#1,gr10,icc0
  28. stu.p gr5,@(gr9,gr4)
  29. bhi icc0,#2,0b
  30. bralr
  31. __insl_ns_misaligned:
  32. subi.p gr9,#1,gr9
  33. setlos #1,gr4
  34. 0:
  35. ldi @(gr8,#0),gr5
  36. srli gr5,#24,gr6
  37. stbu.p gr6,@(gr9,gr4)
  38. srli gr5,#16,gr6
  39. stbu.p gr6,@(gr9,gr4)
  40. srli gr5,#8,gr6
  41. stbu.p gr6,@(gr9,gr4)
  42. subicc gr10,#1,gr10,icc0
  43. stbu.p gr5,@(gr9,gr4)
  44. bhi icc0,#2,0b
  45. bralr
  46. .size __insl_ns, .-__insl_ns