1 #ifndef __ACPI_PROCESSOR_H
2 #define __ACPI_PROCESSOR_H
4 #include <linux/kernel.h>
8 #define ACPI_PROCESSOR_BUSY_METRIC 10
10 #define ACPI_PROCESSOR_MAX_POWER 8
11 #define ACPI_PROCESSOR_MAX_C2_LATENCY 100
12 #define ACPI_PROCESSOR_MAX_C3_LATENCY 1000
14 #define ACPI_PROCESSOR_MAX_THROTTLING 16
15 #define ACPI_PROCESSOR_MAX_THROTTLE 250 /* 25% */
16 #define ACPI_PROCESSOR_MAX_DUTY_WIDTH 4
18 #define ACPI_PDC_REVISION_ID 0x1
20 /* Power Management */
22 struct acpi_processor_cx;
24 struct acpi_power_register {
32 } __attribute__ ((packed));
34 struct acpi_processor_cx_policy {
36 struct acpi_processor_cx *state;
45 struct acpi_processor_cx {
53 struct acpi_processor_cx_policy promotion;
54 struct acpi_processor_cx_policy demotion;
57 struct acpi_processor_power {
58 struct acpi_processor_cx *state;
59 unsigned long bm_check_timestamp;
63 struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER];
66 /* Performance Management */
68 struct acpi_pct_register {
76 } __attribute__ ((packed));
78 struct acpi_processor_px {
79 acpi_integer core_frequency; /* megahertz */
80 acpi_integer power; /* milliWatts */
81 acpi_integer transition_latency; /* microseconds */
82 acpi_integer bus_master_latency; /* microseconds */
83 acpi_integer control; /* control value */
84 acpi_integer status; /* success indicator */
87 struct acpi_processor_performance {
89 unsigned int platform_limit;
90 struct acpi_pct_register control_register;
91 struct acpi_pct_register status_register;
92 unsigned int state_count;
93 struct acpi_processor_px *states;
97 /* Throttling Control */
99 struct acpi_processor_tx {
104 struct acpi_processor_throttling {
110 struct acpi_processor_tx states[ACPI_PROCESSOR_MAX_THROTTLING];
113 /* Limit Interface */
115 struct acpi_processor_lx {
116 int px; /* performace state */
117 int tx; /* throttle level */
120 struct acpi_processor_limit {
121 struct acpi_processor_lx state; /* current limit */
122 struct acpi_processor_lx thermal; /* thermal limit */
123 struct acpi_processor_lx user; /* user limit */
126 struct acpi_processor_flags {
134 u8 power_setup_done:1;
137 struct acpi_processor {
142 int performance_platform_limit;
143 struct acpi_processor_flags flags;
144 struct acpi_processor_power power;
145 struct acpi_processor_performance *performance;
146 struct acpi_processor_throttling throttling;
147 struct acpi_processor_limit limit;
149 /* the _PDC objects for this processor, if any */
150 struct acpi_object_list *pdc;
153 struct acpi_processor_errata {
163 extern int acpi_processor_register_performance(struct acpi_processor_performance
164 *performance, unsigned int cpu);
165 extern void acpi_processor_unregister_performance(struct
166 acpi_processor_performance
170 /* note: this locks both the calling module and the processor module
171 if a _PPC object exists, rmmod is disallowed then */
172 int acpi_processor_notify_smm(struct module *calling_module);
174 /* for communication between multiple parts of the processor kernel module */
175 extern struct acpi_processor *processors[NR_CPUS];
176 extern struct acpi_processor_errata errata;
178 void arch_acpi_processor_init_pdc(struct acpi_processor *pr);
180 #ifdef ARCH_HAS_POWER_INIT
181 void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags,
184 static inline void acpi_processor_power_init_bm_check(struct
186 *flags, unsigned int cpu)
193 /* in processor_perflib.c */
195 #ifdef CONFIG_CPU_FREQ
196 void acpi_processor_ppc_init(void);
197 void acpi_processor_ppc_exit(void);
198 int acpi_processor_ppc_has_changed(struct acpi_processor *pr);
200 static inline void acpi_processor_ppc_init(void)
204 static inline void acpi_processor_ppc_exit(void)
208 static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr)
210 static unsigned int printout = 1;
213 "Warning: Processor Platform Limit event detected, but not handled.\n");
215 "Consider compiling CPUfreq support into your kernel.\n");
220 #endif /* CONFIG_CPU_FREQ */
222 /* in processor_throttling.c */
223 int acpi_processor_get_throttling_info(struct acpi_processor *pr);
224 int acpi_processor_set_throttling(struct acpi_processor *pr, int state);
225 extern struct file_operations acpi_processor_throttling_fops;
227 /* in processor_idle.c */
228 int acpi_processor_power_init(struct acpi_processor *pr,
229 struct acpi_device *device);
230 int acpi_processor_cst_has_changed(struct acpi_processor *pr);
231 int acpi_processor_power_exit(struct acpi_processor *pr,
232 struct acpi_device *device);
234 /* in processor_thermal.c */
235 int acpi_processor_get_limit_info(struct acpi_processor *pr);
236 extern struct file_operations acpi_processor_limit_fops;
238 #ifdef CONFIG_CPU_FREQ
239 void acpi_thermal_cpufreq_init(void);
240 void acpi_thermal_cpufreq_exit(void);
242 static inline void acpi_thermal_cpufreq_init(void)
246 static inline void acpi_thermal_cpufreq_exit(void)