aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi/processor.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/acpi/processor.h')
-rw-r--r--include/acpi/processor.h238
1 files changed, 122 insertions, 116 deletions
diff --git a/include/acpi/processor.h b/include/acpi/processor.h
index 50cfea4ff6ca..7a00d5089de9 100644
--- a/include/acpi/processor.h
+++ b/include/acpi/processor.h
@@ -23,45 +23,44 @@
23struct acpi_processor_cx; 23struct acpi_processor_cx;
24 24
25struct acpi_power_register { 25struct acpi_power_register {
26 u8 descriptor; 26 u8 descriptor;
27 u16 length; 27 u16 length;
28 u8 space_id; 28 u8 space_id;
29 u8 bit_width; 29 u8 bit_width;
30 u8 bit_offset; 30 u8 bit_offset;
31 u8 reserved; 31 u8 reserved;
32 u64 address; 32 u64 address;
33} __attribute__ ((packed)); 33} __attribute__ ((packed));
34 34
35
36struct acpi_processor_cx_policy { 35struct acpi_processor_cx_policy {
37 u32 count; 36 u32 count;
38 struct acpi_processor_cx *state; 37 struct acpi_processor_cx *state;
39 struct { 38 struct {
40 u32 time; 39 u32 time;
41 u32 ticks; 40 u32 ticks;
42 u32 count; 41 u32 count;
43 u32 bm; 42 u32 bm;
44 } threshold; 43 } threshold;
45}; 44};
46 45
47struct acpi_processor_cx { 46struct acpi_processor_cx {
48 u8 valid; 47 u8 valid;
49 u8 type; 48 u8 type;
50 u32 address; 49 u32 address;
51 u32 latency; 50 u32 latency;
52 u32 latency_ticks; 51 u32 latency_ticks;
53 u32 power; 52 u32 power;
54 u32 usage; 53 u32 usage;
55 struct acpi_processor_cx_policy promotion; 54 struct acpi_processor_cx_policy promotion;
56 struct acpi_processor_cx_policy demotion; 55 struct acpi_processor_cx_policy demotion;
57}; 56};
58 57
59struct acpi_processor_power { 58struct acpi_processor_power {
60 struct acpi_processor_cx *state; 59 struct acpi_processor_cx *state;
61 unsigned long bm_check_timestamp; 60 unsigned long bm_check_timestamp;
62 u32 default_state; 61 u32 default_state;
63 u32 bm_activity; 62 u32 bm_activity;
64 int count; 63 int count;
65 struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER]; 64 struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER];
66 65
67 /* the _PDC objects passed by the driver, if any */ 66 /* the _PDC objects passed by the driver, if any */
@@ -71,85 +70,82 @@ struct acpi_processor_power {
71/* Performance Management */ 70/* Performance Management */
72 71
73struct acpi_pct_register { 72struct acpi_pct_register {
74 u8 descriptor; 73 u8 descriptor;
75 u16 length; 74 u16 length;
76 u8 space_id; 75 u8 space_id;
77 u8 bit_width; 76 u8 bit_width;
78 u8 bit_offset; 77 u8 bit_offset;
79 u8 reserved; 78 u8 reserved;
80 u64 address; 79 u64 address;
81} __attribute__ ((packed)); 80} __attribute__ ((packed));
82 81
83struct acpi_processor_px { 82struct acpi_processor_px {
84 acpi_integer core_frequency; /* megahertz */ 83 acpi_integer core_frequency; /* megahertz */
85 acpi_integer power; /* milliWatts */ 84 acpi_integer power; /* milliWatts */
86 acpi_integer transition_latency; /* microseconds */ 85 acpi_integer transition_latency; /* microseconds */
87 acpi_integer bus_master_latency; /* microseconds */ 86 acpi_integer bus_master_latency; /* microseconds */
88 acpi_integer control; /* control value */ 87 acpi_integer control; /* control value */
89 acpi_integer status; /* success indicator */ 88 acpi_integer status; /* success indicator */
90}; 89};
91 90
92struct acpi_processor_performance { 91struct acpi_processor_performance {
93 unsigned int state; 92 unsigned int state;
94 unsigned int platform_limit; 93 unsigned int platform_limit;
95 struct acpi_pct_register control_register; 94 struct acpi_pct_register control_register;
96 struct acpi_pct_register status_register; 95 struct acpi_pct_register status_register;
97 unsigned int state_count; 96 unsigned int state_count;
98 struct acpi_processor_px *states; 97 struct acpi_processor_px *states;
99 98
100 /* the _PDC objects passed by the driver, if any */ 99 /* the _PDC objects passed by the driver, if any */
101 struct acpi_object_list *pdc; 100 struct acpi_object_list *pdc;
102}; 101};
103 102
104
105
106/* Throttling Control */ 103/* Throttling Control */
107 104
108struct acpi_processor_tx { 105struct acpi_processor_tx {
109 u16 power; 106 u16 power;
110 u16 performance; 107 u16 performance;
111}; 108};
112 109
113struct acpi_processor_throttling { 110struct acpi_processor_throttling {
114 int state; 111 int state;
115 u32 address; 112 u32 address;
116 u8 duty_offset; 113 u8 duty_offset;
117 u8 duty_width; 114 u8 duty_width;
118 int state_count; 115 int state_count;
119 struct acpi_processor_tx states[ACPI_PROCESSOR_MAX_THROTTLING]; 116 struct acpi_processor_tx states[ACPI_PROCESSOR_MAX_THROTTLING];
120}; 117};
121 118
122/* Limit Interface */ 119/* Limit Interface */
123 120
124struct acpi_processor_lx { 121struct acpi_processor_lx {
125 int px; /* performace state */ 122 int px; /* performace state */
126 int tx; /* throttle level */ 123 int tx; /* throttle level */
127}; 124};
128 125
129struct acpi_processor_limit { 126struct acpi_processor_limit {
130 struct acpi_processor_lx state; /* current limit */ 127 struct acpi_processor_lx state; /* current limit */
131 struct acpi_processor_lx thermal; /* thermal limit */ 128 struct acpi_processor_lx thermal; /* thermal limit */
132 struct acpi_processor_lx user; /* user limit */ 129 struct acpi_processor_lx user; /* user limit */
133}; 130};
134 131
135
136struct acpi_processor_flags { 132struct acpi_processor_flags {
137 u8 power:1; 133 u8 power:1;
138 u8 performance:1; 134 u8 performance:1;
139 u8 throttling:1; 135 u8 throttling:1;
140 u8 limit:1; 136 u8 limit:1;
141 u8 bm_control:1; 137 u8 bm_control:1;
142 u8 bm_check:1; 138 u8 bm_check:1;
143 u8 has_cst:1; 139 u8 has_cst:1;
144 u8 power_setup_done:1; 140 u8 power_setup_done:1;
145}; 141};
146 142
147struct acpi_processor { 143struct acpi_processor {
148 acpi_handle handle; 144 acpi_handle handle;
149 u32 acpi_id; 145 u32 acpi_id;
150 u32 id; 146 u32 id;
151 u32 pblk; 147 u32 pblk;
152 int performance_platform_limit; 148 int performance_platform_limit;
153 struct acpi_processor_flags flags; 149 struct acpi_processor_flags flags;
154 struct acpi_processor_power power; 150 struct acpi_processor_power power;
155 struct acpi_processor_performance *performance; 151 struct acpi_processor_performance *performance;
@@ -158,50 +154,49 @@ struct acpi_processor {
158}; 154};
159 155
160struct acpi_processor_errata { 156struct acpi_processor_errata {
161 u8 smp; 157 u8 smp;
162 struct { 158 struct {
163 u8 throttle:1; 159 u8 throttle:1;
164 u8 fdma:1; 160 u8 fdma:1;
165 u8 reserved:6; 161 u8 reserved:6;
166 u32 bmisx; 162 u32 bmisx;
167 } piix4; 163 } piix4;
168}; 164};
169 165
170extern int acpi_processor_register_performance ( 166extern int acpi_processor_register_performance(struct acpi_processor_performance
171 struct acpi_processor_performance * performance, 167 *performance, unsigned int cpu);
172 unsigned int cpu); 168extern void acpi_processor_unregister_performance(struct
173extern void acpi_processor_unregister_performance ( 169 acpi_processor_performance
174 struct acpi_processor_performance * performance, 170 *performance,
175 unsigned int cpu); 171 unsigned int cpu);
176 172
177/* note: this locks both the calling module and the processor module 173/* note: this locks both the calling module and the processor module
178 if a _PPC object exists, rmmod is disallowed then */ 174 if a _PPC object exists, rmmod is disallowed then */
179int acpi_processor_notify_smm(struct module *calling_module); 175int acpi_processor_notify_smm(struct module *calling_module);
180 176
181
182
183/* for communication between multiple parts of the processor kernel module */ 177/* for communication between multiple parts of the processor kernel module */
184extern struct acpi_processor *processors[NR_CPUS]; 178extern struct acpi_processor *processors[NR_CPUS];
185extern struct acpi_processor_errata errata; 179extern struct acpi_processor_errata errata;
186 180
187int acpi_processor_set_pdc(struct acpi_processor *pr, 181int acpi_processor_set_pdc(struct acpi_processor *pr,
188 struct acpi_object_list *pdc_in); 182 struct acpi_object_list *pdc_in);
189 183
190#ifdef ARCH_HAS_POWER_PDC_INIT 184#ifdef ARCH_HAS_POWER_PDC_INIT
191void acpi_processor_power_init_pdc(struct acpi_processor_power *pow, 185void acpi_processor_power_init_pdc(struct acpi_processor_power *pow,
192 unsigned int cpu); 186 unsigned int cpu);
193void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags, 187void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags,
194 unsigned int cpu); 188 unsigned int cpu);
195#else 189#else
196static inline void acpi_processor_power_init_pdc( 190static inline void acpi_processor_power_init_pdc(struct acpi_processor_power
197 struct acpi_processor_power *pow, unsigned int cpu) 191 *pow, unsigned int cpu)
198{ 192{
199 pow->pdc = NULL; 193 pow->pdc = NULL;
200 return; 194 return;
201} 195}
202 196
203static inline void acpi_processor_power_init_bm_check( 197static inline void acpi_processor_power_init_bm_check(struct
204 struct acpi_processor_flags *flags, unsigned int cpu) 198 acpi_processor_flags
199 *flags, unsigned int cpu)
205{ 200{
206 flags->bm_check = 1; 201 flags->bm_check = 1;
207 return; 202 return;
@@ -215,51 +210,62 @@ void acpi_processor_ppc_init(void);
215void acpi_processor_ppc_exit(void); 210void acpi_processor_ppc_exit(void);
216int acpi_processor_ppc_has_changed(struct acpi_processor *pr); 211int acpi_processor_ppc_has_changed(struct acpi_processor *pr);
217#else 212#else
218static inline void acpi_processor_ppc_init(void) { return; } 213static inline void acpi_processor_ppc_init(void)
219static inline void acpi_processor_ppc_exit(void) { return; } 214{
220static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr) { 215 return;
216}
217static inline void acpi_processor_ppc_exit(void)
218{
219 return;
220}
221static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr)
222{
221 static unsigned int printout = 1; 223 static unsigned int printout = 1;
222 if (printout) { 224 if (printout) {
223 printk(KERN_WARNING "Warning: Processor Platform Limit event detected, but not handled.\n"); 225 printk(KERN_WARNING
224 printk(KERN_WARNING "Consider compiling CPUfreq support into your kernel.\n"); 226 "Warning: Processor Platform Limit event detected, but not handled.\n");
227 printk(KERN_WARNING
228 "Consider compiling CPUfreq support into your kernel.\n");
225 printout = 0; 229 printout = 0;
226 } 230 }
227 return 0; 231 return 0;
228} 232}
229#endif /* CONFIG_CPU_FREQ */ 233#endif /* CONFIG_CPU_FREQ */
230 234
231/* in processor_throttling.c */ 235/* in processor_throttling.c */
232int acpi_processor_get_throttling_info (struct acpi_processor *pr); 236int acpi_processor_get_throttling_info(struct acpi_processor *pr);
233int acpi_processor_set_throttling (struct acpi_processor *pr, int state); 237int acpi_processor_set_throttling(struct acpi_processor *pr, int state);
234ssize_t acpi_processor_write_throttling ( 238ssize_t acpi_processor_write_throttling(struct file *file,
235 struct file *file, 239 const char __user * buffer,
236 const char __user *buffer, 240 size_t count, loff_t * data);
237 size_t count,
238 loff_t *data);
239extern struct file_operations acpi_processor_throttling_fops; 241extern struct file_operations acpi_processor_throttling_fops;
240 242
241/* in processor_idle.c */ 243/* in processor_idle.c */
242int acpi_processor_power_init(struct acpi_processor *pr, struct acpi_device *device); 244int acpi_processor_power_init(struct acpi_processor *pr,
243int acpi_processor_cst_has_changed (struct acpi_processor *pr); 245 struct acpi_device *device);
244int acpi_processor_power_exit(struct acpi_processor *pr, struct acpi_device *device); 246int acpi_processor_cst_has_changed(struct acpi_processor *pr);
245 247int acpi_processor_power_exit(struct acpi_processor *pr,
248 struct acpi_device *device);
246 249
247/* in processor_thermal.c */ 250/* in processor_thermal.c */
248int acpi_processor_get_limit_info (struct acpi_processor *pr); 251int acpi_processor_get_limit_info(struct acpi_processor *pr);
249ssize_t acpi_processor_write_limit ( 252ssize_t acpi_processor_write_limit(struct file *file,
250 struct file *file, 253 const char __user * buffer,
251 const char __user *buffer, 254 size_t count, loff_t * data);
252 size_t count,
253 loff_t *data);
254extern struct file_operations acpi_processor_limit_fops; 255extern struct file_operations acpi_processor_limit_fops;
255 256
256#ifdef CONFIG_CPU_FREQ 257#ifdef CONFIG_CPU_FREQ
257void acpi_thermal_cpufreq_init(void); 258void acpi_thermal_cpufreq_init(void);
258void acpi_thermal_cpufreq_exit(void); 259void acpi_thermal_cpufreq_exit(void);
259#else 260#else
260static inline void acpi_thermal_cpufreq_init(void) { return; } 261static inline void acpi_thermal_cpufreq_init(void)
261static inline void acpi_thermal_cpufreq_exit(void) { return; } 262{
263 return;
264}
265static inline void acpi_thermal_cpufreq_exit(void)
266{
267 return;
268}
262#endif 269#endif
263 270
264
265#endif 271#endif