idle_power4.S 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * This file contains the power_save function for 970-family CPUs.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version
  7. * 2 of the License, or (at your option) any later version.
  8. */
  9. #include <linux/config.h>
  10. #include <linux/threads.h>
  11. #include <asm/processor.h>
  12. #include <asm/page.h>
  13. #include <asm/cputable.h>
  14. #include <asm/thread_info.h>
  15. #include <asm/ppc_asm.h>
  16. #include <asm/asm-offsets.h>
  17. #undef DEBUG
  18. .text
  19. _GLOBAL(power4_idle)
  20. BEGIN_FTR_SECTION
  21. blr
  22. END_FTR_SECTION_IFCLR(CPU_FTR_CAN_NAP)
  23. /* Now check if user or arch enabled NAP mode */
  24. LOAD_REG_ADDRBASE(r3,powersave_nap)
  25. lwz r4,ADDROFF(powersave_nap)(r3)
  26. cmpwi 0,r4,0
  27. beqlr
  28. /* Go to NAP now */
  29. BEGIN_FTR_SECTION
  30. DSSALL
  31. sync
  32. END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
  33. clrrdi r9,r1,THREAD_SHIFT /* current thread_info */
  34. ld r8,TI_LOCAL_FLAGS(r9) /* set napping bit */
  35. ori r8,r8,_TLF_NAPPING /* so when we take an exception */
  36. std r8,TI_LOCAL_FLAGS(r9) /* it will return to our caller */
  37. mfmsr r7
  38. ori r7,r7,MSR_EE
  39. oris r7,r7,MSR_POW@h
  40. 1: sync
  41. isync
  42. mtmsrd r7
  43. isync
  44. b 1b