dcr-low.S 858 B

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