Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
[safe/jmp/linux-2.6] / include / linux / cpuidle.h
index cb95f5a..dcf77fa 100644 (file)
@@ -19,6 +19,7 @@
 
 #define CPUIDLE_STATE_MAX      8
 #define CPUIDLE_NAME_LEN       16
+#define CPUIDLE_DESC_LEN       32
 
 struct cpuidle_device;
 
@@ -29,6 +30,7 @@ struct cpuidle_device;
 
 struct cpuidle_state {
        char            name[CPUIDLE_NAME_LEN];
+       char            desc[CPUIDLE_DESC_LEN];
        void            *driver_data;
 
        unsigned int    flags;
@@ -36,8 +38,8 @@ struct cpuidle_state {
        unsigned int    power_usage; /* in mW */
        unsigned int    target_residency; /* in US */
 
-       unsigned int    usage;
-       unsigned int    time; /* in US */
+       unsigned long long      usage;
+       unsigned long long      time; /* in US */
 
        int (*enter)    (struct cpuidle_device *dev,
                         struct cpuidle_state *state);
@@ -46,9 +48,10 @@ struct cpuidle_state {
 /* Idle State Flags */
 #define CPUIDLE_FLAG_TIME_VALID        (0x01) /* is residency time measurable? */
 #define CPUIDLE_FLAG_CHECK_BM  (0x02) /* BM activity will exit state */
-#define CPUIDLE_FLAG_SHALLOW   (0x10) /* low latency, minimal savings */
-#define CPUIDLE_FLAG_BALANCED  (0x20) /* medium latency, moderate savings */
-#define CPUIDLE_FLAG_DEEP      (0x40) /* high latency, large savings */
+#define CPUIDLE_FLAG_POLL      (0x10) /* no latency, no savings */
+#define CPUIDLE_FLAG_SHALLOW   (0x20) /* low latency, minimal savings */
+#define CPUIDLE_FLAG_BALANCED  (0x40) /* medium latency, moderate savings */
+#define CPUIDLE_FLAG_DEEP      (0x80) /* high latency, large savings */
 
 #define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000)
 
@@ -72,19 +75,6 @@ cpuidle_set_statedata(struct cpuidle_state *state, void *data)
        state->driver_data = data;
 }
 
-#ifdef CONFIG_SMP
-#ifdef CONFIG_ARCH_HAS_CPU_IDLE_WAIT
-static inline void cpuidle_kick_cpus(void)
-{
-       cpu_idle_wait();
-}
-#else /* !CONFIG_ARCH_HAS_CPU_IDLE_WAIT */
-#error "Arch needs cpu_idle_wait() equivalent here"
-#endif /* !CONFIG_ARCH_HAS_CPU_IDLE_WAIT */
-#else /* !CONFIG_SMP */
-static inline void cpuidle_kick_cpus(void) {}
-#endif /* !CONFIG_SMP */
-
 struct cpuidle_state_kobj {
        struct cpuidle_state *state;
        struct completion kobj_unregister;
@@ -92,7 +82,8 @@ struct cpuidle_state_kobj {
 };
 
 struct cpuidle_device {
-       int                     enabled:1;
+       unsigned int            registered:1;
+       unsigned int            enabled:1;
        unsigned int            cpu;
 
        int                     last_residency;
@@ -105,6 +96,7 @@ struct cpuidle_device {
        struct kobject          kobj;
        struct completion       kobj_unregister;
        void                    *governor_data;
+       struct cpuidle_state    *safe_state;
 };
 
 DECLARE_PER_CPU(struct cpuidle_device *, cpuidle_devices);
@@ -190,4 +182,10 @@ static inline void cpuidle_unregister_governor(struct cpuidle_governor *gov) { }
 
 #endif
 
+#ifdef CONFIG_ARCH_HAS_CPU_RELAX
+#define CPUIDLE_DRIVER_STATE_START     1
+#else
+#define CPUIDLE_DRIVER_STATE_START     0
+#endif
+
 #endif /* _LINUX_CPUIDLE_H */