dcr.S 886 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * arch/ppc/syslib/dcr.S
  3. *
  4. * "Indirect" DCR access
  5. *
  6. * Copyright (c) 2004 Eugene Surovegin <ebs@ebshome.net>
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License as published by the
  10. * Free Software Foundation; either version 2 of the License, or (at your
  11. * option) any later version.
  12. */
  13. #include <asm/ppc_asm.h>
  14. #include <asm/processor.h>
  15. #define DCR_ACCESS_PROLOG(table) \
  16. rlwinm r3,r3,4,18,27; \
  17. lis r5,table@h; \
  18. ori r5,r5,table@l; \
  19. add r3,r3,r5; \
  20. mtctr r3; \
  21. bctr
  22. _GLOBAL(__mfdcr)
  23. DCR_ACCESS_PROLOG(__mfdcr_table)
  24. _GLOBAL(__mtdcr)
  25. DCR_ACCESS_PROLOG(__mtdcr_table)
  26. __mfdcr_table:
  27. mfdcr r3,0; blr
  28. __mtdcr_table:
  29. mtdcr 0,r4; blr
  30. dcr = 1
  31. .rept 1023
  32. mfdcr r3,dcr; blr
  33. mtdcr dcr,r4; blr
  34. dcr = dcr + 1
  35. .endr