diff options
Diffstat (limited to 'drivers/acpi/hardware')
-rw-r--r-- | drivers/acpi/hardware/hwacpi.c | 6 | ||||
-rw-r--r-- | drivers/acpi/hardware/hwgpe.c | 8 | ||||
-rw-r--r-- | drivers/acpi/hardware/hwregs.c | 146 | ||||
-rw-r--r-- | drivers/acpi/hardware/hwsleep.c | 31 | ||||
-rw-r--r-- | drivers/acpi/hardware/hwtimer.c | 20 |
5 files changed, 99 insertions, 112 deletions
diff --git a/drivers/acpi/hardware/hwacpi.c b/drivers/acpi/hardware/hwacpi.c index ea2f13271ff1..de50fab2a910 100644 --- a/drivers/acpi/hardware/hwacpi.c +++ b/drivers/acpi/hardware/hwacpi.c | |||
@@ -63,7 +63,7 @@ acpi_status acpi_hw_initialize(void) | |||
63 | { | 63 | { |
64 | acpi_status status; | 64 | acpi_status status; |
65 | 65 | ||
66 | ACPI_FUNCTION_TRACE("hw_initialize"); | 66 | ACPI_FUNCTION_TRACE(hw_initialize); |
67 | 67 | ||
68 | /* We must have the ACPI tables by the time we get here */ | 68 | /* We must have the ACPI tables by the time we get here */ |
69 | 69 | ||
@@ -100,7 +100,7 @@ acpi_status acpi_hw_set_mode(u32 mode) | |||
100 | acpi_status status; | 100 | acpi_status status; |
101 | u32 retry; | 101 | u32 retry; |
102 | 102 | ||
103 | ACPI_FUNCTION_TRACE("hw_set_mode"); | 103 | ACPI_FUNCTION_TRACE(hw_set_mode); |
104 | 104 | ||
105 | /* | 105 | /* |
106 | * ACPI 2.0 clarified that if SMI_CMD in FADT is zero, | 106 | * ACPI 2.0 clarified that if SMI_CMD in FADT is zero, |
@@ -198,7 +198,7 @@ u32 acpi_hw_get_mode(void) | |||
198 | acpi_status status; | 198 | acpi_status status; |
199 | u32 value; | 199 | u32 value; |
200 | 200 | ||
201 | ACPI_FUNCTION_TRACE("hw_get_mode"); | 201 | ACPI_FUNCTION_TRACE(hw_get_mode); |
202 | 202 | ||
203 | /* | 203 | /* |
204 | * ACPI 2.0 clarified that if SMI_CMD in FADT is zero, | 204 | * ACPI 2.0 clarified that if SMI_CMD in FADT is zero, |
diff --git a/drivers/acpi/hardware/hwgpe.c b/drivers/acpi/hardware/hwgpe.c index d84942d22dd5..608a3a60ee11 100644 --- a/drivers/acpi/hardware/hwgpe.c +++ b/drivers/acpi/hardware/hwgpe.c | |||
@@ -214,6 +214,7 @@ acpi_hw_disable_gpe_block(struct acpi_gpe_xrupt_info * gpe_xrupt_info, | |||
214 | /* Examine each GPE Register within the block */ | 214 | /* Examine each GPE Register within the block */ |
215 | 215 | ||
216 | for (i = 0; i < gpe_block->register_count; i++) { | 216 | for (i = 0; i < gpe_block->register_count; i++) { |
217 | |||
217 | /* Disable all GPEs in this register */ | 218 | /* Disable all GPEs in this register */ |
218 | 219 | ||
219 | status = acpi_hw_low_level_write(8, 0x00, | 220 | status = acpi_hw_low_level_write(8, 0x00, |
@@ -250,6 +251,7 @@ acpi_hw_clear_gpe_block(struct acpi_gpe_xrupt_info * gpe_xrupt_info, | |||
250 | /* Examine each GPE Register within the block */ | 251 | /* Examine each GPE Register within the block */ |
251 | 252 | ||
252 | for (i = 0; i < gpe_block->register_count; i++) { | 253 | for (i = 0; i < gpe_block->register_count; i++) { |
254 | |||
253 | /* Clear status on all GPEs in this register */ | 255 | /* Clear status on all GPEs in this register */ |
254 | 256 | ||
255 | status = acpi_hw_low_level_write(8, 0xFF, | 257 | status = acpi_hw_low_level_write(8, 0xFF, |
@@ -368,7 +370,7 @@ acpi_status acpi_hw_disable_all_gpes(void) | |||
368 | { | 370 | { |
369 | acpi_status status; | 371 | acpi_status status; |
370 | 372 | ||
371 | ACPI_FUNCTION_TRACE("hw_disable_all_gpes"); | 373 | ACPI_FUNCTION_TRACE(hw_disable_all_gpes); |
372 | 374 | ||
373 | status = acpi_ev_walk_gpe_list(acpi_hw_disable_gpe_block); | 375 | status = acpi_ev_walk_gpe_list(acpi_hw_disable_gpe_block); |
374 | status = acpi_ev_walk_gpe_list(acpi_hw_clear_gpe_block); | 376 | status = acpi_ev_walk_gpe_list(acpi_hw_clear_gpe_block); |
@@ -391,7 +393,7 @@ acpi_status acpi_hw_enable_all_runtime_gpes(void) | |||
391 | { | 393 | { |
392 | acpi_status status; | 394 | acpi_status status; |
393 | 395 | ||
394 | ACPI_FUNCTION_TRACE("hw_enable_all_runtime_gpes"); | 396 | ACPI_FUNCTION_TRACE(hw_enable_all_runtime_gpes); |
395 | 397 | ||
396 | status = acpi_ev_walk_gpe_list(acpi_hw_enable_runtime_gpe_block); | 398 | status = acpi_ev_walk_gpe_list(acpi_hw_enable_runtime_gpe_block); |
397 | return_ACPI_STATUS(status); | 399 | return_ACPI_STATUS(status); |
@@ -413,7 +415,7 @@ acpi_status acpi_hw_enable_all_wakeup_gpes(void) | |||
413 | { | 415 | { |
414 | acpi_status status; | 416 | acpi_status status; |
415 | 417 | ||
416 | ACPI_FUNCTION_TRACE("hw_enable_all_wakeup_gpes"); | 418 | ACPI_FUNCTION_TRACE(hw_enable_all_wakeup_gpes); |
417 | 419 | ||
418 | status = acpi_ev_walk_gpe_list(acpi_hw_enable_wakeup_gpe_block); | 420 | status = acpi_ev_walk_gpe_list(acpi_hw_enable_wakeup_gpe_block); |
419 | return_ACPI_STATUS(status); | 421 | return_ACPI_STATUS(status); |
diff --git a/drivers/acpi/hardware/hwregs.c b/drivers/acpi/hardware/hwregs.c index e1fe75498415..ae142de19507 100644 --- a/drivers/acpi/hardware/hwregs.c +++ b/drivers/acpi/hardware/hwregs.c | |||
@@ -43,8 +43,6 @@ | |||
43 | * POSSIBILITY OF SUCH DAMAGES. | 43 | * POSSIBILITY OF SUCH DAMAGES. |
44 | */ | 44 | */ |
45 | 45 | ||
46 | #include <linux/module.h> | ||
47 | |||
48 | #include <acpi/acpi.h> | 46 | #include <acpi/acpi.h> |
49 | #include <acpi/acnamesp.h> | 47 | #include <acpi/acnamesp.h> |
50 | #include <acpi/acevents.h> | 48 | #include <acpi/acevents.h> |
@@ -63,23 +61,21 @@ ACPI_MODULE_NAME("hwregs") | |||
63 | * DESCRIPTION: Clears all fixed and general purpose status bits | 61 | * DESCRIPTION: Clears all fixed and general purpose status bits |
64 | * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED | 62 | * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED |
65 | * | 63 | * |
64 | * NOTE: TBD: Flags parameter is obsolete, to be removed | ||
65 | * | ||
66 | ******************************************************************************/ | 66 | ******************************************************************************/ |
67 | acpi_status acpi_hw_clear_acpi_status(u32 flags) | 67 | acpi_status acpi_hw_clear_acpi_status(u32 flags) |
68 | { | 68 | { |
69 | acpi_status status; | 69 | acpi_status status; |
70 | acpi_cpu_flags lock_flags = 0; | ||
70 | 71 | ||
71 | ACPI_FUNCTION_TRACE("hw_clear_acpi_status"); | 72 | ACPI_FUNCTION_TRACE(hw_clear_acpi_status); |
72 | 73 | ||
73 | ACPI_DEBUG_PRINT((ACPI_DB_IO, "About to write %04X to %04X\n", | 74 | ACPI_DEBUG_PRINT((ACPI_DB_IO, "About to write %04X to %04X\n", |
74 | ACPI_BITMASK_ALL_FIXED_STATUS, | 75 | ACPI_BITMASK_ALL_FIXED_STATUS, |
75 | (u16) acpi_gbl_FADT->xpm1a_evt_blk.address)); | 76 | (u16) acpi_gbl_FADT->xpm1a_evt_blk.address)); |
76 | 77 | ||
77 | if (flags & ACPI_MTX_LOCK) { | 78 | lock_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock); |
78 | status = acpi_ut_acquire_mutex(ACPI_MTX_HARDWARE); | ||
79 | if (ACPI_FAILURE(status)) { | ||
80 | return_ACPI_STATUS(status); | ||
81 | } | ||
82 | } | ||
83 | 79 | ||
84 | status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, | 80 | status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, |
85 | ACPI_REGISTER_PM1_STATUS, | 81 | ACPI_REGISTER_PM1_STATUS, |
@@ -104,9 +100,7 @@ acpi_status acpi_hw_clear_acpi_status(u32 flags) | |||
104 | status = acpi_ev_walk_gpe_list(acpi_hw_clear_gpe_block); | 100 | status = acpi_ev_walk_gpe_list(acpi_hw_clear_gpe_block); |
105 | 101 | ||
106 | unlock_and_exit: | 102 | unlock_and_exit: |
107 | if (flags & ACPI_MTX_LOCK) { | 103 | acpi_os_release_lock(acpi_gbl_hardware_lock, lock_flags); |
108 | (void)acpi_ut_release_mutex(ACPI_MTX_HARDWARE); | ||
109 | } | ||
110 | return_ACPI_STATUS(status); | 104 | return_ACPI_STATUS(status); |
111 | } | 105 | } |
112 | 106 | ||
@@ -129,10 +123,9 @@ acpi_status | |||
129 | acpi_get_sleep_type_data(u8 sleep_state, u8 * sleep_type_a, u8 * sleep_type_b) | 123 | acpi_get_sleep_type_data(u8 sleep_state, u8 * sleep_type_a, u8 * sleep_type_b) |
130 | { | 124 | { |
131 | acpi_status status = AE_OK; | 125 | acpi_status status = AE_OK; |
132 | struct acpi_parameter_info info; | 126 | struct acpi_evaluate_info *info; |
133 | char *sleep_state_name; | ||
134 | 127 | ||
135 | ACPI_FUNCTION_TRACE("acpi_get_sleep_type_data"); | 128 | ACPI_FUNCTION_TRACE(acpi_get_sleep_type_data); |
136 | 129 | ||
137 | /* Validate parameters */ | 130 | /* Validate parameters */ |
138 | 131 | ||
@@ -140,34 +133,39 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 * sleep_type_a, u8 * sleep_type_b) | |||
140 | return_ACPI_STATUS(AE_BAD_PARAMETER); | 133 | return_ACPI_STATUS(AE_BAD_PARAMETER); |
141 | } | 134 | } |
142 | 135 | ||
143 | /* Evaluate the namespace object containing the values for this state */ | 136 | /* Allocate the evaluation information block */ |
137 | |||
138 | info = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_evaluate_info)); | ||
139 | if (!info) { | ||
140 | return_ACPI_STATUS(AE_NO_MEMORY); | ||
141 | } | ||
144 | 142 | ||
145 | info.parameters = NULL; | 143 | info->pathname = |
146 | info.return_object = NULL; | ||
147 | sleep_state_name = | ||
148 | ACPI_CAST_PTR(char, acpi_gbl_sleep_state_names[sleep_state]); | 144 | ACPI_CAST_PTR(char, acpi_gbl_sleep_state_names[sleep_state]); |
149 | 145 | ||
150 | status = acpi_ns_evaluate_by_name(sleep_state_name, &info); | 146 | /* Evaluate the namespace object containing the values for this state */ |
147 | |||
148 | status = acpi_ns_evaluate(info); | ||
151 | if (ACPI_FAILURE(status)) { | 149 | if (ACPI_FAILURE(status)) { |
152 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, | 150 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, |
153 | "%s while evaluating sleep_state [%s]\n", | 151 | "%s while evaluating SleepState [%s]\n", |
154 | acpi_format_exception(status), | 152 | acpi_format_exception(status), |
155 | sleep_state_name)); | 153 | info->pathname)); |
156 | 154 | ||
157 | return_ACPI_STATUS(status); | 155 | goto cleanup; |
158 | } | 156 | } |
159 | 157 | ||
160 | /* Must have a return object */ | 158 | /* Must have a return object */ |
161 | 159 | ||
162 | if (!info.return_object) { | 160 | if (!info->return_object) { |
163 | ACPI_ERROR((AE_INFO, "No Sleep State object returned from [%s]", | 161 | ACPI_ERROR((AE_INFO, "No Sleep State object returned from [%s]", |
164 | sleep_state_name)); | 162 | info->pathname)); |
165 | status = AE_NOT_EXIST; | 163 | status = AE_NOT_EXIST; |
166 | } | 164 | } |
167 | 165 | ||
168 | /* It must be of type Package */ | 166 | /* It must be of type Package */ |
169 | 167 | ||
170 | else if (ACPI_GET_OBJECT_TYPE(info.return_object) != ACPI_TYPE_PACKAGE) { | 168 | else if (ACPI_GET_OBJECT_TYPE(info->return_object) != ACPI_TYPE_PACKAGE) { |
171 | ACPI_ERROR((AE_INFO, | 169 | ACPI_ERROR((AE_INFO, |
172 | "Sleep State return object is not a Package")); | 170 | "Sleep State return object is not a Package")); |
173 | status = AE_AML_OPERAND_TYPE; | 171 | status = AE_AML_OPERAND_TYPE; |
@@ -180,7 +178,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 * sleep_type_a, u8 * sleep_type_b) | |||
180 | * by BIOS vendors seems to be to have 2 or more elements, at least | 178 | * by BIOS vendors seems to be to have 2 or more elements, at least |
181 | * one per sleep type (A/B). | 179 | * one per sleep type (A/B). |
182 | */ | 180 | */ |
183 | else if (info.return_object->package.count < 2) { | 181 | else if (info->return_object->package.count < 2) { |
184 | ACPI_ERROR((AE_INFO, | 182 | ACPI_ERROR((AE_INFO, |
185 | "Sleep State return package does not have at least two elements")); | 183 | "Sleep State return package does not have at least two elements")); |
186 | status = AE_AML_NO_OPERAND; | 184 | status = AE_AML_NO_OPERAND; |
@@ -188,39 +186,42 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 * sleep_type_a, u8 * sleep_type_b) | |||
188 | 186 | ||
189 | /* The first two elements must both be of type Integer */ | 187 | /* The first two elements must both be of type Integer */ |
190 | 188 | ||
191 | else if ((ACPI_GET_OBJECT_TYPE(info.return_object->package.elements[0]) | 189 | else if ((ACPI_GET_OBJECT_TYPE(info->return_object->package.elements[0]) |
192 | != ACPI_TYPE_INTEGER) || | 190 | != ACPI_TYPE_INTEGER) || |
193 | (ACPI_GET_OBJECT_TYPE(info.return_object->package.elements[1]) | 191 | (ACPI_GET_OBJECT_TYPE(info->return_object->package.elements[1]) |
194 | != ACPI_TYPE_INTEGER)) { | 192 | != ACPI_TYPE_INTEGER)) { |
195 | ACPI_ERROR((AE_INFO, | 193 | ACPI_ERROR((AE_INFO, |
196 | "Sleep State return package elements are not both Integers (%s, %s)", | 194 | "Sleep State return package elements are not both Integers (%s, %s)", |
197 | acpi_ut_get_object_type_name(info.return_object-> | 195 | acpi_ut_get_object_type_name(info->return_object-> |
198 | package.elements[0]), | 196 | package.elements[0]), |
199 | acpi_ut_get_object_type_name(info.return_object-> | 197 | acpi_ut_get_object_type_name(info->return_object-> |
200 | package.elements[1]))); | 198 | package.elements[1]))); |
201 | status = AE_AML_OPERAND_TYPE; | 199 | status = AE_AML_OPERAND_TYPE; |
202 | } else { | 200 | } else { |
203 | /* Valid _Sx_ package size, type, and value */ | 201 | /* Valid _Sx_ package size, type, and value */ |
204 | 202 | ||
205 | *sleep_type_a = (u8) | 203 | *sleep_type_a = (u8) |
206 | (info.return_object->package.elements[0])->integer.value; | 204 | (info->return_object->package.elements[0])->integer.value; |
207 | *sleep_type_b = (u8) | 205 | *sleep_type_b = (u8) |
208 | (info.return_object->package.elements[1])->integer.value; | 206 | (info->return_object->package.elements[1])->integer.value; |
209 | } | 207 | } |
210 | 208 | ||
211 | if (ACPI_FAILURE(status)) { | 209 | if (ACPI_FAILURE(status)) { |
212 | ACPI_EXCEPTION((AE_INFO, status, | 210 | ACPI_EXCEPTION((AE_INFO, status, |
213 | "While evaluating sleep_state [%s], bad Sleep object %p type %s", | 211 | "While evaluating SleepState [%s], bad Sleep object %p type %s", |
214 | sleep_state_name, info.return_object, | 212 | info->pathname, info->return_object, |
215 | acpi_ut_get_object_type_name(info. | 213 | acpi_ut_get_object_type_name(info-> |
216 | return_object))); | 214 | return_object))); |
217 | } | 215 | } |
218 | 216 | ||
219 | acpi_ut_remove_reference(info.return_object); | 217 | acpi_ut_remove_reference(info->return_object); |
218 | |||
219 | cleanup: | ||
220 | ACPI_FREE(info); | ||
220 | return_ACPI_STATUS(status); | 221 | return_ACPI_STATUS(status); |
221 | } | 222 | } |
222 | 223 | ||
223 | EXPORT_SYMBOL(acpi_get_sleep_type_data); | 224 | ACPI_EXPORT_SYMBOL(acpi_get_sleep_type_data) |
224 | 225 | ||
225 | /******************************************************************************* | 226 | /******************************************************************************* |
226 | * | 227 | * |
@@ -233,13 +234,12 @@ EXPORT_SYMBOL(acpi_get_sleep_type_data); | |||
233 | * DESCRIPTION: Map register_id into a register bitmask. | 234 | * DESCRIPTION: Map register_id into a register bitmask. |
234 | * | 235 | * |
235 | ******************************************************************************/ | 236 | ******************************************************************************/ |
236 | |||
237 | struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id) | 237 | struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id) |
238 | { | 238 | { |
239 | ACPI_FUNCTION_ENTRY(); | 239 | ACPI_FUNCTION_ENTRY(); |
240 | 240 | ||
241 | if (register_id > ACPI_BITREG_MAX) { | 241 | if (register_id > ACPI_BITREG_MAX) { |
242 | ACPI_ERROR((AE_INFO, "Invalid bit_register ID: %X", | 242 | ACPI_ERROR((AE_INFO, "Invalid BitRegister ID: %X", |
243 | register_id)); | 243 | register_id)); |
244 | return (NULL); | 244 | return (NULL); |
245 | } | 245 | } |
@@ -260,6 +260,8 @@ struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id) | |||
260 | * | 260 | * |
261 | * DESCRIPTION: ACPI bit_register read function. | 261 | * DESCRIPTION: ACPI bit_register read function. |
262 | * | 262 | * |
263 | * NOTE: TBD: Flags parameter is obsolete, to be removed | ||
264 | * | ||
263 | ******************************************************************************/ | 265 | ******************************************************************************/ |
264 | 266 | ||
265 | acpi_status acpi_get_register(u32 register_id, u32 * return_value, u32 flags) | 267 | acpi_status acpi_get_register(u32 register_id, u32 * return_value, u32 flags) |
@@ -268,7 +270,7 @@ acpi_status acpi_get_register(u32 register_id, u32 * return_value, u32 flags) | |||
268 | struct acpi_bit_register_info *bit_reg_info; | 270 | struct acpi_bit_register_info *bit_reg_info; |
269 | acpi_status status; | 271 | acpi_status status; |
270 | 272 | ||
271 | ACPI_FUNCTION_TRACE("acpi_get_register"); | 273 | ACPI_FUNCTION_TRACE(acpi_get_register); |
272 | 274 | ||
273 | /* Get the info structure corresponding to the requested ACPI Register */ | 275 | /* Get the info structure corresponding to the requested ACPI Register */ |
274 | 276 | ||
@@ -277,24 +279,14 @@ acpi_status acpi_get_register(u32 register_id, u32 * return_value, u32 flags) | |||
277 | return_ACPI_STATUS(AE_BAD_PARAMETER); | 279 | return_ACPI_STATUS(AE_BAD_PARAMETER); |
278 | } | 280 | } |
279 | 281 | ||
280 | if (flags & ACPI_MTX_LOCK) { | ||
281 | status = acpi_ut_acquire_mutex(ACPI_MTX_HARDWARE); | ||
282 | if (ACPI_FAILURE(status)) { | ||
283 | return_ACPI_STATUS(status); | ||
284 | } | ||
285 | } | ||
286 | |||
287 | /* Read from the register */ | 282 | /* Read from the register */ |
288 | 283 | ||
289 | status = acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK, | 284 | status = acpi_hw_register_read(ACPI_MTX_LOCK, |
290 | bit_reg_info->parent_register, | 285 | bit_reg_info->parent_register, |
291 | ®ister_value); | 286 | ®ister_value); |
292 | 287 | ||
293 | if (flags & ACPI_MTX_LOCK) { | ||
294 | (void)acpi_ut_release_mutex(ACPI_MTX_HARDWARE); | ||
295 | } | ||
296 | |||
297 | if (ACPI_SUCCESS(status)) { | 288 | if (ACPI_SUCCESS(status)) { |
289 | |||
298 | /* Normalize the value that was read */ | 290 | /* Normalize the value that was read */ |
299 | 291 | ||
300 | register_value = | 292 | register_value = |
@@ -311,7 +303,7 @@ acpi_status acpi_get_register(u32 register_id, u32 * return_value, u32 flags) | |||
311 | return_ACPI_STATUS(status); | 303 | return_ACPI_STATUS(status); |
312 | } | 304 | } |
313 | 305 | ||
314 | EXPORT_SYMBOL(acpi_get_register); | 306 | ACPI_EXPORT_SYMBOL(acpi_get_register) |
315 | 307 | ||
316 | /******************************************************************************* | 308 | /******************************************************************************* |
317 | * | 309 | * |
@@ -326,31 +318,28 @@ EXPORT_SYMBOL(acpi_get_register); | |||
326 | * | 318 | * |
327 | * DESCRIPTION: ACPI Bit Register write function. | 319 | * DESCRIPTION: ACPI Bit Register write function. |
328 | * | 320 | * |
321 | * NOTE: TBD: Flags parameter is obsolete, to be removed | ||
322 | * | ||
329 | ******************************************************************************/ | 323 | ******************************************************************************/ |
330 | |||
331 | acpi_status acpi_set_register(u32 register_id, u32 value, u32 flags) | 324 | acpi_status acpi_set_register(u32 register_id, u32 value, u32 flags) |
332 | { | 325 | { |
333 | u32 register_value = 0; | 326 | u32 register_value = 0; |
334 | struct acpi_bit_register_info *bit_reg_info; | 327 | struct acpi_bit_register_info *bit_reg_info; |
335 | acpi_status status; | 328 | acpi_status status; |
329 | acpi_cpu_flags lock_flags; | ||
336 | 330 | ||
337 | ACPI_FUNCTION_TRACE_U32("acpi_set_register", register_id); | 331 | ACPI_FUNCTION_TRACE_U32(acpi_set_register, register_id); |
338 | 332 | ||
339 | /* Get the info structure corresponding to the requested ACPI Register */ | 333 | /* Get the info structure corresponding to the requested ACPI Register */ |
340 | 334 | ||
341 | bit_reg_info = acpi_hw_get_bit_register_info(register_id); | 335 | bit_reg_info = acpi_hw_get_bit_register_info(register_id); |
342 | if (!bit_reg_info) { | 336 | if (!bit_reg_info) { |
343 | ACPI_ERROR((AE_INFO, "Bad ACPI HW register_id: %X", | 337 | ACPI_ERROR((AE_INFO, "Bad ACPI HW RegisterId: %X", |
344 | register_id)); | 338 | register_id)); |
345 | return_ACPI_STATUS(AE_BAD_PARAMETER); | 339 | return_ACPI_STATUS(AE_BAD_PARAMETER); |
346 | } | 340 | } |
347 | 341 | ||
348 | if (flags & ACPI_MTX_LOCK) { | 342 | lock_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock); |
349 | status = acpi_ut_acquire_mutex(ACPI_MTX_HARDWARE); | ||
350 | if (ACPI_FAILURE(status)) { | ||
351 | return_ACPI_STATUS(status); | ||
352 | } | ||
353 | } | ||
354 | 343 | ||
355 | /* Always do a register read first so we can insert the new bits */ | 344 | /* Always do a register read first so we can insert the new bits */ |
356 | 345 | ||
@@ -458,9 +447,7 @@ acpi_status acpi_set_register(u32 register_id, u32 value, u32 flags) | |||
458 | 447 | ||
459 | unlock_and_exit: | 448 | unlock_and_exit: |
460 | 449 | ||
461 | if (flags & ACPI_MTX_LOCK) { | 450 | acpi_os_release_lock(acpi_gbl_hardware_lock, lock_flags); |
462 | (void)acpi_ut_release_mutex(ACPI_MTX_HARDWARE); | ||
463 | } | ||
464 | 451 | ||
465 | /* Normalize the value that was read */ | 452 | /* Normalize the value that was read */ |
466 | 453 | ||
@@ -474,7 +461,7 @@ acpi_status acpi_set_register(u32 register_id, u32 value, u32 flags) | |||
474 | return_ACPI_STATUS(status); | 461 | return_ACPI_STATUS(status); |
475 | } | 462 | } |
476 | 463 | ||
477 | EXPORT_SYMBOL(acpi_set_register); | 464 | ACPI_EXPORT_SYMBOL(acpi_set_register) |
478 | 465 | ||
479 | /****************************************************************************** | 466 | /****************************************************************************** |
480 | * | 467 | * |
@@ -490,21 +477,18 @@ EXPORT_SYMBOL(acpi_set_register); | |||
490 | * given offset. | 477 | * given offset. |
491 | * | 478 | * |
492 | ******************************************************************************/ | 479 | ******************************************************************************/ |
493 | |||
494 | acpi_status | 480 | acpi_status |
495 | acpi_hw_register_read(u8 use_lock, u32 register_id, u32 * return_value) | 481 | acpi_hw_register_read(u8 use_lock, u32 register_id, u32 * return_value) |
496 | { | 482 | { |
497 | u32 value1 = 0; | 483 | u32 value1 = 0; |
498 | u32 value2 = 0; | 484 | u32 value2 = 0; |
499 | acpi_status status; | 485 | acpi_status status; |
486 | acpi_cpu_flags lock_flags = 0; | ||
500 | 487 | ||
501 | ACPI_FUNCTION_TRACE("hw_register_read"); | 488 | ACPI_FUNCTION_TRACE(hw_register_read); |
502 | 489 | ||
503 | if (ACPI_MTX_LOCK == use_lock) { | 490 | if (ACPI_MTX_LOCK == use_lock) { |
504 | status = acpi_ut_acquire_mutex(ACPI_MTX_HARDWARE); | 491 | lock_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock); |
505 | if (ACPI_FAILURE(status)) { | ||
506 | return_ACPI_STATUS(status); | ||
507 | } | ||
508 | } | 492 | } |
509 | 493 | ||
510 | switch (register_id) { | 494 | switch (register_id) { |
@@ -582,7 +566,7 @@ acpi_hw_register_read(u8 use_lock, u32 register_id, u32 * return_value) | |||
582 | 566 | ||
583 | unlock_and_exit: | 567 | unlock_and_exit: |
584 | if (ACPI_MTX_LOCK == use_lock) { | 568 | if (ACPI_MTX_LOCK == use_lock) { |
585 | (void)acpi_ut_release_mutex(ACPI_MTX_HARDWARE); | 569 | acpi_os_release_lock(acpi_gbl_hardware_lock, lock_flags); |
586 | } | 570 | } |
587 | 571 | ||
588 | if (ACPI_SUCCESS(status)) { | 572 | if (ACPI_SUCCESS(status)) { |
@@ -610,14 +594,12 @@ acpi_hw_register_read(u8 use_lock, u32 register_id, u32 * return_value) | |||
610 | acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value) | 594 | acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value) |
611 | { | 595 | { |
612 | acpi_status status; | 596 | acpi_status status; |
597 | acpi_cpu_flags lock_flags = 0; | ||
613 | 598 | ||
614 | ACPI_FUNCTION_TRACE("hw_register_write"); | 599 | ACPI_FUNCTION_TRACE(hw_register_write); |
615 | 600 | ||
616 | if (ACPI_MTX_LOCK == use_lock) { | 601 | if (ACPI_MTX_LOCK == use_lock) { |
617 | status = acpi_ut_acquire_mutex(ACPI_MTX_HARDWARE); | 602 | lock_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock); |
618 | if (ACPI_FAILURE(status)) { | ||
619 | return_ACPI_STATUS(status); | ||
620 | } | ||
621 | } | 603 | } |
622 | 604 | ||
623 | switch (register_id) { | 605 | switch (register_id) { |
@@ -707,7 +689,7 @@ acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value) | |||
707 | 689 | ||
708 | unlock_and_exit: | 690 | unlock_and_exit: |
709 | if (ACPI_MTX_LOCK == use_lock) { | 691 | if (ACPI_MTX_LOCK == use_lock) { |
710 | (void)acpi_ut_release_mutex(ACPI_MTX_HARDWARE); | 692 | acpi_os_release_lock(acpi_gbl_hardware_lock, lock_flags); |
711 | } | 693 | } |
712 | 694 | ||
713 | return_ACPI_STATUS(status); | 695 | return_ACPI_STATUS(status); |
@@ -733,7 +715,7 @@ acpi_hw_low_level_read(u32 width, u32 * value, struct acpi_generic_address *reg) | |||
733 | u64 address; | 715 | u64 address; |
734 | acpi_status status; | 716 | acpi_status status; |
735 | 717 | ||
736 | ACPI_FUNCTION_NAME("hw_low_level_read"); | 718 | ACPI_FUNCTION_NAME(hw_low_level_read); |
737 | 719 | ||
738 | /* | 720 | /* |
739 | * Must have a valid pointer to a GAS structure, and | 721 | * Must have a valid pointer to a GAS structure, and |
@@ -805,7 +787,7 @@ acpi_hw_low_level_write(u32 width, u32 value, struct acpi_generic_address * reg) | |||
805 | u64 address; | 787 | u64 address; |
806 | acpi_status status; | 788 | acpi_status status; |
807 | 789 | ||
808 | ACPI_FUNCTION_NAME("hw_low_level_write"); | 790 | ACPI_FUNCTION_NAME(hw_low_level_write); |
809 | 791 | ||
810 | /* | 792 | /* |
811 | * Must have a valid pointer to a GAS structure, and | 793 | * Must have a valid pointer to a GAS structure, and |
diff --git a/drivers/acpi/hardware/hwsleep.c b/drivers/acpi/hardware/hwsleep.c index 89269272fd62..8bb43cae60c2 100644 --- a/drivers/acpi/hardware/hwsleep.c +++ b/drivers/acpi/hardware/hwsleep.c | |||
@@ -42,7 +42,6 @@ | |||
42 | * POSSIBILITY OF SUCH DAMAGES. | 42 | * POSSIBILITY OF SUCH DAMAGES. |
43 | */ | 43 | */ |
44 | 44 | ||
45 | #include <linux/module.h> | ||
46 | #include <acpi/acpi.h> | 45 | #include <acpi/acpi.h> |
47 | 46 | ||
48 | #define _COMPONENT ACPI_HARDWARE | 47 | #define _COMPONENT ACPI_HARDWARE |
@@ -64,7 +63,7 @@ acpi_status | |||
64 | acpi_set_firmware_waking_vector(acpi_physical_address physical_address) | 63 | acpi_set_firmware_waking_vector(acpi_physical_address physical_address) |
65 | { | 64 | { |
66 | 65 | ||
67 | ACPI_FUNCTION_TRACE("acpi_set_firmware_waking_vector"); | 66 | ACPI_FUNCTION_TRACE(acpi_set_firmware_waking_vector); |
68 | 67 | ||
69 | /* Set the vector */ | 68 | /* Set the vector */ |
70 | 69 | ||
@@ -79,6 +78,8 @@ acpi_set_firmware_waking_vector(acpi_physical_address physical_address) | |||
79 | return_ACPI_STATUS(AE_OK); | 78 | return_ACPI_STATUS(AE_OK); |
80 | } | 79 | } |
81 | 80 | ||
81 | ACPI_EXPORT_SYMBOL(acpi_set_firmware_waking_vector) | ||
82 | |||
82 | /******************************************************************************* | 83 | /******************************************************************************* |
83 | * | 84 | * |
84 | * FUNCTION: acpi_get_firmware_waking_vector | 85 | * FUNCTION: acpi_get_firmware_waking_vector |
@@ -92,13 +93,12 @@ acpi_set_firmware_waking_vector(acpi_physical_address physical_address) | |||
92 | * DESCRIPTION: Access function for the firmware_waking_vector field in FACS | 93 | * DESCRIPTION: Access function for the firmware_waking_vector field in FACS |
93 | * | 94 | * |
94 | ******************************************************************************/ | 95 | ******************************************************************************/ |
95 | |||
96 | #ifdef ACPI_FUTURE_USAGE | 96 | #ifdef ACPI_FUTURE_USAGE |
97 | acpi_status | 97 | acpi_status |
98 | acpi_get_firmware_waking_vector(acpi_physical_address * physical_address) | 98 | acpi_get_firmware_waking_vector(acpi_physical_address * physical_address) |
99 | { | 99 | { |
100 | 100 | ||
101 | ACPI_FUNCTION_TRACE("acpi_get_firmware_waking_vector"); | 101 | ACPI_FUNCTION_TRACE(acpi_get_firmware_waking_vector); |
102 | 102 | ||
103 | if (!physical_address) { | 103 | if (!physical_address) { |
104 | return_ACPI_STATUS(AE_BAD_PARAMETER); | 104 | return_ACPI_STATUS(AE_BAD_PARAMETER); |
@@ -118,6 +118,8 @@ acpi_get_firmware_waking_vector(acpi_physical_address * physical_address) | |||
118 | 118 | ||
119 | return_ACPI_STATUS(AE_OK); | 119 | return_ACPI_STATUS(AE_OK); |
120 | } | 120 | } |
121 | |||
122 | ACPI_EXPORT_SYMBOL(acpi_get_firmware_waking_vector) | ||
121 | #endif | 123 | #endif |
122 | 124 | ||
123 | /******************************************************************************* | 125 | /******************************************************************************* |
@@ -134,14 +136,13 @@ acpi_get_firmware_waking_vector(acpi_physical_address * physical_address) | |||
134 | * various OS-specific tasks between the two steps. | 136 | * various OS-specific tasks between the two steps. |
135 | * | 137 | * |
136 | ******************************************************************************/ | 138 | ******************************************************************************/ |
137 | |||
138 | acpi_status acpi_enter_sleep_state_prep(u8 sleep_state) | 139 | acpi_status acpi_enter_sleep_state_prep(u8 sleep_state) |
139 | { | 140 | { |
140 | acpi_status status; | 141 | acpi_status status; |
141 | struct acpi_object_list arg_list; | 142 | struct acpi_object_list arg_list; |
142 | union acpi_object arg; | 143 | union acpi_object arg; |
143 | 144 | ||
144 | ACPI_FUNCTION_TRACE("acpi_enter_sleep_state_prep"); | 145 | ACPI_FUNCTION_TRACE(acpi_enter_sleep_state_prep); |
145 | 146 | ||
146 | /* | 147 | /* |
147 | * _PSW methods could be run here to enable wake-on keyboard, LAN, etc. | 148 | * _PSW methods could be run here to enable wake-on keyboard, LAN, etc. |
@@ -206,6 +207,8 @@ acpi_status acpi_enter_sleep_state_prep(u8 sleep_state) | |||
206 | return_ACPI_STATUS(AE_OK); | 207 | return_ACPI_STATUS(AE_OK); |
207 | } | 208 | } |
208 | 209 | ||
210 | ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_prep) | ||
211 | |||
209 | /******************************************************************************* | 212 | /******************************************************************************* |
210 | * | 213 | * |
211 | * FUNCTION: acpi_enter_sleep_state | 214 | * FUNCTION: acpi_enter_sleep_state |
@@ -218,7 +221,6 @@ acpi_status acpi_enter_sleep_state_prep(u8 sleep_state) | |||
218 | * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED | 221 | * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED |
219 | * | 222 | * |
220 | ******************************************************************************/ | 223 | ******************************************************************************/ |
221 | |||
222 | acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state) | 224 | acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state) |
223 | { | 225 | { |
224 | u32 PM1Acontrol; | 226 | u32 PM1Acontrol; |
@@ -228,7 +230,7 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state) | |||
228 | u32 in_value; | 230 | u32 in_value; |
229 | acpi_status status; | 231 | acpi_status status; |
230 | 232 | ||
231 | ACPI_FUNCTION_TRACE("acpi_enter_sleep_state"); | 233 | ACPI_FUNCTION_TRACE(acpi_enter_sleep_state); |
232 | 234 | ||
233 | if ((acpi_gbl_sleep_type_a > ACPI_SLEEP_TYPE_MAX) || | 235 | if ((acpi_gbl_sleep_type_a > ACPI_SLEEP_TYPE_MAX) || |
234 | (acpi_gbl_sleep_type_b > ACPI_SLEEP_TYPE_MAX)) { | 236 | (acpi_gbl_sleep_type_b > ACPI_SLEEP_TYPE_MAX)) { |
@@ -378,7 +380,7 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state) | |||
378 | return_ACPI_STATUS(AE_OK); | 380 | return_ACPI_STATUS(AE_OK); |
379 | } | 381 | } |
380 | 382 | ||
381 | EXPORT_SYMBOL(acpi_enter_sleep_state); | 383 | ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state) |
382 | 384 | ||
383 | /******************************************************************************* | 385 | /******************************************************************************* |
384 | * | 386 | * |
@@ -392,13 +394,12 @@ EXPORT_SYMBOL(acpi_enter_sleep_state); | |||
392 | * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED | 394 | * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED |
393 | * | 395 | * |
394 | ******************************************************************************/ | 396 | ******************************************************************************/ |
395 | |||
396 | acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void) | 397 | acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void) |
397 | { | 398 | { |
398 | u32 in_value; | 399 | u32 in_value; |
399 | acpi_status status; | 400 | acpi_status status; |
400 | 401 | ||
401 | ACPI_FUNCTION_TRACE("acpi_enter_sleep_state_s4bios"); | 402 | ACPI_FUNCTION_TRACE(acpi_enter_sleep_state_s4bios); |
402 | 403 | ||
403 | status = | 404 | status = |
404 | acpi_set_register(ACPI_BITREG_WAKE_STATUS, 1, ACPI_MTX_DO_NOT_LOCK); | 405 | acpi_set_register(ACPI_BITREG_WAKE_STATUS, 1, ACPI_MTX_DO_NOT_LOCK); |
@@ -443,7 +444,7 @@ acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void) | |||
443 | return_ACPI_STATUS(AE_OK); | 444 | return_ACPI_STATUS(AE_OK); |
444 | } | 445 | } |
445 | 446 | ||
446 | EXPORT_SYMBOL(acpi_enter_sleep_state_s4bios); | 447 | ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_s4bios) |
447 | 448 | ||
448 | /******************************************************************************* | 449 | /******************************************************************************* |
449 | * | 450 | * |
@@ -457,7 +458,6 @@ EXPORT_SYMBOL(acpi_enter_sleep_state_s4bios); | |||
457 | * Called with interrupts ENABLED. | 458 | * Called with interrupts ENABLED. |
458 | * | 459 | * |
459 | ******************************************************************************/ | 460 | ******************************************************************************/ |
460 | |||
461 | acpi_status acpi_leave_sleep_state(u8 sleep_state) | 461 | acpi_status acpi_leave_sleep_state(u8 sleep_state) |
462 | { | 462 | { |
463 | struct acpi_object_list arg_list; | 463 | struct acpi_object_list arg_list; |
@@ -468,7 +468,7 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state) | |||
468 | u32 PM1Acontrol; | 468 | u32 PM1Acontrol; |
469 | u32 PM1Bcontrol; | 469 | u32 PM1Bcontrol; |
470 | 470 | ||
471 | ACPI_FUNCTION_TRACE("acpi_leave_sleep_state"); | 471 | ACPI_FUNCTION_TRACE(acpi_leave_sleep_state); |
472 | 472 | ||
473 | /* | 473 | /* |
474 | * Set SLP_TYPE and SLP_EN to state S0. | 474 | * Set SLP_TYPE and SLP_EN to state S0. |
@@ -490,6 +490,7 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state) | |||
490 | ACPI_REGISTER_PM1_CONTROL, | 490 | ACPI_REGISTER_PM1_CONTROL, |
491 | &PM1Acontrol); | 491 | &PM1Acontrol); |
492 | if (ACPI_SUCCESS(status)) { | 492 | if (ACPI_SUCCESS(status)) { |
493 | |||
493 | /* Clear SLP_EN and SLP_TYP fields */ | 494 | /* Clear SLP_EN and SLP_TYP fields */ |
494 | 495 | ||
495 | PM1Acontrol &= ~(sleep_type_reg_info->access_bit_mask | | 496 | PM1Acontrol &= ~(sleep_type_reg_info->access_bit_mask | |
@@ -583,3 +584,5 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state) | |||
583 | 584 | ||
584 | return_ACPI_STATUS(status); | 585 | return_ACPI_STATUS(status); |
585 | } | 586 | } |
587 | |||
588 | ACPI_EXPORT_SYMBOL(acpi_leave_sleep_state) | ||
diff --git a/drivers/acpi/hardware/hwtimer.c b/drivers/acpi/hardware/hwtimer.c index fc10b7cb456f..c4ec47c939fd 100644 --- a/drivers/acpi/hardware/hwtimer.c +++ b/drivers/acpi/hardware/hwtimer.c | |||
@@ -42,7 +42,6 @@ | |||
42 | * POSSIBILITY OF SUCH DAMAGES. | 42 | * POSSIBILITY OF SUCH DAMAGES. |
43 | */ | 43 | */ |
44 | 44 | ||
45 | #include <linux/module.h> | ||
46 | #include <acpi/acpi.h> | 45 | #include <acpi/acpi.h> |
47 | 46 | ||
48 | #define _COMPONENT ACPI_HARDWARE | 47 | #define _COMPONENT ACPI_HARDWARE |
@@ -61,13 +60,13 @@ ACPI_MODULE_NAME("hwtimer") | |||
61 | ******************************************************************************/ | 60 | ******************************************************************************/ |
62 | acpi_status acpi_get_timer_resolution(u32 * resolution) | 61 | acpi_status acpi_get_timer_resolution(u32 * resolution) |
63 | { | 62 | { |
64 | ACPI_FUNCTION_TRACE("acpi_get_timer_resolution"); | 63 | ACPI_FUNCTION_TRACE(acpi_get_timer_resolution); |
65 | 64 | ||
66 | if (!resolution) { | 65 | if (!resolution) { |
67 | return_ACPI_STATUS(AE_BAD_PARAMETER); | 66 | return_ACPI_STATUS(AE_BAD_PARAMETER); |
68 | } | 67 | } |
69 | 68 | ||
70 | if (0 == acpi_gbl_FADT->tmr_val_ext) { | 69 | if (acpi_gbl_FADT->tmr_val_ext == 0) { |
71 | *resolution = 24; | 70 | *resolution = 24; |
72 | } else { | 71 | } else { |
73 | *resolution = 32; | 72 | *resolution = 32; |
@@ -76,6 +75,8 @@ acpi_status acpi_get_timer_resolution(u32 * resolution) | |||
76 | return_ACPI_STATUS(AE_OK); | 75 | return_ACPI_STATUS(AE_OK); |
77 | } | 76 | } |
78 | 77 | ||
78 | ACPI_EXPORT_SYMBOL(acpi_get_timer_resolution) | ||
79 | |||
79 | /****************************************************************************** | 80 | /****************************************************************************** |
80 | * | 81 | * |
81 | * FUNCTION: acpi_get_timer | 82 | * FUNCTION: acpi_get_timer |
@@ -87,12 +88,11 @@ acpi_status acpi_get_timer_resolution(u32 * resolution) | |||
87 | * DESCRIPTION: Obtains current value of ACPI PM Timer (in ticks). | 88 | * DESCRIPTION: Obtains current value of ACPI PM Timer (in ticks). |
88 | * | 89 | * |
89 | ******************************************************************************/ | 90 | ******************************************************************************/ |
90 | |||
91 | acpi_status acpi_get_timer(u32 * ticks) | 91 | acpi_status acpi_get_timer(u32 * ticks) |
92 | { | 92 | { |
93 | acpi_status status; | 93 | acpi_status status; |
94 | 94 | ||
95 | ACPI_FUNCTION_TRACE("acpi_get_timer"); | 95 | ACPI_FUNCTION_TRACE(acpi_get_timer); |
96 | 96 | ||
97 | if (!ticks) { | 97 | if (!ticks) { |
98 | return_ACPI_STATUS(AE_BAD_PARAMETER); | 98 | return_ACPI_STATUS(AE_BAD_PARAMETER); |
@@ -103,7 +103,7 @@ acpi_status acpi_get_timer(u32 * ticks) | |||
103 | return_ACPI_STATUS(status); | 103 | return_ACPI_STATUS(status); |
104 | } | 104 | } |
105 | 105 | ||
106 | EXPORT_SYMBOL(acpi_get_timer); | 106 | ACPI_EXPORT_SYMBOL(acpi_get_timer) |
107 | 107 | ||
108 | /****************************************************************************** | 108 | /****************************************************************************** |
109 | * | 109 | * |
@@ -133,7 +133,6 @@ EXPORT_SYMBOL(acpi_get_timer); | |||
133 | * 2**32 Ticks / 3,600,000 Ticks/Sec = 1193 sec or 19.88 minutes | 133 | * 2**32 Ticks / 3,600,000 Ticks/Sec = 1193 sec or 19.88 minutes |
134 | * | 134 | * |
135 | ******************************************************************************/ | 135 | ******************************************************************************/ |
136 | |||
137 | acpi_status | 136 | acpi_status |
138 | acpi_get_timer_duration(u32 start_ticks, u32 end_ticks, u32 * time_elapsed) | 137 | acpi_get_timer_duration(u32 start_ticks, u32 end_ticks, u32 * time_elapsed) |
139 | { | 138 | { |
@@ -141,7 +140,7 @@ acpi_get_timer_duration(u32 start_ticks, u32 end_ticks, u32 * time_elapsed) | |||
141 | u32 delta_ticks; | 140 | u32 delta_ticks; |
142 | acpi_integer quotient; | 141 | acpi_integer quotient; |
143 | 142 | ||
144 | ACPI_FUNCTION_TRACE("acpi_get_timer_duration"); | 143 | ACPI_FUNCTION_TRACE(acpi_get_timer_duration); |
145 | 144 | ||
146 | if (!time_elapsed) { | 145 | if (!time_elapsed) { |
147 | return_ACPI_STATUS(AE_BAD_PARAMETER); | 146 | return_ACPI_STATUS(AE_BAD_PARAMETER); |
@@ -154,7 +153,8 @@ acpi_get_timer_duration(u32 start_ticks, u32 end_ticks, u32 * time_elapsed) | |||
154 | if (start_ticks < end_ticks) { | 153 | if (start_ticks < end_ticks) { |
155 | delta_ticks = end_ticks - start_ticks; | 154 | delta_ticks = end_ticks - start_ticks; |
156 | } else if (start_ticks > end_ticks) { | 155 | } else if (start_ticks > end_ticks) { |
157 | if (0 == acpi_gbl_FADT->tmr_val_ext) { | 156 | if (acpi_gbl_FADT->tmr_val_ext == 0) { |
157 | |||
158 | /* 24-bit Timer */ | 158 | /* 24-bit Timer */ |
159 | 159 | ||
160 | delta_ticks = | 160 | delta_ticks = |
@@ -183,4 +183,4 @@ acpi_get_timer_duration(u32 start_ticks, u32 end_ticks, u32 * time_elapsed) | |||
183 | return_ACPI_STATUS(status); | 183 | return_ACPI_STATUS(status); |
184 | } | 184 | } |
185 | 185 | ||
186 | EXPORT_SYMBOL(acpi_get_timer_duration); | 186 | ACPI_EXPORT_SYMBOL(acpi_get_timer_duration) |