Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
434 | giacomo | 1 | #ifndef __ACPI_PROCESSOR_H |
2 | #define __ACPI_PROCESSOR_H |
||
3 | |||
4 | #include <linux/kernel.h> |
||
5 | |||
6 | #define ACPI_PROCESSOR_BUSY_METRIC 10 |
||
7 | |||
8 | #define ACPI_PROCESSOR_MAX_POWER ACPI_C_STATE_COUNT |
||
9 | #define ACPI_PROCESSOR_MAX_C2_LATENCY 100 |
||
10 | #define ACPI_PROCESSOR_MAX_C3_LATENCY 1000 |
||
11 | |||
12 | #define ACPI_PROCESSOR_MAX_PERFORMANCE 8 |
||
13 | |||
14 | #define ACPI_PROCESSOR_MAX_THROTTLING 16 |
||
15 | #define ACPI_PROCESSOR_MAX_THROTTLE 250 /* 25% */ |
||
16 | #define ACPI_PROCESSOR_MAX_DUTY_WIDTH 4 |
||
17 | |||
18 | /* Power Management */ |
||
19 | |||
20 | struct acpi_processor_cx_policy { |
||
21 | u32 count; |
||
22 | int state; |
||
23 | struct { |
||
24 | u32 time; |
||
25 | u32 ticks; |
||
26 | u32 count; |
||
27 | u32 bm; |
||
28 | } threshold; |
||
29 | }; |
||
30 | |||
31 | struct acpi_processor_cx { |
||
32 | u8 valid; |
||
33 | u32 address; |
||
34 | u32 latency; |
||
35 | u32 latency_ticks; |
||
36 | u32 power; |
||
37 | u32 usage; |
||
38 | struct acpi_processor_cx_policy promotion; |
||
39 | struct acpi_processor_cx_policy demotion; |
||
40 | }; |
||
41 | |||
42 | struct acpi_processor_power { |
||
43 | int state; |
||
44 | int default_state; |
||
45 | u32 bm_activity; |
||
46 | struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER]; |
||
47 | }; |
||
48 | |||
49 | /* Performance Management */ |
||
50 | |||
51 | struct acpi_pct_register { |
||
52 | u8 descriptor; |
||
53 | u16 length; |
||
54 | u8 space_id; |
||
55 | u8 bit_width; |
||
56 | u8 bit_offset; |
||
57 | u8 reserved; |
||
58 | u64 address; |
||
59 | } __attribute__ ((packed)); |
||
60 | |||
61 | struct acpi_processor_px { |
||
62 | acpi_integer core_frequency; /* megahertz */ |
||
63 | acpi_integer power; /* milliWatts */ |
||
64 | acpi_integer transition_latency; /* microseconds */ |
||
65 | acpi_integer bus_master_latency; /* microseconds */ |
||
66 | acpi_integer control; /* control value */ |
||
67 | acpi_integer status; /* success indicator */ |
||
68 | }; |
||
69 | |||
70 | struct acpi_processor_performance { |
||
71 | int state; |
||
72 | int platform_limit; |
||
73 | u16 control_register; |
||
74 | u16 status_register; |
||
75 | int state_count; |
||
76 | struct acpi_processor_px states[ACPI_PROCESSOR_MAX_PERFORMANCE]; |
||
77 | struct cpufreq_frequency_table freq_table[ACPI_PROCESSOR_MAX_PERFORMANCE]; |
||
78 | struct acpi_processor *pr; |
||
79 | }; |
||
80 | |||
81 | |||
82 | /* Throttling Control */ |
||
83 | |||
84 | struct acpi_processor_tx { |
||
85 | u16 power; |
||
86 | u16 performance; |
||
87 | }; |
||
88 | |||
89 | struct acpi_processor_throttling { |
||
90 | int state; |
||
91 | u32 address; |
||
92 | u8 duty_offset; |
||
93 | u8 duty_width; |
||
94 | int state_count; |
||
95 | struct acpi_processor_tx states[ACPI_PROCESSOR_MAX_THROTTLING]; |
||
96 | }; |
||
97 | |||
98 | /* Limit Interface */ |
||
99 | |||
100 | struct acpi_processor_lx { |
||
101 | int px; /* performace state */ |
||
102 | int tx; /* throttle level */ |
||
103 | }; |
||
104 | |||
105 | struct acpi_processor_limit { |
||
106 | struct acpi_processor_lx state; /* current limit */ |
||
107 | struct acpi_processor_lx thermal; /* thermal limit */ |
||
108 | struct acpi_processor_lx user; /* user limit */ |
||
109 | }; |
||
110 | |||
111 | |||
112 | struct acpi_processor_flags { |
||
113 | u8 power:1; |
||
114 | u8 performance:1; |
||
115 | u8 throttling:1; |
||
116 | u8 limit:1; |
||
117 | u8 bm_control:1; |
||
118 | u8 bm_check:1; |
||
119 | u8 reserved:2; |
||
120 | }; |
||
121 | |||
122 | struct acpi_processor { |
||
123 | acpi_handle handle; |
||
124 | u32 acpi_id; |
||
125 | u32 id; |
||
126 | int performance_platform_limit; |
||
127 | struct acpi_processor_flags flags; |
||
128 | struct acpi_processor_power power; |
||
129 | struct acpi_processor_performance *performance; |
||
130 | struct acpi_processor_throttling throttling; |
||
131 | struct acpi_processor_limit limit; |
||
132 | }; |
||
133 | |||
134 | extern int acpi_processor_get_platform_limit ( |
||
135 | struct acpi_processor* pr); |
||
136 | extern int acpi_processor_register_performance ( |
||
137 | struct acpi_processor_performance * performance, |
||
138 | struct acpi_processor ** pr, |
||
139 | unsigned int cpu); |
||
140 | |||
141 | #endif |