cpuidle.h 881 B

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef _ASM_POWERPC_CPUIDLE_H
  2. #define _ASM_POWERPC_CPUIDLE_H
  3. #ifdef CONFIG_PPC_POWERNV
  4. /* Used in powernv idle state management */
  5. #define PNV_THREAD_RUNNING 0
  6. #define PNV_THREAD_NAP 1
  7. #define PNV_THREAD_SLEEP 2
  8. #define PNV_THREAD_WINKLE 3
  9. #define PNV_CORE_IDLE_LOCK_BIT 0x100
  10. #define PNV_CORE_IDLE_THREAD_BITS 0x0FF
  11. #ifndef __ASSEMBLY__
  12. extern u32 pnv_fastsleep_workaround_at_entry[];
  13. extern u32 pnv_fastsleep_workaround_at_exit[];
  14. extern u64 pnv_first_deep_stop_state;
  15. #endif
  16. #endif
  17. /* Idle state entry routines */
  18. #ifdef CONFIG_PPC_P7_NAP
  19. #define IDLE_STATE_ENTER_SEQ(IDLE_INST) \
  20. /* Magic NAP/SLEEP/WINKLE mode enter sequence */ \
  21. std r0,0(r1); \
  22. ptesync; \
  23. ld r0,0(r1); \
  24. 1: cmpd cr0,r0,r0; \
  25. bne 1b; \
  26. IDLE_INST; \
  27. b .
  28. #endif /* CONFIG_PPC_P7_NAP */
  29. #endif