diff options
Diffstat (limited to 'drivers/acpi')
149 files changed, 2899 insertions, 2217 deletions
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c index 6512b20aeccd..d5fdd36190cc 100644 --- a/drivers/acpi/ac.c +++ b/drivers/acpi/ac.c | |||
@@ -61,7 +61,6 @@ static int acpi_ac_open_fs(struct inode *inode, struct file *file); | |||
61 | 61 | ||
62 | static int acpi_ac_add(struct acpi_device *device); | 62 | static int acpi_ac_add(struct acpi_device *device); |
63 | static int acpi_ac_remove(struct acpi_device *device, int type); | 63 | static int acpi_ac_remove(struct acpi_device *device, int type); |
64 | static int acpi_ac_resume(struct acpi_device *device); | ||
65 | static void acpi_ac_notify(struct acpi_device *device, u32 event); | 64 | static void acpi_ac_notify(struct acpi_device *device, u32 event); |
66 | 65 | ||
67 | static const struct acpi_device_id ac_device_ids[] = { | 66 | static const struct acpi_device_id ac_device_ids[] = { |
@@ -70,6 +69,11 @@ static const struct acpi_device_id ac_device_ids[] = { | |||
70 | }; | 69 | }; |
71 | MODULE_DEVICE_TABLE(acpi, ac_device_ids); | 70 | MODULE_DEVICE_TABLE(acpi, ac_device_ids); |
72 | 71 | ||
72 | #ifdef CONFIG_PM_SLEEP | ||
73 | static int acpi_ac_resume(struct device *dev); | ||
74 | #endif | ||
75 | static SIMPLE_DEV_PM_OPS(acpi_ac_pm, NULL, acpi_ac_resume); | ||
76 | |||
73 | static struct acpi_driver acpi_ac_driver = { | 77 | static struct acpi_driver acpi_ac_driver = { |
74 | .name = "ac", | 78 | .name = "ac", |
75 | .class = ACPI_AC_CLASS, | 79 | .class = ACPI_AC_CLASS, |
@@ -78,9 +82,9 @@ static struct acpi_driver acpi_ac_driver = { | |||
78 | .ops = { | 82 | .ops = { |
79 | .add = acpi_ac_add, | 83 | .add = acpi_ac_add, |
80 | .remove = acpi_ac_remove, | 84 | .remove = acpi_ac_remove, |
81 | .resume = acpi_ac_resume, | ||
82 | .notify = acpi_ac_notify, | 85 | .notify = acpi_ac_notify, |
83 | }, | 86 | }, |
87 | .drv.pm = &acpi_ac_pm, | ||
84 | }; | 88 | }; |
85 | 89 | ||
86 | struct acpi_ac { | 90 | struct acpi_ac { |
@@ -292,7 +296,9 @@ static int acpi_ac_add(struct acpi_device *device) | |||
292 | ac->charger.properties = ac_props; | 296 | ac->charger.properties = ac_props; |
293 | ac->charger.num_properties = ARRAY_SIZE(ac_props); | 297 | ac->charger.num_properties = ARRAY_SIZE(ac_props); |
294 | ac->charger.get_property = get_ac_property; | 298 | ac->charger.get_property = get_ac_property; |
295 | power_supply_register(&ac->device->dev, &ac->charger); | 299 | result = power_supply_register(&ac->device->dev, &ac->charger); |
300 | if (result) | ||
301 | goto end; | ||
296 | 302 | ||
297 | printk(KERN_INFO PREFIX "%s [%s] (%s)\n", | 303 | printk(KERN_INFO PREFIX "%s [%s] (%s)\n", |
298 | acpi_device_name(device), acpi_device_bid(device), | 304 | acpi_device_name(device), acpi_device_bid(device), |
@@ -309,13 +315,19 @@ static int acpi_ac_add(struct acpi_device *device) | |||
309 | return result; | 315 | return result; |
310 | } | 316 | } |
311 | 317 | ||
312 | static int acpi_ac_resume(struct acpi_device *device) | 318 | #ifdef CONFIG_PM_SLEEP |
319 | static int acpi_ac_resume(struct device *dev) | ||
313 | { | 320 | { |
314 | struct acpi_ac *ac; | 321 | struct acpi_ac *ac; |
315 | unsigned old_state; | 322 | unsigned old_state; |
316 | if (!device || !acpi_driver_data(device)) | 323 | |
324 | if (!dev) | ||
317 | return -EINVAL; | 325 | return -EINVAL; |
318 | ac = acpi_driver_data(device); | 326 | |
327 | ac = acpi_driver_data(to_acpi_device(dev)); | ||
328 | if (!ac) | ||
329 | return -EINVAL; | ||
330 | |||
319 | old_state = ac->state; | 331 | old_state = ac->state; |
320 | if (acpi_ac_get_state(ac)) | 332 | if (acpi_ac_get_state(ac)) |
321 | return 0; | 333 | return 0; |
@@ -323,6 +335,7 @@ static int acpi_ac_resume(struct acpi_device *device) | |||
323 | kobject_uevent(&ac->charger.dev->kobj, KOBJ_CHANGE); | 335 | kobject_uevent(&ac->charger.dev->kobj, KOBJ_CHANGE); |
324 | return 0; | 336 | return 0; |
325 | } | 337 | } |
338 | #endif | ||
326 | 339 | ||
327 | static int acpi_ac_remove(struct acpi_device *device, int type) | 340 | static int acpi_ac_remove(struct acpi_device *device, int type) |
328 | { | 341 | { |
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c index d98571385656..24c807f96636 100644 --- a/drivers/acpi/acpi_memhotplug.c +++ b/drivers/acpi/acpi_memhotplug.c | |||
@@ -341,7 +341,7 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data) | |||
341 | { | 341 | { |
342 | struct acpi_memory_device *mem_device; | 342 | struct acpi_memory_device *mem_device; |
343 | struct acpi_device *device; | 343 | struct acpi_device *device; |
344 | 344 | u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */ | |
345 | 345 | ||
346 | switch (event) { | 346 | switch (event) { |
347 | case ACPI_NOTIFY_BUS_CHECK: | 347 | case ACPI_NOTIFY_BUS_CHECK: |
@@ -354,15 +354,20 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data) | |||
354 | "\nReceived DEVICE CHECK notification for device\n")); | 354 | "\nReceived DEVICE CHECK notification for device\n")); |
355 | if (acpi_memory_get_device(handle, &mem_device)) { | 355 | if (acpi_memory_get_device(handle, &mem_device)) { |
356 | printk(KERN_ERR PREFIX "Cannot find driver data\n"); | 356 | printk(KERN_ERR PREFIX "Cannot find driver data\n"); |
357 | return; | 357 | break; |
358 | } | 358 | } |
359 | 359 | ||
360 | if (!acpi_memory_check_device(mem_device)) { | 360 | if (acpi_memory_check_device(mem_device)) |
361 | if (acpi_memory_enable_device(mem_device)) | 361 | break; |
362 | printk(KERN_ERR PREFIX | 362 | |
363 | "Cannot enable memory device\n"); | 363 | if (acpi_memory_enable_device(mem_device)) { |
364 | printk(KERN_ERR PREFIX "Cannot enable memory device\n"); | ||
365 | break; | ||
364 | } | 366 | } |
367 | |||
368 | ost_code = ACPI_OST_SC_SUCCESS; | ||
365 | break; | 369 | break; |
370 | |||
366 | case ACPI_NOTIFY_EJECT_REQUEST: | 371 | case ACPI_NOTIFY_EJECT_REQUEST: |
367 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 372 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
368 | "\nReceived EJECT REQUEST notification for device\n")); | 373 | "\nReceived EJECT REQUEST notification for device\n")); |
@@ -383,19 +388,35 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data) | |||
383 | * TBD: Can also be disabled by Callback registration | 388 | * TBD: Can also be disabled by Callback registration |
384 | * with generic sysfs driver | 389 | * with generic sysfs driver |
385 | */ | 390 | */ |
386 | if (acpi_memory_disable_device(mem_device)) | 391 | if (acpi_memory_disable_device(mem_device)) { |
387 | printk(KERN_ERR PREFIX | 392 | printk(KERN_ERR PREFIX "Disable memory device\n"); |
388 | "Disable memory device\n"); | 393 | /* |
394 | * If _EJ0 was called but failed, _OST is not | ||
395 | * necessary. | ||
396 | */ | ||
397 | if (mem_device->state == MEMORY_INVALID_STATE) | ||
398 | return; | ||
399 | |||
400 | break; | ||
401 | } | ||
402 | |||
389 | /* | 403 | /* |
390 | * TBD: Invoke acpi_bus_remove to cleanup data structures | 404 | * TBD: Invoke acpi_bus_remove to cleanup data structures |
391 | */ | 405 | */ |
392 | break; | 406 | |
407 | /* _EJ0 succeeded; _OST is not necessary */ | ||
408 | return; | ||
409 | |||
393 | default: | 410 | default: |
394 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 411 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
395 | "Unsupported event [0x%x]\n", event)); | 412 | "Unsupported event [0x%x]\n", event)); |
396 | break; | 413 | |
414 | /* non-hotplug event; possibly handled by other handler */ | ||
415 | return; | ||
397 | } | 416 | } |
398 | 417 | ||
418 | /* Inform firmware that the hotplug operation has completed */ | ||
419 | (void) acpi_evaluate_hotplug_ost(handle, event, ost_code, NULL); | ||
399 | return; | 420 | return; |
400 | } | 421 | } |
401 | 422 | ||
diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c index 1502c50273b5..af4aad6ee2eb 100644 --- a/drivers/acpi/acpi_pad.c +++ b/drivers/acpi/acpi_pad.c | |||
@@ -145,7 +145,7 @@ static void exit_round_robin(unsigned int tsk_index) | |||
145 | } | 145 | } |
146 | 146 | ||
147 | static unsigned int idle_pct = 5; /* percentage */ | 147 | static unsigned int idle_pct = 5; /* percentage */ |
148 | static unsigned int round_robin_time = 10; /* second */ | 148 | static unsigned int round_robin_time = 1; /* second */ |
149 | static int power_saving_thread(void *data) | 149 | static int power_saving_thread(void *data) |
150 | { | 150 | { |
151 | struct sched_param param = {.sched_priority = 1}; | 151 | struct sched_param param = {.sched_priority = 1}; |
@@ -235,7 +235,7 @@ static int create_power_saving_task(void) | |||
235 | 235 | ||
236 | ps_tsks[ps_tsk_num] = kthread_run(power_saving_thread, | 236 | ps_tsks[ps_tsk_num] = kthread_run(power_saving_thread, |
237 | (void *)(unsigned long)ps_tsk_num, | 237 | (void *)(unsigned long)ps_tsk_num, |
238 | "power_saving/%d", ps_tsk_num); | 238 | "acpi_pad/%d", ps_tsk_num); |
239 | rc = IS_ERR(ps_tsks[ps_tsk_num]) ? PTR_ERR(ps_tsks[ps_tsk_num]) : 0; | 239 | rc = IS_ERR(ps_tsks[ps_tsk_num]) ? PTR_ERR(ps_tsks[ps_tsk_num]) : 0; |
240 | if (!rc) | 240 | if (!rc) |
241 | ps_tsk_num++; | 241 | ps_tsk_num++; |
diff --git a/drivers/acpi/acpica/Makefile b/drivers/acpi/acpica/Makefile index 793b8cc8e256..7f1d40797e80 100644 --- a/drivers/acpi/acpica/Makefile +++ b/drivers/acpi/acpica/Makefile | |||
@@ -134,12 +134,14 @@ acpi-y += \ | |||
134 | tbinstal.o \ | 134 | tbinstal.o \ |
135 | tbutils.o \ | 135 | tbutils.o \ |
136 | tbxface.o \ | 136 | tbxface.o \ |
137 | tbxfload.o \ | ||
137 | tbxfroot.o | 138 | tbxfroot.o |
138 | 139 | ||
139 | acpi-y += \ | 140 | acpi-y += \ |
140 | utaddress.o \ | 141 | utaddress.o \ |
141 | utalloc.o \ | 142 | utalloc.o \ |
142 | utcopy.o \ | 143 | utcopy.o \ |
144 | utexcep.o \ | ||
143 | utdebug.o \ | 145 | utdebug.o \ |
144 | utdecode.o \ | 146 | utdecode.o \ |
145 | utdelete.o \ | 147 | utdelete.o \ |
@@ -156,5 +158,6 @@ acpi-y += \ | |||
156 | utresrc.o \ | 158 | utresrc.o \ |
157 | utstate.o \ | 159 | utstate.o \ |
158 | utxface.o \ | 160 | utxface.o \ |
161 | utxfinit.o \ | ||
159 | utxferror.o \ | 162 | utxferror.o \ |
160 | utxfmutex.o | 163 | utxfmutex.o |
diff --git a/drivers/acpi/acpica/acevents.h b/drivers/acpi/acpica/acevents.h index d700f63e4701..c0a43b38c6a3 100644 --- a/drivers/acpi/acpica/acevents.h +++ b/drivers/acpi/acpica/acevents.h | |||
@@ -237,7 +237,7 @@ u32 acpi_ev_install_sci_handler(void); | |||
237 | 237 | ||
238 | acpi_status acpi_ev_remove_sci_handler(void); | 238 | acpi_status acpi_ev_remove_sci_handler(void); |
239 | 239 | ||
240 | u32 acpi_ev_initialize_sCI(u32 program_sCI); | 240 | u32 acpi_ev_initialize_SCI(u32 program_SCI); |
241 | 241 | ||
242 | ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_ev_terminate(void)) | 242 | ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_ev_terminate(void)) |
243 | #endif /* __ACEVENTS_H__ */ | 243 | #endif /* __ACEVENTS_H__ */ |
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h index 4f7d3f57d05c..ce79100fb5eb 100644 --- a/drivers/acpi/acpica/acglobal.h +++ b/drivers/acpi/acpica/acglobal.h | |||
@@ -278,8 +278,7 @@ ACPI_EXTERN acpi_cache_t *acpi_gbl_operand_cache; | |||
278 | 278 | ||
279 | /* Global handlers */ | 279 | /* Global handlers */ |
280 | 280 | ||
281 | ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_device_notify; | 281 | ACPI_EXTERN struct acpi_global_notify_handler acpi_gbl_global_notify[2]; |
282 | ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_system_notify; | ||
283 | ACPI_EXTERN acpi_exception_handler acpi_gbl_exception_handler; | 282 | ACPI_EXTERN acpi_exception_handler acpi_gbl_exception_handler; |
284 | ACPI_EXTERN acpi_init_handler acpi_gbl_init_handler; | 283 | ACPI_EXTERN acpi_init_handler acpi_gbl_init_handler; |
285 | ACPI_EXTERN acpi_tbl_handler acpi_gbl_table_handler; | 284 | ACPI_EXTERN acpi_tbl_handler acpi_gbl_table_handler; |
@@ -327,14 +326,6 @@ extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS]; | |||
327 | 326 | ||
328 | #endif | 327 | #endif |
329 | 328 | ||
330 | /* Exception codes */ | ||
331 | |||
332 | extern char const *acpi_gbl_exception_names_env[]; | ||
333 | extern char const *acpi_gbl_exception_names_pgm[]; | ||
334 | extern char const *acpi_gbl_exception_names_tbl[]; | ||
335 | extern char const *acpi_gbl_exception_names_aml[]; | ||
336 | extern char const *acpi_gbl_exception_names_ctrl[]; | ||
337 | |||
338 | /***************************************************************************** | 329 | /***************************************************************************** |
339 | * | 330 | * |
340 | * Namespace globals | 331 | * Namespace globals |
@@ -463,4 +454,12 @@ ACPI_EXTERN u32 acpi_gbl_size_of_acpi_objects; | |||
463 | 454 | ||
464 | #endif /* ACPI_DEBUGGER */ | 455 | #endif /* ACPI_DEBUGGER */ |
465 | 456 | ||
457 | /***************************************************************************** | ||
458 | * | ||
459 | * Info/help support | ||
460 | * | ||
461 | ****************************************************************************/ | ||
462 | |||
463 | extern const struct ah_predefined_name asl_predefined_info[]; | ||
464 | |||
466 | #endif /* __ACGLOBAL_H__ */ | 465 | #endif /* __ACGLOBAL_H__ */ |
diff --git a/drivers/acpi/acpica/achware.h b/drivers/acpi/acpica/achware.h index 5ccb99ae3a6f..d902d31abc6c 100644 --- a/drivers/acpi/acpica/achware.h +++ b/drivers/acpi/acpica/achware.h | |||
@@ -83,22 +83,22 @@ acpi_status acpi_hw_clear_acpi_status(void); | |||
83 | /* | 83 | /* |
84 | * hwsleep - sleep/wake support (Legacy sleep registers) | 84 | * hwsleep - sleep/wake support (Legacy sleep registers) |
85 | */ | 85 | */ |
86 | acpi_status acpi_hw_legacy_sleep(u8 sleep_state, u8 flags); | 86 | acpi_status acpi_hw_legacy_sleep(u8 sleep_state); |
87 | 87 | ||
88 | acpi_status acpi_hw_legacy_wake_prep(u8 sleep_state, u8 flags); | 88 | acpi_status acpi_hw_legacy_wake_prep(u8 sleep_state); |
89 | 89 | ||
90 | acpi_status acpi_hw_legacy_wake(u8 sleep_state, u8 flags); | 90 | acpi_status acpi_hw_legacy_wake(u8 sleep_state); |
91 | 91 | ||
92 | /* | 92 | /* |
93 | * hwesleep - sleep/wake support (Extended FADT-V5 sleep registers) | 93 | * hwesleep - sleep/wake support (Extended FADT-V5 sleep registers) |
94 | */ | 94 | */ |
95 | void acpi_hw_execute_sleep_method(char *method_name, u32 integer_argument); | 95 | void acpi_hw_execute_sleep_method(char *method_name, u32 integer_argument); |
96 | 96 | ||
97 | acpi_status acpi_hw_extended_sleep(u8 sleep_state, u8 flags); | 97 | acpi_status acpi_hw_extended_sleep(u8 sleep_state); |
98 | 98 | ||
99 | acpi_status acpi_hw_extended_wake_prep(u8 sleep_state, u8 flags); | 99 | acpi_status acpi_hw_extended_wake_prep(u8 sleep_state); |
100 | 100 | ||
101 | acpi_status acpi_hw_extended_wake(u8 sleep_state, u8 flags); | 101 | acpi_status acpi_hw_extended_wake(u8 sleep_state); |
102 | 102 | ||
103 | /* | 103 | /* |
104 | * hwvalid - Port I/O with validation | 104 | * hwvalid - Port I/O with validation |
@@ -110,8 +110,7 @@ acpi_status acpi_hw_write_port(acpi_io_address address, u32 value, u32 width); | |||
110 | /* | 110 | /* |
111 | * hwgpe - GPE support | 111 | * hwgpe - GPE support |
112 | */ | 112 | */ |
113 | u32 acpi_hw_get_gpe_register_bit(struct acpi_gpe_event_info *gpe_event_info, | 113 | u32 acpi_hw_get_gpe_register_bit(struct acpi_gpe_event_info *gpe_event_info); |
114 | struct acpi_gpe_register_info *gpe_register_info); | ||
115 | 114 | ||
116 | acpi_status | 115 | acpi_status |
117 | acpi_hw_low_set_gpe(struct acpi_gpe_event_info *gpe_event_info, u32 action); | 116 | acpi_hw_low_set_gpe(struct acpi_gpe_event_info *gpe_event_info, u32 action); |
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h index e3922ca20e7f..c816ee675094 100644 --- a/drivers/acpi/acpica/aclocal.h +++ b/drivers/acpi/acpica/aclocal.h | |||
@@ -299,7 +299,7 @@ acpi_status(*ACPI_INTERNAL_METHOD) (struct acpi_walk_state * walk_state); | |||
299 | * Information structure for ACPI predefined names. | 299 | * Information structure for ACPI predefined names. |
300 | * Each entry in the table contains the following items: | 300 | * Each entry in the table contains the following items: |
301 | * | 301 | * |
302 | * Name - The ACPI reserved name | 302 | * name - The ACPI reserved name |
303 | * param_count - Number of arguments to the method | 303 | * param_count - Number of arguments to the method |
304 | * expected_return_btypes - Allowed type(s) for the return value | 304 | * expected_return_btypes - Allowed type(s) for the return value |
305 | */ | 305 | */ |
@@ -404,6 +404,13 @@ struct acpi_gpe_handler_info { | |||
404 | u8 originally_enabled; /* True if GPE was originally enabled */ | 404 | u8 originally_enabled; /* True if GPE was originally enabled */ |
405 | }; | 405 | }; |
406 | 406 | ||
407 | /* Notify info for implicit notify, multiple device objects */ | ||
408 | |||
409 | struct acpi_gpe_notify_info { | ||
410 | struct acpi_namespace_node *device_node; /* Device to be notified */ | ||
411 | struct acpi_gpe_notify_info *next; | ||
412 | }; | ||
413 | |||
407 | struct acpi_gpe_notify_object { | 414 | struct acpi_gpe_notify_object { |
408 | struct acpi_namespace_node *node; | 415 | struct acpi_namespace_node *node; |
409 | struct acpi_gpe_notify_object *next; | 416 | struct acpi_gpe_notify_object *next; |
@@ -412,7 +419,7 @@ struct acpi_gpe_notify_object { | |||
412 | union acpi_gpe_dispatch_info { | 419 | union acpi_gpe_dispatch_info { |
413 | struct acpi_namespace_node *method_node; /* Method node for this GPE level */ | 420 | struct acpi_namespace_node *method_node; /* Method node for this GPE level */ |
414 | struct acpi_gpe_handler_info *handler; /* Installed GPE handler */ | 421 | struct acpi_gpe_handler_info *handler; /* Installed GPE handler */ |
415 | struct acpi_gpe_notify_object device; /* List of _PRW devices for implicit notify */ | 422 | struct acpi_gpe_notify_info *notify_list; /* List of _PRW devices for implicit notifies */ |
416 | }; | 423 | }; |
417 | 424 | ||
418 | /* | 425 | /* |
@@ -420,7 +427,7 @@ union acpi_gpe_dispatch_info { | |||
420 | * NOTE: Important to keep this struct as small as possible. | 427 | * NOTE: Important to keep this struct as small as possible. |
421 | */ | 428 | */ |
422 | struct acpi_gpe_event_info { | 429 | struct acpi_gpe_event_info { |
423 | union acpi_gpe_dispatch_info dispatch; /* Either Method or Handler */ | 430 | union acpi_gpe_dispatch_info dispatch; /* Either Method, Handler, or notify_list */ |
424 | struct acpi_gpe_register_info *register_info; /* Backpointer to register info */ | 431 | struct acpi_gpe_register_info *register_info; /* Backpointer to register info */ |
425 | u8 flags; /* Misc info about this GPE */ | 432 | u8 flags; /* Misc info about this GPE */ |
426 | u8 gpe_number; /* This GPE */ | 433 | u8 gpe_number; /* This GPE */ |
@@ -600,13 +607,22 @@ acpi_status(*acpi_parse_downwards) (struct acpi_walk_state * walk_state, | |||
600 | 607 | ||
601 | typedef acpi_status(*acpi_parse_upwards) (struct acpi_walk_state * walk_state); | 608 | typedef acpi_status(*acpi_parse_upwards) (struct acpi_walk_state * walk_state); |
602 | 609 | ||
610 | /* Global handlers for AML Notifies */ | ||
611 | |||
612 | struct acpi_global_notify_handler { | ||
613 | acpi_notify_handler handler; | ||
614 | void *context; | ||
615 | }; | ||
616 | |||
603 | /* | 617 | /* |
604 | * Notify info - used to pass info to the deferred notify | 618 | * Notify info - used to pass info to the deferred notify |
605 | * handler/dispatcher. | 619 | * handler/dispatcher. |
606 | */ | 620 | */ |
607 | struct acpi_notify_info { | 621 | struct acpi_notify_info { |
608 | ACPI_STATE_COMMON struct acpi_namespace_node *node; | 622 | ACPI_STATE_COMMON u8 handler_list_id; |
609 | union acpi_operand_object *handler_obj; | 623 | struct acpi_namespace_node *node; |
624 | union acpi_operand_object *handler_list_head; | ||
625 | struct acpi_global_notify_handler *global; | ||
610 | }; | 626 | }; |
611 | 627 | ||
612 | /* Generic state is union of structs above */ | 628 | /* Generic state is union of structs above */ |
@@ -691,15 +707,18 @@ union acpi_parse_value { | |||
691 | u8 disasm_opcode; /* Subtype used for disassembly */\ | 707 | u8 disasm_opcode; /* Subtype used for disassembly */\ |
692 | char aml_op_name[16]) /* Op name (debug only) */ | 708 | char aml_op_name[16]) /* Op name (debug only) */ |
693 | 709 | ||
694 | #define ACPI_DASM_BUFFER 0x00 | 710 | /* Flags for disasm_flags field above */ |
695 | #define ACPI_DASM_RESOURCE 0x01 | 711 | |
696 | #define ACPI_DASM_STRING 0x02 | 712 | #define ACPI_DASM_BUFFER 0x00 /* Buffer is a simple data buffer */ |
697 | #define ACPI_DASM_UNICODE 0x03 | 713 | #define ACPI_DASM_RESOURCE 0x01 /* Buffer is a Resource Descriptor */ |
698 | #define ACPI_DASM_EISAID 0x04 | 714 | #define ACPI_DASM_STRING 0x02 /* Buffer is a ASCII string */ |
699 | #define ACPI_DASM_MATCHOP 0x05 | 715 | #define ACPI_DASM_UNICODE 0x03 /* Buffer is a Unicode string */ |
700 | #define ACPI_DASM_LNOT_PREFIX 0x06 | 716 | #define ACPI_DASM_PLD_METHOD 0x04 /* Buffer is a _PLD method bit-packed buffer */ |
701 | #define ACPI_DASM_LNOT_SUFFIX 0x07 | 717 | #define ACPI_DASM_EISAID 0x05 /* Integer is an EISAID */ |
702 | #define ACPI_DASM_IGNORE 0x08 | 718 | #define ACPI_DASM_MATCHOP 0x06 /* Parent opcode is a Match() operator */ |
719 | #define ACPI_DASM_LNOT_PREFIX 0x07 /* Start of a Lnot_equal (etc.) pair of opcodes */ | ||
720 | #define ACPI_DASM_LNOT_SUFFIX 0x08 /* End of a Lnot_equal (etc.) pair of opcodes */ | ||
721 | #define ACPI_DASM_IGNORE 0x09 /* Not used at this time */ | ||
703 | 722 | ||
704 | /* | 723 | /* |
705 | * Generic operation (for example: If, While, Store) | 724 | * Generic operation (for example: If, While, Store) |
@@ -718,7 +737,7 @@ struct acpi_parse_obj_named { | |||
718 | u32 name; /* 4-byte name or zero if no name */ | 737 | u32 name; /* 4-byte name or zero if no name */ |
719 | }; | 738 | }; |
720 | 739 | ||
721 | /* This version is used by the i_aSL compiler only */ | 740 | /* This version is used by the iASL compiler only */ |
722 | 741 | ||
723 | #define ACPI_MAX_PARSEOP_NAME 20 | 742 | #define ACPI_MAX_PARSEOP_NAME 20 |
724 | 743 | ||
@@ -787,6 +806,7 @@ struct acpi_parse_state { | |||
787 | #define ACPI_PARSEOP_IGNORE 0x01 | 806 | #define ACPI_PARSEOP_IGNORE 0x01 |
788 | #define ACPI_PARSEOP_PARAMLIST 0x02 | 807 | #define ACPI_PARSEOP_PARAMLIST 0x02 |
789 | #define ACPI_PARSEOP_EMPTY_TERMLIST 0x04 | 808 | #define ACPI_PARSEOP_EMPTY_TERMLIST 0x04 |
809 | #define ACPI_PARSEOP_PREDEF_CHECKED 0x08 | ||
790 | #define ACPI_PARSEOP_SPECIAL 0x10 | 810 | #define ACPI_PARSEOP_SPECIAL 0x10 |
791 | 811 | ||
792 | /***************************************************************************** | 812 | /***************************************************************************** |
@@ -915,6 +935,7 @@ struct acpi_bit_register_info { | |||
915 | #define ACPI_OSI_WIN_VISTA_SP1 0x09 | 935 | #define ACPI_OSI_WIN_VISTA_SP1 0x09 |
916 | #define ACPI_OSI_WIN_VISTA_SP2 0x0A | 936 | #define ACPI_OSI_WIN_VISTA_SP2 0x0A |
917 | #define ACPI_OSI_WIN_7 0x0B | 937 | #define ACPI_OSI_WIN_7 0x0B |
938 | #define ACPI_OSI_WIN_8 0x0C | ||
918 | 939 | ||
919 | #define ACPI_ALWAYS_ILLEGAL 0x00 | 940 | #define ACPI_ALWAYS_ILLEGAL 0x00 |
920 | 941 | ||
@@ -1007,6 +1028,7 @@ struct acpi_port_info { | |||
1007 | ****************************************************************************/ | 1028 | ****************************************************************************/ |
1008 | 1029 | ||
1009 | struct acpi_db_method_info { | 1030 | struct acpi_db_method_info { |
1031 | acpi_handle method; | ||
1010 | acpi_handle main_thread_gate; | 1032 | acpi_handle main_thread_gate; |
1011 | acpi_handle thread_complete_gate; | 1033 | acpi_handle thread_complete_gate; |
1012 | acpi_thread_id *threads; | 1034 | acpi_thread_id *threads; |
@@ -1075,4 +1097,18 @@ struct acpi_debug_mem_block { | |||
1075 | #define ACPI_MEM_LIST_MAX 1 | 1097 | #define ACPI_MEM_LIST_MAX 1 |
1076 | #define ACPI_NUM_MEM_LISTS 2 | 1098 | #define ACPI_NUM_MEM_LISTS 2 |
1077 | 1099 | ||
1100 | /***************************************************************************** | ||
1101 | * | ||
1102 | * Info/help support | ||
1103 | * | ||
1104 | ****************************************************************************/ | ||
1105 | |||
1106 | struct ah_predefined_name { | ||
1107 | char *name; | ||
1108 | char *description; | ||
1109 | #ifndef ACPI_ASL_COMPILER | ||
1110 | char *action; | ||
1111 | #endif | ||
1112 | }; | ||
1113 | |||
1078 | #endif /* __ACLOCAL_H__ */ | 1114 | #endif /* __ACLOCAL_H__ */ |
diff --git a/drivers/acpi/acpica/acmacros.h b/drivers/acpi/acpica/acmacros.h index f119f473f71a..a7f68c47f517 100644 --- a/drivers/acpi/acpica/acmacros.h +++ b/drivers/acpi/acpica/acmacros.h | |||
@@ -62,7 +62,7 @@ | |||
62 | * printf() format helpers | 62 | * printf() format helpers |
63 | */ | 63 | */ |
64 | 64 | ||
65 | /* Split 64-bit integer into two 32-bit values. Use with %8.8_x%8.8_x */ | 65 | /* Split 64-bit integer into two 32-bit values. Use with %8.8X%8.8X */ |
66 | 66 | ||
67 | #define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i), ACPI_LODWORD(i) | 67 | #define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i), ACPI_LODWORD(i) |
68 | 68 | ||
@@ -277,14 +277,37 @@ | |||
277 | 277 | ||
278 | /* Bitfields within ACPI registers */ | 278 | /* Bitfields within ACPI registers */ |
279 | 279 | ||
280 | #define ACPI_REGISTER_PREPARE_BITS(val, pos, mask) ((val << pos) & mask) | 280 | #define ACPI_REGISTER_PREPARE_BITS(val, pos, mask) \ |
281 | #define ACPI_REGISTER_INSERT_VALUE(reg, pos, mask, val) reg = (reg & (~(mask))) | ACPI_REGISTER_PREPARE_BITS(val, pos, mask) | 281 | ((val << pos) & mask) |
282 | 282 | ||
283 | #define ACPI_INSERT_BITS(target, mask, source) target = ((target & (~(mask))) | (source & mask)) | 283 | #define ACPI_REGISTER_INSERT_VALUE(reg, pos, mask, val) \ |
284 | reg = (reg & (~(mask))) | ACPI_REGISTER_PREPARE_BITS(val, pos, mask) | ||
285 | |||
286 | #define ACPI_INSERT_BITS(target, mask, source) \ | ||
287 | target = ((target & (~(mask))) | (source & mask)) | ||
288 | |||
289 | /* Generic bitfield macros and masks */ | ||
290 | |||
291 | #define ACPI_GET_BITS(source_ptr, position, mask) \ | ||
292 | ((*source_ptr >> position) & mask) | ||
293 | |||
294 | #define ACPI_SET_BITS(target_ptr, position, mask, value) \ | ||
295 | (*target_ptr |= ((value & mask) << position)) | ||
296 | |||
297 | #define ACPI_1BIT_MASK 0x00000001 | ||
298 | #define ACPI_2BIT_MASK 0x00000003 | ||
299 | #define ACPI_3BIT_MASK 0x00000007 | ||
300 | #define ACPI_4BIT_MASK 0x0000000F | ||
301 | #define ACPI_5BIT_MASK 0x0000001F | ||
302 | #define ACPI_6BIT_MASK 0x0000003F | ||
303 | #define ACPI_7BIT_MASK 0x0000007F | ||
304 | #define ACPI_8BIT_MASK 0x000000FF | ||
305 | #define ACPI_16BIT_MASK 0x0000FFFF | ||
306 | #define ACPI_24BIT_MASK 0x00FFFFFF | ||
284 | 307 | ||
285 | /* | 308 | /* |
286 | * A struct acpi_namespace_node can appear in some contexts | 309 | * An object of type struct acpi_namespace_node can appear in some contexts |
287 | * where a pointer to a union acpi_operand_object can also | 310 | * where a pointer to an object of type union acpi_operand_object can also |
288 | * appear. This macro is used to distinguish them. | 311 | * appear. This macro is used to distinguish them. |
289 | * | 312 | * |
290 | * The "Descriptor" field is the first field in both structures. | 313 | * The "Descriptor" field is the first field in both structures. |
diff --git a/drivers/acpi/acpica/acobject.h b/drivers/acpi/acpica/acobject.h index c065078ca83b..364a1303fb8f 100644 --- a/drivers/acpi/acpica/acobject.h +++ b/drivers/acpi/acpica/acobject.h | |||
@@ -113,8 +113,8 @@ struct acpi_object_integer { | |||
113 | }; | 113 | }; |
114 | 114 | ||
115 | /* | 115 | /* |
116 | * Note: The String and Buffer object must be identical through the Pointer | 116 | * Note: The String and Buffer object must be identical through the |
117 | * and length elements. There is code that depends on this. | 117 | * pointer and length elements. There is code that depends on this. |
118 | * | 118 | * |
119 | * Fields common to both Strings and Buffers | 119 | * Fields common to both Strings and Buffers |
120 | */ | 120 | */ |
@@ -206,8 +206,7 @@ struct acpi_object_method { | |||
206 | * Common fields for objects that support ASL notifications | 206 | * Common fields for objects that support ASL notifications |
207 | */ | 207 | */ |
208 | #define ACPI_COMMON_NOTIFY_INFO \ | 208 | #define ACPI_COMMON_NOTIFY_INFO \ |
209 | union acpi_operand_object *system_notify; /* Handler for system notifies */\ | 209 | union acpi_operand_object *notify_list[2]; /* Handlers for system/device notifies */\ |
210 | union acpi_operand_object *device_notify; /* Handler for driver notifies */\ | ||
211 | union acpi_operand_object *handler; /* Handler for Address space */ | 210 | union acpi_operand_object *handler; /* Handler for Address space */ |
212 | 211 | ||
213 | struct acpi_object_notify_common { /* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */ | 212 | struct acpi_object_notify_common { /* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */ |
@@ -296,10 +295,10 @@ struct acpi_object_buffer_field { | |||
296 | 295 | ||
297 | struct acpi_object_notify_handler { | 296 | struct acpi_object_notify_handler { |
298 | ACPI_OBJECT_COMMON_HEADER struct acpi_namespace_node *node; /* Parent device */ | 297 | ACPI_OBJECT_COMMON_HEADER struct acpi_namespace_node *node; /* Parent device */ |
299 | u32 handler_type; | 298 | u32 handler_type; /* Type: Device/System/Both */ |
300 | acpi_notify_handler handler; | 299 | acpi_notify_handler handler; /* Handler address */ |
301 | void *context; | 300 | void *context; |
302 | struct acpi_object_notify_handler *next; | 301 | union acpi_operand_object *next[2]; /* Device and System handler lists */ |
303 | }; | 302 | }; |
304 | 303 | ||
305 | struct acpi_object_addr_handler { | 304 | struct acpi_object_addr_handler { |
@@ -382,7 +381,7 @@ struct acpi_object_cache_list { | |||
382 | 381 | ||
383 | /****************************************************************************** | 382 | /****************************************************************************** |
384 | * | 383 | * |
385 | * union acpi_operand_object Descriptor - a giant union of all of the above | 384 | * union acpi_operand_object descriptor - a giant union of all of the above |
386 | * | 385 | * |
387 | *****************************************************************************/ | 386 | *****************************************************************************/ |
388 | 387 | ||
diff --git a/drivers/acpi/acpica/acpredef.h b/drivers/acpi/acpica/acpredef.h index bbb34c9be4e8..3080c017f5ba 100644 --- a/drivers/acpi/acpica/acpredef.h +++ b/drivers/acpi/acpica/acpredef.h | |||
@@ -140,7 +140,7 @@ enum acpi_return_package_types { | |||
140 | * | 140 | * |
141 | * The main entries in the table each contain the following items: | 141 | * The main entries in the table each contain the following items: |
142 | * | 142 | * |
143 | * Name - The ACPI reserved name | 143 | * name - The ACPI reserved name |
144 | * param_count - Number of arguments to the method | 144 | * param_count - Number of arguments to the method |
145 | * expected_btypes - Allowed type(s) for the return value. | 145 | * expected_btypes - Allowed type(s) for the return value. |
146 | * 0 means that no return value is expected. | 146 | * 0 means that no return value is expected. |
@@ -511,14 +511,14 @@ static const union acpi_predefined_info predefined_names[] = | |||
511 | {{"_TMP", 0, ACPI_RTYPE_INTEGER}}, | 511 | {{"_TMP", 0, ACPI_RTYPE_INTEGER}}, |
512 | {{"_TPC", 0, ACPI_RTYPE_INTEGER}}, | 512 | {{"_TPC", 0, ACPI_RTYPE_INTEGER}}, |
513 | {{"_TPT", 1, 0}}, | 513 | {{"_TPT", 1, 0}}, |
514 | {{"_TRT", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each 2_ref/6_int */ | 514 | {{"_TRT", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each 2 Ref/6 Int */ |
515 | {{{ACPI_PTYPE2, ACPI_RTYPE_REFERENCE, 2, ACPI_RTYPE_INTEGER}, 6, 0}}, | 515 | {{{ACPI_PTYPE2, ACPI_RTYPE_REFERENCE, 2, ACPI_RTYPE_INTEGER}, 6, 0}}, |
516 | 516 | ||
517 | {{"_TSD", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each 5_int with count */ | 517 | {{"_TSD", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each 5 Int with count */ |
518 | {{{ACPI_PTYPE2_COUNT,ACPI_RTYPE_INTEGER, 5,0}, 0,0}}, | 518 | {{{ACPI_PTYPE2_COUNT,ACPI_RTYPE_INTEGER, 5,0}, 0,0}}, |
519 | 519 | ||
520 | {{"_TSP", 0, ACPI_RTYPE_INTEGER}}, | 520 | {{"_TSP", 0, ACPI_RTYPE_INTEGER}}, |
521 | {{"_TSS", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each 5_int */ | 521 | {{"_TSS", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each 5 Int */ |
522 | {{{ACPI_PTYPE2, ACPI_RTYPE_INTEGER, 5,0}, 0,0}}, | 522 | {{{ACPI_PTYPE2, ACPI_RTYPE_INTEGER, 5,0}, 0,0}}, |
523 | 523 | ||
524 | {{"_TST", 0, ACPI_RTYPE_INTEGER}}, | 524 | {{"_TST", 0, ACPI_RTYPE_INTEGER}}, |
diff --git a/drivers/acpi/acpica/acstruct.h b/drivers/acpi/acpica/acstruct.h index 0404df605bc1..f196e2c9a71f 100644 --- a/drivers/acpi/acpica/acstruct.h +++ b/drivers/acpi/acpica/acstruct.h | |||
@@ -68,7 +68,7 @@ | |||
68 | #define ACPI_WALK_METHOD 0x01 | 68 | #define ACPI_WALK_METHOD 0x01 |
69 | #define ACPI_WALK_METHOD_RESTART 0x02 | 69 | #define ACPI_WALK_METHOD_RESTART 0x02 |
70 | 70 | ||
71 | /* Flags for i_aSL compiler only */ | 71 | /* Flags for iASL compiler only */ |
72 | 72 | ||
73 | #define ACPI_WALK_CONST_REQUIRED 0x10 | 73 | #define ACPI_WALK_CONST_REQUIRED 0x10 |
74 | #define ACPI_WALK_CONST_OPTIONAL 0x20 | 74 | #define ACPI_WALK_CONST_OPTIONAL 0x20 |
diff --git a/drivers/acpi/acpica/acutils.h b/drivers/acpi/acpica/acutils.h index 925ccf22101b..5035327ebccc 100644 --- a/drivers/acpi/acpica/acutils.h +++ b/drivers/acpi/acpica/acutils.h | |||
@@ -460,6 +460,8 @@ acpi_ut_short_divide(u64 in_dividend, | |||
460 | /* | 460 | /* |
461 | * utmisc | 461 | * utmisc |
462 | */ | 462 | */ |
463 | void ut_convert_backslashes(char *pathname); | ||
464 | |||
463 | const char *acpi_ut_validate_exception(acpi_status status); | 465 | const char *acpi_ut_validate_exception(acpi_status status); |
464 | 466 | ||
465 | u8 acpi_ut_is_pci_root_bridge(char *id); | 467 | u8 acpi_ut_is_pci_root_bridge(char *id); |
diff --git a/drivers/acpi/acpica/amlcode.h b/drivers/acpi/acpica/amlcode.h index 905280fec0fa..c26f8ff6c3b9 100644 --- a/drivers/acpi/acpica/amlcode.h +++ b/drivers/acpi/acpica/amlcode.h | |||
@@ -182,7 +182,7 @@ | |||
182 | 182 | ||
183 | /* | 183 | /* |
184 | * Combination opcodes (actually two one-byte opcodes) | 184 | * Combination opcodes (actually two one-byte opcodes) |
185 | * Used by the disassembler and i_aSL compiler | 185 | * Used by the disassembler and iASL compiler |
186 | */ | 186 | */ |
187 | #define AML_LGREATEREQUAL_OP (u16) 0x9295 | 187 | #define AML_LGREATEREQUAL_OP (u16) 0x9295 |
188 | #define AML_LLESSEQUAL_OP (u16) 0x9294 | 188 | #define AML_LLESSEQUAL_OP (u16) 0x9294 |
@@ -280,7 +280,7 @@ | |||
280 | 280 | ||
281 | /* Multiple/complex types */ | 281 | /* Multiple/complex types */ |
282 | 282 | ||
283 | #define ARGI_DATAOBJECT 0x12 /* Buffer, String, package or reference to a Node - Used only by size_of operator */ | 283 | #define ARGI_DATAOBJECT 0x12 /* Buffer, String, package or reference to a node - Used only by size_of operator */ |
284 | #define ARGI_COMPLEXOBJ 0x13 /* Buffer, String, or package (Used by INDEX op only) */ | 284 | #define ARGI_COMPLEXOBJ 0x13 /* Buffer, String, or package (Used by INDEX op only) */ |
285 | #define ARGI_REF_OR_STRING 0x14 /* Reference or String (Used by DEREFOF op only) */ | 285 | #define ARGI_REF_OR_STRING 0x14 /* Reference or String (Used by DEREFOF op only) */ |
286 | #define ARGI_REGION_OR_BUFFER 0x15 /* Used by LOAD op only */ | 286 | #define ARGI_REGION_OR_BUFFER 0x15 /* Used by LOAD op only */ |
diff --git a/drivers/acpi/acpica/amlresrc.h b/drivers/acpi/acpica/amlresrc.h index 7b2128f274e7..af4947956ec2 100644 --- a/drivers/acpi/acpica/amlresrc.h +++ b/drivers/acpi/acpica/amlresrc.h | |||
@@ -98,7 +98,7 @@ | |||
98 | #define ACPI_RESTAG_TRANSLATION "_TRA" | 98 | #define ACPI_RESTAG_TRANSLATION "_TRA" |
99 | #define ACPI_RESTAG_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */ | 99 | #define ACPI_RESTAG_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */ |
100 | #define ACPI_RESTAG_TYPE "_TTP" /* Translation(1), Static (0) */ | 100 | #define ACPI_RESTAG_TYPE "_TTP" /* Translation(1), Static (0) */ |
101 | #define ACPI_RESTAG_XFERTYPE "_SIZ" /* 8(0), 8_and16(1), 16(2) */ | 101 | #define ACPI_RESTAG_XFERTYPE "_SIZ" /* 8(0), 8And16(1), 16(2) */ |
102 | #define ACPI_RESTAG_VENDORDATA "_VEN" | 102 | #define ACPI_RESTAG_VENDORDATA "_VEN" |
103 | 103 | ||
104 | /* Default sizes for "small" resource descriptors */ | 104 | /* Default sizes for "small" resource descriptors */ |
@@ -235,7 +235,7 @@ AML_RESOURCE_LARGE_HEADER_COMMON AML_RESOURCE_ADDRESS_COMMON}; | |||
235 | 235 | ||
236 | struct aml_resource_extended_address64 { | 236 | struct aml_resource_extended_address64 { |
237 | AML_RESOURCE_LARGE_HEADER_COMMON | 237 | AML_RESOURCE_LARGE_HEADER_COMMON |
238 | AML_RESOURCE_ADDRESS_COMMON u8 revision_iD; | 238 | AML_RESOURCE_ADDRESS_COMMON u8 revision_ID; |
239 | u8 reserved; | 239 | u8 reserved; |
240 | u64 granularity; | 240 | u64 granularity; |
241 | u64 minimum; | 241 | u64 minimum; |
diff --git a/drivers/acpi/acpica/dsargs.c b/drivers/acpi/acpica/dsargs.c index 80eb1900297f..c8b5e2565b98 100644 --- a/drivers/acpi/acpica/dsargs.c +++ b/drivers/acpi/acpica/dsargs.c | |||
@@ -62,7 +62,7 @@ acpi_ds_execute_arguments(struct acpi_namespace_node *node, | |||
62 | * | 62 | * |
63 | * FUNCTION: acpi_ds_execute_arguments | 63 | * FUNCTION: acpi_ds_execute_arguments |
64 | * | 64 | * |
65 | * PARAMETERS: Node - Object NS node | 65 | * PARAMETERS: node - Object NS node |
66 | * scope_node - Parent NS node | 66 | * scope_node - Parent NS node |
67 | * aml_length - Length of executable AML | 67 | * aml_length - Length of executable AML |
68 | * aml_start - Pointer to the AML | 68 | * aml_start - Pointer to the AML |
diff --git a/drivers/acpi/acpica/dscontrol.c b/drivers/acpi/acpica/dscontrol.c index effe4ca1133f..465f02134b89 100644 --- a/drivers/acpi/acpica/dscontrol.c +++ b/drivers/acpi/acpica/dscontrol.c | |||
@@ -56,7 +56,7 @@ ACPI_MODULE_NAME("dscontrol") | |||
56 | * FUNCTION: acpi_ds_exec_begin_control_op | 56 | * FUNCTION: acpi_ds_exec_begin_control_op |
57 | * | 57 | * |
58 | * PARAMETERS: walk_list - The list that owns the walk stack | 58 | * PARAMETERS: walk_list - The list that owns the walk stack |
59 | * Op - The control Op | 59 | * op - The control Op |
60 | * | 60 | * |
61 | * RETURN: Status | 61 | * RETURN: Status |
62 | * | 62 | * |
@@ -153,7 +153,7 @@ acpi_ds_exec_begin_control_op(struct acpi_walk_state *walk_state, | |||
153 | * FUNCTION: acpi_ds_exec_end_control_op | 153 | * FUNCTION: acpi_ds_exec_end_control_op |
154 | * | 154 | * |
155 | * PARAMETERS: walk_list - The list that owns the walk stack | 155 | * PARAMETERS: walk_list - The list that owns the walk stack |
156 | * Op - The control Op | 156 | * op - The control Op |
157 | * | 157 | * |
158 | * RETURN: Status | 158 | * RETURN: Status |
159 | * | 159 | * |
diff --git a/drivers/acpi/acpica/dsfield.c b/drivers/acpi/acpica/dsfield.c index cd243cf2cab2..3da6fd8530c5 100644 --- a/drivers/acpi/acpica/dsfield.c +++ b/drivers/acpi/acpica/dsfield.c | |||
@@ -53,16 +53,84 @@ | |||
53 | ACPI_MODULE_NAME("dsfield") | 53 | ACPI_MODULE_NAME("dsfield") |
54 | 54 | ||
55 | /* Local prototypes */ | 55 | /* Local prototypes */ |
56 | #ifdef ACPI_ASL_COMPILER | ||
57 | #include "acdisasm.h" | ||
58 | static acpi_status | ||
59 | acpi_ds_create_external_region(acpi_status lookup_status, | ||
60 | union acpi_parse_object *op, | ||
61 | char *path, | ||
62 | struct acpi_walk_state *walk_state, | ||
63 | struct acpi_namespace_node **node); | ||
64 | #endif | ||
65 | |||
56 | static acpi_status | 66 | static acpi_status |
57 | acpi_ds_get_field_names(struct acpi_create_field_info *info, | 67 | acpi_ds_get_field_names(struct acpi_create_field_info *info, |
58 | struct acpi_walk_state *walk_state, | 68 | struct acpi_walk_state *walk_state, |
59 | union acpi_parse_object *arg); | 69 | union acpi_parse_object *arg); |
60 | 70 | ||
71 | #ifdef ACPI_ASL_COMPILER | ||
72 | /******************************************************************************* | ||
73 | * | ||
74 | * FUNCTION: acpi_ds_create_external_region (iASL Disassembler only) | ||
75 | * | ||
76 | * PARAMETERS: lookup_status - Status from ns_lookup operation | ||
77 | * op - Op containing the Field definition and args | ||
78 | * path - Pathname of the region | ||
79 | * ` walk_state - Current method state | ||
80 | * node - Where the new region node is returned | ||
81 | * | ||
82 | * RETURN: Status | ||
83 | * | ||
84 | * DESCRIPTION: Add region to the external list if NOT_FOUND. Create a new | ||
85 | * region node/object. | ||
86 | * | ||
87 | ******************************************************************************/ | ||
88 | |||
89 | static acpi_status | ||
90 | acpi_ds_create_external_region(acpi_status lookup_status, | ||
91 | union acpi_parse_object *op, | ||
92 | char *path, | ||
93 | struct acpi_walk_state *walk_state, | ||
94 | struct acpi_namespace_node **node) | ||
95 | { | ||
96 | acpi_status status; | ||
97 | union acpi_operand_object *obj_desc; | ||
98 | |||
99 | if (lookup_status != AE_NOT_FOUND) { | ||
100 | return (lookup_status); | ||
101 | } | ||
102 | |||
103 | /* | ||
104 | * Table disassembly: | ||
105 | * operation_region not found. Generate an External for it, and | ||
106 | * insert the name into the namespace. | ||
107 | */ | ||
108 | acpi_dm_add_to_external_list(op, path, ACPI_TYPE_REGION, 0); | ||
109 | status = acpi_ns_lookup(walk_state->scope_info, path, ACPI_TYPE_REGION, | ||
110 | ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT, | ||
111 | walk_state, node); | ||
112 | if (ACPI_FAILURE(status)) { | ||
113 | return (status); | ||
114 | } | ||
115 | |||
116 | /* Must create and install a region object for the new node */ | ||
117 | |||
118 | obj_desc = acpi_ut_create_internal_object(ACPI_TYPE_REGION); | ||
119 | if (!obj_desc) { | ||
120 | return (AE_NO_MEMORY); | ||
121 | } | ||
122 | |||
123 | obj_desc->region.node = *node; | ||
124 | status = acpi_ns_attach_object(*node, obj_desc, ACPI_TYPE_REGION); | ||
125 | return (status); | ||
126 | } | ||
127 | #endif | ||
128 | |||
61 | /******************************************************************************* | 129 | /******************************************************************************* |
62 | * | 130 | * |
63 | * FUNCTION: acpi_ds_create_buffer_field | 131 | * FUNCTION: acpi_ds_create_buffer_field |
64 | * | 132 | * |
65 | * PARAMETERS: Op - Current parse op (create_xXField) | 133 | * PARAMETERS: op - Current parse op (create_XXField) |
66 | * walk_state - Current state | 134 | * walk_state - Current state |
67 | * | 135 | * |
68 | * RETURN: Status | 136 | * RETURN: Status |
@@ -99,7 +167,7 @@ acpi_ds_create_buffer_field(union acpi_parse_object *op, | |||
99 | 167 | ||
100 | arg = acpi_ps_get_arg(op, 3); | 168 | arg = acpi_ps_get_arg(op, 3); |
101 | } else { | 169 | } else { |
102 | /* For all other create_xXXField operators, name is the 3rd argument */ | 170 | /* For all other create_XXXField operators, name is the 3rd argument */ |
103 | 171 | ||
104 | arg = acpi_ps_get_arg(op, 2); | 172 | arg = acpi_ps_get_arg(op, 2); |
105 | } | 173 | } |
@@ -203,9 +271,9 @@ acpi_ds_create_buffer_field(union acpi_parse_object *op, | |||
203 | * | 271 | * |
204 | * FUNCTION: acpi_ds_get_field_names | 272 | * FUNCTION: acpi_ds_get_field_names |
205 | * | 273 | * |
206 | * PARAMETERS: Info - create_field info structure | 274 | * PARAMETERS: info - create_field info structure |
207 | * ` walk_state - Current method state | 275 | * ` walk_state - Current method state |
208 | * Arg - First parser arg for the field name list | 276 | * arg - First parser arg for the field name list |
209 | * | 277 | * |
210 | * RETURN: Status | 278 | * RETURN: Status |
211 | * | 279 | * |
@@ -234,10 +302,10 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info, | |||
234 | while (arg) { | 302 | while (arg) { |
235 | /* | 303 | /* |
236 | * Four types of field elements are handled: | 304 | * Four types of field elements are handled: |
237 | * 1) Name - Enters a new named field into the namespace | 305 | * 1) name - Enters a new named field into the namespace |
238 | * 2) Offset - specifies a bit offset | 306 | * 2) offset - specifies a bit offset |
239 | * 3) access_as - changes the access mode/attributes | 307 | * 3) access_as - changes the access mode/attributes |
240 | * 4) Connection - Associate a resource template with the field | 308 | * 4) connection - Associate a resource template with the field |
241 | */ | 309 | */ |
242 | switch (arg->common.aml_opcode) { | 310 | switch (arg->common.aml_opcode) { |
243 | case AML_INT_RESERVEDFIELD_OP: | 311 | case AML_INT_RESERVEDFIELD_OP: |
@@ -389,7 +457,7 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info, | |||
389 | * | 457 | * |
390 | * FUNCTION: acpi_ds_create_field | 458 | * FUNCTION: acpi_ds_create_field |
391 | * | 459 | * |
392 | * PARAMETERS: Op - Op containing the Field definition and args | 460 | * PARAMETERS: op - Op containing the Field definition and args |
393 | * region_node - Object for the containing Operation Region | 461 | * region_node - Object for the containing Operation Region |
394 | * ` walk_state - Current method state | 462 | * ` walk_state - Current method state |
395 | * | 463 | * |
@@ -413,12 +481,19 @@ acpi_ds_create_field(union acpi_parse_object *op, | |||
413 | /* First arg is the name of the parent op_region (must already exist) */ | 481 | /* First arg is the name of the parent op_region (must already exist) */ |
414 | 482 | ||
415 | arg = op->common.value.arg; | 483 | arg = op->common.value.arg; |
484 | |||
416 | if (!region_node) { | 485 | if (!region_node) { |
417 | status = | 486 | status = |
418 | acpi_ns_lookup(walk_state->scope_info, | 487 | acpi_ns_lookup(walk_state->scope_info, |
419 | arg->common.value.name, ACPI_TYPE_REGION, | 488 | arg->common.value.name, ACPI_TYPE_REGION, |
420 | ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, | 489 | ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, |
421 | walk_state, ®ion_node); | 490 | walk_state, ®ion_node); |
491 | #ifdef ACPI_ASL_COMPILER | ||
492 | status = acpi_ds_create_external_region(status, arg, | ||
493 | arg->common.value.name, | ||
494 | walk_state, | ||
495 | ®ion_node); | ||
496 | #endif | ||
422 | if (ACPI_FAILURE(status)) { | 497 | if (ACPI_FAILURE(status)) { |
423 | ACPI_ERROR_NAMESPACE(arg->common.value.name, status); | 498 | ACPI_ERROR_NAMESPACE(arg->common.value.name, status); |
424 | return_ACPI_STATUS(status); | 499 | return_ACPI_STATUS(status); |
@@ -446,7 +521,7 @@ acpi_ds_create_field(union acpi_parse_object *op, | |||
446 | * | 521 | * |
447 | * FUNCTION: acpi_ds_init_field_objects | 522 | * FUNCTION: acpi_ds_init_field_objects |
448 | * | 523 | * |
449 | * PARAMETERS: Op - Op containing the Field definition and args | 524 | * PARAMETERS: op - Op containing the Field definition and args |
450 | * ` walk_state - Current method state | 525 | * ` walk_state - Current method state |
451 | * | 526 | * |
452 | * RETURN: Status | 527 | * RETURN: Status |
@@ -561,7 +636,7 @@ acpi_ds_init_field_objects(union acpi_parse_object *op, | |||
561 | * | 636 | * |
562 | * FUNCTION: acpi_ds_create_bank_field | 637 | * FUNCTION: acpi_ds_create_bank_field |
563 | * | 638 | * |
564 | * PARAMETERS: Op - Op containing the Field definition and args | 639 | * PARAMETERS: op - Op containing the Field definition and args |
565 | * region_node - Object for the containing Operation Region | 640 | * region_node - Object for the containing Operation Region |
566 | * walk_state - Current method state | 641 | * walk_state - Current method state |
567 | * | 642 | * |
@@ -591,6 +666,12 @@ acpi_ds_create_bank_field(union acpi_parse_object *op, | |||
591 | arg->common.value.name, ACPI_TYPE_REGION, | 666 | arg->common.value.name, ACPI_TYPE_REGION, |
592 | ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, | 667 | ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, |
593 | walk_state, ®ion_node); | 668 | walk_state, ®ion_node); |
669 | #ifdef ACPI_ASL_COMPILER | ||
670 | status = acpi_ds_create_external_region(status, arg, | ||
671 | arg->common.value.name, | ||
672 | walk_state, | ||
673 | ®ion_node); | ||
674 | #endif | ||
594 | if (ACPI_FAILURE(status)) { | 675 | if (ACPI_FAILURE(status)) { |
595 | ACPI_ERROR_NAMESPACE(arg->common.value.name, status); | 676 | ACPI_ERROR_NAMESPACE(arg->common.value.name, status); |
596 | return_ACPI_STATUS(status); | 677 | return_ACPI_STATUS(status); |
@@ -645,7 +726,7 @@ acpi_ds_create_bank_field(union acpi_parse_object *op, | |||
645 | * | 726 | * |
646 | * FUNCTION: acpi_ds_create_index_field | 727 | * FUNCTION: acpi_ds_create_index_field |
647 | * | 728 | * |
648 | * PARAMETERS: Op - Op containing the Field definition and args | 729 | * PARAMETERS: op - Op containing the Field definition and args |
649 | * region_node - Object for the containing Operation Region | 730 | * region_node - Object for the containing Operation Region |
650 | * ` walk_state - Current method state | 731 | * ` walk_state - Current method state |
651 | * | 732 | * |
diff --git a/drivers/acpi/acpica/dsinit.c b/drivers/acpi/acpica/dsinit.c index 9e5ac7f780a7..87eff701ecfa 100644 --- a/drivers/acpi/acpica/dsinit.c +++ b/drivers/acpi/acpica/dsinit.c | |||
@@ -60,8 +60,8 @@ acpi_ds_init_one_object(acpi_handle obj_handle, | |||
60 | * FUNCTION: acpi_ds_init_one_object | 60 | * FUNCTION: acpi_ds_init_one_object |
61 | * | 61 | * |
62 | * PARAMETERS: obj_handle - Node for the object | 62 | * PARAMETERS: obj_handle - Node for the object |
63 | * Level - Current nesting level | 63 | * level - Current nesting level |
64 | * Context - Points to a init info struct | 64 | * context - Points to a init info struct |
65 | * return_value - Not used | 65 | * return_value - Not used |
66 | * | 66 | * |
67 | * RETURN: Status | 67 | * RETURN: Status |
diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c index 00f5dab5bcc0..aa9a5d4e4052 100644 --- a/drivers/acpi/acpica/dsmethod.c +++ b/drivers/acpi/acpica/dsmethod.c | |||
@@ -61,7 +61,7 @@ acpi_ds_create_method_mutex(union acpi_operand_object *method_desc); | |||
61 | * | 61 | * |
62 | * FUNCTION: acpi_ds_method_error | 62 | * FUNCTION: acpi_ds_method_error |
63 | * | 63 | * |
64 | * PARAMETERS: Status - Execution status | 64 | * PARAMETERS: status - Execution status |
65 | * walk_state - Current state | 65 | * walk_state - Current state |
66 | * | 66 | * |
67 | * RETURN: Status | 67 | * RETURN: Status |
@@ -306,9 +306,9 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node, | |||
306 | * | 306 | * |
307 | * FUNCTION: acpi_ds_call_control_method | 307 | * FUNCTION: acpi_ds_call_control_method |
308 | * | 308 | * |
309 | * PARAMETERS: Thread - Info for this thread | 309 | * PARAMETERS: thread - Info for this thread |
310 | * this_walk_state - Current walk state | 310 | * this_walk_state - Current walk state |
311 | * Op - Current Op to be walked | 311 | * op - Current Op to be walked |
312 | * | 312 | * |
313 | * RETURN: Status | 313 | * RETURN: Status |
314 | * | 314 | * |
diff --git a/drivers/acpi/acpica/dsmthdat.c b/drivers/acpi/acpica/dsmthdat.c index b40bd507be5d..8d55cebaa656 100644 --- a/drivers/acpi/acpica/dsmthdat.c +++ b/drivers/acpi/acpica/dsmthdat.c | |||
@@ -177,7 +177,7 @@ void acpi_ds_method_data_delete_all(struct acpi_walk_state *walk_state) | |||
177 | * | 177 | * |
178 | * FUNCTION: acpi_ds_method_data_init_args | 178 | * FUNCTION: acpi_ds_method_data_init_args |
179 | * | 179 | * |
180 | * PARAMETERS: *Params - Pointer to a parameter list for the method | 180 | * PARAMETERS: *params - Pointer to a parameter list for the method |
181 | * max_param_count - The arg count for this method | 181 | * max_param_count - The arg count for this method |
182 | * walk_state - Current walk state object | 182 | * walk_state - Current walk state object |
183 | * | 183 | * |
@@ -232,11 +232,11 @@ acpi_ds_method_data_init_args(union acpi_operand_object **params, | |||
232 | * | 232 | * |
233 | * FUNCTION: acpi_ds_method_data_get_node | 233 | * FUNCTION: acpi_ds_method_data_get_node |
234 | * | 234 | * |
235 | * PARAMETERS: Type - Either ACPI_REFCLASS_LOCAL or | 235 | * PARAMETERS: type - Either ACPI_REFCLASS_LOCAL or |
236 | * ACPI_REFCLASS_ARG | 236 | * ACPI_REFCLASS_ARG |
237 | * Index - Which Local or Arg whose type to get | 237 | * index - Which Local or Arg whose type to get |
238 | * walk_state - Current walk state object | 238 | * walk_state - Current walk state object |
239 | * Node - Where the node is returned. | 239 | * node - Where the node is returned. |
240 | * | 240 | * |
241 | * RETURN: Status and node | 241 | * RETURN: Status and node |
242 | * | 242 | * |
@@ -296,10 +296,10 @@ acpi_ds_method_data_get_node(u8 type, | |||
296 | * | 296 | * |
297 | * FUNCTION: acpi_ds_method_data_set_value | 297 | * FUNCTION: acpi_ds_method_data_set_value |
298 | * | 298 | * |
299 | * PARAMETERS: Type - Either ACPI_REFCLASS_LOCAL or | 299 | * PARAMETERS: type - Either ACPI_REFCLASS_LOCAL or |
300 | * ACPI_REFCLASS_ARG | 300 | * ACPI_REFCLASS_ARG |
301 | * Index - Which Local or Arg to get | 301 | * index - Which Local or Arg to get |
302 | * Object - Object to be inserted into the stack entry | 302 | * object - Object to be inserted into the stack entry |
303 | * walk_state - Current walk state object | 303 | * walk_state - Current walk state object |
304 | * | 304 | * |
305 | * RETURN: Status | 305 | * RETURN: Status |
@@ -336,7 +336,7 @@ acpi_ds_method_data_set_value(u8 type, | |||
336 | * Increment ref count so object can't be deleted while installed. | 336 | * Increment ref count so object can't be deleted while installed. |
337 | * NOTE: We do not copy the object in order to preserve the call by | 337 | * NOTE: We do not copy the object in order to preserve the call by |
338 | * reference semantics of ACPI Control Method invocation. | 338 | * reference semantics of ACPI Control Method invocation. |
339 | * (See ACPI Specification 2.0_c) | 339 | * (See ACPI Specification 2.0C) |
340 | */ | 340 | */ |
341 | acpi_ut_add_reference(object); | 341 | acpi_ut_add_reference(object); |
342 | 342 | ||
@@ -350,9 +350,9 @@ acpi_ds_method_data_set_value(u8 type, | |||
350 | * | 350 | * |
351 | * FUNCTION: acpi_ds_method_data_get_value | 351 | * FUNCTION: acpi_ds_method_data_get_value |
352 | * | 352 | * |
353 | * PARAMETERS: Type - Either ACPI_REFCLASS_LOCAL or | 353 | * PARAMETERS: type - Either ACPI_REFCLASS_LOCAL or |
354 | * ACPI_REFCLASS_ARG | 354 | * ACPI_REFCLASS_ARG |
355 | * Index - Which local_var or argument to get | 355 | * index - Which localVar or argument to get |
356 | * walk_state - Current walk state object | 356 | * walk_state - Current walk state object |
357 | * dest_desc - Where Arg or Local value is returned | 357 | * dest_desc - Where Arg or Local value is returned |
358 | * | 358 | * |
@@ -458,9 +458,9 @@ acpi_ds_method_data_get_value(u8 type, | |||
458 | * | 458 | * |
459 | * FUNCTION: acpi_ds_method_data_delete_value | 459 | * FUNCTION: acpi_ds_method_data_delete_value |
460 | * | 460 | * |
461 | * PARAMETERS: Type - Either ACPI_REFCLASS_LOCAL or | 461 | * PARAMETERS: type - Either ACPI_REFCLASS_LOCAL or |
462 | * ACPI_REFCLASS_ARG | 462 | * ACPI_REFCLASS_ARG |
463 | * Index - Which local_var or argument to delete | 463 | * index - Which localVar or argument to delete |
464 | * walk_state - Current walk state object | 464 | * walk_state - Current walk state object |
465 | * | 465 | * |
466 | * RETURN: None | 466 | * RETURN: None |
@@ -515,9 +515,9 @@ acpi_ds_method_data_delete_value(u8 type, | |||
515 | * | 515 | * |
516 | * FUNCTION: acpi_ds_store_object_to_local | 516 | * FUNCTION: acpi_ds_store_object_to_local |
517 | * | 517 | * |
518 | * PARAMETERS: Type - Either ACPI_REFCLASS_LOCAL or | 518 | * PARAMETERS: type - Either ACPI_REFCLASS_LOCAL or |
519 | * ACPI_REFCLASS_ARG | 519 | * ACPI_REFCLASS_ARG |
520 | * Index - Which Local or Arg to set | 520 | * index - Which Local or Arg to set |
521 | * obj_desc - Value to be stored | 521 | * obj_desc - Value to be stored |
522 | * walk_state - Current walk state | 522 | * walk_state - Current walk state |
523 | * | 523 | * |
@@ -670,8 +670,8 @@ acpi_ds_store_object_to_local(u8 type, | |||
670 | * | 670 | * |
671 | * FUNCTION: acpi_ds_method_data_get_type | 671 | * FUNCTION: acpi_ds_method_data_get_type |
672 | * | 672 | * |
673 | * PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP | 673 | * PARAMETERS: opcode - Either AML_LOCAL_OP or AML_ARG_OP |
674 | * Index - Which Local or Arg whose type to get | 674 | * index - Which Local or Arg whose type to get |
675 | * walk_state - Current walk state object | 675 | * walk_state - Current walk state object |
676 | * | 676 | * |
677 | * RETURN: Data type of current value of the selected Arg or Local | 677 | * RETURN: Data type of current value of the selected Arg or Local |
diff --git a/drivers/acpi/acpica/dsobject.c b/drivers/acpi/acpica/dsobject.c index d7045ca3e32a..68592dd34960 100644 --- a/drivers/acpi/acpica/dsobject.c +++ b/drivers/acpi/acpica/dsobject.c | |||
@@ -64,7 +64,7 @@ acpi_ds_build_internal_object(struct acpi_walk_state *walk_state, | |||
64 | * FUNCTION: acpi_ds_build_internal_object | 64 | * FUNCTION: acpi_ds_build_internal_object |
65 | * | 65 | * |
66 | * PARAMETERS: walk_state - Current walk state | 66 | * PARAMETERS: walk_state - Current walk state |
67 | * Op - Parser object to be translated | 67 | * op - Parser object to be translated |
68 | * obj_desc_ptr - Where the ACPI internal object is returned | 68 | * obj_desc_ptr - Where the ACPI internal object is returned |
69 | * | 69 | * |
70 | * RETURN: Status | 70 | * RETURN: Status |
@@ -250,7 +250,7 @@ acpi_ds_build_internal_object(struct acpi_walk_state *walk_state, | |||
250 | * FUNCTION: acpi_ds_build_internal_buffer_obj | 250 | * FUNCTION: acpi_ds_build_internal_buffer_obj |
251 | * | 251 | * |
252 | * PARAMETERS: walk_state - Current walk state | 252 | * PARAMETERS: walk_state - Current walk state |
253 | * Op - Parser object to be translated | 253 | * op - Parser object to be translated |
254 | * buffer_length - Length of the buffer | 254 | * buffer_length - Length of the buffer |
255 | * obj_desc_ptr - Where the ACPI internal object is returned | 255 | * obj_desc_ptr - Where the ACPI internal object is returned |
256 | * | 256 | * |
@@ -354,7 +354,7 @@ acpi_ds_build_internal_buffer_obj(struct acpi_walk_state *walk_state, | |||
354 | * FUNCTION: acpi_ds_build_internal_package_obj | 354 | * FUNCTION: acpi_ds_build_internal_package_obj |
355 | * | 355 | * |
356 | * PARAMETERS: walk_state - Current walk state | 356 | * PARAMETERS: walk_state - Current walk state |
357 | * Op - Parser object to be translated | 357 | * op - Parser object to be translated |
358 | * element_count - Number of elements in the package - this is | 358 | * element_count - Number of elements in the package - this is |
359 | * the num_elements argument to Package() | 359 | * the num_elements argument to Package() |
360 | * obj_desc_ptr - Where the ACPI internal object is returned | 360 | * obj_desc_ptr - Where the ACPI internal object is returned |
@@ -547,8 +547,8 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state, | |||
547 | * FUNCTION: acpi_ds_create_node | 547 | * FUNCTION: acpi_ds_create_node |
548 | * | 548 | * |
549 | * PARAMETERS: walk_state - Current walk state | 549 | * PARAMETERS: walk_state - Current walk state |
550 | * Node - NS Node to be initialized | 550 | * node - NS Node to be initialized |
551 | * Op - Parser object to be translated | 551 | * op - Parser object to be translated |
552 | * | 552 | * |
553 | * RETURN: Status | 553 | * RETURN: Status |
554 | * | 554 | * |
@@ -611,8 +611,8 @@ acpi_ds_create_node(struct acpi_walk_state *walk_state, | |||
611 | * FUNCTION: acpi_ds_init_object_from_op | 611 | * FUNCTION: acpi_ds_init_object_from_op |
612 | * | 612 | * |
613 | * PARAMETERS: walk_state - Current walk state | 613 | * PARAMETERS: walk_state - Current walk state |
614 | * Op - Parser op used to init the internal object | 614 | * op - Parser op used to init the internal object |
615 | * Opcode - AML opcode associated with the object | 615 | * opcode - AML opcode associated with the object |
616 | * ret_obj_desc - Namespace object to be initialized | 616 | * ret_obj_desc - Namespace object to be initialized |
617 | * | 617 | * |
618 | * RETURN: Status | 618 | * RETURN: Status |
diff --git a/drivers/acpi/acpica/dsopcode.c b/drivers/acpi/acpica/dsopcode.c index e5eff7585102..aa34d8984d34 100644 --- a/drivers/acpi/acpica/dsopcode.c +++ b/drivers/acpi/acpica/dsopcode.c | |||
@@ -286,7 +286,7 @@ acpi_ds_init_buffer_field(u16 aml_opcode, | |||
286 | * FUNCTION: acpi_ds_eval_buffer_field_operands | 286 | * FUNCTION: acpi_ds_eval_buffer_field_operands |
287 | * | 287 | * |
288 | * PARAMETERS: walk_state - Current walk | 288 | * PARAMETERS: walk_state - Current walk |
289 | * Op - A valid buffer_field Op object | 289 | * op - A valid buffer_field Op object |
290 | * | 290 | * |
291 | * RETURN: Status | 291 | * RETURN: Status |
292 | * | 292 | * |
@@ -370,7 +370,7 @@ acpi_ds_eval_buffer_field_operands(struct acpi_walk_state *walk_state, | |||
370 | * FUNCTION: acpi_ds_eval_region_operands | 370 | * FUNCTION: acpi_ds_eval_region_operands |
371 | * | 371 | * |
372 | * PARAMETERS: walk_state - Current walk | 372 | * PARAMETERS: walk_state - Current walk |
373 | * Op - A valid region Op object | 373 | * op - A valid region Op object |
374 | * | 374 | * |
375 | * RETURN: Status | 375 | * RETURN: Status |
376 | * | 376 | * |
@@ -397,7 +397,7 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state, | |||
397 | */ | 397 | */ |
398 | node = op->common.node; | 398 | node = op->common.node; |
399 | 399 | ||
400 | /* next_op points to the op that holds the space_iD */ | 400 | /* next_op points to the op that holds the space_ID */ |
401 | 401 | ||
402 | next_op = op->common.value.arg; | 402 | next_op = op->common.value.arg; |
403 | 403 | ||
@@ -461,7 +461,7 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state, | |||
461 | * FUNCTION: acpi_ds_eval_table_region_operands | 461 | * FUNCTION: acpi_ds_eval_table_region_operands |
462 | * | 462 | * |
463 | * PARAMETERS: walk_state - Current walk | 463 | * PARAMETERS: walk_state - Current walk |
464 | * Op - A valid region Op object | 464 | * op - A valid region Op object |
465 | * | 465 | * |
466 | * RETURN: Status | 466 | * RETURN: Status |
467 | * | 467 | * |
@@ -560,7 +560,7 @@ acpi_ds_eval_table_region_operands(struct acpi_walk_state *walk_state, | |||
560 | * FUNCTION: acpi_ds_eval_data_object_operands | 560 | * FUNCTION: acpi_ds_eval_data_object_operands |
561 | * | 561 | * |
562 | * PARAMETERS: walk_state - Current walk | 562 | * PARAMETERS: walk_state - Current walk |
563 | * Op - A valid data_object Op object | 563 | * op - A valid data_object Op object |
564 | * obj_desc - data_object | 564 | * obj_desc - data_object |
565 | * | 565 | * |
566 | * RETURN: Status | 566 | * RETURN: Status |
@@ -662,7 +662,7 @@ acpi_ds_eval_data_object_operands(struct acpi_walk_state *walk_state, | |||
662 | * FUNCTION: acpi_ds_eval_bank_field_operands | 662 | * FUNCTION: acpi_ds_eval_bank_field_operands |
663 | * | 663 | * |
664 | * PARAMETERS: walk_state - Current walk | 664 | * PARAMETERS: walk_state - Current walk |
665 | * Op - A valid bank_field Op object | 665 | * op - A valid bank_field Op object |
666 | * | 666 | * |
667 | * RETURN: Status | 667 | * RETURN: Status |
668 | * | 668 | * |
diff --git a/drivers/acpi/acpica/dsutils.c b/drivers/acpi/acpica/dsutils.c index 1abcda31037f..73a5447475f5 100644 --- a/drivers/acpi/acpica/dsutils.c +++ b/drivers/acpi/acpica/dsutils.c | |||
@@ -157,7 +157,7 @@ acpi_ds_do_implicit_return(union acpi_operand_object *return_desc, | |||
157 | * | 157 | * |
158 | * FUNCTION: acpi_ds_is_result_used | 158 | * FUNCTION: acpi_ds_is_result_used |
159 | * | 159 | * |
160 | * PARAMETERS: Op - Current Op | 160 | * PARAMETERS: op - Current Op |
161 | * walk_state - Current State | 161 | * walk_state - Current State |
162 | * | 162 | * |
163 | * RETURN: TRUE if result is used, FALSE otherwise | 163 | * RETURN: TRUE if result is used, FALSE otherwise |
@@ -323,7 +323,7 @@ acpi_ds_is_result_used(union acpi_parse_object * op, | |||
323 | * | 323 | * |
324 | * FUNCTION: acpi_ds_delete_result_if_not_used | 324 | * FUNCTION: acpi_ds_delete_result_if_not_used |
325 | * | 325 | * |
326 | * PARAMETERS: Op - Current parse Op | 326 | * PARAMETERS: op - Current parse Op |
327 | * result_obj - Result of the operation | 327 | * result_obj - Result of the operation |
328 | * walk_state - Current state | 328 | * walk_state - Current state |
329 | * | 329 | * |
@@ -445,7 +445,7 @@ void acpi_ds_clear_operands(struct acpi_walk_state *walk_state) | |||
445 | * FUNCTION: acpi_ds_create_operand | 445 | * FUNCTION: acpi_ds_create_operand |
446 | * | 446 | * |
447 | * PARAMETERS: walk_state - Current walk state | 447 | * PARAMETERS: walk_state - Current walk state |
448 | * Arg - Parse object for the argument | 448 | * arg - Parse object for the argument |
449 | * arg_index - Which argument (zero based) | 449 | * arg_index - Which argument (zero based) |
450 | * | 450 | * |
451 | * RETURN: Status | 451 | * RETURN: Status |
diff --git a/drivers/acpi/acpica/dswload.c b/drivers/acpi/acpica/dswload.c index 552aa3a50c84..557510084c7a 100644 --- a/drivers/acpi/acpica/dswload.c +++ b/drivers/acpi/acpica/dswload.c | |||
@@ -230,6 +230,20 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state, | |||
230 | walk_state->scope_info->common.value = ACPI_TYPE_ANY; | 230 | walk_state->scope_info->common.value = ACPI_TYPE_ANY; |
231 | break; | 231 | break; |
232 | 232 | ||
233 | case ACPI_TYPE_METHOD: | ||
234 | |||
235 | /* | ||
236 | * Allow scope change to root during execution of module-level | ||
237 | * code. Root is typed METHOD during this time. | ||
238 | */ | ||
239 | if ((node == acpi_gbl_root_node) && | ||
240 | (walk_state-> | ||
241 | parse_flags & ACPI_PARSE_MODULE_LEVEL)) { | ||
242 | break; | ||
243 | } | ||
244 | |||
245 | /*lint -fallthrough */ | ||
246 | |||
233 | default: | 247 | default: |
234 | 248 | ||
235 | /* All other types are an error */ | 249 | /* All other types are an error */ |
diff --git a/drivers/acpi/acpica/dswload2.c b/drivers/acpi/acpica/dswload2.c index ae7147724763..89c0114210c0 100644 --- a/drivers/acpi/acpica/dswload2.c +++ b/drivers/acpi/acpica/dswload2.c | |||
@@ -230,6 +230,20 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state, | |||
230 | walk_state->scope_info->common.value = ACPI_TYPE_ANY; | 230 | walk_state->scope_info->common.value = ACPI_TYPE_ANY; |
231 | break; | 231 | break; |
232 | 232 | ||
233 | case ACPI_TYPE_METHOD: | ||
234 | |||
235 | /* | ||
236 | * Allow scope change to root during execution of module-level | ||
237 | * code. Root is typed METHOD during this time. | ||
238 | */ | ||
239 | if ((node == acpi_gbl_root_node) && | ||
240 | (walk_state-> | ||
241 | parse_flags & ACPI_PARSE_MODULE_LEVEL)) { | ||
242 | break; | ||
243 | } | ||
244 | |||
245 | /*lint -fallthrough */ | ||
246 | |||
233 | default: | 247 | default: |
234 | 248 | ||
235 | /* All other types are an error */ | 249 | /* All other types are an error */ |
diff --git a/drivers/acpi/acpica/dswscope.c b/drivers/acpi/acpica/dswscope.c index 9e9490a9cbf0..f6c4295470ae 100644 --- a/drivers/acpi/acpica/dswscope.c +++ b/drivers/acpi/acpica/dswscope.c | |||
@@ -85,8 +85,8 @@ void acpi_ds_scope_stack_clear(struct acpi_walk_state *walk_state) | |||
85 | * | 85 | * |
86 | * FUNCTION: acpi_ds_scope_stack_push | 86 | * FUNCTION: acpi_ds_scope_stack_push |
87 | * | 87 | * |
88 | * PARAMETERS: Node - Name to be made current | 88 | * PARAMETERS: node - Name to be made current |
89 | * Type - Type of frame being pushed | 89 | * type - Type of frame being pushed |
90 | * walk_state - Current state | 90 | * walk_state - Current state |
91 | * | 91 | * |
92 | * RETURN: Status | 92 | * RETURN: Status |
diff --git a/drivers/acpi/acpica/dswstate.c b/drivers/acpi/acpica/dswstate.c index c9c2ac13e7cc..d0e6555061e4 100644 --- a/drivers/acpi/acpica/dswstate.c +++ b/drivers/acpi/acpica/dswstate.c | |||
@@ -58,7 +58,7 @@ static acpi_status acpi_ds_result_stack_pop(struct acpi_walk_state *ws); | |||
58 | * | 58 | * |
59 | * FUNCTION: acpi_ds_result_pop | 59 | * FUNCTION: acpi_ds_result_pop |
60 | * | 60 | * |
61 | * PARAMETERS: Object - Where to return the popped object | 61 | * PARAMETERS: object - Where to return the popped object |
62 | * walk_state - Current Walk state | 62 | * walk_state - Current Walk state |
63 | * | 63 | * |
64 | * RETURN: Status | 64 | * RETURN: Status |
@@ -132,7 +132,7 @@ acpi_ds_result_pop(union acpi_operand_object **object, | |||
132 | * | 132 | * |
133 | * FUNCTION: acpi_ds_result_push | 133 | * FUNCTION: acpi_ds_result_push |
134 | * | 134 | * |
135 | * PARAMETERS: Object - Where to return the popped object | 135 | * PARAMETERS: object - Where to return the popped object |
136 | * walk_state - Current Walk state | 136 | * walk_state - Current Walk state |
137 | * | 137 | * |
138 | * RETURN: Status | 138 | * RETURN: Status |
@@ -296,7 +296,7 @@ static acpi_status acpi_ds_result_stack_pop(struct acpi_walk_state *walk_state) | |||
296 | * | 296 | * |
297 | * FUNCTION: acpi_ds_obj_stack_push | 297 | * FUNCTION: acpi_ds_obj_stack_push |
298 | * | 298 | * |
299 | * PARAMETERS: Object - Object to push | 299 | * PARAMETERS: object - Object to push |
300 | * walk_state - Current Walk state | 300 | * walk_state - Current Walk state |
301 | * | 301 | * |
302 | * RETURN: Status | 302 | * RETURN: Status |
@@ -433,7 +433,7 @@ acpi_ds_obj_stack_pop_and_delete(u32 pop_count, | |||
433 | * | 433 | * |
434 | * FUNCTION: acpi_ds_get_current_walk_state | 434 | * FUNCTION: acpi_ds_get_current_walk_state |
435 | * | 435 | * |
436 | * PARAMETERS: Thread - Get current active state for this Thread | 436 | * PARAMETERS: thread - Get current active state for this Thread |
437 | * | 437 | * |
438 | * RETURN: Pointer to the current walk state | 438 | * RETURN: Pointer to the current walk state |
439 | * | 439 | * |
@@ -462,7 +462,7 @@ struct acpi_walk_state *acpi_ds_get_current_walk_state(struct acpi_thread_state | |||
462 | * FUNCTION: acpi_ds_push_walk_state | 462 | * FUNCTION: acpi_ds_push_walk_state |
463 | * | 463 | * |
464 | * PARAMETERS: walk_state - State to push | 464 | * PARAMETERS: walk_state - State to push |
465 | * Thread - Thread state object | 465 | * thread - Thread state object |
466 | * | 466 | * |
467 | * RETURN: None | 467 | * RETURN: None |
468 | * | 468 | * |
@@ -486,7 +486,7 @@ acpi_ds_push_walk_state(struct acpi_walk_state *walk_state, | |||
486 | * | 486 | * |
487 | * FUNCTION: acpi_ds_pop_walk_state | 487 | * FUNCTION: acpi_ds_pop_walk_state |
488 | * | 488 | * |
489 | * PARAMETERS: Thread - Current thread state | 489 | * PARAMETERS: thread - Current thread state |
490 | * | 490 | * |
491 | * RETURN: A walk_state object popped from the thread's stack | 491 | * RETURN: A walk_state object popped from the thread's stack |
492 | * | 492 | * |
@@ -525,9 +525,9 @@ struct acpi_walk_state *acpi_ds_pop_walk_state(struct acpi_thread_state *thread) | |||
525 | * FUNCTION: acpi_ds_create_walk_state | 525 | * FUNCTION: acpi_ds_create_walk_state |
526 | * | 526 | * |
527 | * PARAMETERS: owner_id - ID for object creation | 527 | * PARAMETERS: owner_id - ID for object creation |
528 | * Origin - Starting point for this walk | 528 | * origin - Starting point for this walk |
529 | * method_desc - Method object | 529 | * method_desc - Method object |
530 | * Thread - Current thread state | 530 | * thread - Current thread state |
531 | * | 531 | * |
532 | * RETURN: Pointer to the new walk state. | 532 | * RETURN: Pointer to the new walk state. |
533 | * | 533 | * |
@@ -578,11 +578,11 @@ struct acpi_walk_state *acpi_ds_create_walk_state(acpi_owner_id owner_id, union | |||
578 | * FUNCTION: acpi_ds_init_aml_walk | 578 | * FUNCTION: acpi_ds_init_aml_walk |
579 | * | 579 | * |
580 | * PARAMETERS: walk_state - New state to be initialized | 580 | * PARAMETERS: walk_state - New state to be initialized |
581 | * Op - Current parse op | 581 | * op - Current parse op |
582 | * method_node - Control method NS node, if any | 582 | * method_node - Control method NS node, if any |
583 | * aml_start - Start of AML | 583 | * aml_start - Start of AML |
584 | * aml_length - Length of AML | 584 | * aml_length - Length of AML |
585 | * Info - Method info block (params, etc.) | 585 | * info - Method info block (params, etc.) |
586 | * pass_number - 1, 2, or 3 | 586 | * pass_number - 1, 2, or 3 |
587 | * | 587 | * |
588 | * RETURN: Status | 588 | * RETURN: Status |
diff --git a/drivers/acpi/acpica/evevent.c b/drivers/acpi/acpica/evevent.c index 07e4dc44f81c..d4acfbbe5b29 100644 --- a/drivers/acpi/acpica/evevent.c +++ b/drivers/acpi/acpica/evevent.c | |||
@@ -251,7 +251,7 @@ u32 acpi_ev_fixed_event_detect(void) | |||
251 | * | 251 | * |
252 | * FUNCTION: acpi_ev_fixed_event_dispatch | 252 | * FUNCTION: acpi_ev_fixed_event_dispatch |
253 | * | 253 | * |
254 | * PARAMETERS: Event - Event type | 254 | * PARAMETERS: event - Event type |
255 | * | 255 | * |
256 | * RETURN: INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED | 256 | * RETURN: INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED |
257 | * | 257 | * |
diff --git a/drivers/acpi/acpica/evglock.c b/drivers/acpi/acpica/evglock.c index cfeab38795d8..af14a7137632 100644 --- a/drivers/acpi/acpica/evglock.c +++ b/drivers/acpi/acpica/evglock.c | |||
@@ -135,7 +135,7 @@ acpi_status acpi_ev_remove_global_lock_handler(void) | |||
135 | * | 135 | * |
136 | * FUNCTION: acpi_ev_global_lock_handler | 136 | * FUNCTION: acpi_ev_global_lock_handler |
137 | * | 137 | * |
138 | * PARAMETERS: Context - From thread interface, not used | 138 | * PARAMETERS: context - From thread interface, not used |
139 | * | 139 | * |
140 | * RETURN: ACPI_INTERRUPT_HANDLED | 140 | * RETURN: ACPI_INTERRUPT_HANDLED |
141 | * | 141 | * |
@@ -182,7 +182,7 @@ static u32 acpi_ev_global_lock_handler(void *context) | |||
182 | * | 182 | * |
183 | * FUNCTION: acpi_ev_acquire_global_lock | 183 | * FUNCTION: acpi_ev_acquire_global_lock |
184 | * | 184 | * |
185 | * PARAMETERS: Timeout - Max time to wait for the lock, in millisec. | 185 | * PARAMETERS: timeout - Max time to wait for the lock, in millisec. |
186 | * | 186 | * |
187 | * RETURN: Status | 187 | * RETURN: Status |
188 | * | 188 | * |
diff --git a/drivers/acpi/acpica/evgpe.c b/drivers/acpi/acpica/evgpe.c index 8ba0e5f17091..ef0193d74b5d 100644 --- a/drivers/acpi/acpica/evgpe.c +++ b/drivers/acpi/acpica/evgpe.c | |||
@@ -80,8 +80,7 @@ acpi_ev_update_gpe_enable_mask(struct acpi_gpe_event_info *gpe_event_info) | |||
80 | return_ACPI_STATUS(AE_NOT_EXIST); | 80 | return_ACPI_STATUS(AE_NOT_EXIST); |
81 | } | 81 | } |
82 | 82 | ||
83 | register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info, | 83 | register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info); |
84 | gpe_register_info); | ||
85 | 84 | ||
86 | /* Clear the run bit up front */ | 85 | /* Clear the run bit up front */ |
87 | 86 | ||
@@ -379,6 +378,18 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list) | |||
379 | */ | 378 | */ |
380 | if (!(gpe_register_info->enable_for_run | | 379 | if (!(gpe_register_info->enable_for_run | |
381 | gpe_register_info->enable_for_wake)) { | 380 | gpe_register_info->enable_for_wake)) { |
381 | ACPI_DEBUG_PRINT((ACPI_DB_INTERRUPTS, | ||
382 | "Ignore disabled registers for GPE%02X-GPE%02X: " | ||
383 | "RunEnable=%02X, WakeEnable=%02X\n", | ||
384 | gpe_register_info-> | ||
385 | base_gpe_number, | ||
386 | gpe_register_info-> | ||
387 | base_gpe_number + | ||
388 | (ACPI_GPE_REGISTER_WIDTH - 1), | ||
389 | gpe_register_info-> | ||
390 | enable_for_run, | ||
391 | gpe_register_info-> | ||
392 | enable_for_wake)); | ||
382 | continue; | 393 | continue; |
383 | } | 394 | } |
384 | 395 | ||
@@ -401,9 +412,14 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list) | |||
401 | } | 412 | } |
402 | 413 | ||
403 | ACPI_DEBUG_PRINT((ACPI_DB_INTERRUPTS, | 414 | ACPI_DEBUG_PRINT((ACPI_DB_INTERRUPTS, |
404 | "Read GPE Register at GPE%02X: Status=%02X, Enable=%02X\n", | 415 | "Read registers for GPE%02X-GPE%02X: Status=%02X, Enable=%02X, " |
416 | "RunEnable=%02X, WakeEnable=%02X\n", | ||
405 | gpe_register_info->base_gpe_number, | 417 | gpe_register_info->base_gpe_number, |
406 | status_reg, enable_reg)); | 418 | gpe_register_info->base_gpe_number + |
419 | (ACPI_GPE_REGISTER_WIDTH - 1), | ||
420 | status_reg, enable_reg, | ||
421 | gpe_register_info->enable_for_run, | ||
422 | gpe_register_info->enable_for_wake)); | ||
407 | 423 | ||
408 | /* Check if there is anything active at all in this register */ | 424 | /* Check if there is anything active at all in this register */ |
409 | 425 | ||
@@ -466,7 +482,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context) | |||
466 | acpi_status status; | 482 | acpi_status status; |
467 | struct acpi_gpe_event_info *local_gpe_event_info; | 483 | struct acpi_gpe_event_info *local_gpe_event_info; |
468 | struct acpi_evaluate_info *info; | 484 | struct acpi_evaluate_info *info; |
469 | struct acpi_gpe_notify_object *notify_object; | 485 | struct acpi_gpe_notify_info *notify; |
470 | 486 | ||
471 | ACPI_FUNCTION_TRACE(ev_asynch_execute_gpe_method); | 487 | ACPI_FUNCTION_TRACE(ev_asynch_execute_gpe_method); |
472 | 488 | ||
@@ -517,17 +533,17 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context) | |||
517 | * completes. The notify handlers are NOT invoked synchronously | 533 | * completes. The notify handlers are NOT invoked synchronously |
518 | * from this thread -- because handlers may in turn run other | 534 | * from this thread -- because handlers may in turn run other |
519 | * control methods. | 535 | * control methods. |
536 | * | ||
537 | * June 2012: Expand implicit notify mechanism to support | ||
538 | * notifies on multiple device objects. | ||
520 | */ | 539 | */ |
521 | status = acpi_ev_queue_notify_request( | 540 | notify = local_gpe_event_info->dispatch.notify_list; |
522 | local_gpe_event_info->dispatch.device.node, | 541 | while (ACPI_SUCCESS(status) && notify) { |
523 | ACPI_NOTIFY_DEVICE_WAKE); | 542 | status = |
524 | 543 | acpi_ev_queue_notify_request(notify->device_node, | |
525 | notify_object = local_gpe_event_info->dispatch.device.next; | 544 | ACPI_NOTIFY_DEVICE_WAKE); |
526 | while (ACPI_SUCCESS(status) && notify_object) { | 545 | |
527 | status = acpi_ev_queue_notify_request( | 546 | notify = notify->next; |
528 | notify_object->node, | ||
529 | ACPI_NOTIFY_DEVICE_WAKE); | ||
530 | notify_object = notify_object->next; | ||
531 | } | 547 | } |
532 | 548 | ||
533 | break; | 549 | break; |
diff --git a/drivers/acpi/acpica/evgpeblk.c b/drivers/acpi/acpica/evgpeblk.c index 23a3ca86b2eb..8cf4c104c7b7 100644 --- a/drivers/acpi/acpica/evgpeblk.c +++ b/drivers/acpi/acpica/evgpeblk.c | |||
@@ -318,7 +318,7 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block) | |||
318 | * FUNCTION: acpi_ev_create_gpe_block | 318 | * FUNCTION: acpi_ev_create_gpe_block |
319 | * | 319 | * |
320 | * PARAMETERS: gpe_device - Handle to the parent GPE block | 320 | * PARAMETERS: gpe_device - Handle to the parent GPE block |
321 | * gpe_block_address - Address and space_iD | 321 | * gpe_block_address - Address and space_ID |
322 | * register_count - Number of GPE register pairs in the block | 322 | * register_count - Number of GPE register pairs in the block |
323 | * gpe_block_base_number - Starting GPE number for the block | 323 | * gpe_block_base_number - Starting GPE number for the block |
324 | * interrupt_number - H/W interrupt for the block | 324 | * interrupt_number - H/W interrupt for the block |
diff --git a/drivers/acpi/acpica/evgpeutil.c b/drivers/acpi/acpica/evgpeutil.c index 3c43796b8361..cb50dd91bc18 100644 --- a/drivers/acpi/acpica/evgpeutil.c +++ b/drivers/acpi/acpica/evgpeutil.c | |||
@@ -54,7 +54,7 @@ ACPI_MODULE_NAME("evgpeutil") | |||
54 | * FUNCTION: acpi_ev_walk_gpe_list | 54 | * FUNCTION: acpi_ev_walk_gpe_list |
55 | * | 55 | * |
56 | * PARAMETERS: gpe_walk_callback - Routine called for each GPE block | 56 | * PARAMETERS: gpe_walk_callback - Routine called for each GPE block |
57 | * Context - Value passed to callback | 57 | * context - Value passed to callback |
58 | * | 58 | * |
59 | * RETURN: Status | 59 | * RETURN: Status |
60 | * | 60 | * |
@@ -347,6 +347,8 @@ acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info, | |||
347 | void *context) | 347 | void *context) |
348 | { | 348 | { |
349 | struct acpi_gpe_event_info *gpe_event_info; | 349 | struct acpi_gpe_event_info *gpe_event_info; |
350 | struct acpi_gpe_notify_info *notify; | ||
351 | struct acpi_gpe_notify_info *next; | ||
350 | u32 i; | 352 | u32 i; |
351 | u32 j; | 353 | u32 j; |
352 | 354 | ||
@@ -365,10 +367,28 @@ acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info, | |||
365 | 367 | ||
366 | if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == | 368 | if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == |
367 | ACPI_GPE_DISPATCH_HANDLER) { | 369 | ACPI_GPE_DISPATCH_HANDLER) { |
370 | |||
371 | /* Delete an installed handler block */ | ||
372 | |||
368 | ACPI_FREE(gpe_event_info->dispatch.handler); | 373 | ACPI_FREE(gpe_event_info->dispatch.handler); |
369 | gpe_event_info->dispatch.handler = NULL; | 374 | gpe_event_info->dispatch.handler = NULL; |
370 | gpe_event_info->flags &= | 375 | gpe_event_info->flags &= |
371 | ~ACPI_GPE_DISPATCH_MASK; | 376 | ~ACPI_GPE_DISPATCH_MASK; |
377 | } else if ((gpe_event_info-> | ||
378 | flags & ACPI_GPE_DISPATCH_MASK) == | ||
379 | ACPI_GPE_DISPATCH_NOTIFY) { | ||
380 | |||
381 | /* Delete the implicit notification device list */ | ||
382 | |||
383 | notify = gpe_event_info->dispatch.notify_list; | ||
384 | while (notify) { | ||
385 | next = notify->next; | ||
386 | ACPI_FREE(notify); | ||
387 | notify = next; | ||
388 | } | ||
389 | gpe_event_info->dispatch.notify_list = NULL; | ||
390 | gpe_event_info->flags &= | ||
391 | ~ACPI_GPE_DISPATCH_MASK; | ||
372 | } | 392 | } |
373 | } | 393 | } |
374 | } | 394 | } |
diff --git a/drivers/acpi/acpica/evmisc.c b/drivers/acpi/acpica/evmisc.c index 51ef9f5e002d..51f537937c1f 100644 --- a/drivers/acpi/acpica/evmisc.c +++ b/drivers/acpi/acpica/evmisc.c | |||
@@ -56,7 +56,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context); | |||
56 | * | 56 | * |
57 | * FUNCTION: acpi_ev_is_notify_object | 57 | * FUNCTION: acpi_ev_is_notify_object |
58 | * | 58 | * |
59 | * PARAMETERS: Node - Node to check | 59 | * PARAMETERS: node - Node to check |
60 | * | 60 | * |
61 | * RETURN: TRUE if notifies allowed on this object | 61 | * RETURN: TRUE if notifies allowed on this object |
62 | * | 62 | * |
@@ -86,7 +86,7 @@ u8 acpi_ev_is_notify_object(struct acpi_namespace_node *node) | |||
86 | * | 86 | * |
87 | * FUNCTION: acpi_ev_queue_notify_request | 87 | * FUNCTION: acpi_ev_queue_notify_request |
88 | * | 88 | * |
89 | * PARAMETERS: Node - NS node for the notified object | 89 | * PARAMETERS: node - NS node for the notified object |
90 | * notify_value - Value from the Notify() request | 90 | * notify_value - Value from the Notify() request |
91 | * | 91 | * |
92 | * RETURN: Status | 92 | * RETURN: Status |
@@ -101,102 +101,77 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node, | |||
101 | u32 notify_value) | 101 | u32 notify_value) |
102 | { | 102 | { |
103 | union acpi_operand_object *obj_desc; | 103 | union acpi_operand_object *obj_desc; |
104 | union acpi_operand_object *handler_obj = NULL; | 104 | union acpi_operand_object *handler_list_head = NULL; |
105 | union acpi_generic_state *notify_info; | 105 | union acpi_generic_state *info; |
106 | u8 handler_list_id = 0; | ||
106 | acpi_status status = AE_OK; | 107 | acpi_status status = AE_OK; |
107 | 108 | ||
108 | ACPI_FUNCTION_NAME(ev_queue_notify_request); | 109 | ACPI_FUNCTION_NAME(ev_queue_notify_request); |
109 | 110 | ||
110 | /* | 111 | /* Are Notifies allowed on this object? */ |
111 | * For value 0x03 (Ejection Request), may need to run a device method. | ||
112 | * For value 0x02 (Device Wake), if _PRW exists, may need to run | ||
113 | * the _PS0 method. | ||
114 | * For value 0x80 (Status Change) on the power button or sleep button, | ||
115 | * initiate soft-off or sleep operation. | ||
116 | * | ||
117 | * For all cases, simply dispatch the notify to the handler. | ||
118 | */ | ||
119 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | ||
120 | "Dispatching Notify on [%4.4s] (%s) Value 0x%2.2X (%s) Node %p\n", | ||
121 | acpi_ut_get_node_name(node), | ||
122 | acpi_ut_get_type_name(node->type), notify_value, | ||
123 | acpi_ut_get_notify_name(notify_value), node)); | ||
124 | 112 | ||
125 | /* Get the notify object attached to the NS Node */ | 113 | if (!acpi_ev_is_notify_object(node)) { |
126 | 114 | return (AE_TYPE); | |
127 | obj_desc = acpi_ns_get_attached_object(node); | 115 | } |
128 | if (obj_desc) { | ||
129 | |||
130 | /* We have the notify object, Get the correct handler */ | ||
131 | |||
132 | switch (node->type) { | ||
133 | 116 | ||
134 | /* Notify is allowed only on these types */ | 117 | /* Get the correct notify list type (System or Device) */ |
135 | 118 | ||
136 | case ACPI_TYPE_DEVICE: | 119 | if (notify_value <= ACPI_MAX_SYS_NOTIFY) { |
137 | case ACPI_TYPE_THERMAL: | 120 | handler_list_id = ACPI_SYSTEM_HANDLER_LIST; |
138 | case ACPI_TYPE_PROCESSOR: | 121 | } else { |
122 | handler_list_id = ACPI_DEVICE_HANDLER_LIST; | ||
123 | } | ||
139 | 124 | ||
140 | if (notify_value <= ACPI_MAX_SYS_NOTIFY) { | 125 | /* Get the notify object attached to the namespace Node */ |
141 | handler_obj = | ||
142 | obj_desc->common_notify.system_notify; | ||
143 | } else { | ||
144 | handler_obj = | ||
145 | obj_desc->common_notify.device_notify; | ||
146 | } | ||
147 | break; | ||
148 | 126 | ||
149 | default: | 127 | obj_desc = acpi_ns_get_attached_object(node); |
128 | if (obj_desc) { | ||
150 | 129 | ||
151 | /* All other types are not supported */ | 130 | /* We have an attached object, Get the correct handler list */ |
152 | 131 | ||
153 | return (AE_TYPE); | 132 | handler_list_head = |
154 | } | 133 | obj_desc->common_notify.notify_list[handler_list_id]; |
155 | } | 134 | } |
156 | 135 | ||
157 | /* | 136 | /* |
158 | * If there is a handler to run, schedule the dispatcher. | 137 | * If there is no notify handler (Global or Local) |
159 | * Check for: | 138 | * for this object, just ignore the notify |
160 | * 1) Global system notify handler | ||
161 | * 2) Global device notify handler | ||
162 | * 3) Per-device notify handler | ||
163 | */ | 139 | */ |
164 | if ((acpi_gbl_system_notify.handler && | 140 | if (!acpi_gbl_global_notify[handler_list_id].handler |
165 | (notify_value <= ACPI_MAX_SYS_NOTIFY)) || | 141 | && !handler_list_head) { |
166 | (acpi_gbl_device_notify.handler && | 142 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
167 | (notify_value > ACPI_MAX_SYS_NOTIFY)) || handler_obj) { | 143 | "No notify handler for Notify, ignoring (%4.4s, %X) node %p\n", |
168 | notify_info = acpi_ut_create_generic_state(); | 144 | acpi_ut_get_node_name(node), notify_value, |
169 | if (!notify_info) { | 145 | node)); |
170 | return (AE_NO_MEMORY); | ||
171 | } | ||
172 | 146 | ||
173 | if (!handler_obj) { | 147 | return (AE_OK); |
174 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 148 | } |
175 | "Executing system notify handler for Notify (%4.4s, %X) " | ||
176 | "node %p\n", | ||
177 | acpi_ut_get_node_name(node), | ||
178 | notify_value, node)); | ||
179 | } | ||
180 | 149 | ||
181 | notify_info->common.descriptor_type = | 150 | /* Setup notify info and schedule the notify dispatcher */ |
182 | ACPI_DESC_TYPE_STATE_NOTIFY; | ||
183 | notify_info->notify.node = node; | ||
184 | notify_info->notify.value = (u16) notify_value; | ||
185 | notify_info->notify.handler_obj = handler_obj; | ||
186 | 151 | ||
187 | status = | 152 | info = acpi_ut_create_generic_state(); |
188 | acpi_os_execute(OSL_NOTIFY_HANDLER, acpi_ev_notify_dispatch, | 153 | if (!info) { |
189 | notify_info); | 154 | return (AE_NO_MEMORY); |
190 | if (ACPI_FAILURE(status)) { | 155 | } |
191 | acpi_ut_delete_generic_state(notify_info); | ||
192 | } | ||
193 | } else { | ||
194 | /* There is no notify handler (per-device or system) for this device */ | ||
195 | 156 | ||
196 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 157 | info->common.descriptor_type = ACPI_DESC_TYPE_STATE_NOTIFY; |
197 | "No notify handler for Notify (%4.4s, %X) node %p\n", | 158 | |
198 | acpi_ut_get_node_name(node), notify_value, | 159 | info->notify.node = node; |
199 | node)); | 160 | info->notify.value = (u16)notify_value; |
161 | info->notify.handler_list_id = handler_list_id; | ||
162 | info->notify.handler_list_head = handler_list_head; | ||
163 | info->notify.global = &acpi_gbl_global_notify[handler_list_id]; | ||
164 | |||
165 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | ||
166 | "Dispatching Notify on [%4.4s] (%s) Value 0x%2.2X (%s) Node %p\n", | ||
167 | acpi_ut_get_node_name(node), | ||
168 | acpi_ut_get_type_name(node->type), notify_value, | ||
169 | acpi_ut_get_notify_name(notify_value), node)); | ||
170 | |||
171 | status = acpi_os_execute(OSL_NOTIFY_HANDLER, acpi_ev_notify_dispatch, | ||
172 | info); | ||
173 | if (ACPI_FAILURE(status)) { | ||
174 | acpi_ut_delete_generic_state(info); | ||
200 | } | 175 | } |
201 | 176 | ||
202 | return (status); | 177 | return (status); |
@@ -206,7 +181,7 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node, | |||
206 | * | 181 | * |
207 | * FUNCTION: acpi_ev_notify_dispatch | 182 | * FUNCTION: acpi_ev_notify_dispatch |
208 | * | 183 | * |
209 | * PARAMETERS: Context - To be passed to the notify handler | 184 | * PARAMETERS: context - To be passed to the notify handler |
210 | * | 185 | * |
211 | * RETURN: None. | 186 | * RETURN: None. |
212 | * | 187 | * |
@@ -217,60 +192,34 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node, | |||
217 | 192 | ||
218 | static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context) | 193 | static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context) |
219 | { | 194 | { |
220 | union acpi_generic_state *notify_info = | 195 | union acpi_generic_state *info = (union acpi_generic_state *)context; |
221 | (union acpi_generic_state *)context; | ||
222 | acpi_notify_handler global_handler = NULL; | ||
223 | void *global_context = NULL; | ||
224 | union acpi_operand_object *handler_obj; | 196 | union acpi_operand_object *handler_obj; |
225 | 197 | ||
226 | ACPI_FUNCTION_ENTRY(); | 198 | ACPI_FUNCTION_ENTRY(); |
227 | 199 | ||
228 | /* | 200 | /* Invoke a global notify handler if installed */ |
229 | * We will invoke a global notify handler if installed. This is done | ||
230 | * _before_ we invoke the per-device handler attached to the device. | ||
231 | */ | ||
232 | if (notify_info->notify.value <= ACPI_MAX_SYS_NOTIFY) { | ||
233 | |||
234 | /* Global system notification handler */ | ||
235 | |||
236 | if (acpi_gbl_system_notify.handler) { | ||
237 | global_handler = acpi_gbl_system_notify.handler; | ||
238 | global_context = acpi_gbl_system_notify.context; | ||
239 | } | ||
240 | } else { | ||
241 | /* Global driver notification handler */ | ||
242 | |||
243 | if (acpi_gbl_device_notify.handler) { | ||
244 | global_handler = acpi_gbl_device_notify.handler; | ||
245 | global_context = acpi_gbl_device_notify.context; | ||
246 | } | ||
247 | } | ||
248 | |||
249 | /* Invoke the system handler first, if present */ | ||
250 | 201 | ||
251 | if (global_handler) { | 202 | if (info->notify.global->handler) { |
252 | global_handler(notify_info->notify.node, | 203 | info->notify.global->handler(info->notify.node, |
253 | notify_info->notify.value, global_context); | 204 | info->notify.value, |
205 | info->notify.global->context); | ||
254 | } | 206 | } |
255 | 207 | ||
256 | /* Now invoke the per-device handler, if present */ | 208 | /* Now invoke the local notify handler(s) if any are installed */ |
257 | 209 | ||
258 | handler_obj = notify_info->notify.handler_obj; | 210 | handler_obj = info->notify.handler_list_head; |
259 | if (handler_obj) { | 211 | while (handler_obj) { |
260 | struct acpi_object_notify_handler *notifier; | 212 | handler_obj->notify.handler(info->notify.node, |
213 | info->notify.value, | ||
214 | handler_obj->notify.context); | ||
261 | 215 | ||
262 | notifier = &handler_obj->notify; | 216 | handler_obj = |
263 | while (notifier) { | 217 | handler_obj->notify.next[info->notify.handler_list_id]; |
264 | notifier->handler(notify_info->notify.node, | ||
265 | notify_info->notify.value, | ||
266 | notifier->context); | ||
267 | notifier = notifier->next; | ||
268 | } | ||
269 | } | 218 | } |
270 | 219 | ||
271 | /* All done with the info object */ | 220 | /* All done with the info object */ |
272 | 221 | ||
273 | acpi_ut_delete_generic_state(notify_info); | 222 | acpi_ut_delete_generic_state(info); |
274 | } | 223 | } |
275 | 224 | ||
276 | #if (!ACPI_REDUCED_HARDWARE) | 225 | #if (!ACPI_REDUCED_HARDWARE) |
diff --git a/drivers/acpi/acpica/evregion.c b/drivers/acpi/acpica/evregion.c index 1b0180a1b798..0cc6a16fedc7 100644 --- a/drivers/acpi/acpica/evregion.c +++ b/drivers/acpi/acpica/evregion.c | |||
@@ -150,7 +150,7 @@ acpi_status acpi_ev_install_region_handlers(void) | |||
150 | * | 150 | * |
151 | * FUNCTION: acpi_ev_has_default_handler | 151 | * FUNCTION: acpi_ev_has_default_handler |
152 | * | 152 | * |
153 | * PARAMETERS: Node - Namespace node for the device | 153 | * PARAMETERS: node - Namespace node for the device |
154 | * space_id - The address space ID | 154 | * space_id - The address space ID |
155 | * | 155 | * |
156 | * RETURN: TRUE if default handler is installed, FALSE otherwise | 156 | * RETURN: TRUE if default handler is installed, FALSE otherwise |
@@ -244,7 +244,7 @@ acpi_status acpi_ev_initialize_op_regions(void) | |||
244 | * FUNCTION: acpi_ev_execute_reg_method | 244 | * FUNCTION: acpi_ev_execute_reg_method |
245 | * | 245 | * |
246 | * PARAMETERS: region_obj - Region object | 246 | * PARAMETERS: region_obj - Region object |
247 | * Function - Passed to _REG: On (1) or Off (0) | 247 | * function - Passed to _REG: On (1) or Off (0) |
248 | * | 248 | * |
249 | * RETURN: Status | 249 | * RETURN: Status |
250 | * | 250 | * |
@@ -286,10 +286,10 @@ acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function) | |||
286 | /* | 286 | /* |
287 | * The _REG method has two arguments: | 287 | * The _REG method has two arguments: |
288 | * | 288 | * |
289 | * Arg0 - Integer: | 289 | * arg0 - Integer: |
290 | * Operation region space ID Same value as region_obj->Region.space_id | 290 | * Operation region space ID Same value as region_obj->Region.space_id |
291 | * | 291 | * |
292 | * Arg1 - Integer: | 292 | * arg1 - Integer: |
293 | * connection status 1 for connecting the handler, 0 for disconnecting | 293 | * connection status 1 for connecting the handler, 0 for disconnecting |
294 | * the handler (Passed as a parameter) | 294 | * the handler (Passed as a parameter) |
295 | */ | 295 | */ |
@@ -330,10 +330,10 @@ acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function) | |||
330 | * | 330 | * |
331 | * PARAMETERS: region_obj - Internal region object | 331 | * PARAMETERS: region_obj - Internal region object |
332 | * field_obj - Corresponding field. Can be NULL. | 332 | * field_obj - Corresponding field. Can be NULL. |
333 | * Function - Read or Write operation | 333 | * function - Read or Write operation |
334 | * region_offset - Where in the region to read or write | 334 | * region_offset - Where in the region to read or write |
335 | * bit_width - Field width in bits (8, 16, 32, or 64) | 335 | * bit_width - Field width in bits (8, 16, 32, or 64) |
336 | * Value - Pointer to in or out value, must be | 336 | * value - Pointer to in or out value, must be |
337 | * a full 64-bit integer | 337 | * a full 64-bit integer |
338 | * | 338 | * |
339 | * RETURN: Status | 339 | * RETURN: Status |
@@ -840,11 +840,11 @@ acpi_ev_install_handler(acpi_handle obj_handle, | |||
840 | * | 840 | * |
841 | * FUNCTION: acpi_ev_install_space_handler | 841 | * FUNCTION: acpi_ev_install_space_handler |
842 | * | 842 | * |
843 | * PARAMETERS: Node - Namespace node for the device | 843 | * PARAMETERS: node - Namespace node for the device |
844 | * space_id - The address space ID | 844 | * space_id - The address space ID |
845 | * Handler - Address of the handler | 845 | * handler - Address of the handler |
846 | * Setup - Address of the setup function | 846 | * setup - Address of the setup function |
847 | * Context - Value passed to the handler on each access | 847 | * context - Value passed to the handler on each access |
848 | * | 848 | * |
849 | * RETURN: Status | 849 | * RETURN: Status |
850 | * | 850 | * |
@@ -1061,7 +1061,7 @@ acpi_ev_install_space_handler(struct acpi_namespace_node * node, | |||
1061 | * | 1061 | * |
1062 | * FUNCTION: acpi_ev_execute_reg_methods | 1062 | * FUNCTION: acpi_ev_execute_reg_methods |
1063 | * | 1063 | * |
1064 | * PARAMETERS: Node - Namespace node for the device | 1064 | * PARAMETERS: node - Namespace node for the device |
1065 | * space_id - The address space ID | 1065 | * space_id - The address space ID |
1066 | * | 1066 | * |
1067 | * RETURN: Status | 1067 | * RETURN: Status |
@@ -1104,7 +1104,7 @@ acpi_ev_execute_reg_methods(struct acpi_namespace_node *node, | |||
1104 | * | 1104 | * |
1105 | * PARAMETERS: walk_namespace callback | 1105 | * PARAMETERS: walk_namespace callback |
1106 | * | 1106 | * |
1107 | * DESCRIPTION: Run _REG method for region objects of the requested space_iD | 1107 | * DESCRIPTION: Run _REG method for region objects of the requested spaceID |
1108 | * | 1108 | * |
1109 | ******************************************************************************/ | 1109 | ******************************************************************************/ |
1110 | 1110 | ||
diff --git a/drivers/acpi/acpica/evrgnini.c b/drivers/acpi/acpica/evrgnini.c index 819c17f5897a..4c1c8261166f 100644 --- a/drivers/acpi/acpica/evrgnini.c +++ b/drivers/acpi/acpica/evrgnini.c | |||
@@ -56,8 +56,8 @@ static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node); | |||
56 | * | 56 | * |
57 | * FUNCTION: acpi_ev_system_memory_region_setup | 57 | * FUNCTION: acpi_ev_system_memory_region_setup |
58 | * | 58 | * |
59 | * PARAMETERS: Handle - Region we are interested in | 59 | * PARAMETERS: handle - Region we are interested in |
60 | * Function - Start or stop | 60 | * function - Start or stop |
61 | * handler_context - Address space handler context | 61 | * handler_context - Address space handler context |
62 | * region_context - Region specific context | 62 | * region_context - Region specific context |
63 | * | 63 | * |
@@ -118,8 +118,8 @@ acpi_ev_system_memory_region_setup(acpi_handle handle, | |||
118 | * | 118 | * |
119 | * FUNCTION: acpi_ev_io_space_region_setup | 119 | * FUNCTION: acpi_ev_io_space_region_setup |
120 | * | 120 | * |
121 | * PARAMETERS: Handle - Region we are interested in | 121 | * PARAMETERS: handle - Region we are interested in |
122 | * Function - Start or stop | 122 | * function - Start or stop |
123 | * handler_context - Address space handler context | 123 | * handler_context - Address space handler context |
124 | * region_context - Region specific context | 124 | * region_context - Region specific context |
125 | * | 125 | * |
@@ -149,8 +149,8 @@ acpi_ev_io_space_region_setup(acpi_handle handle, | |||
149 | * | 149 | * |
150 | * FUNCTION: acpi_ev_pci_config_region_setup | 150 | * FUNCTION: acpi_ev_pci_config_region_setup |
151 | * | 151 | * |
152 | * PARAMETERS: Handle - Region we are interested in | 152 | * PARAMETERS: handle - Region we are interested in |
153 | * Function - Start or stop | 153 | * function - Start or stop |
154 | * handler_context - Address space handler context | 154 | * handler_context - Address space handler context |
155 | * region_context - Region specific context | 155 | * region_context - Region specific context |
156 | * | 156 | * |
@@ -338,7 +338,7 @@ acpi_ev_pci_config_region_setup(acpi_handle handle, | |||
338 | * | 338 | * |
339 | * FUNCTION: acpi_ev_is_pci_root_bridge | 339 | * FUNCTION: acpi_ev_is_pci_root_bridge |
340 | * | 340 | * |
341 | * PARAMETERS: Node - Device node being examined | 341 | * PARAMETERS: node - Device node being examined |
342 | * | 342 | * |
343 | * RETURN: TRUE if device is a PCI/PCI-Express Root Bridge | 343 | * RETURN: TRUE if device is a PCI/PCI-Express Root Bridge |
344 | * | 344 | * |
@@ -393,14 +393,14 @@ static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node) | |||
393 | * | 393 | * |
394 | * FUNCTION: acpi_ev_pci_bar_region_setup | 394 | * FUNCTION: acpi_ev_pci_bar_region_setup |
395 | * | 395 | * |
396 | * PARAMETERS: Handle - Region we are interested in | 396 | * PARAMETERS: handle - Region we are interested in |
397 | * Function - Start or stop | 397 | * function - Start or stop |
398 | * handler_context - Address space handler context | 398 | * handler_context - Address space handler context |
399 | * region_context - Region specific context | 399 | * region_context - Region specific context |
400 | * | 400 | * |
401 | * RETURN: Status | 401 | * RETURN: Status |
402 | * | 402 | * |
403 | * DESCRIPTION: Setup a pci_bAR operation region | 403 | * DESCRIPTION: Setup a pci_BAR operation region |
404 | * | 404 | * |
405 | * MUTEX: Assumes namespace is not locked | 405 | * MUTEX: Assumes namespace is not locked |
406 | * | 406 | * |
@@ -420,8 +420,8 @@ acpi_ev_pci_bar_region_setup(acpi_handle handle, | |||
420 | * | 420 | * |
421 | * FUNCTION: acpi_ev_cmos_region_setup | 421 | * FUNCTION: acpi_ev_cmos_region_setup |
422 | * | 422 | * |
423 | * PARAMETERS: Handle - Region we are interested in | 423 | * PARAMETERS: handle - Region we are interested in |
424 | * Function - Start or stop | 424 | * function - Start or stop |
425 | * handler_context - Address space handler context | 425 | * handler_context - Address space handler context |
426 | * region_context - Region specific context | 426 | * region_context - Region specific context |
427 | * | 427 | * |
@@ -447,8 +447,8 @@ acpi_ev_cmos_region_setup(acpi_handle handle, | |||
447 | * | 447 | * |
448 | * FUNCTION: acpi_ev_default_region_setup | 448 | * FUNCTION: acpi_ev_default_region_setup |
449 | * | 449 | * |
450 | * PARAMETERS: Handle - Region we are interested in | 450 | * PARAMETERS: handle - Region we are interested in |
451 | * Function - Start or stop | 451 | * function - Start or stop |
452 | * handler_context - Address space handler context | 452 | * handler_context - Address space handler context |
453 | * region_context - Region specific context | 453 | * region_context - Region specific context |
454 | * | 454 | * |
diff --git a/drivers/acpi/acpica/evsci.c b/drivers/acpi/acpica/evsci.c index 6a57aa2d70d1..f9661e2b46a9 100644 --- a/drivers/acpi/acpica/evsci.c +++ b/drivers/acpi/acpica/evsci.c | |||
@@ -56,7 +56,7 @@ static u32 ACPI_SYSTEM_XFACE acpi_ev_sci_xrupt_handler(void *context); | |||
56 | * | 56 | * |
57 | * FUNCTION: acpi_ev_sci_xrupt_handler | 57 | * FUNCTION: acpi_ev_sci_xrupt_handler |
58 | * | 58 | * |
59 | * PARAMETERS: Context - Calling Context | 59 | * PARAMETERS: context - Calling Context |
60 | * | 60 | * |
61 | * RETURN: Status code indicates whether interrupt was handled. | 61 | * RETURN: Status code indicates whether interrupt was handled. |
62 | * | 62 | * |
@@ -96,7 +96,7 @@ static u32 ACPI_SYSTEM_XFACE acpi_ev_sci_xrupt_handler(void *context) | |||
96 | * | 96 | * |
97 | * FUNCTION: acpi_ev_gpe_xrupt_handler | 97 | * FUNCTION: acpi_ev_gpe_xrupt_handler |
98 | * | 98 | * |
99 | * PARAMETERS: Context - Calling Context | 99 | * PARAMETERS: context - Calling Context |
100 | * | 100 | * |
101 | * RETURN: Status code indicates whether interrupt was handled. | 101 | * RETURN: Status code indicates whether interrupt was handled. |
102 | * | 102 | * |
diff --git a/drivers/acpi/acpica/evxface.c b/drivers/acpi/acpica/evxface.c index 44bef5744ebb..7587eb6c9584 100644 --- a/drivers/acpi/acpica/evxface.c +++ b/drivers/acpi/acpica/evxface.c | |||
@@ -54,86 +54,25 @@ ACPI_MODULE_NAME("evxface") | |||
54 | 54 | ||
55 | /******************************************************************************* | 55 | /******************************************************************************* |
56 | * | 56 | * |
57 | * FUNCTION: acpi_populate_handler_object | ||
58 | * | ||
59 | * PARAMETERS: handler_obj - Handler object to populate | ||
60 | * handler_type - The type of handler: | ||
61 | * ACPI_SYSTEM_NOTIFY: system_handler (00-7f) | ||
62 | * ACPI_DEVICE_NOTIFY: driver_handler (80-ff) | ||
63 | * ACPI_ALL_NOTIFY: both system and device | ||
64 | * handler - Address of the handler | ||
65 | * context - Value passed to the handler on each GPE | ||
66 | * next - Address of a handler object to link to | ||
67 | * | ||
68 | * RETURN: None | ||
69 | * | ||
70 | * DESCRIPTION: Populate a handler object. | ||
71 | * | ||
72 | ******************************************************************************/ | ||
73 | static void | ||
74 | acpi_populate_handler_object(struct acpi_object_notify_handler *handler_obj, | ||
75 | u32 handler_type, | ||
76 | acpi_notify_handler handler, void *context, | ||
77 | struct acpi_object_notify_handler *next) | ||
78 | { | ||
79 | handler_obj->handler_type = handler_type; | ||
80 | handler_obj->handler = handler; | ||
81 | handler_obj->context = context; | ||
82 | handler_obj->next = next; | ||
83 | } | ||
84 | |||
85 | /******************************************************************************* | ||
86 | * | ||
87 | * FUNCTION: acpi_add_handler_object | ||
88 | * | ||
89 | * PARAMETERS: parent_obj - Parent of the new object | ||
90 | * handler - Address of the handler | ||
91 | * context - Value passed to the handler on each GPE | ||
92 | * | ||
93 | * RETURN: Status | ||
94 | * | ||
95 | * DESCRIPTION: Create a new handler object and populate it. | ||
96 | * | ||
97 | ******************************************************************************/ | ||
98 | static acpi_status | ||
99 | acpi_add_handler_object(struct acpi_object_notify_handler *parent_obj, | ||
100 | acpi_notify_handler handler, void *context) | ||
101 | { | ||
102 | struct acpi_object_notify_handler *handler_obj; | ||
103 | |||
104 | /* The parent must not be a defice notify handler object. */ | ||
105 | if (parent_obj->handler_type & ACPI_DEVICE_NOTIFY) | ||
106 | return AE_BAD_PARAMETER; | ||
107 | |||
108 | handler_obj = ACPI_ALLOCATE_ZEROED(sizeof(*handler_obj)); | ||
109 | if (!handler_obj) | ||
110 | return AE_NO_MEMORY; | ||
111 | |||
112 | acpi_populate_handler_object(handler_obj, | ||
113 | ACPI_SYSTEM_NOTIFY, | ||
114 | handler, context, | ||
115 | parent_obj->next); | ||
116 | parent_obj->next = handler_obj; | ||
117 | |||
118 | return AE_OK; | ||
119 | } | ||
120 | |||
121 | |||
122 | /******************************************************************************* | ||
123 | * | ||
124 | * FUNCTION: acpi_install_notify_handler | 57 | * FUNCTION: acpi_install_notify_handler |
125 | * | 58 | * |
126 | * PARAMETERS: Device - The device for which notifies will be handled | 59 | * PARAMETERS: Device - The device for which notifies will be handled |
127 | * handler_type - The type of handler: | 60 | * handler_type - The type of handler: |
128 | * ACPI_SYSTEM_NOTIFY: system_handler (00-7f) | 61 | * ACPI_SYSTEM_NOTIFY: System Handler (00-7F) |
129 | * ACPI_DEVICE_NOTIFY: driver_handler (80-ff) | 62 | * ACPI_DEVICE_NOTIFY: Device Handler (80-FF) |
130 | * ACPI_ALL_NOTIFY: both system and device | 63 | * ACPI_ALL_NOTIFY: Both System and Device |
131 | * Handler - Address of the handler | 64 | * Handler - Address of the handler |
132 | * Context - Value passed to the handler on each GPE | 65 | * Context - Value passed to the handler on each GPE |
133 | * | 66 | * |
134 | * RETURN: Status | 67 | * RETURN: Status |
135 | * | 68 | * |
136 | * DESCRIPTION: Install a handler for notifies on an ACPI device | 69 | * DESCRIPTION: Install a handler for notifications on an ACPI Device, |
70 | * thermal_zone, or Processor object. | ||
71 | * | ||
72 | * NOTES: The Root namespace object may have only one handler for each | ||
73 | * type of notify (System/Device). Device/Thermal/Processor objects | ||
74 | * may have one device notify handler, and multiple system notify | ||
75 | * handlers. | ||
137 | * | 76 | * |
138 | ******************************************************************************/ | 77 | ******************************************************************************/ |
139 | acpi_status | 78 | acpi_status |
@@ -141,17 +80,19 @@ acpi_install_notify_handler(acpi_handle device, | |||
141 | u32 handler_type, | 80 | u32 handler_type, |
142 | acpi_notify_handler handler, void *context) | 81 | acpi_notify_handler handler, void *context) |
143 | { | 82 | { |
83 | struct acpi_namespace_node *node = | ||
84 | ACPI_CAST_PTR(struct acpi_namespace_node, device); | ||
144 | union acpi_operand_object *obj_desc; | 85 | union acpi_operand_object *obj_desc; |
145 | union acpi_operand_object *notify_obj; | 86 | union acpi_operand_object *handler_obj; |
146 | struct acpi_namespace_node *node; | ||
147 | acpi_status status; | 87 | acpi_status status; |
88 | u32 i; | ||
148 | 89 | ||
149 | ACPI_FUNCTION_TRACE(acpi_install_notify_handler); | 90 | ACPI_FUNCTION_TRACE(acpi_install_notify_handler); |
150 | 91 | ||
151 | /* Parameter validation */ | 92 | /* Parameter validation */ |
152 | 93 | ||
153 | if ((!device) || | 94 | if ((!device) || (!handler) || (!handler_type) || |
154 | (!handler) || (handler_type > ACPI_MAX_NOTIFY_HANDLER_TYPE)) { | 95 | (handler_type > ACPI_MAX_NOTIFY_HANDLER_TYPE)) { |
155 | return_ACPI_STATUS(AE_BAD_PARAMETER); | 96 | return_ACPI_STATUS(AE_BAD_PARAMETER); |
156 | } | 97 | } |
157 | 98 | ||
@@ -160,144 +101,112 @@ acpi_install_notify_handler(acpi_handle device, | |||
160 | return_ACPI_STATUS(status); | 101 | return_ACPI_STATUS(status); |
161 | } | 102 | } |
162 | 103 | ||
163 | /* Convert and validate the device handle */ | ||
164 | |||
165 | node = acpi_ns_validate_handle(device); | ||
166 | if (!node) { | ||
167 | status = AE_BAD_PARAMETER; | ||
168 | goto unlock_and_exit; | ||
169 | } | ||
170 | |||
171 | /* | 104 | /* |
172 | * Root Object: | 105 | * Root Object: |
173 | * Registering a notify handler on the root object indicates that the | 106 | * Registering a notify handler on the root object indicates that the |
174 | * caller wishes to receive notifications for all objects. Note that | 107 | * caller wishes to receive notifications for all objects. Note that |
175 | * only one <external> global handler can be regsitered (per notify type). | 108 | * only one global handler can be registered per notify type. |
109 | * Ensure that a handler is not already installed. | ||
176 | */ | 110 | */ |
177 | if (device == ACPI_ROOT_OBJECT) { | 111 | if (device == ACPI_ROOT_OBJECT) { |
112 | for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++) { | ||
113 | if (handler_type & (i + 1)) { | ||
114 | if (acpi_gbl_global_notify[i].handler) { | ||
115 | status = AE_ALREADY_EXISTS; | ||
116 | goto unlock_and_exit; | ||
117 | } | ||
178 | 118 | ||
179 | /* Make sure the handler is not already installed */ | 119 | acpi_gbl_global_notify[i].handler = handler; |
180 | 120 | acpi_gbl_global_notify[i].context = context; | |
181 | if (((handler_type & ACPI_SYSTEM_NOTIFY) && | 121 | } |
182 | acpi_gbl_system_notify.handler) || | ||
183 | ((handler_type & ACPI_DEVICE_NOTIFY) && | ||
184 | acpi_gbl_device_notify.handler)) { | ||
185 | status = AE_ALREADY_EXISTS; | ||
186 | goto unlock_and_exit; | ||
187 | } | ||
188 | |||
189 | if (handler_type & ACPI_SYSTEM_NOTIFY) { | ||
190 | acpi_gbl_system_notify.node = node; | ||
191 | acpi_gbl_system_notify.handler = handler; | ||
192 | acpi_gbl_system_notify.context = context; | ||
193 | } | ||
194 | |||
195 | if (handler_type & ACPI_DEVICE_NOTIFY) { | ||
196 | acpi_gbl_device_notify.node = node; | ||
197 | acpi_gbl_device_notify.handler = handler; | ||
198 | acpi_gbl_device_notify.context = context; | ||
199 | } | 122 | } |
200 | 123 | ||
201 | /* Global notify handler installed */ | 124 | goto unlock_and_exit; /* Global notify handler installed, all done */ |
202 | } | 125 | } |
203 | 126 | ||
204 | /* | 127 | /* |
205 | * All Other Objects: | 128 | * All Other Objects: |
206 | * Caller will only receive notifications specific to the target object. | 129 | * Caller will only receive notifications specific to the target |
207 | * Note that only certain object types can receive notifications. | 130 | * object. Note that only certain object types are allowed to |
131 | * receive notifications. | ||
208 | */ | 132 | */ |
209 | else { | ||
210 | /* Notifies allowed on this object? */ | ||
211 | 133 | ||
212 | if (!acpi_ev_is_notify_object(node)) { | 134 | /* Are Notifies allowed on this object? */ |
213 | status = AE_TYPE; | ||
214 | goto unlock_and_exit; | ||
215 | } | ||
216 | 135 | ||
217 | /* Check for an existing internal object */ | 136 | if (!acpi_ev_is_notify_object(node)) { |
137 | status = AE_TYPE; | ||
138 | goto unlock_and_exit; | ||
139 | } | ||
218 | 140 | ||
219 | obj_desc = acpi_ns_get_attached_object(node); | 141 | /* Check for an existing internal object, might not exist */ |
220 | if (obj_desc) { | ||
221 | 142 | ||
222 | /* Object exists. */ | 143 | obj_desc = acpi_ns_get_attached_object(node); |
144 | if (!obj_desc) { | ||
223 | 145 | ||
224 | /* For a device notify, make sure there's no handler. */ | 146 | /* Create a new object */ |
225 | if ((handler_type & ACPI_DEVICE_NOTIFY) && | ||
226 | obj_desc->common_notify.device_notify) { | ||
227 | status = AE_ALREADY_EXISTS; | ||
228 | goto unlock_and_exit; | ||
229 | } | ||
230 | 147 | ||
231 | /* System notifies may have more handlers installed. */ | 148 | obj_desc = acpi_ut_create_internal_object(node->type); |
232 | notify_obj = obj_desc->common_notify.system_notify; | 149 | if (!obj_desc) { |
150 | status = AE_NO_MEMORY; | ||
151 | goto unlock_and_exit; | ||
152 | } | ||
233 | 153 | ||
234 | if ((handler_type & ACPI_SYSTEM_NOTIFY) && notify_obj) { | 154 | /* Attach new object to the Node, remove local reference */ |
235 | struct acpi_object_notify_handler *parent_obj; | 155 | |
156 | status = acpi_ns_attach_object(device, obj_desc, node->type); | ||
157 | acpi_ut_remove_reference(obj_desc); | ||
158 | if (ACPI_FAILURE(status)) { | ||
159 | goto unlock_and_exit; | ||
160 | } | ||
161 | } | ||
236 | 162 | ||
237 | if (handler_type & ACPI_DEVICE_NOTIFY) { | 163 | /* Ensure that the handler is not already installed in the lists */ |
164 | |||
165 | for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++) { | ||
166 | if (handler_type & (i + 1)) { | ||
167 | handler_obj = obj_desc->common_notify.notify_list[i]; | ||
168 | while (handler_obj) { | ||
169 | if (handler_obj->notify.handler == handler) { | ||
238 | status = AE_ALREADY_EXISTS; | 170 | status = AE_ALREADY_EXISTS; |
239 | goto unlock_and_exit; | 171 | goto unlock_and_exit; |
240 | } | 172 | } |
241 | 173 | ||
242 | parent_obj = ¬ify_obj->notify; | 174 | handler_obj = handler_obj->notify.next[i]; |
243 | status = acpi_add_handler_object(parent_obj, | ||
244 | handler, | ||
245 | context); | ||
246 | goto unlock_and_exit; | ||
247 | } | ||
248 | } else { | ||
249 | /* Create a new object */ | ||
250 | |||
251 | obj_desc = acpi_ut_create_internal_object(node->type); | ||
252 | if (!obj_desc) { | ||
253 | status = AE_NO_MEMORY; | ||
254 | goto unlock_and_exit; | ||
255 | } | ||
256 | |||
257 | /* Attach new object to the Node */ | ||
258 | |||
259 | status = | ||
260 | acpi_ns_attach_object(device, obj_desc, node->type); | ||
261 | |||
262 | /* Remove local reference to the object */ | ||
263 | |||
264 | acpi_ut_remove_reference(obj_desc); | ||
265 | if (ACPI_FAILURE(status)) { | ||
266 | goto unlock_and_exit; | ||
267 | } | 175 | } |
268 | } | 176 | } |
177 | } | ||
269 | 178 | ||
270 | /* Install the handler */ | 179 | /* Create and populate a new notify handler object */ |
271 | 180 | ||
272 | notify_obj = | 181 | handler_obj = acpi_ut_create_internal_object(ACPI_TYPE_LOCAL_NOTIFY); |
273 | acpi_ut_create_internal_object(ACPI_TYPE_LOCAL_NOTIFY); | 182 | if (!handler_obj) { |
274 | if (!notify_obj) { | 183 | status = AE_NO_MEMORY; |
275 | status = AE_NO_MEMORY; | 184 | goto unlock_and_exit; |
276 | goto unlock_and_exit; | 185 | } |
277 | } | ||
278 | 186 | ||
279 | acpi_populate_handler_object(¬ify_obj->notify, | 187 | handler_obj->notify.node = node; |
280 | handler_type, | 188 | handler_obj->notify.handler_type = handler_type; |
281 | handler, context, | 189 | handler_obj->notify.handler = handler; |
282 | NULL); | 190 | handler_obj->notify.context = context; |
283 | 191 | ||
284 | if (handler_type & ACPI_SYSTEM_NOTIFY) { | 192 | /* Install the handler at the list head(s) */ |
285 | obj_desc->common_notify.system_notify = notify_obj; | ||
286 | } | ||
287 | 193 | ||
288 | if (handler_type & ACPI_DEVICE_NOTIFY) { | 194 | for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++) { |
289 | obj_desc->common_notify.device_notify = notify_obj; | 195 | if (handler_type & (i + 1)) { |
290 | } | 196 | handler_obj->notify.next[i] = |
197 | obj_desc->common_notify.notify_list[i]; | ||
291 | 198 | ||
292 | if (handler_type == ACPI_ALL_NOTIFY) { | 199 | obj_desc->common_notify.notify_list[i] = handler_obj; |
200 | } | ||
201 | } | ||
293 | 202 | ||
294 | /* Extra ref if installed in both */ | 203 | /* Add an extra reference if handler was installed in both lists */ |
295 | 204 | ||
296 | acpi_ut_add_reference(notify_obj); | 205 | if (handler_type == ACPI_ALL_NOTIFY) { |
297 | } | 206 | acpi_ut_add_reference(handler_obj); |
298 | } | 207 | } |
299 | 208 | ||
300 | unlock_and_exit: | 209 | unlock_and_exit: |
301 | (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); | 210 | (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); |
302 | return_ACPI_STATUS(status); | 211 | return_ACPI_STATUS(status); |
303 | } | 212 | } |
@@ -308,11 +217,11 @@ ACPI_EXPORT_SYMBOL(acpi_install_notify_handler) | |||
308 | * | 217 | * |
309 | * FUNCTION: acpi_remove_notify_handler | 218 | * FUNCTION: acpi_remove_notify_handler |
310 | * | 219 | * |
311 | * PARAMETERS: Device - The device for which notifies will be handled | 220 | * PARAMETERS: Device - The device for which the handler is installed |
312 | * handler_type - The type of handler: | 221 | * handler_type - The type of handler: |
313 | * ACPI_SYSTEM_NOTIFY: system_handler (00-7f) | 222 | * ACPI_SYSTEM_NOTIFY: System Handler (00-7F) |
314 | * ACPI_DEVICE_NOTIFY: driver_handler (80-ff) | 223 | * ACPI_DEVICE_NOTIFY: Device Handler (80-FF) |
315 | * ACPI_ALL_NOTIFY: both system and device | 224 | * ACPI_ALL_NOTIFY: Both System and Device |
316 | * Handler - Address of the handler | 225 | * Handler - Address of the handler |
317 | * | 226 | * |
318 | * RETURN: Status | 227 | * RETURN: Status |
@@ -324,165 +233,106 @@ acpi_status | |||
324 | acpi_remove_notify_handler(acpi_handle device, | 233 | acpi_remove_notify_handler(acpi_handle device, |
325 | u32 handler_type, acpi_notify_handler handler) | 234 | u32 handler_type, acpi_notify_handler handler) |
326 | { | 235 | { |
327 | union acpi_operand_object *notify_obj; | 236 | struct acpi_namespace_node *node = |
237 | ACPI_CAST_PTR(struct acpi_namespace_node, device); | ||
328 | union acpi_operand_object *obj_desc; | 238 | union acpi_operand_object *obj_desc; |
329 | struct acpi_namespace_node *node; | 239 | union acpi_operand_object *handler_obj; |
240 | union acpi_operand_object *previous_handler_obj; | ||
330 | acpi_status status; | 241 | acpi_status status; |
242 | u32 i; | ||
331 | 243 | ||
332 | ACPI_FUNCTION_TRACE(acpi_remove_notify_handler); | 244 | ACPI_FUNCTION_TRACE(acpi_remove_notify_handler); |
333 | 245 | ||
334 | /* Parameter validation */ | 246 | /* Parameter validation */ |
335 | 247 | ||
336 | if ((!device) || | 248 | if ((!device) || (!handler) || (!handler_type) || |
337 | (!handler) || (handler_type > ACPI_MAX_NOTIFY_HANDLER_TYPE)) { | 249 | (handler_type > ACPI_MAX_NOTIFY_HANDLER_TYPE)) { |
338 | status = AE_BAD_PARAMETER; | 250 | return_ACPI_STATUS(AE_BAD_PARAMETER); |
339 | goto exit; | ||
340 | } | 251 | } |
341 | |||
342 | |||
343 | /* Make sure all deferred tasks are completed */ | 252 | /* Make sure all deferred tasks are completed */ |
344 | acpi_os_wait_events_complete(NULL); | 253 | |
254 | acpi_os_wait_events_complete(); | ||
345 | 255 | ||
346 | status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); | 256 | status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); |
347 | if (ACPI_FAILURE(status)) { | 257 | if (ACPI_FAILURE(status)) { |
348 | goto exit; | 258 | return_ACPI_STATUS(status); |
349 | } | ||
350 | |||
351 | /* Convert and validate the device handle */ | ||
352 | |||
353 | node = acpi_ns_validate_handle(device); | ||
354 | if (!node) { | ||
355 | status = AE_BAD_PARAMETER; | ||
356 | goto unlock_and_exit; | ||
357 | } | 259 | } |
358 | 260 | ||
359 | /* Root Object */ | 261 | /* Root Object. Global handlers are removed here */ |
360 | 262 | ||
361 | if (device == ACPI_ROOT_OBJECT) { | 263 | if (device == ACPI_ROOT_OBJECT) { |
362 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 264 | for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++) { |
363 | "Removing notify handler for namespace root object\n")); | 265 | if (handler_type & (i + 1)) { |
266 | if (!acpi_gbl_global_notify[i].handler || | ||
267 | (acpi_gbl_global_notify[i].handler != | ||
268 | handler)) { | ||
269 | status = AE_NOT_EXIST; | ||
270 | goto unlock_and_exit; | ||
271 | } | ||
364 | 272 | ||
365 | if (((handler_type & ACPI_SYSTEM_NOTIFY) && | 273 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
366 | !acpi_gbl_system_notify.handler) || | 274 | "Removing global notify handler\n")); |
367 | ((handler_type & ACPI_DEVICE_NOTIFY) && | ||
368 | !acpi_gbl_device_notify.handler)) { | ||
369 | status = AE_NOT_EXIST; | ||
370 | goto unlock_and_exit; | ||
371 | } | ||
372 | 275 | ||
373 | if (handler_type & ACPI_SYSTEM_NOTIFY) { | 276 | acpi_gbl_global_notify[i].handler = NULL; |
374 | acpi_gbl_system_notify.node = NULL; | 277 | acpi_gbl_global_notify[i].context = NULL; |
375 | acpi_gbl_system_notify.handler = NULL; | 278 | } |
376 | acpi_gbl_system_notify.context = NULL; | ||
377 | } | 279 | } |
378 | 280 | ||
379 | if (handler_type & ACPI_DEVICE_NOTIFY) { | 281 | goto unlock_and_exit; |
380 | acpi_gbl_device_notify.node = NULL; | ||
381 | acpi_gbl_device_notify.handler = NULL; | ||
382 | acpi_gbl_device_notify.context = NULL; | ||
383 | } | ||
384 | } | 282 | } |
385 | 283 | ||
386 | /* All Other Objects */ | 284 | /* All other objects: Are Notifies allowed on this object? */ |
387 | 285 | ||
388 | else { | 286 | if (!acpi_ev_is_notify_object(node)) { |
389 | /* Notifies allowed on this object? */ | 287 | status = AE_TYPE; |
288 | goto unlock_and_exit; | ||
289 | } | ||
390 | 290 | ||
391 | if (!acpi_ev_is_notify_object(node)) { | 291 | /* Must have an existing internal object */ |
392 | status = AE_TYPE; | ||
393 | goto unlock_and_exit; | ||
394 | } | ||
395 | 292 | ||
396 | /* Check for an existing internal object */ | 293 | obj_desc = acpi_ns_get_attached_object(node); |
294 | if (!obj_desc) { | ||
295 | status = AE_NOT_EXIST; | ||
296 | goto unlock_and_exit; | ||
297 | } | ||
397 | 298 | ||
398 | obj_desc = acpi_ns_get_attached_object(node); | 299 | /* Internal object exists. Find the handler and remove it */ |
399 | if (!obj_desc) { | ||
400 | status = AE_NOT_EXIST; | ||
401 | goto unlock_and_exit; | ||
402 | } | ||
403 | 300 | ||
404 | /* Object exists - make sure there's an existing handler */ | 301 | for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++) { |
302 | if (handler_type & (i + 1)) { | ||
303 | handler_obj = obj_desc->common_notify.notify_list[i]; | ||
304 | previous_handler_obj = NULL; | ||
405 | 305 | ||
406 | if (handler_type & ACPI_SYSTEM_NOTIFY) { | 306 | /* Attempt to find the handler in the handler list */ |
407 | struct acpi_object_notify_handler *handler_obj; | ||
408 | struct acpi_object_notify_handler *parent_obj; | ||
409 | 307 | ||
410 | notify_obj = obj_desc->common_notify.system_notify; | 308 | while (handler_obj && |
411 | if (!notify_obj) { | 309 | (handler_obj->notify.handler != handler)) { |
412 | status = AE_NOT_EXIST; | 310 | previous_handler_obj = handler_obj; |
413 | goto unlock_and_exit; | 311 | handler_obj = handler_obj->notify.next[i]; |
414 | } | ||
415 | |||
416 | handler_obj = ¬ify_obj->notify; | ||
417 | parent_obj = NULL; | ||
418 | while (handler_obj->handler != handler) { | ||
419 | if (handler_obj->next) { | ||
420 | parent_obj = handler_obj; | ||
421 | handler_obj = handler_obj->next; | ||
422 | } else { | ||
423 | break; | ||
424 | } | ||
425 | } | 312 | } |
426 | 313 | ||
427 | if (handler_obj->handler != handler) { | 314 | if (!handler_obj) { |
428 | status = AE_BAD_PARAMETER; | 315 | status = AE_NOT_EXIST; |
429 | goto unlock_and_exit; | 316 | goto unlock_and_exit; |
430 | } | 317 | } |
431 | 318 | ||
432 | /* | 319 | /* Remove the handler object from the list */ |
433 | * Remove the handler. There are three possible cases. | ||
434 | * First, we may need to remove a non-embedded object. | ||
435 | * Second, we may need to remove the embedded object's | ||
436 | * handler data, while non-embedded objects exist. | ||
437 | * Finally, we may need to remove the embedded object | ||
438 | * entirely along with its container. | ||
439 | */ | ||
440 | if (parent_obj) { | ||
441 | /* Non-embedded object is being removed. */ | ||
442 | parent_obj->next = handler_obj->next; | ||
443 | ACPI_FREE(handler_obj); | ||
444 | } else if (notify_obj->notify.next) { | ||
445 | /* | ||
446 | * The handler matches the embedded object, but | ||
447 | * there are more handler objects in the list. | ||
448 | * Replace the embedded object's data with the | ||
449 | * first next object's data and remove that | ||
450 | * object. | ||
451 | */ | ||
452 | parent_obj = ¬ify_obj->notify; | ||
453 | handler_obj = notify_obj->notify.next; | ||
454 | *parent_obj = *handler_obj; | ||
455 | ACPI_FREE(handler_obj); | ||
456 | } else { | ||
457 | /* No more handler objects in the list. */ | ||
458 | obj_desc->common_notify.system_notify = NULL; | ||
459 | acpi_ut_remove_reference(notify_obj); | ||
460 | } | ||
461 | } | ||
462 | 320 | ||
463 | if (handler_type & ACPI_DEVICE_NOTIFY) { | 321 | if (previous_handler_obj) { /* Handler is not at the list head */ |
464 | notify_obj = obj_desc->common_notify.device_notify; | 322 | previous_handler_obj->notify.next[i] = |
465 | if (!notify_obj) { | 323 | handler_obj->notify.next[i]; |
466 | status = AE_NOT_EXIST; | 324 | } else { /* Handler is at the list head */ |
467 | goto unlock_and_exit; | ||
468 | } | ||
469 | 325 | ||
470 | if (notify_obj->notify.handler != handler) { | 326 | obj_desc->common_notify.notify_list[i] = |
471 | status = AE_BAD_PARAMETER; | 327 | handler_obj->notify.next[i]; |
472 | goto unlock_and_exit; | ||
473 | } | 328 | } |
474 | 329 | ||
475 | /* Remove the handler */ | 330 | acpi_ut_remove_reference(handler_obj); |
476 | obj_desc->common_notify.device_notify = NULL; | ||
477 | acpi_ut_remove_reference(notify_obj); | ||
478 | } | 331 | } |
479 | } | 332 | } |
480 | 333 | ||
481 | unlock_and_exit: | 334 | unlock_and_exit: |
482 | (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); | 335 | (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); |
483 | exit: | ||
484 | if (ACPI_FAILURE(status)) | ||
485 | ACPI_EXCEPTION((AE_INFO, status, "Removing notify handler")); | ||
486 | return_ACPI_STATUS(status); | 336 | return_ACPI_STATUS(status); |
487 | } | 337 | } |
488 | 338 | ||
@@ -492,7 +342,7 @@ ACPI_EXPORT_SYMBOL(acpi_remove_notify_handler) | |||
492 | * | 342 | * |
493 | * FUNCTION: acpi_install_exception_handler | 343 | * FUNCTION: acpi_install_exception_handler |
494 | * | 344 | * |
495 | * PARAMETERS: Handler - Pointer to the handler function for the | 345 | * PARAMETERS: handler - Pointer to the handler function for the |
496 | * event | 346 | * event |
497 | * | 347 | * |
498 | * RETURN: Status | 348 | * RETURN: Status |
@@ -536,8 +386,8 @@ ACPI_EXPORT_SYMBOL(acpi_install_exception_handler) | |||
536 | * | 386 | * |
537 | * FUNCTION: acpi_install_global_event_handler | 387 | * FUNCTION: acpi_install_global_event_handler |
538 | * | 388 | * |
539 | * PARAMETERS: Handler - Pointer to the global event handler function | 389 | * PARAMETERS: handler - Pointer to the global event handler function |
540 | * Context - Value passed to the handler on each event | 390 | * context - Value passed to the handler on each event |
541 | * | 391 | * |
542 | * RETURN: Status | 392 | * RETURN: Status |
543 | * | 393 | * |
@@ -586,10 +436,10 @@ ACPI_EXPORT_SYMBOL(acpi_install_global_event_handler) | |||
586 | * | 436 | * |
587 | * FUNCTION: acpi_install_fixed_event_handler | 437 | * FUNCTION: acpi_install_fixed_event_handler |
588 | * | 438 | * |
589 | * PARAMETERS: Event - Event type to enable. | 439 | * PARAMETERS: event - Event type to enable. |
590 | * Handler - Pointer to the handler function for the | 440 | * handler - Pointer to the handler function for the |
591 | * event | 441 | * event |
592 | * Context - Value passed to the handler on each GPE | 442 | * context - Value passed to the handler on each GPE |
593 | * | 443 | * |
594 | * RETURN: Status | 444 | * RETURN: Status |
595 | * | 445 | * |
@@ -656,8 +506,8 @@ ACPI_EXPORT_SYMBOL(acpi_install_fixed_event_handler) | |||
656 | * | 506 | * |
657 | * FUNCTION: acpi_remove_fixed_event_handler | 507 | * FUNCTION: acpi_remove_fixed_event_handler |
658 | * | 508 | * |
659 | * PARAMETERS: Event - Event type to disable. | 509 | * PARAMETERS: event - Event type to disable. |
660 | * Handler - Address of the handler | 510 | * handler - Address of the handler |
661 | * | 511 | * |
662 | * RETURN: Status | 512 | * RETURN: Status |
663 | * | 513 | * |
@@ -713,10 +563,10 @@ ACPI_EXPORT_SYMBOL(acpi_remove_fixed_event_handler) | |||
713 | * PARAMETERS: gpe_device - Namespace node for the GPE (NULL for FADT | 563 | * PARAMETERS: gpe_device - Namespace node for the GPE (NULL for FADT |
714 | * defined GPEs) | 564 | * defined GPEs) |
715 | * gpe_number - The GPE number within the GPE block | 565 | * gpe_number - The GPE number within the GPE block |
716 | * Type - Whether this GPE should be treated as an | 566 | * type - Whether this GPE should be treated as an |
717 | * edge- or level-triggered interrupt. | 567 | * edge- or level-triggered interrupt. |
718 | * Address - Address of the handler | 568 | * address - Address of the handler |
719 | * Context - Value passed to the handler on each GPE | 569 | * context - Value passed to the handler on each GPE |
720 | * | 570 | * |
721 | * RETURN: Status | 571 | * RETURN: Status |
722 | * | 572 | * |
@@ -823,7 +673,7 @@ ACPI_EXPORT_SYMBOL(acpi_install_gpe_handler) | |||
823 | * PARAMETERS: gpe_device - Namespace node for the GPE (NULL for FADT | 673 | * PARAMETERS: gpe_device - Namespace node for the GPE (NULL for FADT |
824 | * defined GPEs) | 674 | * defined GPEs) |
825 | * gpe_number - The event to remove a handler | 675 | * gpe_number - The event to remove a handler |
826 | * Address - Address of the handler | 676 | * address - Address of the handler |
827 | * | 677 | * |
828 | * RETURN: Status | 678 | * RETURN: Status |
829 | * | 679 | * |
@@ -849,7 +699,7 @@ acpi_remove_gpe_handler(acpi_handle gpe_device, | |||
849 | 699 | ||
850 | /* Make sure all deferred tasks are completed */ | 700 | /* Make sure all deferred tasks are completed */ |
851 | 701 | ||
852 | acpi_os_wait_events_complete(NULL); | 702 | acpi_os_wait_events_complete(); |
853 | 703 | ||
854 | status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); | 704 | status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); |
855 | if (ACPI_FAILURE(status)) { | 705 | if (ACPI_FAILURE(status)) { |
@@ -919,8 +769,8 @@ ACPI_EXPORT_SYMBOL(acpi_remove_gpe_handler) | |||
919 | * | 769 | * |
920 | * FUNCTION: acpi_acquire_global_lock | 770 | * FUNCTION: acpi_acquire_global_lock |
921 | * | 771 | * |
922 | * PARAMETERS: Timeout - How long the caller is willing to wait | 772 | * PARAMETERS: timeout - How long the caller is willing to wait |
923 | * Handle - Where the handle to the lock is returned | 773 | * handle - Where the handle to the lock is returned |
924 | * (if acquired) | 774 | * (if acquired) |
925 | * | 775 | * |
926 | * RETURN: Status | 776 | * RETURN: Status |
@@ -967,7 +817,7 @@ ACPI_EXPORT_SYMBOL(acpi_acquire_global_lock) | |||
967 | * | 817 | * |
968 | * FUNCTION: acpi_release_global_lock | 818 | * FUNCTION: acpi_release_global_lock |
969 | * | 819 | * |
970 | * PARAMETERS: Handle - Returned from acpi_acquire_global_lock | 820 | * PARAMETERS: handle - Returned from acpi_acquire_global_lock |
971 | * | 821 | * |
972 | * RETURN: Status | 822 | * RETURN: Status |
973 | * | 823 | * |
diff --git a/drivers/acpi/acpica/evxfevnt.c b/drivers/acpi/acpica/evxfevnt.c index 77cee5a5e891..35520c6eeefb 100644 --- a/drivers/acpi/acpica/evxfevnt.c +++ b/drivers/acpi/acpica/evxfevnt.c | |||
@@ -153,8 +153,8 @@ ACPI_EXPORT_SYMBOL(acpi_disable) | |||
153 | * | 153 | * |
154 | * FUNCTION: acpi_enable_event | 154 | * FUNCTION: acpi_enable_event |
155 | * | 155 | * |
156 | * PARAMETERS: Event - The fixed eventto be enabled | 156 | * PARAMETERS: event - The fixed eventto be enabled |
157 | * Flags - Reserved | 157 | * flags - Reserved |
158 | * | 158 | * |
159 | * RETURN: Status | 159 | * RETURN: Status |
160 | * | 160 | * |
@@ -265,7 +265,7 @@ ACPI_EXPORT_SYMBOL(acpi_disable_event) | |||
265 | * | 265 | * |
266 | * FUNCTION: acpi_clear_event | 266 | * FUNCTION: acpi_clear_event |
267 | * | 267 | * |
268 | * PARAMETERS: Event - The fixed event to be cleared | 268 | * PARAMETERS: event - The fixed event to be cleared |
269 | * | 269 | * |
270 | * RETURN: Status | 270 | * RETURN: Status |
271 | * | 271 | * |
@@ -301,7 +301,7 @@ ACPI_EXPORT_SYMBOL(acpi_clear_event) | |||
301 | * | 301 | * |
302 | * FUNCTION: acpi_get_event_status | 302 | * FUNCTION: acpi_get_event_status |
303 | * | 303 | * |
304 | * PARAMETERS: Event - The fixed event | 304 | * PARAMETERS: event - The fixed event |
305 | * event_status - Where the current status of the event will | 305 | * event_status - Where the current status of the event will |
306 | * be returned | 306 | * be returned |
307 | * | 307 | * |
diff --git a/drivers/acpi/acpica/evxfgpe.c b/drivers/acpi/acpica/evxfgpe.c index 86f9b343ebd4..87c5f2332260 100644 --- a/drivers/acpi/acpica/evxfgpe.c +++ b/drivers/acpi/acpica/evxfgpe.c | |||
@@ -197,12 +197,12 @@ acpi_status | |||
197 | acpi_setup_gpe_for_wake(acpi_handle wake_device, | 197 | acpi_setup_gpe_for_wake(acpi_handle wake_device, |
198 | acpi_handle gpe_device, u32 gpe_number) | 198 | acpi_handle gpe_device, u32 gpe_number) |
199 | { | 199 | { |
200 | acpi_status status = AE_BAD_PARAMETER; | 200 | acpi_status status; |
201 | struct acpi_gpe_event_info *gpe_event_info; | 201 | struct acpi_gpe_event_info *gpe_event_info; |
202 | struct acpi_namespace_node *device_node; | 202 | struct acpi_namespace_node *device_node; |
203 | struct acpi_gpe_notify_object *notify_object; | 203 | struct acpi_gpe_notify_info *notify; |
204 | struct acpi_gpe_notify_info *new_notify; | ||
204 | acpi_cpu_flags flags; | 205 | acpi_cpu_flags flags; |
205 | u8 gpe_dispatch_mask; | ||
206 | 206 | ||
207 | ACPI_FUNCTION_TRACE(acpi_setup_gpe_for_wake); | 207 | ACPI_FUNCTION_TRACE(acpi_setup_gpe_for_wake); |
208 | 208 | ||
@@ -216,63 +216,95 @@ acpi_setup_gpe_for_wake(acpi_handle wake_device, | |||
216 | return_ACPI_STATUS(AE_BAD_PARAMETER); | 216 | return_ACPI_STATUS(AE_BAD_PARAMETER); |
217 | } | 217 | } |
218 | 218 | ||
219 | /* Handle root object case */ | ||
220 | |||
221 | if (wake_device == ACPI_ROOT_OBJECT) { | ||
222 | device_node = acpi_gbl_root_node; | ||
223 | } else { | ||
224 | device_node = ACPI_CAST_PTR(struct acpi_namespace_node, wake_device); | ||
225 | } | ||
226 | |||
227 | /* Validate WakeDevice is of type Device */ | ||
228 | |||
229 | if (device_node->type != ACPI_TYPE_DEVICE) { | ||
230 | return_ACPI_STATUS (AE_BAD_PARAMETER); | ||
231 | } | ||
232 | |||
233 | /* | ||
234 | * Allocate a new notify object up front, in case it is needed. | ||
235 | * Memory allocation while holding a spinlock is a big no-no | ||
236 | * on some hosts. | ||
237 | */ | ||
238 | new_notify = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_gpe_notify_info)); | ||
239 | if (!new_notify) { | ||
240 | return_ACPI_STATUS(AE_NO_MEMORY); | ||
241 | } | ||
242 | |||
219 | flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); | 243 | flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); |
220 | 244 | ||
221 | /* Ensure that we have a valid GPE number */ | 245 | /* Ensure that we have a valid GPE number */ |
222 | 246 | ||
223 | gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number); | 247 | gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number); |
224 | if (!gpe_event_info) { | 248 | if (!gpe_event_info) { |
249 | status = AE_BAD_PARAMETER; | ||
225 | goto unlock_and_exit; | 250 | goto unlock_and_exit; |
226 | } | 251 | } |
227 | 252 | ||
228 | if (wake_device == ACPI_ROOT_OBJECT) { | ||
229 | goto out; | ||
230 | } | ||
231 | |||
232 | /* | 253 | /* |
233 | * If there is no method or handler for this GPE, then the | 254 | * If there is no method or handler for this GPE, then the |
234 | * wake_device will be notified whenever this GPE fires (aka | 255 | * wake_device will be notified whenever this GPE fires. This is |
235 | * "implicit notify") Note: The GPE is assumed to be | 256 | * known as an "implicit notify". Note: The GPE is assumed to be |
236 | * level-triggered (for windows compatibility). | 257 | * level-triggered (for windows compatibility). |
237 | */ | 258 | */ |
238 | gpe_dispatch_mask = gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK; | 259 | if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == |
239 | if (gpe_dispatch_mask != ACPI_GPE_DISPATCH_NONE | 260 | ACPI_GPE_DISPATCH_NONE) { |
240 | && gpe_dispatch_mask != ACPI_GPE_DISPATCH_NOTIFY) { | 261 | /* |
241 | goto out; | 262 | * This is the first device for implicit notify on this GPE. |
242 | } | 263 | * Just set the flags here, and enter the NOTIFY block below. |
243 | 264 | */ | |
244 | /* Validate wake_device is of type Device */ | 265 | gpe_event_info->flags = |
245 | 266 | (ACPI_GPE_DISPATCH_NOTIFY | ACPI_GPE_LEVEL_TRIGGERED); | |
246 | device_node = ACPI_CAST_PTR(struct acpi_namespace_node, wake_device); | ||
247 | if (device_node->type != ACPI_TYPE_DEVICE) { | ||
248 | goto unlock_and_exit; | ||
249 | } | 267 | } |
250 | 268 | ||
251 | if (gpe_dispatch_mask == ACPI_GPE_DISPATCH_NONE) { | 269 | /* |
252 | gpe_event_info->flags = (ACPI_GPE_DISPATCH_NOTIFY | | 270 | * If we already have an implicit notify on this GPE, add |
253 | ACPI_GPE_LEVEL_TRIGGERED); | 271 | * this device to the notify list. |
254 | gpe_event_info->dispatch.device.node = device_node; | 272 | */ |
255 | gpe_event_info->dispatch.device.next = NULL; | 273 | if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == |
256 | } else { | 274 | ACPI_GPE_DISPATCH_NOTIFY) { |
257 | /* There are multiple devices to notify implicitly. */ | 275 | |
258 | 276 | /* Ensure that the device is not already in the list */ | |
259 | notify_object = ACPI_ALLOCATE_ZEROED(sizeof(*notify_object)); | 277 | |
260 | if (!notify_object) { | 278 | notify = gpe_event_info->dispatch.notify_list; |
261 | status = AE_NO_MEMORY; | 279 | while (notify) { |
262 | goto unlock_and_exit; | 280 | if (notify->device_node == device_node) { |
281 | status = AE_ALREADY_EXISTS; | ||
282 | goto unlock_and_exit; | ||
283 | } | ||
284 | notify = notify->next; | ||
263 | } | 285 | } |
264 | 286 | ||
265 | notify_object->node = device_node; | 287 | /* Add this device to the notify list for this GPE */ |
266 | notify_object->next = gpe_event_info->dispatch.device.next; | 288 | |
267 | gpe_event_info->dispatch.device.next = notify_object; | 289 | new_notify->device_node = device_node; |
290 | new_notify->next = gpe_event_info->dispatch.notify_list; | ||
291 | gpe_event_info->dispatch.notify_list = new_notify; | ||
292 | new_notify = NULL; | ||
268 | } | 293 | } |
269 | 294 | ||
270 | out: | 295 | /* Mark the GPE as a possible wake event */ |
296 | |||
271 | gpe_event_info->flags |= ACPI_GPE_CAN_WAKE; | 297 | gpe_event_info->flags |= ACPI_GPE_CAN_WAKE; |
272 | status = AE_OK; | 298 | status = AE_OK; |
273 | 299 | ||
274 | unlock_and_exit: | 300 | unlock_and_exit: |
275 | acpi_os_release_lock(acpi_gbl_gpe_lock, flags); | 301 | acpi_os_release_lock(acpi_gbl_gpe_lock, flags); |
302 | |||
303 | /* Delete the notify object if it was not used above */ | ||
304 | |||
305 | if (new_notify) { | ||
306 | ACPI_FREE(new_notify); | ||
307 | } | ||
276 | return_ACPI_STATUS(status); | 308 | return_ACPI_STATUS(status); |
277 | } | 309 | } |
278 | ACPI_EXPORT_SYMBOL(acpi_setup_gpe_for_wake) | 310 | ACPI_EXPORT_SYMBOL(acpi_setup_gpe_for_wake) |
@@ -283,7 +315,7 @@ ACPI_EXPORT_SYMBOL(acpi_setup_gpe_for_wake) | |||
283 | * | 315 | * |
284 | * PARAMETERS: gpe_device - Parent GPE Device. NULL for GPE0/GPE1 | 316 | * PARAMETERS: gpe_device - Parent GPE Device. NULL for GPE0/GPE1 |
285 | * gpe_number - GPE level within the GPE block | 317 | * gpe_number - GPE level within the GPE block |
286 | * Action - Enable or Disable | 318 | * action - Enable or Disable |
287 | * | 319 | * |
288 | * RETURN: Status | 320 | * RETURN: Status |
289 | * | 321 | * |
@@ -325,8 +357,7 @@ acpi_status acpi_set_gpe_wake_mask(acpi_handle gpe_device, u32 gpe_number, u8 ac | |||
325 | goto unlock_and_exit; | 357 | goto unlock_and_exit; |
326 | } | 358 | } |
327 | 359 | ||
328 | register_bit = | 360 | register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info); |
329 | acpi_hw_get_gpe_register_bit(gpe_event_info, gpe_register_info); | ||
330 | 361 | ||
331 | /* Perform the action */ | 362 | /* Perform the action */ |
332 | 363 | ||
@@ -508,7 +539,7 @@ ACPI_EXPORT_SYMBOL(acpi_enable_all_runtime_gpes) | |||
508 | * FUNCTION: acpi_install_gpe_block | 539 | * FUNCTION: acpi_install_gpe_block |
509 | * | 540 | * |
510 | * PARAMETERS: gpe_device - Handle to the parent GPE Block Device | 541 | * PARAMETERS: gpe_device - Handle to the parent GPE Block Device |
511 | * gpe_block_address - Address and space_iD | 542 | * gpe_block_address - Address and space_ID |
512 | * register_count - Number of GPE register pairs in the block | 543 | * register_count - Number of GPE register pairs in the block |
513 | * interrupt_number - H/W interrupt for the block | 544 | * interrupt_number - H/W interrupt for the block |
514 | * | 545 | * |
@@ -653,7 +684,7 @@ ACPI_EXPORT_SYMBOL(acpi_remove_gpe_block) | |||
653 | * | 684 | * |
654 | * FUNCTION: acpi_get_gpe_device | 685 | * FUNCTION: acpi_get_gpe_device |
655 | * | 686 | * |
656 | * PARAMETERS: Index - System GPE index (0-current_gpe_count) | 687 | * PARAMETERS: index - System GPE index (0-current_gpe_count) |
657 | * gpe_device - Where the parent GPE Device is returned | 688 | * gpe_device - Where the parent GPE Device is returned |
658 | * | 689 | * |
659 | * RETURN: Status | 690 | * RETURN: Status |
diff --git a/drivers/acpi/acpica/evxfregn.c b/drivers/acpi/acpica/evxfregn.c index 6019208cd4b6..96b412d03950 100644 --- a/drivers/acpi/acpica/evxfregn.c +++ b/drivers/acpi/acpica/evxfregn.c | |||
@@ -55,11 +55,11 @@ ACPI_MODULE_NAME("evxfregn") | |||
55 | * | 55 | * |
56 | * FUNCTION: acpi_install_address_space_handler | 56 | * FUNCTION: acpi_install_address_space_handler |
57 | * | 57 | * |
58 | * PARAMETERS: Device - Handle for the device | 58 | * PARAMETERS: device - Handle for the device |
59 | * space_id - The address space ID | 59 | * space_id - The address space ID |
60 | * Handler - Address of the handler | 60 | * handler - Address of the handler |
61 | * Setup - Address of the setup function | 61 | * setup - Address of the setup function |
62 | * Context - Value passed to the handler on each access | 62 | * context - Value passed to the handler on each access |
63 | * | 63 | * |
64 | * RETURN: Status | 64 | * RETURN: Status |
65 | * | 65 | * |
@@ -112,16 +112,16 @@ acpi_install_address_space_handler(acpi_handle device, | |||
112 | } | 112 | } |
113 | 113 | ||
114 | /* | 114 | /* |
115 | * For the default space_iDs, (the IDs for which there are default region handlers | 115 | * For the default space_IDs, (the IDs for which there are default region handlers |
116 | * installed) Only execute the _REG methods if the global initialization _REG | 116 | * installed) Only execute the _REG methods if the global initialization _REG |
117 | * methods have already been run (via acpi_initialize_objects). In other words, | 117 | * methods have already been run (via acpi_initialize_objects). In other words, |
118 | * we will defer the execution of the _REG methods for these space_iDs until | 118 | * we will defer the execution of the _REG methods for these space_IDs until |
119 | * execution of acpi_initialize_objects. This is done because we need the handlers | 119 | * execution of acpi_initialize_objects. This is done because we need the handlers |
120 | * for the default spaces (mem/io/pci/table) to be installed before we can run | 120 | * for the default spaces (mem/io/pci/table) to be installed before we can run |
121 | * any control methods (or _REG methods). There is known BIOS code that depends | 121 | * any control methods (or _REG methods). There is known BIOS code that depends |
122 | * on this. | 122 | * on this. |
123 | * | 123 | * |
124 | * For all other space_iDs, we can safely execute the _REG methods immediately. | 124 | * For all other space_IDs, we can safely execute the _REG methods immediately. |
125 | * This means that for IDs like embedded_controller, this function should be called | 125 | * This means that for IDs like embedded_controller, this function should be called |
126 | * only after acpi_enable_subsystem has been called. | 126 | * only after acpi_enable_subsystem has been called. |
127 | */ | 127 | */ |
@@ -157,9 +157,9 @@ ACPI_EXPORT_SYMBOL(acpi_install_address_space_handler) | |||
157 | * | 157 | * |
158 | * FUNCTION: acpi_remove_address_space_handler | 158 | * FUNCTION: acpi_remove_address_space_handler |
159 | * | 159 | * |
160 | * PARAMETERS: Device - Handle for the device | 160 | * PARAMETERS: device - Handle for the device |
161 | * space_id - The address space ID | 161 | * space_id - The address space ID |
162 | * Handler - Address of the handler | 162 | * handler - Address of the handler |
163 | * | 163 | * |
164 | * RETURN: Status | 164 | * RETURN: Status |
165 | * | 165 | * |
diff --git a/drivers/acpi/acpica/exconfig.c b/drivers/acpi/acpica/exconfig.c index c86d44e41bc8..16219bde48da 100644 --- a/drivers/acpi/acpica/exconfig.c +++ b/drivers/acpi/acpica/exconfig.c | |||
@@ -66,7 +66,7 @@ acpi_ex_region_read(union acpi_operand_object *obj_desc, | |||
66 | * | 66 | * |
67 | * FUNCTION: acpi_ex_add_table | 67 | * FUNCTION: acpi_ex_add_table |
68 | * | 68 | * |
69 | * PARAMETERS: Table - Pointer to raw table | 69 | * PARAMETERS: table - Pointer to raw table |
70 | * parent_node - Where to load the table (scope) | 70 | * parent_node - Where to load the table (scope) |
71 | * ddb_handle - Where to return the table handle. | 71 | * ddb_handle - Where to return the table handle. |
72 | * | 72 | * |
@@ -276,8 +276,8 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state, | |||
276 | * FUNCTION: acpi_ex_region_read | 276 | * FUNCTION: acpi_ex_region_read |
277 | * | 277 | * |
278 | * PARAMETERS: obj_desc - Region descriptor | 278 | * PARAMETERS: obj_desc - Region descriptor |
279 | * Length - Number of bytes to read | 279 | * length - Number of bytes to read |
280 | * Buffer - Pointer to where to put the data | 280 | * buffer - Pointer to where to put the data |
281 | * | 281 | * |
282 | * RETURN: Status | 282 | * RETURN: Status |
283 | * | 283 | * |
@@ -318,7 +318,7 @@ acpi_ex_region_read(union acpi_operand_object *obj_desc, u32 length, u8 *buffer) | |||
318 | * | 318 | * |
319 | * PARAMETERS: obj_desc - Region or Buffer/Field where the table will be | 319 | * PARAMETERS: obj_desc - Region or Buffer/Field where the table will be |
320 | * obtained | 320 | * obtained |
321 | * Target - Where a handle to the table will be stored | 321 | * target - Where a handle to the table will be stored |
322 | * walk_state - Current state | 322 | * walk_state - Current state |
323 | * | 323 | * |
324 | * RETURN: Status | 324 | * RETURN: Status |
diff --git a/drivers/acpi/acpica/exconvrt.c b/drivers/acpi/acpica/exconvrt.c index e385436bd424..bfb062e4c4b4 100644 --- a/drivers/acpi/acpica/exconvrt.c +++ b/drivers/acpi/acpica/exconvrt.c | |||
@@ -60,7 +60,7 @@ acpi_ex_convert_to_ascii(u64 integer, u16 base, u8 *string, u8 max_length); | |||
60 | * PARAMETERS: obj_desc - Object to be converted. Must be an | 60 | * PARAMETERS: obj_desc - Object to be converted. Must be an |
61 | * Integer, Buffer, or String | 61 | * Integer, Buffer, or String |
62 | * result_desc - Where the new Integer object is returned | 62 | * result_desc - Where the new Integer object is returned |
63 | * Flags - Used for string conversion | 63 | * flags - Used for string conversion |
64 | * | 64 | * |
65 | * RETURN: Status | 65 | * RETURN: Status |
66 | * | 66 | * |
@@ -272,9 +272,9 @@ acpi_ex_convert_to_buffer(union acpi_operand_object *obj_desc, | |||
272 | * | 272 | * |
273 | * FUNCTION: acpi_ex_convert_to_ascii | 273 | * FUNCTION: acpi_ex_convert_to_ascii |
274 | * | 274 | * |
275 | * PARAMETERS: Integer - Value to be converted | 275 | * PARAMETERS: integer - Value to be converted |
276 | * Base - ACPI_STRING_DECIMAL or ACPI_STRING_HEX | 276 | * base - ACPI_STRING_DECIMAL or ACPI_STRING_HEX |
277 | * String - Where the string is returned | 277 | * string - Where the string is returned |
278 | * data_width - Size of data item to be converted, in bytes | 278 | * data_width - Size of data item to be converted, in bytes |
279 | * | 279 | * |
280 | * RETURN: Actual string length | 280 | * RETURN: Actual string length |
@@ -385,7 +385,7 @@ acpi_ex_convert_to_ascii(u64 integer, u16 base, u8 *string, u8 data_width) | |||
385 | * PARAMETERS: obj_desc - Object to be converted. Must be an | 385 | * PARAMETERS: obj_desc - Object to be converted. Must be an |
386 | * Integer, Buffer, or String | 386 | * Integer, Buffer, or String |
387 | * result_desc - Where the string object is returned | 387 | * result_desc - Where the string object is returned |
388 | * Type - String flags (base and conversion type) | 388 | * type - String flags (base and conversion type) |
389 | * | 389 | * |
390 | * RETURN: Status | 390 | * RETURN: Status |
391 | * | 391 | * |
diff --git a/drivers/acpi/acpica/excreate.c b/drivers/acpi/acpica/excreate.c index 3f5bc998c1cb..691d4763102c 100644 --- a/drivers/acpi/acpica/excreate.c +++ b/drivers/acpi/acpica/excreate.c | |||
@@ -369,7 +369,7 @@ acpi_ex_create_region(u8 * aml_start, | |||
369 | * | 369 | * |
370 | * DESCRIPTION: Create a new processor object and populate the fields | 370 | * DESCRIPTION: Create a new processor object and populate the fields |
371 | * | 371 | * |
372 | * Processor (Name[0], cpu_iD[1], pblock_addr[2], pblock_length[3]) | 372 | * Processor (Name[0], cpu_ID[1], pblock_addr[2], pblock_length[3]) |
373 | * | 373 | * |
374 | ******************************************************************************/ | 374 | ******************************************************************************/ |
375 | 375 | ||
diff --git a/drivers/acpi/acpica/exdebug.c b/drivers/acpi/acpica/exdebug.c index e211e9c19215..bc5b9a6a1316 100644 --- a/drivers/acpi/acpica/exdebug.c +++ b/drivers/acpi/acpica/exdebug.c | |||
@@ -54,8 +54,8 @@ ACPI_MODULE_NAME("exdebug") | |||
54 | * FUNCTION: acpi_ex_do_debug_object | 54 | * FUNCTION: acpi_ex_do_debug_object |
55 | * | 55 | * |
56 | * PARAMETERS: source_desc - Object to be output to "Debug Object" | 56 | * PARAMETERS: source_desc - Object to be output to "Debug Object" |
57 | * Level - Indentation level (used for packages) | 57 | * level - Indentation level (used for packages) |
58 | * Index - Current package element, zero if not pkg | 58 | * index - Current package element, zero if not pkg |
59 | * | 59 | * |
60 | * RETURN: None | 60 | * RETURN: None |
61 | * | 61 | * |
diff --git a/drivers/acpi/acpica/exdump.c b/drivers/acpi/acpica/exdump.c index 2a6ac0a3bc1e..213c081776fc 100644 --- a/drivers/acpi/acpica/exdump.c +++ b/drivers/acpi/acpica/exdump.c | |||
@@ -109,9 +109,9 @@ static struct acpi_exdump_info acpi_ex_dump_package[5] = { | |||
109 | static struct acpi_exdump_info acpi_ex_dump_device[4] = { | 109 | static struct acpi_exdump_info acpi_ex_dump_device[4] = { |
110 | {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_device), NULL}, | 110 | {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_device), NULL}, |
111 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(device.handler), "Handler"}, | 111 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(device.handler), "Handler"}, |
112 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(device.system_notify), | 112 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(device.notify_list[0]), |
113 | "System Notify"}, | 113 | "System Notify"}, |
114 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(device.device_notify), | 114 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(device.notify_list[1]), |
115 | "Device Notify"} | 115 | "Device Notify"} |
116 | }; | 116 | }; |
117 | 117 | ||
@@ -158,9 +158,9 @@ static struct acpi_exdump_info acpi_ex_dump_power[5] = { | |||
158 | "System Level"}, | 158 | "System Level"}, |
159 | {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(power_resource.resource_order), | 159 | {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(power_resource.resource_order), |
160 | "Resource Order"}, | 160 | "Resource Order"}, |
161 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(power_resource.system_notify), | 161 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(power_resource.notify_list[0]), |
162 | "System Notify"}, | 162 | "System Notify"}, |
163 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(power_resource.device_notify), | 163 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(power_resource.notify_list[1]), |
164 | "Device Notify"} | 164 | "Device Notify"} |
165 | }; | 165 | }; |
166 | 166 | ||
@@ -169,18 +169,18 @@ static struct acpi_exdump_info acpi_ex_dump_processor[7] = { | |||
169 | {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(processor.proc_id), "Processor ID"}, | 169 | {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(processor.proc_id), "Processor ID"}, |
170 | {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(processor.length), "Length"}, | 170 | {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(processor.length), "Length"}, |
171 | {ACPI_EXD_ADDRESS, ACPI_EXD_OFFSET(processor.address), "Address"}, | 171 | {ACPI_EXD_ADDRESS, ACPI_EXD_OFFSET(processor.address), "Address"}, |
172 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(processor.system_notify), | 172 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(processor.notify_list[0]), |
173 | "System Notify"}, | 173 | "System Notify"}, |
174 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(processor.device_notify), | 174 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(processor.notify_list[1]), |
175 | "Device Notify"}, | 175 | "Device Notify"}, |
176 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(processor.handler), "Handler"} | 176 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(processor.handler), "Handler"} |
177 | }; | 177 | }; |
178 | 178 | ||
179 | static struct acpi_exdump_info acpi_ex_dump_thermal[4] = { | 179 | static struct acpi_exdump_info acpi_ex_dump_thermal[4] = { |
180 | {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_thermal), NULL}, | 180 | {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_thermal), NULL}, |
181 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(thermal_zone.system_notify), | 181 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(thermal_zone.notify_list[0]), |
182 | "System Notify"}, | 182 | "System Notify"}, |
183 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(thermal_zone.device_notify), | 183 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(thermal_zone.notify_list[1]), |
184 | "Device Notify"}, | 184 | "Device Notify"}, |
185 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(thermal_zone.handler), "Handler"} | 185 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(thermal_zone.handler), "Handler"} |
186 | }; | 186 | }; |
@@ -241,10 +241,15 @@ static struct acpi_exdump_info acpi_ex_dump_address_handler[6] = { | |||
241 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(address_space.context), "Context"} | 241 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(address_space.context), "Context"} |
242 | }; | 242 | }; |
243 | 243 | ||
244 | static struct acpi_exdump_info acpi_ex_dump_notify[3] = { | 244 | static struct acpi_exdump_info acpi_ex_dump_notify[7] = { |
245 | {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_notify), NULL}, | 245 | {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_notify), NULL}, |
246 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(notify.node), "Node"}, | 246 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(notify.node), "Node"}, |
247 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(notify.context), "Context"} | 247 | {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(notify.handler_type), "Handler Type"}, |
248 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(notify.handler), "Handler"}, | ||
249 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(notify.context), "Context"}, | ||
250 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(notify.next[0]), | ||
251 | "Next System Notify"}, | ||
252 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(notify.next[1]), "Next Device Notify"} | ||
248 | }; | 253 | }; |
249 | 254 | ||
250 | /* Miscellaneous tables */ | 255 | /* Miscellaneous tables */ |
@@ -318,7 +323,7 @@ static struct acpi_exdump_info *acpi_ex_dump_info[] = { | |||
318 | * FUNCTION: acpi_ex_dump_object | 323 | * FUNCTION: acpi_ex_dump_object |
319 | * | 324 | * |
320 | * PARAMETERS: obj_desc - Descriptor to dump | 325 | * PARAMETERS: obj_desc - Descriptor to dump |
321 | * Info - Info table corresponding to this object | 326 | * info - Info table corresponding to this object |
322 | * type | 327 | * type |
323 | * | 328 | * |
324 | * RETURN: None | 329 | * RETURN: None |
@@ -444,7 +449,7 @@ acpi_ex_dump_object(union acpi_operand_object *obj_desc, | |||
444 | * FUNCTION: acpi_ex_dump_operand | 449 | * FUNCTION: acpi_ex_dump_operand |
445 | * | 450 | * |
446 | * PARAMETERS: *obj_desc - Pointer to entry to be dumped | 451 | * PARAMETERS: *obj_desc - Pointer to entry to be dumped |
447 | * Depth - Current nesting depth | 452 | * depth - Current nesting depth |
448 | * | 453 | * |
449 | * RETURN: None | 454 | * RETURN: None |
450 | * | 455 | * |
@@ -726,7 +731,7 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth) | |||
726 | * | 731 | * |
727 | * FUNCTION: acpi_ex_dump_operands | 732 | * FUNCTION: acpi_ex_dump_operands |
728 | * | 733 | * |
729 | * PARAMETERS: Operands - A list of Operand objects | 734 | * PARAMETERS: operands - A list of Operand objects |
730 | * opcode_name - AML opcode name | 735 | * opcode_name - AML opcode name |
731 | * num_operands - Operand count for this opcode | 736 | * num_operands - Operand count for this opcode |
732 | * | 737 | * |
@@ -769,8 +774,8 @@ acpi_ex_dump_operands(union acpi_operand_object **operands, | |||
769 | * | 774 | * |
770 | * FUNCTION: acpi_ex_out* functions | 775 | * FUNCTION: acpi_ex_out* functions |
771 | * | 776 | * |
772 | * PARAMETERS: Title - Descriptive text | 777 | * PARAMETERS: title - Descriptive text |
773 | * Value - Value to be displayed | 778 | * value - Value to be displayed |
774 | * | 779 | * |
775 | * DESCRIPTION: Object dump output formatting functions. These functions | 780 | * DESCRIPTION: Object dump output formatting functions. These functions |
776 | * reduce the number of format strings required and keeps them | 781 | * reduce the number of format strings required and keeps them |
@@ -792,8 +797,8 @@ static void acpi_ex_out_pointer(char *title, void *value) | |||
792 | * | 797 | * |
793 | * FUNCTION: acpi_ex_dump_namespace_node | 798 | * FUNCTION: acpi_ex_dump_namespace_node |
794 | * | 799 | * |
795 | * PARAMETERS: Node - Descriptor to dump | 800 | * PARAMETERS: node - Descriptor to dump |
796 | * Flags - Force display if TRUE | 801 | * flags - Force display if TRUE |
797 | * | 802 | * |
798 | * DESCRIPTION: Dumps the members of the given.Node | 803 | * DESCRIPTION: Dumps the members of the given.Node |
799 | * | 804 | * |
@@ -825,7 +830,7 @@ void acpi_ex_dump_namespace_node(struct acpi_namespace_node *node, u32 flags) | |||
825 | * | 830 | * |
826 | * FUNCTION: acpi_ex_dump_reference_obj | 831 | * FUNCTION: acpi_ex_dump_reference_obj |
827 | * | 832 | * |
828 | * PARAMETERS: Object - Descriptor to dump | 833 | * PARAMETERS: object - Descriptor to dump |
829 | * | 834 | * |
830 | * DESCRIPTION: Dumps a reference object | 835 | * DESCRIPTION: Dumps a reference object |
831 | * | 836 | * |
@@ -882,8 +887,8 @@ static void acpi_ex_dump_reference_obj(union acpi_operand_object *obj_desc) | |||
882 | * FUNCTION: acpi_ex_dump_package_obj | 887 | * FUNCTION: acpi_ex_dump_package_obj |
883 | * | 888 | * |
884 | * PARAMETERS: obj_desc - Descriptor to dump | 889 | * PARAMETERS: obj_desc - Descriptor to dump |
885 | * Level - Indentation Level | 890 | * level - Indentation Level |
886 | * Index - Package index for this object | 891 | * index - Package index for this object |
887 | * | 892 | * |
888 | * DESCRIPTION: Dumps the elements of the package | 893 | * DESCRIPTION: Dumps the elements of the package |
889 | * | 894 | * |
@@ -926,9 +931,7 @@ acpi_ex_dump_package_obj(union acpi_operand_object *obj_desc, | |||
926 | case ACPI_TYPE_STRING: | 931 | case ACPI_TYPE_STRING: |
927 | 932 | ||
928 | acpi_os_printf("[String] Value: "); | 933 | acpi_os_printf("[String] Value: "); |
929 | for (i = 0; i < obj_desc->string.length; i++) { | 934 | acpi_ut_print_string(obj_desc->string.pointer, ACPI_UINT8_MAX); |
930 | acpi_os_printf("%c", obj_desc->string.pointer[i]); | ||
931 | } | ||
932 | acpi_os_printf("\n"); | 935 | acpi_os_printf("\n"); |
933 | break; | 936 | break; |
934 | 937 | ||
@@ -977,7 +980,7 @@ acpi_ex_dump_package_obj(union acpi_operand_object *obj_desc, | |||
977 | * FUNCTION: acpi_ex_dump_object_descriptor | 980 | * FUNCTION: acpi_ex_dump_object_descriptor |
978 | * | 981 | * |
979 | * PARAMETERS: obj_desc - Descriptor to dump | 982 | * PARAMETERS: obj_desc - Descriptor to dump |
980 | * Flags - Force display if TRUE | 983 | * flags - Force display if TRUE |
981 | * | 984 | * |
982 | * DESCRIPTION: Dumps the members of the object descriptor given. | 985 | * DESCRIPTION: Dumps the members of the object descriptor given. |
983 | * | 986 | * |
diff --git a/drivers/acpi/acpica/exfldio.c b/drivers/acpi/acpica/exfldio.c index 149de45fdadd..a7784152ed30 100644 --- a/drivers/acpi/acpica/exfldio.c +++ b/drivers/acpi/acpica/exfldio.c | |||
@@ -222,9 +222,9 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc, | |||
222 | * PARAMETERS: obj_desc - Field to be read | 222 | * PARAMETERS: obj_desc - Field to be read |
223 | * field_datum_byte_offset - Byte offset of this datum within the | 223 | * field_datum_byte_offset - Byte offset of this datum within the |
224 | * parent field | 224 | * parent field |
225 | * Value - Where to store value (must at least | 225 | * value - Where to store value (must at least |
226 | * 64 bits) | 226 | * 64 bits) |
227 | * Function - Read or Write flag plus other region- | 227 | * function - Read or Write flag plus other region- |
228 | * dependent flags | 228 | * dependent flags |
229 | * | 229 | * |
230 | * RETURN: Status | 230 | * RETURN: Status |
@@ -315,7 +315,7 @@ acpi_ex_access_region(union acpi_operand_object *obj_desc, | |||
315 | * FUNCTION: acpi_ex_register_overflow | 315 | * FUNCTION: acpi_ex_register_overflow |
316 | * | 316 | * |
317 | * PARAMETERS: obj_desc - Register(Field) to be written | 317 | * PARAMETERS: obj_desc - Register(Field) to be written |
318 | * Value - Value to be stored | 318 | * value - Value to be stored |
319 | * | 319 | * |
320 | * RETURN: TRUE if value overflows the field, FALSE otherwise | 320 | * RETURN: TRUE if value overflows the field, FALSE otherwise |
321 | * | 321 | * |
@@ -365,7 +365,7 @@ acpi_ex_register_overflow(union acpi_operand_object *obj_desc, u64 value) | |||
365 | * PARAMETERS: obj_desc - Field to be read | 365 | * PARAMETERS: obj_desc - Field to be read |
366 | * field_datum_byte_offset - Byte offset of this datum within the | 366 | * field_datum_byte_offset - Byte offset of this datum within the |
367 | * parent field | 367 | * parent field |
368 | * Value - Where to store value (must be 64 bits) | 368 | * value - Where to store value (must be 64 bits) |
369 | * read_write - Read or Write flag | 369 | * read_write - Read or Write flag |
370 | * | 370 | * |
371 | * RETURN: Status | 371 | * RETURN: Status |
@@ -574,7 +574,7 @@ acpi_ex_field_datum_io(union acpi_operand_object *obj_desc, | |||
574 | * FUNCTION: acpi_ex_write_with_update_rule | 574 | * FUNCTION: acpi_ex_write_with_update_rule |
575 | * | 575 | * |
576 | * PARAMETERS: obj_desc - Field to be written | 576 | * PARAMETERS: obj_desc - Field to be written |
577 | * Mask - bitmask within field datum | 577 | * mask - bitmask within field datum |
578 | * field_value - Value to write | 578 | * field_value - Value to write |
579 | * field_datum_byte_offset - Offset of datum within field | 579 | * field_datum_byte_offset - Offset of datum within field |
580 | * | 580 | * |
@@ -678,7 +678,7 @@ acpi_ex_write_with_update_rule(union acpi_operand_object *obj_desc, | |||
678 | * FUNCTION: acpi_ex_extract_from_field | 678 | * FUNCTION: acpi_ex_extract_from_field |
679 | * | 679 | * |
680 | * PARAMETERS: obj_desc - Field to be read | 680 | * PARAMETERS: obj_desc - Field to be read |
681 | * Buffer - Where to store the field data | 681 | * buffer - Where to store the field data |
682 | * buffer_length - Length of Buffer | 682 | * buffer_length - Length of Buffer |
683 | * | 683 | * |
684 | * RETURN: Status | 684 | * RETURN: Status |
@@ -823,7 +823,7 @@ acpi_ex_extract_from_field(union acpi_operand_object *obj_desc, | |||
823 | * FUNCTION: acpi_ex_insert_into_field | 823 | * FUNCTION: acpi_ex_insert_into_field |
824 | * | 824 | * |
825 | * PARAMETERS: obj_desc - Field to be written | 825 | * PARAMETERS: obj_desc - Field to be written |
826 | * Buffer - Data to be written | 826 | * buffer - Data to be written |
827 | * buffer_length - Length of Buffer | 827 | * buffer_length - Length of Buffer |
828 | * | 828 | * |
829 | * RETURN: Status | 829 | * RETURN: Status |
diff --git a/drivers/acpi/acpica/exmisc.c b/drivers/acpi/acpica/exmisc.c index 0a0893310348..271c0c57ea10 100644 --- a/drivers/acpi/acpica/exmisc.c +++ b/drivers/acpi/acpica/exmisc.c | |||
@@ -144,8 +144,8 @@ acpi_ex_get_object_reference(union acpi_operand_object *obj_desc, | |||
144 | * | 144 | * |
145 | * FUNCTION: acpi_ex_concat_template | 145 | * FUNCTION: acpi_ex_concat_template |
146 | * | 146 | * |
147 | * PARAMETERS: Operand0 - First source object | 147 | * PARAMETERS: operand0 - First source object |
148 | * Operand1 - Second source object | 148 | * operand1 - Second source object |
149 | * actual_return_desc - Where to place the return object | 149 | * actual_return_desc - Where to place the return object |
150 | * walk_state - Current walk state | 150 | * walk_state - Current walk state |
151 | * | 151 | * |
@@ -229,8 +229,8 @@ acpi_ex_concat_template(union acpi_operand_object *operand0, | |||
229 | * | 229 | * |
230 | * FUNCTION: acpi_ex_do_concatenate | 230 | * FUNCTION: acpi_ex_do_concatenate |
231 | * | 231 | * |
232 | * PARAMETERS: Operand0 - First source object | 232 | * PARAMETERS: operand0 - First source object |
233 | * Operand1 - Second source object | 233 | * operand1 - Second source object |
234 | * actual_return_desc - Where to place the return object | 234 | * actual_return_desc - Where to place the return object |
235 | * walk_state - Current walk state | 235 | * walk_state - Current walk state |
236 | * | 236 | * |
@@ -397,9 +397,9 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0, | |||
397 | * | 397 | * |
398 | * FUNCTION: acpi_ex_do_math_op | 398 | * FUNCTION: acpi_ex_do_math_op |
399 | * | 399 | * |
400 | * PARAMETERS: Opcode - AML opcode | 400 | * PARAMETERS: opcode - AML opcode |
401 | * Integer0 - Integer operand #0 | 401 | * integer0 - Integer operand #0 |
402 | * Integer1 - Integer operand #1 | 402 | * integer1 - Integer operand #1 |
403 | * | 403 | * |
404 | * RETURN: Integer result of the operation | 404 | * RETURN: Integer result of the operation |
405 | * | 405 | * |
@@ -479,9 +479,9 @@ u64 acpi_ex_do_math_op(u16 opcode, u64 integer0, u64 integer1) | |||
479 | * | 479 | * |
480 | * FUNCTION: acpi_ex_do_logical_numeric_op | 480 | * FUNCTION: acpi_ex_do_logical_numeric_op |
481 | * | 481 | * |
482 | * PARAMETERS: Opcode - AML opcode | 482 | * PARAMETERS: opcode - AML opcode |
483 | * Integer0 - Integer operand #0 | 483 | * integer0 - Integer operand #0 |
484 | * Integer1 - Integer operand #1 | 484 | * integer1 - Integer operand #1 |
485 | * logical_result - TRUE/FALSE result of the operation | 485 | * logical_result - TRUE/FALSE result of the operation |
486 | * | 486 | * |
487 | * RETURN: Status | 487 | * RETURN: Status |
@@ -534,9 +534,9 @@ acpi_ex_do_logical_numeric_op(u16 opcode, | |||
534 | * | 534 | * |
535 | * FUNCTION: acpi_ex_do_logical_op | 535 | * FUNCTION: acpi_ex_do_logical_op |
536 | * | 536 | * |
537 | * PARAMETERS: Opcode - AML opcode | 537 | * PARAMETERS: opcode - AML opcode |
538 | * Operand0 - operand #0 | 538 | * operand0 - operand #0 |
539 | * Operand1 - operand #1 | 539 | * operand1 - operand #1 |
540 | * logical_result - TRUE/FALSE result of the operation | 540 | * logical_result - TRUE/FALSE result of the operation |
541 | * | 541 | * |
542 | * RETURN: Status | 542 | * RETURN: Status |
diff --git a/drivers/acpi/acpica/exmutex.c b/drivers/acpi/acpica/exmutex.c index 60933e9dc3c0..bcceda5be9e3 100644 --- a/drivers/acpi/acpica/exmutex.c +++ b/drivers/acpi/acpica/exmutex.c | |||
@@ -102,7 +102,7 @@ void acpi_ex_unlink_mutex(union acpi_operand_object *obj_desc) | |||
102 | * FUNCTION: acpi_ex_link_mutex | 102 | * FUNCTION: acpi_ex_link_mutex |
103 | * | 103 | * |
104 | * PARAMETERS: obj_desc - The mutex to be linked | 104 | * PARAMETERS: obj_desc - The mutex to be linked |
105 | * Thread - Current executing thread object | 105 | * thread - Current executing thread object |
106 | * | 106 | * |
107 | * RETURN: None | 107 | * RETURN: None |
108 | * | 108 | * |
@@ -138,7 +138,7 @@ acpi_ex_link_mutex(union acpi_operand_object *obj_desc, | |||
138 | * | 138 | * |
139 | * FUNCTION: acpi_ex_acquire_mutex_object | 139 | * FUNCTION: acpi_ex_acquire_mutex_object |
140 | * | 140 | * |
141 | * PARAMETERS: Timeout - Timeout in milliseconds | 141 | * PARAMETERS: timeout - Timeout in milliseconds |
142 | * obj_desc - Mutex object | 142 | * obj_desc - Mutex object |
143 | * thread_id - Current thread state | 143 | * thread_id - Current thread state |
144 | * | 144 | * |
@@ -443,7 +443,7 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc, | |||
443 | * | 443 | * |
444 | * FUNCTION: acpi_ex_release_all_mutexes | 444 | * FUNCTION: acpi_ex_release_all_mutexes |
445 | * | 445 | * |
446 | * PARAMETERS: Thread - Current executing thread object | 446 | * PARAMETERS: thread - Current executing thread object |
447 | * | 447 | * |
448 | * RETURN: Status | 448 | * RETURN: Status |
449 | * | 449 | * |
diff --git a/drivers/acpi/acpica/exprep.c b/drivers/acpi/acpica/exprep.c index 30157f5a12d7..81eca60d2748 100644 --- a/drivers/acpi/acpica/exprep.c +++ b/drivers/acpi/acpica/exprep.c | |||
@@ -391,12 +391,12 @@ acpi_ex_prep_common_field_object(union acpi_operand_object *obj_desc, | |||
391 | * | 391 | * |
392 | * FUNCTION: acpi_ex_prep_field_value | 392 | * FUNCTION: acpi_ex_prep_field_value |
393 | * | 393 | * |
394 | * PARAMETERS: Info - Contains all field creation info | 394 | * PARAMETERS: info - Contains all field creation info |
395 | * | 395 | * |
396 | * RETURN: Status | 396 | * RETURN: Status |
397 | * | 397 | * |
398 | * DESCRIPTION: Construct a union acpi_operand_object of type def_field and | 398 | * DESCRIPTION: Construct an object of type union acpi_operand_object with a |
399 | * connect it to the parent Node. | 399 | * subtype of def_field and connect it to the parent Node. |
400 | * | 400 | * |
401 | ******************************************************************************/ | 401 | ******************************************************************************/ |
402 | 402 | ||
diff --git a/drivers/acpi/acpica/exregion.c b/drivers/acpi/acpica/exregion.c index 12d51df6d3bf..1f1ce0c3d2f8 100644 --- a/drivers/acpi/acpica/exregion.c +++ b/drivers/acpi/acpica/exregion.c | |||
@@ -53,10 +53,10 @@ ACPI_MODULE_NAME("exregion") | |||
53 | * | 53 | * |
54 | * FUNCTION: acpi_ex_system_memory_space_handler | 54 | * FUNCTION: acpi_ex_system_memory_space_handler |
55 | * | 55 | * |
56 | * PARAMETERS: Function - Read or Write operation | 56 | * PARAMETERS: function - Read or Write operation |
57 | * Address - Where in the space to read or write | 57 | * address - Where in the space to read or write |
58 | * bit_width - Field width in bits (8, 16, or 32) | 58 | * bit_width - Field width in bits (8, 16, or 32) |
59 | * Value - Pointer to in or out value | 59 | * value - Pointer to in or out value |
60 | * handler_context - Pointer to Handler's context | 60 | * handler_context - Pointer to Handler's context |
61 | * region_context - Pointer to context specific to the | 61 | * region_context - Pointer to context specific to the |
62 | * accessed region | 62 | * accessed region |
@@ -270,10 +270,10 @@ acpi_ex_system_memory_space_handler(u32 function, | |||
270 | * | 270 | * |
271 | * FUNCTION: acpi_ex_system_io_space_handler | 271 | * FUNCTION: acpi_ex_system_io_space_handler |
272 | * | 272 | * |
273 | * PARAMETERS: Function - Read or Write operation | 273 | * PARAMETERS: function - Read or Write operation |
274 | * Address - Where in the space to read or write | 274 | * address - Where in the space to read or write |
275 | * bit_width - Field width in bits (8, 16, or 32) | 275 | * bit_width - Field width in bits (8, 16, or 32) |
276 | * Value - Pointer to in or out value | 276 | * value - Pointer to in or out value |
277 | * handler_context - Pointer to Handler's context | 277 | * handler_context - Pointer to Handler's context |
278 | * region_context - Pointer to context specific to the | 278 | * region_context - Pointer to context specific to the |
279 | * accessed region | 279 | * accessed region |
@@ -329,10 +329,10 @@ acpi_ex_system_io_space_handler(u32 function, | |||
329 | * | 329 | * |
330 | * FUNCTION: acpi_ex_pci_config_space_handler | 330 | * FUNCTION: acpi_ex_pci_config_space_handler |
331 | * | 331 | * |
332 | * PARAMETERS: Function - Read or Write operation | 332 | * PARAMETERS: function - Read or Write operation |
333 | * Address - Where in the space to read or write | 333 | * address - Where in the space to read or write |
334 | * bit_width - Field width in bits (8, 16, or 32) | 334 | * bit_width - Field width in bits (8, 16, or 32) |
335 | * Value - Pointer to in or out value | 335 | * value - Pointer to in or out value |
336 | * handler_context - Pointer to Handler's context | 336 | * handler_context - Pointer to Handler's context |
337 | * region_context - Pointer to context specific to the | 337 | * region_context - Pointer to context specific to the |
338 | * accessed region | 338 | * accessed region |
@@ -365,7 +365,7 @@ acpi_ex_pci_config_space_handler(u32 function, | |||
365 | * pci_function is the PCI device function number | 365 | * pci_function is the PCI device function number |
366 | * pci_register is the Config space register range 0-255 bytes | 366 | * pci_register is the Config space register range 0-255 bytes |
367 | * | 367 | * |
368 | * Value - input value for write, output address for read | 368 | * value - input value for write, output address for read |
369 | * | 369 | * |
370 | */ | 370 | */ |
371 | pci_id = (struct acpi_pci_id *)region_context; | 371 | pci_id = (struct acpi_pci_id *)region_context; |
@@ -402,10 +402,10 @@ acpi_ex_pci_config_space_handler(u32 function, | |||
402 | * | 402 | * |
403 | * FUNCTION: acpi_ex_cmos_space_handler | 403 | * FUNCTION: acpi_ex_cmos_space_handler |
404 | * | 404 | * |
405 | * PARAMETERS: Function - Read or Write operation | 405 | * PARAMETERS: function - Read or Write operation |
406 | * Address - Where in the space to read or write | 406 | * address - Where in the space to read or write |
407 | * bit_width - Field width in bits (8, 16, or 32) | 407 | * bit_width - Field width in bits (8, 16, or 32) |
408 | * Value - Pointer to in or out value | 408 | * value - Pointer to in or out value |
409 | * handler_context - Pointer to Handler's context | 409 | * handler_context - Pointer to Handler's context |
410 | * region_context - Pointer to context specific to the | 410 | * region_context - Pointer to context specific to the |
411 | * accessed region | 411 | * accessed region |
@@ -434,10 +434,10 @@ acpi_ex_cmos_space_handler(u32 function, | |||
434 | * | 434 | * |
435 | * FUNCTION: acpi_ex_pci_bar_space_handler | 435 | * FUNCTION: acpi_ex_pci_bar_space_handler |
436 | * | 436 | * |
437 | * PARAMETERS: Function - Read or Write operation | 437 | * PARAMETERS: function - Read or Write operation |
438 | * Address - Where in the space to read or write | 438 | * address - Where in the space to read or write |
439 | * bit_width - Field width in bits (8, 16, or 32) | 439 | * bit_width - Field width in bits (8, 16, or 32) |
440 | * Value - Pointer to in or out value | 440 | * value - Pointer to in or out value |
441 | * handler_context - Pointer to Handler's context | 441 | * handler_context - Pointer to Handler's context |
442 | * region_context - Pointer to context specific to the | 442 | * region_context - Pointer to context specific to the |
443 | * accessed region | 443 | * accessed region |
@@ -466,10 +466,10 @@ acpi_ex_pci_bar_space_handler(u32 function, | |||
466 | * | 466 | * |
467 | * FUNCTION: acpi_ex_data_table_space_handler | 467 | * FUNCTION: acpi_ex_data_table_space_handler |
468 | * | 468 | * |
469 | * PARAMETERS: Function - Read or Write operation | 469 | * PARAMETERS: function - Read or Write operation |
470 | * Address - Where in the space to read or write | 470 | * address - Where in the space to read or write |
471 | * bit_width - Field width in bits (8, 16, or 32) | 471 | * bit_width - Field width in bits (8, 16, or 32) |
472 | * Value - Pointer to in or out value | 472 | * value - Pointer to in or out value |
473 | * handler_context - Pointer to Handler's context | 473 | * handler_context - Pointer to Handler's context |
474 | * region_context - Pointer to context specific to the | 474 | * region_context - Pointer to context specific to the |
475 | * accessed region | 475 | * accessed region |
diff --git a/drivers/acpi/acpica/exresolv.c b/drivers/acpi/acpica/exresolv.c index 6e335dc34528..bbf40ac27585 100644 --- a/drivers/acpi/acpica/exresolv.c +++ b/drivers/acpi/acpica/exresolv.c | |||
@@ -147,7 +147,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr, | |||
147 | 147 | ||
148 | stack_desc = *stack_ptr; | 148 | stack_desc = *stack_ptr; |
149 | 149 | ||
150 | /* This is a union acpi_operand_object */ | 150 | /* This is an object of type union acpi_operand_object */ |
151 | 151 | ||
152 | switch (stack_desc->common.type) { | 152 | switch (stack_desc->common.type) { |
153 | case ACPI_TYPE_LOCAL_REFERENCE: | 153 | case ACPI_TYPE_LOCAL_REFERENCE: |
@@ -321,7 +321,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr, | |||
321 | * FUNCTION: acpi_ex_resolve_multiple | 321 | * FUNCTION: acpi_ex_resolve_multiple |
322 | * | 322 | * |
323 | * PARAMETERS: walk_state - Current state (contains AML opcode) | 323 | * PARAMETERS: walk_state - Current state (contains AML opcode) |
324 | * Operand - Starting point for resolution | 324 | * operand - Starting point for resolution |
325 | * return_type - Where the object type is returned | 325 | * return_type - Where the object type is returned |
326 | * return_desc - Where the resolved object is returned | 326 | * return_desc - Where the resolved object is returned |
327 | * | 327 | * |
diff --git a/drivers/acpi/acpica/exresop.c b/drivers/acpi/acpica/exresop.c index a67b1d925ddd..f232fbabdea8 100644 --- a/drivers/acpi/acpica/exresop.c +++ b/drivers/acpi/acpica/exresop.c | |||
@@ -113,7 +113,7 @@ acpi_ex_check_object_type(acpi_object_type type_needed, | |||
113 | * | 113 | * |
114 | * FUNCTION: acpi_ex_resolve_operands | 114 | * FUNCTION: acpi_ex_resolve_operands |
115 | * | 115 | * |
116 | * PARAMETERS: Opcode - Opcode being interpreted | 116 | * PARAMETERS: opcode - Opcode being interpreted |
117 | * stack_ptr - Pointer to the operand stack to be | 117 | * stack_ptr - Pointer to the operand stack to be |
118 | * resolved | 118 | * resolved |
119 | * walk_state - Current state | 119 | * walk_state - Current state |
@@ -307,7 +307,7 @@ acpi_ex_resolve_operands(u16 opcode, | |||
307 | case ARGI_DEVICE_REF: | 307 | case ARGI_DEVICE_REF: |
308 | case ARGI_TARGETREF: /* Allows implicit conversion rules before store */ | 308 | case ARGI_TARGETREF: /* Allows implicit conversion rules before store */ |
309 | case ARGI_FIXED_TARGET: /* No implicit conversion before store to target */ | 309 | case ARGI_FIXED_TARGET: /* No implicit conversion before store to target */ |
310 | case ARGI_SIMPLE_TARGET: /* Name, Local, or Arg - no implicit conversion */ | 310 | case ARGI_SIMPLE_TARGET: /* Name, Local, or arg - no implicit conversion */ |
311 | 311 | ||
312 | /* | 312 | /* |
313 | * Need an operand of type ACPI_TYPE_LOCAL_REFERENCE | 313 | * Need an operand of type ACPI_TYPE_LOCAL_REFERENCE |
@@ -410,7 +410,7 @@ acpi_ex_resolve_operands(u16 opcode, | |||
410 | /* | 410 | /* |
411 | * Need an operand of type ACPI_TYPE_INTEGER, | 411 | * Need an operand of type ACPI_TYPE_INTEGER, |
412 | * But we can implicitly convert from a STRING or BUFFER | 412 | * But we can implicitly convert from a STRING or BUFFER |
413 | * Aka - "Implicit Source Operand Conversion" | 413 | * aka - "Implicit Source Operand Conversion" |
414 | */ | 414 | */ |
415 | status = | 415 | status = |
416 | acpi_ex_convert_to_integer(obj_desc, stack_ptr, 16); | 416 | acpi_ex_convert_to_integer(obj_desc, stack_ptr, 16); |
@@ -437,7 +437,7 @@ acpi_ex_resolve_operands(u16 opcode, | |||
437 | /* | 437 | /* |
438 | * Need an operand of type ACPI_TYPE_BUFFER, | 438 | * Need an operand of type ACPI_TYPE_BUFFER, |
439 | * But we can implicitly convert from a STRING or INTEGER | 439 | * But we can implicitly convert from a STRING or INTEGER |
440 | * Aka - "Implicit Source Operand Conversion" | 440 | * aka - "Implicit Source Operand Conversion" |
441 | */ | 441 | */ |
442 | status = acpi_ex_convert_to_buffer(obj_desc, stack_ptr); | 442 | status = acpi_ex_convert_to_buffer(obj_desc, stack_ptr); |
443 | if (ACPI_FAILURE(status)) { | 443 | if (ACPI_FAILURE(status)) { |
@@ -463,7 +463,7 @@ acpi_ex_resolve_operands(u16 opcode, | |||
463 | /* | 463 | /* |
464 | * Need an operand of type ACPI_TYPE_STRING, | 464 | * Need an operand of type ACPI_TYPE_STRING, |
465 | * But we can implicitly convert from a BUFFER or INTEGER | 465 | * But we can implicitly convert from a BUFFER or INTEGER |
466 | * Aka - "Implicit Source Operand Conversion" | 466 | * aka - "Implicit Source Operand Conversion" |
467 | */ | 467 | */ |
468 | status = acpi_ex_convert_to_string(obj_desc, stack_ptr, | 468 | status = acpi_ex_convert_to_string(obj_desc, stack_ptr, |
469 | ACPI_IMPLICIT_CONVERT_HEX); | 469 | ACPI_IMPLICIT_CONVERT_HEX); |
diff --git a/drivers/acpi/acpica/exstore.c b/drivers/acpi/acpica/exstore.c index c6cf843cc4c9..5fffe7ab5ece 100644 --- a/drivers/acpi/acpica/exstore.c +++ b/drivers/acpi/acpica/exstore.c | |||
@@ -62,8 +62,8 @@ acpi_ex_store_object_to_index(union acpi_operand_object *val_desc, | |||
62 | * FUNCTION: acpi_ex_store | 62 | * FUNCTION: acpi_ex_store |
63 | * | 63 | * |
64 | * PARAMETERS: *source_desc - Value to be stored | 64 | * PARAMETERS: *source_desc - Value to be stored |
65 | * *dest_desc - Where to store it. Must be an NS node | 65 | * *dest_desc - Where to store it. Must be an NS node |
66 | * or a union acpi_operand_object of type | 66 | * or union acpi_operand_object of type |
67 | * Reference; | 67 | * Reference; |
68 | * walk_state - Current walk state | 68 | * walk_state - Current walk state |
69 | * | 69 | * |
@@ -361,7 +361,7 @@ acpi_ex_store_object_to_index(union acpi_operand_object *source_desc, | |||
361 | * FUNCTION: acpi_ex_store_object_to_node | 361 | * FUNCTION: acpi_ex_store_object_to_node |
362 | * | 362 | * |
363 | * PARAMETERS: source_desc - Value to be stored | 363 | * PARAMETERS: source_desc - Value to be stored |
364 | * Node - Named object to receive the value | 364 | * node - Named object to receive the value |
365 | * walk_state - Current walk state | 365 | * walk_state - Current walk state |
366 | * implicit_conversion - Perform implicit conversion (yes/no) | 366 | * implicit_conversion - Perform implicit conversion (yes/no) |
367 | * | 367 | * |
diff --git a/drivers/acpi/acpica/exstorob.c b/drivers/acpi/acpica/exstorob.c index 65a45d8335c8..53c248473547 100644 --- a/drivers/acpi/acpica/exstorob.c +++ b/drivers/acpi/acpica/exstorob.c | |||
@@ -110,7 +110,7 @@ acpi_ex_store_buffer_to_buffer(union acpi_operand_object *source_desc, | |||
110 | * NOTE: ACPI versions up to 3.0 specified that the buffer must be | 110 | * NOTE: ACPI versions up to 3.0 specified that the buffer must be |
111 | * truncated if the string is smaller than the buffer. However, "other" | 111 | * truncated if the string is smaller than the buffer. However, "other" |
112 | * implementations of ACPI never did this and thus became the defacto | 112 | * implementations of ACPI never did this and thus became the defacto |
113 | * standard. ACPI 3.0_a changes this behavior such that the buffer | 113 | * standard. ACPI 3.0A changes this behavior such that the buffer |
114 | * is no longer truncated. | 114 | * is no longer truncated. |
115 | */ | 115 | */ |
116 | 116 | ||
diff --git a/drivers/acpi/acpica/exsystem.c b/drivers/acpi/acpica/exsystem.c index 191a12945226..b760641e2fc6 100644 --- a/drivers/acpi/acpica/exsystem.c +++ b/drivers/acpi/acpica/exsystem.c | |||
@@ -53,8 +53,8 @@ ACPI_MODULE_NAME("exsystem") | |||
53 | * | 53 | * |
54 | * FUNCTION: acpi_ex_system_wait_semaphore | 54 | * FUNCTION: acpi_ex_system_wait_semaphore |
55 | * | 55 | * |
56 | * PARAMETERS: Semaphore - Semaphore to wait on | 56 | * PARAMETERS: semaphore - Semaphore to wait on |
57 | * Timeout - Max time to wait | 57 | * timeout - Max time to wait |
58 | * | 58 | * |
59 | * RETURN: Status | 59 | * RETURN: Status |
60 | * | 60 | * |
@@ -98,8 +98,8 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout) | |||
98 | * | 98 | * |
99 | * FUNCTION: acpi_ex_system_wait_mutex | 99 | * FUNCTION: acpi_ex_system_wait_mutex |
100 | * | 100 | * |
101 | * PARAMETERS: Mutex - Mutex to wait on | 101 | * PARAMETERS: mutex - Mutex to wait on |
102 | * Timeout - Max time to wait | 102 | * timeout - Max time to wait |
103 | * | 103 | * |
104 | * RETURN: Status | 104 | * RETURN: Status |
105 | * | 105 | * |
diff --git a/drivers/acpi/acpica/exutils.c b/drivers/acpi/acpica/exutils.c index eb6798ba8b59..d1ab7917eed7 100644 --- a/drivers/acpi/acpica/exutils.c +++ b/drivers/acpi/acpica/exutils.c | |||
@@ -109,7 +109,7 @@ void acpi_ex_enter_interpreter(void) | |||
109 | * | 109 | * |
110 | * DESCRIPTION: Reacquire the interpreter execution region from within the | 110 | * DESCRIPTION: Reacquire the interpreter execution region from within the |
111 | * interpreter code. Failure to enter the interpreter region is a | 111 | * interpreter code. Failure to enter the interpreter region is a |
112 | * fatal system error. Used in conjunction with | 112 | * fatal system error. Used in conjunction with |
113 | * relinquish_interpreter | 113 | * relinquish_interpreter |
114 | * | 114 | * |
115 | ******************************************************************************/ | 115 | ******************************************************************************/ |
@@ -317,8 +317,8 @@ void acpi_ex_release_global_lock(u32 field_flags) | |||
317 | * | 317 | * |
318 | * FUNCTION: acpi_ex_digits_needed | 318 | * FUNCTION: acpi_ex_digits_needed |
319 | * | 319 | * |
320 | * PARAMETERS: Value - Value to be represented | 320 | * PARAMETERS: value - Value to be represented |
321 | * Base - Base of representation | 321 | * base - Base of representation |
322 | * | 322 | * |
323 | * RETURN: The number of digits. | 323 | * RETURN: The number of digits. |
324 | * | 324 | * |
@@ -408,7 +408,7 @@ void acpi_ex_eisa_id_to_string(char *out_string, u64 compressed_id) | |||
408 | * PARAMETERS: out_string - Where to put the converted string. At least | 408 | * PARAMETERS: out_string - Where to put the converted string. At least |
409 | * 21 bytes are needed to hold the largest | 409 | * 21 bytes are needed to hold the largest |
410 | * possible 64-bit integer. | 410 | * possible 64-bit integer. |
411 | * Value - Value to be converted | 411 | * value - Value to be converted |
412 | * | 412 | * |
413 | * RETURN: None, string | 413 | * RETURN: None, string |
414 | * | 414 | * |
@@ -443,7 +443,7 @@ void acpi_ex_integer_to_string(char *out_string, u64 value) | |||
443 | * | 443 | * |
444 | * RETURN: TRUE if valid/supported ID. | 444 | * RETURN: TRUE if valid/supported ID. |
445 | * | 445 | * |
446 | * DESCRIPTION: Validate an operation region space_iD. | 446 | * DESCRIPTION: Validate an operation region space_ID. |
447 | * | 447 | * |
448 | ******************************************************************************/ | 448 | ******************************************************************************/ |
449 | 449 | ||
diff --git a/drivers/acpi/acpica/hwacpi.c b/drivers/acpi/acpica/hwacpi.c index d0b9ed5df97e..a1e71d0ef57b 100644 --- a/drivers/acpi/acpica/hwacpi.c +++ b/drivers/acpi/acpica/hwacpi.c | |||
@@ -53,7 +53,7 @@ ACPI_MODULE_NAME("hwacpi") | |||
53 | * | 53 | * |
54 | * FUNCTION: acpi_hw_set_mode | 54 | * FUNCTION: acpi_hw_set_mode |
55 | * | 55 | * |
56 | * PARAMETERS: Mode - SYS_MODE_ACPI or SYS_MODE_LEGACY | 56 | * PARAMETERS: mode - SYS_MODE_ACPI or SYS_MODE_LEGACY |
57 | * | 57 | * |
58 | * RETURN: Status | 58 | * RETURN: Status |
59 | * | 59 | * |
diff --git a/drivers/acpi/acpica/hwesleep.c b/drivers/acpi/acpica/hwesleep.c index 29e859293edd..94996f9ae3ad 100644 --- a/drivers/acpi/acpica/hwesleep.c +++ b/drivers/acpi/acpica/hwesleep.c | |||
@@ -90,7 +90,6 @@ void acpi_hw_execute_sleep_method(char *method_pathname, u32 integer_argument) | |||
90 | * FUNCTION: acpi_hw_extended_sleep | 90 | * FUNCTION: acpi_hw_extended_sleep |
91 | * | 91 | * |
92 | * PARAMETERS: sleep_state - Which sleep state to enter | 92 | * PARAMETERS: sleep_state - Which sleep state to enter |
93 | * Flags - ACPI_EXECUTE_GTS to run optional method | ||
94 | * | 93 | * |
95 | * RETURN: Status | 94 | * RETURN: Status |
96 | * | 95 | * |
@@ -100,7 +99,7 @@ void acpi_hw_execute_sleep_method(char *method_pathname, u32 integer_argument) | |||
100 | * | 99 | * |
101 | ******************************************************************************/ | 100 | ******************************************************************************/ |
102 | 101 | ||
103 | acpi_status acpi_hw_extended_sleep(u8 sleep_state, u8 flags) | 102 | acpi_status acpi_hw_extended_sleep(u8 sleep_state) |
104 | { | 103 | { |
105 | acpi_status status; | 104 | acpi_status status; |
106 | u8 sleep_type_value; | 105 | u8 sleep_type_value; |
@@ -117,19 +116,14 @@ acpi_status acpi_hw_extended_sleep(u8 sleep_state, u8 flags) | |||
117 | 116 | ||
118 | /* Clear wake status (WAK_STS) */ | 117 | /* Clear wake status (WAK_STS) */ |
119 | 118 | ||
120 | status = acpi_write(ACPI_X_WAKE_STATUS, &acpi_gbl_FADT.sleep_status); | 119 | status = |
120 | acpi_write((u64)ACPI_X_WAKE_STATUS, &acpi_gbl_FADT.sleep_status); | ||
121 | if (ACPI_FAILURE(status)) { | 121 | if (ACPI_FAILURE(status)) { |
122 | return_ACPI_STATUS(status); | 122 | return_ACPI_STATUS(status); |
123 | } | 123 | } |
124 | 124 | ||
125 | acpi_gbl_system_awake_and_running = FALSE; | 125 | acpi_gbl_system_awake_and_running = FALSE; |
126 | 126 | ||
127 | /* Optionally execute _GTS (Going To Sleep) */ | ||
128 | |||
129 | if (flags & ACPI_EXECUTE_GTS) { | ||
130 | acpi_hw_execute_sleep_method(METHOD_PATHNAME__GTS, sleep_state); | ||
131 | } | ||
132 | |||
133 | /* Flush caches, as per ACPI specification */ | 127 | /* Flush caches, as per ACPI specification */ |
134 | 128 | ||
135 | ACPI_FLUSH_CPU_CACHE(); | 129 | ACPI_FLUSH_CPU_CACHE(); |
@@ -147,7 +141,7 @@ acpi_status acpi_hw_extended_sleep(u8 sleep_state, u8 flags) | |||
147 | ((acpi_gbl_sleep_type_a << ACPI_X_SLEEP_TYPE_POSITION) & | 141 | ((acpi_gbl_sleep_type_a << ACPI_X_SLEEP_TYPE_POSITION) & |
148 | ACPI_X_SLEEP_TYPE_MASK); | 142 | ACPI_X_SLEEP_TYPE_MASK); |
149 | 143 | ||
150 | status = acpi_write((sleep_type_value | ACPI_X_SLEEP_ENABLE), | 144 | status = acpi_write((u64)(sleep_type_value | ACPI_X_SLEEP_ENABLE), |
151 | &acpi_gbl_FADT.sleep_control); | 145 | &acpi_gbl_FADT.sleep_control); |
152 | if (ACPI_FAILURE(status)) { | 146 | if (ACPI_FAILURE(status)) { |
153 | return_ACPI_STATUS(status); | 147 | return_ACPI_STATUS(status); |
@@ -171,7 +165,6 @@ acpi_status acpi_hw_extended_sleep(u8 sleep_state, u8 flags) | |||
171 | * FUNCTION: acpi_hw_extended_wake_prep | 165 | * FUNCTION: acpi_hw_extended_wake_prep |
172 | * | 166 | * |
173 | * PARAMETERS: sleep_state - Which sleep state we just exited | 167 | * PARAMETERS: sleep_state - Which sleep state we just exited |
174 | * Flags - ACPI_EXECUTE_BFS to run optional method | ||
175 | * | 168 | * |
176 | * RETURN: Status | 169 | * RETURN: Status |
177 | * | 170 | * |
@@ -180,7 +173,7 @@ acpi_status acpi_hw_extended_sleep(u8 sleep_state, u8 flags) | |||
180 | * | 173 | * |
181 | ******************************************************************************/ | 174 | ******************************************************************************/ |
182 | 175 | ||
183 | acpi_status acpi_hw_extended_wake_prep(u8 sleep_state, u8 flags) | 176 | acpi_status acpi_hw_extended_wake_prep(u8 sleep_state) |
184 | { | 177 | { |
185 | acpi_status status; | 178 | acpi_status status; |
186 | u8 sleep_type_value; | 179 | u8 sleep_type_value; |
@@ -195,15 +188,10 @@ acpi_status acpi_hw_extended_wake_prep(u8 sleep_state, u8 flags) | |||
195 | ((acpi_gbl_sleep_type_a << ACPI_X_SLEEP_TYPE_POSITION) & | 188 | ((acpi_gbl_sleep_type_a << ACPI_X_SLEEP_TYPE_POSITION) & |
196 | ACPI_X_SLEEP_TYPE_MASK); | 189 | ACPI_X_SLEEP_TYPE_MASK); |
197 | 190 | ||
198 | (void)acpi_write((sleep_type_value | ACPI_X_SLEEP_ENABLE), | 191 | (void)acpi_write((u64)(sleep_type_value | ACPI_X_SLEEP_ENABLE), |
199 | &acpi_gbl_FADT.sleep_control); | 192 | &acpi_gbl_FADT.sleep_control); |
200 | } | 193 | } |
201 | 194 | ||
202 | /* Optionally execute _BFS (Back From Sleep) */ | ||
203 | |||
204 | if (flags & ACPI_EXECUTE_BFS) { | ||
205 | acpi_hw_execute_sleep_method(METHOD_PATHNAME__BFS, sleep_state); | ||
206 | } | ||
207 | return_ACPI_STATUS(AE_OK); | 195 | return_ACPI_STATUS(AE_OK); |
208 | } | 196 | } |
209 | 197 | ||
@@ -212,7 +200,7 @@ acpi_status acpi_hw_extended_wake_prep(u8 sleep_state, u8 flags) | |||
212 | * FUNCTION: acpi_hw_extended_wake | 200 | * FUNCTION: acpi_hw_extended_wake |
213 | * | 201 | * |
214 | * PARAMETERS: sleep_state - Which sleep state we just exited | 202 | * PARAMETERS: sleep_state - Which sleep state we just exited |
215 | * Flags - Reserved, set to zero | 203 | * flags - Reserved, set to zero |
216 | * | 204 | * |
217 | * RETURN: Status | 205 | * RETURN: Status |
218 | * | 206 | * |
@@ -221,7 +209,7 @@ acpi_status acpi_hw_extended_wake_prep(u8 sleep_state, u8 flags) | |||
221 | * | 209 | * |
222 | ******************************************************************************/ | 210 | ******************************************************************************/ |
223 | 211 | ||
224 | acpi_status acpi_hw_extended_wake(u8 sleep_state, u8 flags) | 212 | acpi_status acpi_hw_extended_wake(u8 sleep_state) |
225 | { | 213 | { |
226 | ACPI_FUNCTION_TRACE(hw_extended_wake); | 214 | ACPI_FUNCTION_TRACE(hw_extended_wake); |
227 | 215 | ||
@@ -239,7 +227,7 @@ acpi_status acpi_hw_extended_wake(u8 sleep_state, u8 flags) | |||
239 | * and use it to determine whether the system is rebooting or | 227 | * and use it to determine whether the system is rebooting or |
240 | * resuming. Clear WAK_STS for compatibility. | 228 | * resuming. Clear WAK_STS for compatibility. |
241 | */ | 229 | */ |
242 | (void)acpi_write(ACPI_X_WAKE_STATUS, &acpi_gbl_FADT.sleep_status); | 230 | (void)acpi_write((u64)ACPI_X_WAKE_STATUS, &acpi_gbl_FADT.sleep_status); |
243 | acpi_gbl_system_awake_and_running = TRUE; | 231 | acpi_gbl_system_awake_and_running = TRUE; |
244 | 232 | ||
245 | acpi_hw_execute_sleep_method(METHOD_PATHNAME__SST, ACPI_SST_WORKING); | 233 | acpi_hw_execute_sleep_method(METHOD_PATHNAME__SST, ACPI_SST_WORKING); |
diff --git a/drivers/acpi/acpica/hwgpe.c b/drivers/acpi/acpica/hwgpe.c index 25bd28c4ae8d..db4076580e2b 100644 --- a/drivers/acpi/acpica/hwgpe.c +++ b/drivers/acpi/acpica/hwgpe.c | |||
@@ -60,7 +60,6 @@ acpi_hw_enable_wakeup_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, | |||
60 | * FUNCTION: acpi_hw_get_gpe_register_bit | 60 | * FUNCTION: acpi_hw_get_gpe_register_bit |
61 | * | 61 | * |
62 | * PARAMETERS: gpe_event_info - Info block for the GPE | 62 | * PARAMETERS: gpe_event_info - Info block for the GPE |
63 | * gpe_register_info - Info block for the GPE register | ||
64 | * | 63 | * |
65 | * RETURN: Register mask with a one in the GPE bit position | 64 | * RETURN: Register mask with a one in the GPE bit position |
66 | * | 65 | * |
@@ -69,11 +68,10 @@ acpi_hw_enable_wakeup_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, | |||
69 | * | 68 | * |
70 | ******************************************************************************/ | 69 | ******************************************************************************/ |
71 | 70 | ||
72 | u32 acpi_hw_get_gpe_register_bit(struct acpi_gpe_event_info *gpe_event_info, | 71 | u32 acpi_hw_get_gpe_register_bit(struct acpi_gpe_event_info *gpe_event_info) |
73 | struct acpi_gpe_register_info *gpe_register_info) | ||
74 | { | 72 | { |
75 | return (u32)1 << (gpe_event_info->gpe_number - | 73 | return (u32)1 << (gpe_event_info->gpe_number - |
76 | gpe_register_info->base_gpe_number); | 74 | gpe_event_info->register_info->base_gpe_number); |
77 | } | 75 | } |
78 | 76 | ||
79 | /****************************************************************************** | 77 | /****************************************************************************** |
@@ -115,8 +113,7 @@ acpi_hw_low_set_gpe(struct acpi_gpe_event_info *gpe_event_info, u32 action) | |||
115 | 113 | ||
116 | /* Set or clear just the bit that corresponds to this GPE */ | 114 | /* Set or clear just the bit that corresponds to this GPE */ |
117 | 115 | ||
118 | register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info, | 116 | register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info); |
119 | gpe_register_info); | ||
120 | switch (action) { | 117 | switch (action) { |
121 | case ACPI_GPE_CONDITIONAL_ENABLE: | 118 | case ACPI_GPE_CONDITIONAL_ENABLE: |
122 | 119 | ||
@@ -178,8 +175,7 @@ acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info * gpe_event_info) | |||
178 | * Write a one to the appropriate bit in the status register to | 175 | * Write a one to the appropriate bit in the status register to |
179 | * clear this GPE. | 176 | * clear this GPE. |
180 | */ | 177 | */ |
181 | register_bit = | 178 | register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info); |
182 | acpi_hw_get_gpe_register_bit(gpe_event_info, gpe_register_info); | ||
183 | 179 | ||
184 | status = acpi_hw_write(register_bit, | 180 | status = acpi_hw_write(register_bit, |
185 | &gpe_register_info->status_address); | 181 | &gpe_register_info->status_address); |
@@ -222,8 +218,7 @@ acpi_hw_get_gpe_status(struct acpi_gpe_event_info * gpe_event_info, | |||
222 | 218 | ||
223 | /* Get the register bitmask for this GPE */ | 219 | /* Get the register bitmask for this GPE */ |
224 | 220 | ||
225 | register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info, | 221 | register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info); |
226 | gpe_register_info); | ||
227 | 222 | ||
228 | /* GPE currently enabled? (enabled for runtime?) */ | 223 | /* GPE currently enabled? (enabled for runtime?) */ |
229 | 224 | ||
diff --git a/drivers/acpi/acpica/hwregs.c b/drivers/acpi/acpica/hwregs.c index 6b6c83b87b52..4af6d20ef077 100644 --- a/drivers/acpi/acpica/hwregs.c +++ b/drivers/acpi/acpica/hwregs.c | |||
@@ -69,9 +69,9 @@ acpi_hw_write_multiple(u32 value, | |||
69 | * | 69 | * |
70 | * FUNCTION: acpi_hw_validate_register | 70 | * FUNCTION: acpi_hw_validate_register |
71 | * | 71 | * |
72 | * PARAMETERS: Reg - GAS register structure | 72 | * PARAMETERS: reg - GAS register structure |
73 | * max_bit_width - Max bit_width supported (32 or 64) | 73 | * max_bit_width - Max bit_width supported (32 or 64) |
74 | * Address - Pointer to where the gas->address | 74 | * address - Pointer to where the gas->address |
75 | * is returned | 75 | * is returned |
76 | * | 76 | * |
77 | * RETURN: Status | 77 | * RETURN: Status |
@@ -102,7 +102,7 @@ acpi_hw_validate_register(struct acpi_generic_address *reg, | |||
102 | return (AE_BAD_ADDRESS); | 102 | return (AE_BAD_ADDRESS); |
103 | } | 103 | } |
104 | 104 | ||
105 | /* Validate the space_iD */ | 105 | /* Validate the space_ID */ |
106 | 106 | ||
107 | if ((reg->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) && | 107 | if ((reg->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) && |
108 | (reg->space_id != ACPI_ADR_SPACE_SYSTEM_IO)) { | 108 | (reg->space_id != ACPI_ADR_SPACE_SYSTEM_IO)) { |
@@ -137,8 +137,8 @@ acpi_hw_validate_register(struct acpi_generic_address *reg, | |||
137 | * | 137 | * |
138 | * FUNCTION: acpi_hw_read | 138 | * FUNCTION: acpi_hw_read |
139 | * | 139 | * |
140 | * PARAMETERS: Value - Where the value is returned | 140 | * PARAMETERS: value - Where the value is returned |
141 | * Reg - GAS register structure | 141 | * reg - GAS register structure |
142 | * | 142 | * |
143 | * RETURN: Status | 143 | * RETURN: Status |
144 | * | 144 | * |
@@ -148,7 +148,7 @@ acpi_hw_validate_register(struct acpi_generic_address *reg, | |||
148 | * | 148 | * |
149 | * LIMITATIONS: <These limitations also apply to acpi_hw_write> | 149 | * LIMITATIONS: <These limitations also apply to acpi_hw_write> |
150 | * bit_width must be exactly 8, 16, or 32. | 150 | * bit_width must be exactly 8, 16, or 32. |
151 | * space_iD must be system_memory or system_iO. | 151 | * space_ID must be system_memory or system_IO. |
152 | * bit_offset and access_width are currently ignored, as there has | 152 | * bit_offset and access_width are currently ignored, as there has |
153 | * not been a need to implement these. | 153 | * not been a need to implement these. |
154 | * | 154 | * |
@@ -200,8 +200,8 @@ acpi_status acpi_hw_read(u32 *value, struct acpi_generic_address *reg) | |||
200 | * | 200 | * |
201 | * FUNCTION: acpi_hw_write | 201 | * FUNCTION: acpi_hw_write |
202 | * | 202 | * |
203 | * PARAMETERS: Value - Value to be written | 203 | * PARAMETERS: value - Value to be written |
204 | * Reg - GAS register structure | 204 | * reg - GAS register structure |
205 | * | 205 | * |
206 | * RETURN: Status | 206 | * RETURN: Status |
207 | * | 207 | * |
@@ -439,7 +439,7 @@ acpi_hw_register_read(u32 register_id, u32 * return_value) | |||
439 | * FUNCTION: acpi_hw_register_write | 439 | * FUNCTION: acpi_hw_register_write |
440 | * | 440 | * |
441 | * PARAMETERS: register_id - ACPI Register ID | 441 | * PARAMETERS: register_id - ACPI Register ID |
442 | * Value - The value to write | 442 | * value - The value to write |
443 | * | 443 | * |
444 | * RETURN: Status | 444 | * RETURN: Status |
445 | * | 445 | * |
@@ -571,7 +571,7 @@ acpi_status acpi_hw_register_write(u32 register_id, u32 value) | |||
571 | * | 571 | * |
572 | * FUNCTION: acpi_hw_read_multiple | 572 | * FUNCTION: acpi_hw_read_multiple |
573 | * | 573 | * |
574 | * PARAMETERS: Value - Where the register value is returned | 574 | * PARAMETERS: value - Where the register value is returned |
575 | * register_a - First ACPI register (required) | 575 | * register_a - First ACPI register (required) |
576 | * register_b - Second ACPI register (optional) | 576 | * register_b - Second ACPI register (optional) |
577 | * | 577 | * |
@@ -624,7 +624,7 @@ acpi_hw_read_multiple(u32 *value, | |||
624 | * | 624 | * |
625 | * FUNCTION: acpi_hw_write_multiple | 625 | * FUNCTION: acpi_hw_write_multiple |
626 | * | 626 | * |
627 | * PARAMETERS: Value - The value to write | 627 | * PARAMETERS: value - The value to write |
628 | * register_a - First ACPI register (required) | 628 | * register_a - First ACPI register (required) |
629 | * register_b - Second ACPI register (optional) | 629 | * register_b - Second ACPI register (optional) |
630 | * | 630 | * |
diff --git a/drivers/acpi/acpica/hwsleep.c b/drivers/acpi/acpica/hwsleep.c index 615996a36bed..3fddde056a5e 100644 --- a/drivers/acpi/acpica/hwsleep.c +++ b/drivers/acpi/acpica/hwsleep.c | |||
@@ -56,7 +56,6 @@ ACPI_MODULE_NAME("hwsleep") | |||
56 | * FUNCTION: acpi_hw_legacy_sleep | 56 | * FUNCTION: acpi_hw_legacy_sleep |
57 | * | 57 | * |
58 | * PARAMETERS: sleep_state - Which sleep state to enter | 58 | * PARAMETERS: sleep_state - Which sleep state to enter |
59 | * Flags - ACPI_EXECUTE_GTS to run optional method | ||
60 | * | 59 | * |
61 | * RETURN: Status | 60 | * RETURN: Status |
62 | * | 61 | * |
@@ -64,7 +63,7 @@ ACPI_MODULE_NAME("hwsleep") | |||
64 | * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED | 63 | * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED |
65 | * | 64 | * |
66 | ******************************************************************************/ | 65 | ******************************************************************************/ |
67 | acpi_status acpi_hw_legacy_sleep(u8 sleep_state, u8 flags) | 66 | acpi_status acpi_hw_legacy_sleep(u8 sleep_state) |
68 | { | 67 | { |
69 | struct acpi_bit_register_info *sleep_type_reg_info; | 68 | struct acpi_bit_register_info *sleep_type_reg_info; |
70 | struct acpi_bit_register_info *sleep_enable_reg_info; | 69 | struct acpi_bit_register_info *sleep_enable_reg_info; |
@@ -110,12 +109,6 @@ acpi_status acpi_hw_legacy_sleep(u8 sleep_state, u8 flags) | |||
110 | return_ACPI_STATUS(status); | 109 | return_ACPI_STATUS(status); |
111 | } | 110 | } |
112 | 111 | ||
113 | /* Optionally execute _GTS (Going To Sleep) */ | ||
114 | |||
115 | if (flags & ACPI_EXECUTE_GTS) { | ||
116 | acpi_hw_execute_sleep_method(METHOD_PATHNAME__GTS, sleep_state); | ||
117 | } | ||
118 | |||
119 | /* Get current value of PM1A control */ | 112 | /* Get current value of PM1A control */ |
120 | 113 | ||
121 | status = acpi_hw_register_read(ACPI_REGISTER_PM1_CONTROL, | 114 | status = acpi_hw_register_read(ACPI_REGISTER_PM1_CONTROL, |
@@ -214,7 +207,6 @@ acpi_status acpi_hw_legacy_sleep(u8 sleep_state, u8 flags) | |||
214 | * FUNCTION: acpi_hw_legacy_wake_prep | 207 | * FUNCTION: acpi_hw_legacy_wake_prep |
215 | * | 208 | * |
216 | * PARAMETERS: sleep_state - Which sleep state we just exited | 209 | * PARAMETERS: sleep_state - Which sleep state we just exited |
217 | * Flags - ACPI_EXECUTE_BFS to run optional method | ||
218 | * | 210 | * |
219 | * RETURN: Status | 211 | * RETURN: Status |
220 | * | 212 | * |
@@ -224,7 +216,7 @@ acpi_status acpi_hw_legacy_sleep(u8 sleep_state, u8 flags) | |||
224 | * | 216 | * |
225 | ******************************************************************************/ | 217 | ******************************************************************************/ |
226 | 218 | ||
227 | acpi_status acpi_hw_legacy_wake_prep(u8 sleep_state, u8 flags) | 219 | acpi_status acpi_hw_legacy_wake_prep(u8 sleep_state) |
228 | { | 220 | { |
229 | acpi_status status; | 221 | acpi_status status; |
230 | struct acpi_bit_register_info *sleep_type_reg_info; | 222 | struct acpi_bit_register_info *sleep_type_reg_info; |
@@ -275,11 +267,6 @@ acpi_status acpi_hw_legacy_wake_prep(u8 sleep_state, u8 flags) | |||
275 | } | 267 | } |
276 | } | 268 | } |
277 | 269 | ||
278 | /* Optionally execute _BFS (Back From Sleep) */ | ||
279 | |||
280 | if (flags & ACPI_EXECUTE_BFS) { | ||
281 | acpi_hw_execute_sleep_method(METHOD_PATHNAME__BFS, sleep_state); | ||
282 | } | ||
283 | return_ACPI_STATUS(status); | 270 | return_ACPI_STATUS(status); |
284 | } | 271 | } |
285 | 272 | ||
@@ -288,7 +275,6 @@ acpi_status acpi_hw_legacy_wake_prep(u8 sleep_state, u8 flags) | |||
288 | * FUNCTION: acpi_hw_legacy_wake | 275 | * FUNCTION: acpi_hw_legacy_wake |
289 | * | 276 | * |
290 | * PARAMETERS: sleep_state - Which sleep state we just exited | 277 | * PARAMETERS: sleep_state - Which sleep state we just exited |
291 | * Flags - Reserved, set to zero | ||
292 | * | 278 | * |
293 | * RETURN: Status | 279 | * RETURN: Status |
294 | * | 280 | * |
@@ -297,7 +283,7 @@ acpi_status acpi_hw_legacy_wake_prep(u8 sleep_state, u8 flags) | |||
297 | * | 283 | * |
298 | ******************************************************************************/ | 284 | ******************************************************************************/ |
299 | 285 | ||
300 | acpi_status acpi_hw_legacy_wake(u8 sleep_state, u8 flags) | 286 | acpi_status acpi_hw_legacy_wake(u8 sleep_state) |
301 | { | 287 | { |
302 | acpi_status status; | 288 | acpi_status status; |
303 | 289 | ||
diff --git a/drivers/acpi/acpica/hwtimer.c b/drivers/acpi/acpica/hwtimer.c index f1b2c3b94cac..b6411f16832f 100644 --- a/drivers/acpi/acpica/hwtimer.c +++ b/drivers/acpi/acpica/hwtimer.c | |||
@@ -54,7 +54,7 @@ ACPI_MODULE_NAME("hwtimer") | |||
54 | * | 54 | * |
55 | * FUNCTION: acpi_get_timer_resolution | 55 | * FUNCTION: acpi_get_timer_resolution |
56 | * | 56 | * |
57 | * PARAMETERS: Resolution - Where the resolution is returned | 57 | * PARAMETERS: resolution - Where the resolution is returned |
58 | * | 58 | * |
59 | * RETURN: Status and timer resolution | 59 | * RETURN: Status and timer resolution |
60 | * | 60 | * |
@@ -84,7 +84,7 @@ ACPI_EXPORT_SYMBOL(acpi_get_timer_resolution) | |||
84 | * | 84 | * |
85 | * FUNCTION: acpi_get_timer | 85 | * FUNCTION: acpi_get_timer |
86 | * | 86 | * |
87 | * PARAMETERS: Ticks - Where the timer value is returned | 87 | * PARAMETERS: ticks - Where the timer value is returned |
88 | * | 88 | * |
89 | * RETURN: Status and current timer value (ticks) | 89 | * RETURN: Status and current timer value (ticks) |
90 | * | 90 | * |
diff --git a/drivers/acpi/acpica/hwvalid.c b/drivers/acpi/acpica/hwvalid.c index 6e5c43a60bb7..c99d546b217f 100644 --- a/drivers/acpi/acpica/hwvalid.c +++ b/drivers/acpi/acpica/hwvalid.c | |||
@@ -58,7 +58,7 @@ acpi_hw_validate_io_request(acpi_io_address address, u32 bit_width); | |||
58 | * | 58 | * |
59 | * The table is used to implement the Microsoft port access rules that | 59 | * The table is used to implement the Microsoft port access rules that |
60 | * first appeared in Windows XP. Some ports are always illegal, and some | 60 | * first appeared in Windows XP. Some ports are always illegal, and some |
61 | * ports are only illegal if the BIOS calls _OSI with a win_xP string or | 61 | * ports are only illegal if the BIOS calls _OSI with a win_XP string or |
62 | * later (meaning that the BIOS itelf is post-XP.) | 62 | * later (meaning that the BIOS itelf is post-XP.) |
63 | * | 63 | * |
64 | * This provides ACPICA with the desired port protections and | 64 | * This provides ACPICA with the desired port protections and |
@@ -66,7 +66,7 @@ acpi_hw_validate_io_request(acpi_io_address address, u32 bit_width); | |||
66 | * | 66 | * |
67 | * Description of port entries: | 67 | * Description of port entries: |
68 | * DMA: DMA controller | 68 | * DMA: DMA controller |
69 | * PIC0: Programmable Interrupt Controller (8259_a) | 69 | * PIC0: Programmable Interrupt Controller (8259A) |
70 | * PIT1: System Timer 1 | 70 | * PIT1: System Timer 1 |
71 | * PIT2: System Timer 2 failsafe | 71 | * PIT2: System Timer 2 failsafe |
72 | * RTC: Real-time clock | 72 | * RTC: Real-time clock |
diff --git a/drivers/acpi/acpica/hwxface.c b/drivers/acpi/acpica/hwxface.c index a716fede4f25..7bfd649d1996 100644 --- a/drivers/acpi/acpica/hwxface.c +++ b/drivers/acpi/acpica/hwxface.c | |||
@@ -104,8 +104,8 @@ ACPI_EXPORT_SYMBOL(acpi_reset) | |||
104 | * | 104 | * |
105 | * FUNCTION: acpi_read | 105 | * FUNCTION: acpi_read |
106 | * | 106 | * |
107 | * PARAMETERS: Value - Where the value is returned | 107 | * PARAMETERS: value - Where the value is returned |
108 | * Reg - GAS register structure | 108 | * reg - GAS register structure |
109 | * | 109 | * |
110 | * RETURN: Status | 110 | * RETURN: Status |
111 | * | 111 | * |
@@ -113,7 +113,7 @@ ACPI_EXPORT_SYMBOL(acpi_reset) | |||
113 | * | 113 | * |
114 | * LIMITATIONS: <These limitations also apply to acpi_write> | 114 | * LIMITATIONS: <These limitations also apply to acpi_write> |
115 | * bit_width must be exactly 8, 16, 32, or 64. | 115 | * bit_width must be exactly 8, 16, 32, or 64. |
116 | * space_iD must be system_memory or system_iO. | 116 | * space_ID must be system_memory or system_IO. |
117 | * bit_offset and access_width are currently ignored, as there has | 117 | * bit_offset and access_width are currently ignored, as there has |
118 | * not been a need to implement these. | 118 | * not been a need to implement these. |
119 | * | 119 | * |
@@ -196,8 +196,8 @@ ACPI_EXPORT_SYMBOL(acpi_read) | |||
196 | * | 196 | * |
197 | * FUNCTION: acpi_write | 197 | * FUNCTION: acpi_write |
198 | * | 198 | * |
199 | * PARAMETERS: Value - Value to be written | 199 | * PARAMETERS: value - Value to be written |
200 | * Reg - GAS register structure | 200 | * reg - GAS register structure |
201 | * | 201 | * |
202 | * RETURN: Status | 202 | * RETURN: Status |
203 | * | 203 | * |
@@ -441,7 +441,7 @@ ACPI_EXPORT_SYMBOL(acpi_write_bit_register) | |||
441 | * *sleep_type_a - Where SLP_TYPa is returned | 441 | * *sleep_type_a - Where SLP_TYPa is returned |
442 | * *sleep_type_b - Where SLP_TYPb is returned | 442 | * *sleep_type_b - Where SLP_TYPb is returned |
443 | * | 443 | * |
444 | * RETURN: Status - ACPI status | 444 | * RETURN: status - ACPI status |
445 | * | 445 | * |
446 | * DESCRIPTION: Obtain the SLP_TYPa and SLP_TYPb values for the requested sleep | 446 | * DESCRIPTION: Obtain the SLP_TYPa and SLP_TYPb values for the requested sleep |
447 | * state. | 447 | * state. |
diff --git a/drivers/acpi/acpica/hwxfsleep.c b/drivers/acpi/acpica/hwxfsleep.c index 762d059bb508..0ff1ecea5c3a 100644 --- a/drivers/acpi/acpica/hwxfsleep.c +++ b/drivers/acpi/acpica/hwxfsleep.c | |||
@@ -50,7 +50,7 @@ ACPI_MODULE_NAME("hwxfsleep") | |||
50 | 50 | ||
51 | /* Local prototypes */ | 51 | /* Local prototypes */ |
52 | static acpi_status | 52 | static acpi_status |
53 | acpi_hw_sleep_dispatch(u8 sleep_state, u8 flags, u32 function_id); | 53 | acpi_hw_sleep_dispatch(u8 sleep_state, u32 function_id); |
54 | 54 | ||
55 | /* | 55 | /* |
56 | * Dispatch table used to efficiently branch to the various sleep | 56 | * Dispatch table used to efficiently branch to the various sleep |
@@ -205,7 +205,7 @@ acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void) | |||
205 | ACPI_FLUSH_CPU_CACHE(); | 205 | ACPI_FLUSH_CPU_CACHE(); |
206 | 206 | ||
207 | status = acpi_hw_write_port(acpi_gbl_FADT.smi_command, | 207 | status = acpi_hw_write_port(acpi_gbl_FADT.smi_command, |
208 | (u32)acpi_gbl_FADT.S4bios_request, 8); | 208 | (u32)acpi_gbl_FADT.s4_bios_request, 8); |
209 | 209 | ||
210 | do { | 210 | do { |
211 | acpi_os_stall(1000); | 211 | acpi_os_stall(1000); |
@@ -235,7 +235,7 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_s4bios) | |||
235 | * | 235 | * |
236 | ******************************************************************************/ | 236 | ******************************************************************************/ |
237 | static acpi_status | 237 | static acpi_status |
238 | acpi_hw_sleep_dispatch(u8 sleep_state, u8 flags, u32 function_id) | 238 | acpi_hw_sleep_dispatch(u8 sleep_state, u32 function_id) |
239 | { | 239 | { |
240 | acpi_status status; | 240 | acpi_status status; |
241 | struct acpi_sleep_functions *sleep_functions = | 241 | struct acpi_sleep_functions *sleep_functions = |
@@ -248,11 +248,11 @@ acpi_hw_sleep_dispatch(u8 sleep_state, u8 flags, u32 function_id) | |||
248 | * use the extended sleep registers | 248 | * use the extended sleep registers |
249 | */ | 249 | */ |
250 | if (acpi_gbl_reduced_hardware || acpi_gbl_FADT.sleep_control.address) { | 250 | if (acpi_gbl_reduced_hardware || acpi_gbl_FADT.sleep_control.address) { |
251 | status = sleep_functions->extended_function(sleep_state, flags); | 251 | status = sleep_functions->extended_function(sleep_state); |
252 | } else { | 252 | } else { |
253 | /* Legacy sleep */ | 253 | /* Legacy sleep */ |
254 | 254 | ||
255 | status = sleep_functions->legacy_function(sleep_state, flags); | 255 | status = sleep_functions->legacy_function(sleep_state); |
256 | } | 256 | } |
257 | 257 | ||
258 | return (status); | 258 | return (status); |
@@ -262,7 +262,7 @@ acpi_hw_sleep_dispatch(u8 sleep_state, u8 flags, u32 function_id) | |||
262 | * For the case where reduced-hardware-only code is being generated, | 262 | * For the case where reduced-hardware-only code is being generated, |
263 | * we know that only the extended sleep registers are available | 263 | * we know that only the extended sleep registers are available |
264 | */ | 264 | */ |
265 | status = sleep_functions->extended_function(sleep_state, flags); | 265 | status = sleep_functions->extended_function(sleep_state); |
266 | return (status); | 266 | return (status); |
267 | 267 | ||
268 | #endif /* !ACPI_REDUCED_HARDWARE */ | 268 | #endif /* !ACPI_REDUCED_HARDWARE */ |
@@ -349,7 +349,6 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_prep) | |||
349 | * FUNCTION: acpi_enter_sleep_state | 349 | * FUNCTION: acpi_enter_sleep_state |
350 | * | 350 | * |
351 | * PARAMETERS: sleep_state - Which sleep state to enter | 351 | * PARAMETERS: sleep_state - Which sleep state to enter |
352 | * Flags - ACPI_EXECUTE_GTS to run optional method | ||
353 | * | 352 | * |
354 | * RETURN: Status | 353 | * RETURN: Status |
355 | * | 354 | * |
@@ -357,7 +356,7 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_prep) | |||
357 | * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED | 356 | * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED |
358 | * | 357 | * |
359 | ******************************************************************************/ | 358 | ******************************************************************************/ |
360 | acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state, u8 flags) | 359 | acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state) |
361 | { | 360 | { |
362 | acpi_status status; | 361 | acpi_status status; |
363 | 362 | ||
@@ -371,7 +370,7 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state, u8 flags) | |||
371 | } | 370 | } |
372 | 371 | ||
373 | status = | 372 | status = |
374 | acpi_hw_sleep_dispatch(sleep_state, flags, ACPI_SLEEP_FUNCTION_ID); | 373 | acpi_hw_sleep_dispatch(sleep_state, ACPI_SLEEP_FUNCTION_ID); |
375 | return_ACPI_STATUS(status); | 374 | return_ACPI_STATUS(status); |
376 | } | 375 | } |
377 | 376 | ||
@@ -382,7 +381,6 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state) | |||
382 | * FUNCTION: acpi_leave_sleep_state_prep | 381 | * FUNCTION: acpi_leave_sleep_state_prep |
383 | * | 382 | * |
384 | * PARAMETERS: sleep_state - Which sleep state we are exiting | 383 | * PARAMETERS: sleep_state - Which sleep state we are exiting |
385 | * Flags - ACPI_EXECUTE_BFS to run optional method | ||
386 | * | 384 | * |
387 | * RETURN: Status | 385 | * RETURN: Status |
388 | * | 386 | * |
@@ -391,14 +389,14 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state) | |||
391 | * Called with interrupts DISABLED. | 389 | * Called with interrupts DISABLED. |
392 | * | 390 | * |
393 | ******************************************************************************/ | 391 | ******************************************************************************/ |
394 | acpi_status acpi_leave_sleep_state_prep(u8 sleep_state, u8 flags) | 392 | acpi_status acpi_leave_sleep_state_prep(u8 sleep_state) |
395 | { | 393 | { |
396 | acpi_status status; | 394 | acpi_status status; |
397 | 395 | ||
398 | ACPI_FUNCTION_TRACE(acpi_leave_sleep_state_prep); | 396 | ACPI_FUNCTION_TRACE(acpi_leave_sleep_state_prep); |
399 | 397 | ||
400 | status = | 398 | status = |
401 | acpi_hw_sleep_dispatch(sleep_state, flags, | 399 | acpi_hw_sleep_dispatch(sleep_state, |
402 | ACPI_WAKE_PREP_FUNCTION_ID); | 400 | ACPI_WAKE_PREP_FUNCTION_ID); |
403 | return_ACPI_STATUS(status); | 401 | return_ACPI_STATUS(status); |
404 | } | 402 | } |
@@ -423,8 +421,7 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state) | |||
423 | 421 | ||
424 | ACPI_FUNCTION_TRACE(acpi_leave_sleep_state); | 422 | ACPI_FUNCTION_TRACE(acpi_leave_sleep_state); |
425 | 423 | ||
426 | 424 | status = acpi_hw_sleep_dispatch(sleep_state, ACPI_WAKE_FUNCTION_ID); | |
427 | status = acpi_hw_sleep_dispatch(sleep_state, 0, ACPI_WAKE_FUNCTION_ID); | ||
428 | return_ACPI_STATUS(status); | 425 | return_ACPI_STATUS(status); |
429 | } | 426 | } |
430 | 427 | ||
diff --git a/drivers/acpi/acpica/nsaccess.c b/drivers/acpi/acpica/nsaccess.c index 61623f3f6826..23db53ce2293 100644 --- a/drivers/acpi/acpica/nsaccess.c +++ b/drivers/acpi/acpica/nsaccess.c | |||
@@ -157,7 +157,7 @@ acpi_status acpi_ns_root_initialize(void) | |||
157 | 157 | ||
158 | #if defined (ACPI_ASL_COMPILER) | 158 | #if defined (ACPI_ASL_COMPILER) |
159 | 159 | ||
160 | /* Save the parameter count for the i_aSL compiler */ | 160 | /* Save the parameter count for the iASL compiler */ |
161 | 161 | ||
162 | new_node->value = obj_desc->method.param_count; | 162 | new_node->value = obj_desc->method.param_count; |
163 | #else | 163 | #else |
@@ -258,11 +258,11 @@ acpi_status acpi_ns_root_initialize(void) | |||
258 | * FUNCTION: acpi_ns_lookup | 258 | * FUNCTION: acpi_ns_lookup |
259 | * | 259 | * |
260 | * PARAMETERS: scope_info - Current scope info block | 260 | * PARAMETERS: scope_info - Current scope info block |
261 | * Pathname - Search pathname, in internal format | 261 | * pathname - Search pathname, in internal format |
262 | * (as represented in the AML stream) | 262 | * (as represented in the AML stream) |
263 | * Type - Type associated with name | 263 | * type - Type associated with name |
264 | * interpreter_mode - IMODE_LOAD_PASS2 => add name if not found | 264 | * interpreter_mode - IMODE_LOAD_PASS2 => add name if not found |
265 | * Flags - Flags describing the search restrictions | 265 | * flags - Flags describing the search restrictions |
266 | * walk_state - Current state of the walk | 266 | * walk_state - Current state of the walk |
267 | * return_node - Where the Node is placed (if found | 267 | * return_node - Where the Node is placed (if found |
268 | * or created successfully) | 268 | * or created successfully) |
diff --git a/drivers/acpi/acpica/nsalloc.c b/drivers/acpi/acpica/nsalloc.c index 7c3d3ceb98b3..ac389e5bb594 100644 --- a/drivers/acpi/acpica/nsalloc.c +++ b/drivers/acpi/acpica/nsalloc.c | |||
@@ -52,7 +52,7 @@ ACPI_MODULE_NAME("nsalloc") | |||
52 | * | 52 | * |
53 | * FUNCTION: acpi_ns_create_node | 53 | * FUNCTION: acpi_ns_create_node |
54 | * | 54 | * |
55 | * PARAMETERS: Name - Name of the new node (4 char ACPI name) | 55 | * PARAMETERS: name - Name of the new node (4 char ACPI name) |
56 | * | 56 | * |
57 | * RETURN: New namespace node (Null on failure) | 57 | * RETURN: New namespace node (Null on failure) |
58 | * | 58 | * |
@@ -92,7 +92,7 @@ struct acpi_namespace_node *acpi_ns_create_node(u32 name) | |||
92 | * | 92 | * |
93 | * FUNCTION: acpi_ns_delete_node | 93 | * FUNCTION: acpi_ns_delete_node |
94 | * | 94 | * |
95 | * PARAMETERS: Node - Node to be deleted | 95 | * PARAMETERS: node - Node to be deleted |
96 | * | 96 | * |
97 | * RETURN: None | 97 | * RETURN: None |
98 | * | 98 | * |
@@ -143,7 +143,7 @@ void acpi_ns_delete_node(struct acpi_namespace_node *node) | |||
143 | * | 143 | * |
144 | * FUNCTION: acpi_ns_remove_node | 144 | * FUNCTION: acpi_ns_remove_node |
145 | * | 145 | * |
146 | * PARAMETERS: Node - Node to be removed/deleted | 146 | * PARAMETERS: node - Node to be removed/deleted |
147 | * | 147 | * |
148 | * RETURN: None | 148 | * RETURN: None |
149 | * | 149 | * |
@@ -196,8 +196,8 @@ void acpi_ns_remove_node(struct acpi_namespace_node *node) | |||
196 | * | 196 | * |
197 | * PARAMETERS: walk_state - Current state of the walk | 197 | * PARAMETERS: walk_state - Current state of the walk |
198 | * parent_node - The parent of the new Node | 198 | * parent_node - The parent of the new Node |
199 | * Node - The new Node to install | 199 | * node - The new Node to install |
200 | * Type - ACPI object type of the new Node | 200 | * type - ACPI object type of the new Node |
201 | * | 201 | * |
202 | * RETURN: None | 202 | * RETURN: None |
203 | * | 203 | * |
diff --git a/drivers/acpi/acpica/nsdump.c b/drivers/acpi/acpica/nsdump.c index 3f7f3f6e7dd5..2526aaf945ee 100644 --- a/drivers/acpi/acpica/nsdump.c +++ b/drivers/acpi/acpica/nsdump.c | |||
@@ -63,7 +63,7 @@ acpi_ns_dump_one_device(acpi_handle obj_handle, | |||
63 | * FUNCTION: acpi_ns_print_pathname | 63 | * FUNCTION: acpi_ns_print_pathname |
64 | * | 64 | * |
65 | * PARAMETERS: num_segments - Number of ACPI name segments | 65 | * PARAMETERS: num_segments - Number of ACPI name segments |
66 | * Pathname - The compressed (internal) path | 66 | * pathname - The compressed (internal) path |
67 | * | 67 | * |
68 | * RETURN: None | 68 | * RETURN: None |
69 | * | 69 | * |
@@ -107,10 +107,10 @@ void acpi_ns_print_pathname(u32 num_segments, char *pathname) | |||
107 | * | 107 | * |
108 | * FUNCTION: acpi_ns_dump_pathname | 108 | * FUNCTION: acpi_ns_dump_pathname |
109 | * | 109 | * |
110 | * PARAMETERS: Handle - Object | 110 | * PARAMETERS: handle - Object |
111 | * Msg - Prefix message | 111 | * msg - Prefix message |
112 | * Level - Desired debug level | 112 | * level - Desired debug level |
113 | * Component - Caller's component ID | 113 | * component - Caller's component ID |
114 | * | 114 | * |
115 | * RETURN: None | 115 | * RETURN: None |
116 | * | 116 | * |
@@ -143,8 +143,8 @@ acpi_ns_dump_pathname(acpi_handle handle, char *msg, u32 level, u32 component) | |||
143 | * FUNCTION: acpi_ns_dump_one_object | 143 | * FUNCTION: acpi_ns_dump_one_object |
144 | * | 144 | * |
145 | * PARAMETERS: obj_handle - Node to be dumped | 145 | * PARAMETERS: obj_handle - Node to be dumped |
146 | * Level - Nesting level of the handle | 146 | * level - Nesting level of the handle |
147 | * Context - Passed into walk_namespace | 147 | * context - Passed into walk_namespace |
148 | * return_value - Not used | 148 | * return_value - Not used |
149 | * | 149 | * |
150 | * RETURN: Status | 150 | * RETURN: Status |
@@ -264,7 +264,7 @@ acpi_ns_dump_one_object(acpi_handle obj_handle, | |||
264 | switch (type) { | 264 | switch (type) { |
265 | case ACPI_TYPE_PROCESSOR: | 265 | case ACPI_TYPE_PROCESSOR: |
266 | 266 | ||
267 | acpi_os_printf("ID %X Len %.4X Addr %p\n", | 267 | acpi_os_printf("ID %02X Len %02X Addr %p\n", |
268 | obj_desc->processor.proc_id, | 268 | obj_desc->processor.proc_id, |
269 | obj_desc->processor.length, | 269 | obj_desc->processor.length, |
270 | ACPI_CAST_PTR(void, | 270 | ACPI_CAST_PTR(void, |
@@ -615,7 +615,7 @@ acpi_ns_dump_one_object(acpi_handle obj_handle, | |||
615 | * | 615 | * |
616 | * FUNCTION: acpi_ns_dump_objects | 616 | * FUNCTION: acpi_ns_dump_objects |
617 | * | 617 | * |
618 | * PARAMETERS: Type - Object type to be dumped | 618 | * PARAMETERS: type - Object type to be dumped |
619 | * display_type - 0 or ACPI_DISPLAY_SUMMARY | 619 | * display_type - 0 or ACPI_DISPLAY_SUMMARY |
620 | * max_depth - Maximum depth of dump. Use ACPI_UINT32_MAX | 620 | * max_depth - Maximum depth of dump. Use ACPI_UINT32_MAX |
621 | * for an effectively unlimited depth. | 621 | * for an effectively unlimited depth. |
@@ -671,7 +671,7 @@ acpi_ns_dump_objects(acpi_object_type type, | |||
671 | * | 671 | * |
672 | * FUNCTION: acpi_ns_dump_entry | 672 | * FUNCTION: acpi_ns_dump_entry |
673 | * | 673 | * |
674 | * PARAMETERS: Handle - Node to be dumped | 674 | * PARAMETERS: handle - Node to be dumped |
675 | * debug_level - Output level | 675 | * debug_level - Output level |
676 | * | 676 | * |
677 | * RETURN: None | 677 | * RETURN: None |
diff --git a/drivers/acpi/acpica/nsdumpdv.c b/drivers/acpi/acpica/nsdumpdv.c index 3b5acb0eb406..944d4c8d9438 100644 --- a/drivers/acpi/acpica/nsdumpdv.c +++ b/drivers/acpi/acpica/nsdumpdv.c | |||
@@ -55,9 +55,9 @@ ACPI_MODULE_NAME("nsdumpdv") | |||
55 | * | 55 | * |
56 | * FUNCTION: acpi_ns_dump_one_device | 56 | * FUNCTION: acpi_ns_dump_one_device |
57 | * | 57 | * |
58 | * PARAMETERS: Handle - Node to be dumped | 58 | * PARAMETERS: handle - Node to be dumped |
59 | * Level - Nesting level of the handle | 59 | * level - Nesting level of the handle |
60 | * Context - Passed into walk_namespace | 60 | * context - Passed into walk_namespace |
61 | * return_value - Not used | 61 | * return_value - Not used |
62 | * | 62 | * |
63 | * RETURN: Status | 63 | * RETURN: Status |
diff --git a/drivers/acpi/acpica/nseval.c b/drivers/acpi/acpica/nseval.c index f375cb82e321..69074be498e8 100644 --- a/drivers/acpi/acpica/nseval.c +++ b/drivers/acpi/acpica/nseval.c | |||
@@ -59,11 +59,11 @@ acpi_ns_exec_module_code(union acpi_operand_object *method_obj, | |||
59 | * | 59 | * |
60 | * FUNCTION: acpi_ns_evaluate | 60 | * FUNCTION: acpi_ns_evaluate |
61 | * | 61 | * |
62 | * PARAMETERS: Info - Evaluation info block, contains: | 62 | * PARAMETERS: info - Evaluation info block, contains: |
63 | * prefix_node - Prefix or Method/Object Node to execute | 63 | * prefix_node - Prefix or Method/Object Node to execute |
64 | * Pathname - Name of method to execute, If NULL, the | 64 | * pathname - Name of method to execute, If NULL, the |
65 | * Node is the object to execute | 65 | * Node is the object to execute |
66 | * Parameters - List of parameters to pass to the method, | 66 | * parameters - List of parameters to pass to the method, |
67 | * terminated by NULL. Params itself may be | 67 | * terminated by NULL. Params itself may be |
68 | * NULL if no parameters are being passed. | 68 | * NULL if no parameters are being passed. |
69 | * return_object - Where to put method's return value (if | 69 | * return_object - Where to put method's return value (if |
@@ -71,7 +71,7 @@ acpi_ns_exec_module_code(union acpi_operand_object *method_obj, | |||
71 | * parameter_type - Type of Parameter list | 71 | * parameter_type - Type of Parameter list |
72 | * return_object - Where to put method's return value (if | 72 | * return_object - Where to put method's return value (if |
73 | * any). If NULL, no value is returned. | 73 | * any). If NULL, no value is returned. |
74 | * Flags - ACPI_IGNORE_RETURN_VALUE to delete return | 74 | * flags - ACPI_IGNORE_RETURN_VALUE to delete return |
75 | * | 75 | * |
76 | * RETURN: Status | 76 | * RETURN: Status |
77 | * | 77 | * |
@@ -351,7 +351,7 @@ void acpi_ns_exec_module_code_list(void) | |||
351 | * FUNCTION: acpi_ns_exec_module_code | 351 | * FUNCTION: acpi_ns_exec_module_code |
352 | * | 352 | * |
353 | * PARAMETERS: method_obj - Object container for the module-level code | 353 | * PARAMETERS: method_obj - Object container for the module-level code |
354 | * Info - Info block for method evaluation | 354 | * info - Info block for method evaluation |
355 | * | 355 | * |
356 | * RETURN: None. Exceptions during method execution are ignored, since | 356 | * RETURN: None. Exceptions during method execution are ignored, since |
357 | * we cannot abort a table load. | 357 | * we cannot abort a table load. |
diff --git a/drivers/acpi/acpica/nsinit.c b/drivers/acpi/acpica/nsinit.c index 9d84ec2f0211..95ffe8dfa1f1 100644 --- a/drivers/acpi/acpica/nsinit.c +++ b/drivers/acpi/acpica/nsinit.c | |||
@@ -224,8 +224,8 @@ acpi_status acpi_ns_initialize_devices(void) | |||
224 | * FUNCTION: acpi_ns_init_one_object | 224 | * FUNCTION: acpi_ns_init_one_object |
225 | * | 225 | * |
226 | * PARAMETERS: obj_handle - Node | 226 | * PARAMETERS: obj_handle - Node |
227 | * Level - Current nesting level | 227 | * level - Current nesting level |
228 | * Context - Points to a init info struct | 228 | * context - Points to a init info struct |
229 | * return_value - Not used | 229 | * return_value - Not used |
230 | * | 230 | * |
231 | * RETURN: Status | 231 | * RETURN: Status |
@@ -530,7 +530,7 @@ acpi_ns_init_one_device(acpi_handle obj_handle, | |||
530 | * we will not run _INI, but we continue to examine the children | 530 | * we will not run _INI, but we continue to examine the children |
531 | * of this device. | 531 | * of this device. |
532 | * | 532 | * |
533 | * From the ACPI spec, description of _STA: (Note - no mention | 533 | * From the ACPI spec, description of _STA: (note - no mention |
534 | * of whether to run _INI or not on the device in question) | 534 | * of whether to run _INI or not on the device in question) |
535 | * | 535 | * |
536 | * "_STA may return bit 0 clear (not present) with bit 3 set | 536 | * "_STA may return bit 0 clear (not present) with bit 3 set |
diff --git a/drivers/acpi/acpica/nsload.c b/drivers/acpi/acpica/nsload.c index 5cbf15ffe7d8..76935ff29289 100644 --- a/drivers/acpi/acpica/nsload.c +++ b/drivers/acpi/acpica/nsload.c | |||
@@ -63,7 +63,7 @@ static acpi_status acpi_ns_delete_subtree(acpi_handle start_handle); | |||
63 | * FUNCTION: acpi_ns_load_table | 63 | * FUNCTION: acpi_ns_load_table |
64 | * | 64 | * |
65 | * PARAMETERS: table_index - Index for table to be loaded | 65 | * PARAMETERS: table_index - Index for table to be loaded |
66 | * Node - Owning NS node | 66 | * node - Owning NS node |
67 | * | 67 | * |
68 | * RETURN: Status | 68 | * RETURN: Status |
69 | * | 69 | * |
@@ -278,7 +278,7 @@ static acpi_status acpi_ns_delete_subtree(acpi_handle start_handle) | |||
278 | * | 278 | * |
279 | * FUNCTION: acpi_ns_unload_name_space | 279 | * FUNCTION: acpi_ns_unload_name_space |
280 | * | 280 | * |
281 | * PARAMETERS: Handle - Root of namespace subtree to be deleted | 281 | * PARAMETERS: handle - Root of namespace subtree to be deleted |
282 | * | 282 | * |
283 | * RETURN: Status | 283 | * RETURN: Status |
284 | * | 284 | * |
diff --git a/drivers/acpi/acpica/nsnames.c b/drivers/acpi/acpica/nsnames.c index b20e7c8c3ffb..96e0eb609bb4 100644 --- a/drivers/acpi/acpica/nsnames.c +++ b/drivers/acpi/acpica/nsnames.c | |||
@@ -53,8 +53,8 @@ ACPI_MODULE_NAME("nsnames") | |||
53 | * | 53 | * |
54 | * FUNCTION: acpi_ns_build_external_path | 54 | * FUNCTION: acpi_ns_build_external_path |
55 | * | 55 | * |
56 | * PARAMETERS: Node - NS node whose pathname is needed | 56 | * PARAMETERS: node - NS node whose pathname is needed |
57 | * Size - Size of the pathname | 57 | * size - Size of the pathname |
58 | * *name_buffer - Where to return the pathname | 58 | * *name_buffer - Where to return the pathname |
59 | * | 59 | * |
60 | * RETURN: Status | 60 | * RETURN: Status |
@@ -120,7 +120,7 @@ acpi_ns_build_external_path(struct acpi_namespace_node *node, | |||
120 | * | 120 | * |
121 | * FUNCTION: acpi_ns_get_external_pathname | 121 | * FUNCTION: acpi_ns_get_external_pathname |
122 | * | 122 | * |
123 | * PARAMETERS: Node - Namespace node whose pathname is needed | 123 | * PARAMETERS: node - Namespace node whose pathname is needed |
124 | * | 124 | * |
125 | * RETURN: Pointer to storage containing the fully qualified name of | 125 | * RETURN: Pointer to storage containing the fully qualified name of |
126 | * the node, In external format (name segments separated by path | 126 | * the node, In external format (name segments separated by path |
@@ -168,7 +168,7 @@ char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node) | |||
168 | * | 168 | * |
169 | * FUNCTION: acpi_ns_get_pathname_length | 169 | * FUNCTION: acpi_ns_get_pathname_length |
170 | * | 170 | * |
171 | * PARAMETERS: Node - Namespace node | 171 | * PARAMETERS: node - Namespace node |
172 | * | 172 | * |
173 | * RETURN: Length of path, including prefix | 173 | * RETURN: Length of path, including prefix |
174 | * | 174 | * |
@@ -214,7 +214,7 @@ acpi_size acpi_ns_get_pathname_length(struct acpi_namespace_node *node) | |||
214 | * | 214 | * |
215 | * PARAMETERS: target_handle - Handle of named object whose name is | 215 | * PARAMETERS: target_handle - Handle of named object whose name is |
216 | * to be found | 216 | * to be found |
217 | * Buffer - Where the pathname is returned | 217 | * buffer - Where the pathname is returned |
218 | * | 218 | * |
219 | * RETURN: Status, Buffer is filled with pathname if status is AE_OK | 219 | * RETURN: Status, Buffer is filled with pathname if status is AE_OK |
220 | * | 220 | * |
diff --git a/drivers/acpi/acpica/nsobject.c b/drivers/acpi/acpica/nsobject.c index dd77a3ce6e50..d6c9a3cc6716 100644 --- a/drivers/acpi/acpica/nsobject.c +++ b/drivers/acpi/acpica/nsobject.c | |||
@@ -53,9 +53,9 @@ ACPI_MODULE_NAME("nsobject") | |||
53 | * | 53 | * |
54 | * FUNCTION: acpi_ns_attach_object | 54 | * FUNCTION: acpi_ns_attach_object |
55 | * | 55 | * |
56 | * PARAMETERS: Node - Parent Node | 56 | * PARAMETERS: node - Parent Node |
57 | * Object - Object to be attached | 57 | * object - Object to be attached |
58 | * Type - Type of object, or ACPI_TYPE_ANY if not | 58 | * type - Type of object, or ACPI_TYPE_ANY if not |
59 | * known | 59 | * known |
60 | * | 60 | * |
61 | * RETURN: Status | 61 | * RETURN: Status |
@@ -191,7 +191,7 @@ acpi_ns_attach_object(struct acpi_namespace_node *node, | |||
191 | * | 191 | * |
192 | * FUNCTION: acpi_ns_detach_object | 192 | * FUNCTION: acpi_ns_detach_object |
193 | * | 193 | * |
194 | * PARAMETERS: Node - A Namespace node whose object will be detached | 194 | * PARAMETERS: node - A Namespace node whose object will be detached |
195 | * | 195 | * |
196 | * RETURN: None. | 196 | * RETURN: None. |
197 | * | 197 | * |
@@ -250,7 +250,7 @@ void acpi_ns_detach_object(struct acpi_namespace_node *node) | |||
250 | * | 250 | * |
251 | * FUNCTION: acpi_ns_get_attached_object | 251 | * FUNCTION: acpi_ns_get_attached_object |
252 | * | 252 | * |
253 | * PARAMETERS: Node - Namespace node | 253 | * PARAMETERS: node - Namespace node |
254 | * | 254 | * |
255 | * RETURN: Current value of the object field from the Node whose | 255 | * RETURN: Current value of the object field from the Node whose |
256 | * handle is passed | 256 | * handle is passed |
@@ -285,7 +285,7 @@ union acpi_operand_object *acpi_ns_get_attached_object(struct | |||
285 | * | 285 | * |
286 | * FUNCTION: acpi_ns_get_secondary_object | 286 | * FUNCTION: acpi_ns_get_secondary_object |
287 | * | 287 | * |
288 | * PARAMETERS: Node - Namespace node | 288 | * PARAMETERS: node - Namespace node |
289 | * | 289 | * |
290 | * RETURN: Current value of the object field from the Node whose | 290 | * RETURN: Current value of the object field from the Node whose |
291 | * handle is passed. | 291 | * handle is passed. |
@@ -315,9 +315,9 @@ union acpi_operand_object *acpi_ns_get_secondary_object(union | |||
315 | * | 315 | * |
316 | * FUNCTION: acpi_ns_attach_data | 316 | * FUNCTION: acpi_ns_attach_data |
317 | * | 317 | * |
318 | * PARAMETERS: Node - Namespace node | 318 | * PARAMETERS: node - Namespace node |
319 | * Handler - Handler to be associated with the data | 319 | * handler - Handler to be associated with the data |
320 | * Data - Data to be attached | 320 | * data - Data to be attached |
321 | * | 321 | * |
322 | * RETURN: Status | 322 | * RETURN: Status |
323 | * | 323 | * |
@@ -372,8 +372,8 @@ acpi_ns_attach_data(struct acpi_namespace_node *node, | |||
372 | * | 372 | * |
373 | * FUNCTION: acpi_ns_detach_data | 373 | * FUNCTION: acpi_ns_detach_data |
374 | * | 374 | * |
375 | * PARAMETERS: Node - Namespace node | 375 | * PARAMETERS: node - Namespace node |
376 | * Handler - Handler associated with the data | 376 | * handler - Handler associated with the data |
377 | * | 377 | * |
378 | * RETURN: Status | 378 | * RETURN: Status |
379 | * | 379 | * |
@@ -416,9 +416,9 @@ acpi_ns_detach_data(struct acpi_namespace_node * node, | |||
416 | * | 416 | * |
417 | * FUNCTION: acpi_ns_get_attached_data | 417 | * FUNCTION: acpi_ns_get_attached_data |
418 | * | 418 | * |
419 | * PARAMETERS: Node - Namespace node | 419 | * PARAMETERS: node - Namespace node |
420 | * Handler - Handler associated with the data | 420 | * handler - Handler associated with the data |
421 | * Data - Where the data is returned | 421 | * data - Where the data is returned |
422 | * | 422 | * |
423 | * RETURN: Status | 423 | * RETURN: Status |
424 | * | 424 | * |
diff --git a/drivers/acpi/acpica/nspredef.c b/drivers/acpi/acpica/nspredef.c index fe6626035495..2419f417ea33 100644 --- a/drivers/acpi/acpica/nspredef.c +++ b/drivers/acpi/acpica/nspredef.c | |||
@@ -116,7 +116,7 @@ static const char *acpi_rtype_names[] = { | |||
116 | * | 116 | * |
117 | * FUNCTION: acpi_ns_check_predefined_names | 117 | * FUNCTION: acpi_ns_check_predefined_names |
118 | * | 118 | * |
119 | * PARAMETERS: Node - Namespace node for the method/object | 119 | * PARAMETERS: node - Namespace node for the method/object |
120 | * user_param_count - Number of parameters actually passed | 120 | * user_param_count - Number of parameters actually passed |
121 | * return_status - Status from the object evaluation | 121 | * return_status - Status from the object evaluation |
122 | * return_object_ptr - Pointer to the object returned from the | 122 | * return_object_ptr - Pointer to the object returned from the |
@@ -275,10 +275,10 @@ cleanup: | |||
275 | * | 275 | * |
276 | * FUNCTION: acpi_ns_check_parameter_count | 276 | * FUNCTION: acpi_ns_check_parameter_count |
277 | * | 277 | * |
278 | * PARAMETERS: Pathname - Full pathname to the node (for error msgs) | 278 | * PARAMETERS: pathname - Full pathname to the node (for error msgs) |
279 | * Node - Namespace node for the method/object | 279 | * node - Namespace node for the method/object |
280 | * user_param_count - Number of args passed in by the caller | 280 | * user_param_count - Number of args passed in by the caller |
281 | * Predefined - Pointer to entry in predefined name table | 281 | * predefined - Pointer to entry in predefined name table |
282 | * | 282 | * |
283 | * RETURN: None | 283 | * RETURN: None |
284 | * | 284 | * |
@@ -364,7 +364,7 @@ acpi_ns_check_parameter_count(char *pathname, | |||
364 | * | 364 | * |
365 | * FUNCTION: acpi_ns_check_for_predefined_name | 365 | * FUNCTION: acpi_ns_check_for_predefined_name |
366 | * | 366 | * |
367 | * PARAMETERS: Node - Namespace node for the method/object | 367 | * PARAMETERS: node - Namespace node for the method/object |
368 | * | 368 | * |
369 | * RETURN: Pointer to entry in predefined table. NULL indicates not found. | 369 | * RETURN: Pointer to entry in predefined table. NULL indicates not found. |
370 | * | 370 | * |
@@ -410,7 +410,7 @@ const union acpi_predefined_info *acpi_ns_check_for_predefined_name(struct | |||
410 | * | 410 | * |
411 | * FUNCTION: acpi_ns_check_package | 411 | * FUNCTION: acpi_ns_check_package |
412 | * | 412 | * |
413 | * PARAMETERS: Data - Pointer to validation data structure | 413 | * PARAMETERS: data - Pointer to validation data structure |
414 | * return_object_ptr - Pointer to the object returned from the | 414 | * return_object_ptr - Pointer to the object returned from the |
415 | * evaluation of a method or object | 415 | * evaluation of a method or object |
416 | * | 416 | * |
@@ -685,11 +685,11 @@ package_too_small: | |||
685 | * | 685 | * |
686 | * FUNCTION: acpi_ns_check_package_list | 686 | * FUNCTION: acpi_ns_check_package_list |
687 | * | 687 | * |
688 | * PARAMETERS: Data - Pointer to validation data structure | 688 | * PARAMETERS: data - Pointer to validation data structure |
689 | * Package - Pointer to package-specific info for method | 689 | * package - Pointer to package-specific info for method |
690 | * Elements - Element list of parent package. All elements | 690 | * elements - Element list of parent package. All elements |
691 | * of this list should be of type Package. | 691 | * of this list should be of type Package. |
692 | * Count - Count of subpackages | 692 | * count - Count of subpackages |
693 | * | 693 | * |
694 | * RETURN: Status | 694 | * RETURN: Status |
695 | * | 695 | * |
@@ -911,12 +911,12 @@ package_too_small: | |||
911 | * | 911 | * |
912 | * FUNCTION: acpi_ns_check_package_elements | 912 | * FUNCTION: acpi_ns_check_package_elements |
913 | * | 913 | * |
914 | * PARAMETERS: Data - Pointer to validation data structure | 914 | * PARAMETERS: data - Pointer to validation data structure |
915 | * Elements - Pointer to the package elements array | 915 | * elements - Pointer to the package elements array |
916 | * Type1 - Object type for first group | 916 | * type1 - Object type for first group |
917 | * Count1 - Count for first group | 917 | * count1 - Count for first group |
918 | * Type2 - Object type for second group | 918 | * type2 - Object type for second group |
919 | * Count2 - Count for second group | 919 | * count2 - Count for second group |
920 | * start_index - Start of the first group of elements | 920 | * start_index - Start of the first group of elements |
921 | * | 921 | * |
922 | * RETURN: Status | 922 | * RETURN: Status |
@@ -968,7 +968,7 @@ acpi_ns_check_package_elements(struct acpi_predefined_data *data, | |||
968 | * | 968 | * |
969 | * FUNCTION: acpi_ns_check_object_type | 969 | * FUNCTION: acpi_ns_check_object_type |
970 | * | 970 | * |
971 | * PARAMETERS: Data - Pointer to validation data structure | 971 | * PARAMETERS: data - Pointer to validation data structure |
972 | * return_object_ptr - Pointer to the object returned from the | 972 | * return_object_ptr - Pointer to the object returned from the |
973 | * evaluation of a method or object | 973 | * evaluation of a method or object |
974 | * expected_btypes - Bitmap of expected return type(s) | 974 | * expected_btypes - Bitmap of expected return type(s) |
@@ -1102,7 +1102,7 @@ acpi_ns_check_object_type(struct acpi_predefined_data *data, | |||
1102 | * | 1102 | * |
1103 | * FUNCTION: acpi_ns_check_reference | 1103 | * FUNCTION: acpi_ns_check_reference |
1104 | * | 1104 | * |
1105 | * PARAMETERS: Data - Pointer to validation data structure | 1105 | * PARAMETERS: data - Pointer to validation data structure |
1106 | * return_object - Object returned from the evaluation of a | 1106 | * return_object - Object returned from the evaluation of a |
1107 | * method or object | 1107 | * method or object |
1108 | * | 1108 | * |
@@ -1140,7 +1140,7 @@ acpi_ns_check_reference(struct acpi_predefined_data *data, | |||
1140 | * | 1140 | * |
1141 | * FUNCTION: acpi_ns_get_expected_types | 1141 | * FUNCTION: acpi_ns_get_expected_types |
1142 | * | 1142 | * |
1143 | * PARAMETERS: Buffer - Pointer to where the string is returned | 1143 | * PARAMETERS: buffer - Pointer to where the string is returned |
1144 | * expected_btypes - Bitmap of expected return type(s) | 1144 | * expected_btypes - Bitmap of expected return type(s) |
1145 | * | 1145 | * |
1146 | * RETURN: Buffer is populated with type names. | 1146 | * RETURN: Buffer is populated with type names. |
diff --git a/drivers/acpi/acpica/nsrepair.c b/drivers/acpi/acpica/nsrepair.c index 5519a64a353f..8c5f292860fc 100644 --- a/drivers/acpi/acpica/nsrepair.c +++ b/drivers/acpi/acpica/nsrepair.c | |||
@@ -94,7 +94,7 @@ acpi_ns_convert_to_buffer(union acpi_operand_object *original_object, | |||
94 | * | 94 | * |
95 | * FUNCTION: acpi_ns_repair_object | 95 | * FUNCTION: acpi_ns_repair_object |
96 | * | 96 | * |
97 | * PARAMETERS: Data - Pointer to validation data structure | 97 | * PARAMETERS: data - Pointer to validation data structure |
98 | * expected_btypes - Object types expected | 98 | * expected_btypes - Object types expected |
99 | * package_index - Index of object within parent package (if | 99 | * package_index - Index of object within parent package (if |
100 | * applicable - ACPI_NOT_PACKAGE_ELEMENT | 100 | * applicable - ACPI_NOT_PACKAGE_ELEMENT |
@@ -470,7 +470,7 @@ acpi_ns_convert_to_buffer(union acpi_operand_object *original_object, | |||
470 | * | 470 | * |
471 | * FUNCTION: acpi_ns_repair_null_element | 471 | * FUNCTION: acpi_ns_repair_null_element |
472 | * | 472 | * |
473 | * PARAMETERS: Data - Pointer to validation data structure | 473 | * PARAMETERS: data - Pointer to validation data structure |
474 | * expected_btypes - Object types expected | 474 | * expected_btypes - Object types expected |
475 | * package_index - Index of object within parent package (if | 475 | * package_index - Index of object within parent package (if |
476 | * applicable - ACPI_NOT_PACKAGE_ELEMENT | 476 | * applicable - ACPI_NOT_PACKAGE_ELEMENT |
@@ -509,17 +509,17 @@ acpi_ns_repair_null_element(struct acpi_predefined_data *data, | |||
509 | */ | 509 | */ |
510 | if (expected_btypes & ACPI_RTYPE_INTEGER) { | 510 | if (expected_btypes & ACPI_RTYPE_INTEGER) { |
511 | 511 | ||
512 | /* Need an Integer - create a zero-value integer */ | 512 | /* Need an integer - create a zero-value integer */ |
513 | 513 | ||
514 | new_object = acpi_ut_create_integer_object((u64)0); | 514 | new_object = acpi_ut_create_integer_object((u64)0); |
515 | } else if (expected_btypes & ACPI_RTYPE_STRING) { | 515 | } else if (expected_btypes & ACPI_RTYPE_STRING) { |
516 | 516 | ||
517 | /* Need a String - create a NULL string */ | 517 | /* Need a string - create a NULL string */ |
518 | 518 | ||
519 | new_object = acpi_ut_create_string_object(0); | 519 | new_object = acpi_ut_create_string_object(0); |
520 | } else if (expected_btypes & ACPI_RTYPE_BUFFER) { | 520 | } else if (expected_btypes & ACPI_RTYPE_BUFFER) { |
521 | 521 | ||
522 | /* Need a Buffer - create a zero-length buffer */ | 522 | /* Need a buffer - create a zero-length buffer */ |
523 | 523 | ||
524 | new_object = acpi_ut_create_buffer_object(0); | 524 | new_object = acpi_ut_create_buffer_object(0); |
525 | } else { | 525 | } else { |
@@ -552,7 +552,7 @@ acpi_ns_repair_null_element(struct acpi_predefined_data *data, | |||
552 | * | 552 | * |
553 | * FUNCTION: acpi_ns_remove_null_elements | 553 | * FUNCTION: acpi_ns_remove_null_elements |
554 | * | 554 | * |
555 | * PARAMETERS: Data - Pointer to validation data structure | 555 | * PARAMETERS: data - Pointer to validation data structure |
556 | * package_type - An acpi_return_package_types value | 556 | * package_type - An acpi_return_package_types value |
557 | * obj_desc - A Package object | 557 | * obj_desc - A Package object |
558 | * | 558 | * |
@@ -635,7 +635,7 @@ acpi_ns_remove_null_elements(struct acpi_predefined_data *data, | |||
635 | * | 635 | * |
636 | * FUNCTION: acpi_ns_wrap_with_package | 636 | * FUNCTION: acpi_ns_wrap_with_package |
637 | * | 637 | * |
638 | * PARAMETERS: Data - Pointer to validation data structure | 638 | * PARAMETERS: data - Pointer to validation data structure |
639 | * original_object - Pointer to the object to repair. | 639 | * original_object - Pointer to the object to repair. |
640 | * obj_desc_ptr - The new package object is returned here | 640 | * obj_desc_ptr - The new package object is returned here |
641 | * | 641 | * |
diff --git a/drivers/acpi/acpica/nsrepair2.c b/drivers/acpi/acpica/nsrepair2.c index 726bc8e687f7..90189251cdf0 100644 --- a/drivers/acpi/acpica/nsrepair2.c +++ b/drivers/acpi/acpica/nsrepair2.c | |||
@@ -149,8 +149,8 @@ static const struct acpi_repair_info acpi_ns_repairable_names[] = { | |||
149 | * | 149 | * |
150 | * FUNCTION: acpi_ns_complex_repairs | 150 | * FUNCTION: acpi_ns_complex_repairs |
151 | * | 151 | * |
152 | * PARAMETERS: Data - Pointer to validation data structure | 152 | * PARAMETERS: data - Pointer to validation data structure |
153 | * Node - Namespace node for the method/object | 153 | * node - Namespace node for the method/object |
154 | * validate_status - Original status of earlier validation | 154 | * validate_status - Original status of earlier validation |
155 | * return_object_ptr - Pointer to the object returned from the | 155 | * return_object_ptr - Pointer to the object returned from the |
156 | * evaluation of a method or object | 156 | * evaluation of a method or object |
@@ -187,7 +187,7 @@ acpi_ns_complex_repairs(struct acpi_predefined_data *data, | |||
187 | * | 187 | * |
188 | * FUNCTION: acpi_ns_match_repairable_name | 188 | * FUNCTION: acpi_ns_match_repairable_name |
189 | * | 189 | * |
190 | * PARAMETERS: Node - Namespace node for the method/object | 190 | * PARAMETERS: node - Namespace node for the method/object |
191 | * | 191 | * |
192 | * RETURN: Pointer to entry in repair table. NULL indicates not found. | 192 | * RETURN: Pointer to entry in repair table. NULL indicates not found. |
193 | * | 193 | * |
@@ -218,7 +218,7 @@ static const struct acpi_repair_info *acpi_ns_match_repairable_name(struct | |||
218 | * | 218 | * |
219 | * FUNCTION: acpi_ns_repair_ALR | 219 | * FUNCTION: acpi_ns_repair_ALR |
220 | * | 220 | * |
221 | * PARAMETERS: Data - Pointer to validation data structure | 221 | * PARAMETERS: data - Pointer to validation data structure |
222 | * return_object_ptr - Pointer to the object returned from the | 222 | * return_object_ptr - Pointer to the object returned from the |
223 | * evaluation of a method or object | 223 | * evaluation of a method or object |
224 | * | 224 | * |
@@ -247,7 +247,7 @@ acpi_ns_repair_ALR(struct acpi_predefined_data *data, | |||
247 | * | 247 | * |
248 | * FUNCTION: acpi_ns_repair_FDE | 248 | * FUNCTION: acpi_ns_repair_FDE |
249 | * | 249 | * |
250 | * PARAMETERS: Data - Pointer to validation data structure | 250 | * PARAMETERS: data - Pointer to validation data structure |
251 | * return_object_ptr - Pointer to the object returned from the | 251 | * return_object_ptr - Pointer to the object returned from the |
252 | * evaluation of a method or object | 252 | * evaluation of a method or object |
253 | * | 253 | * |
@@ -335,7 +335,7 @@ acpi_ns_repair_FDE(struct acpi_predefined_data *data, | |||
335 | * | 335 | * |
336 | * FUNCTION: acpi_ns_repair_CID | 336 | * FUNCTION: acpi_ns_repair_CID |
337 | * | 337 | * |
338 | * PARAMETERS: Data - Pointer to validation data structure | 338 | * PARAMETERS: data - Pointer to validation data structure |
339 | * return_object_ptr - Pointer to the object returned from the | 339 | * return_object_ptr - Pointer to the object returned from the |
340 | * evaluation of a method or object | 340 | * evaluation of a method or object |
341 | * | 341 | * |
@@ -405,7 +405,7 @@ acpi_ns_repair_CID(struct acpi_predefined_data *data, | |||
405 | * | 405 | * |
406 | * FUNCTION: acpi_ns_repair_HID | 406 | * FUNCTION: acpi_ns_repair_HID |
407 | * | 407 | * |
408 | * PARAMETERS: Data - Pointer to validation data structure | 408 | * PARAMETERS: data - Pointer to validation data structure |
409 | * return_object_ptr - Pointer to the object returned from the | 409 | * return_object_ptr - Pointer to the object returned from the |
410 | * evaluation of a method or object | 410 | * evaluation of a method or object |
411 | * | 411 | * |
@@ -487,7 +487,7 @@ acpi_ns_repair_HID(struct acpi_predefined_data *data, | |||
487 | * | 487 | * |
488 | * FUNCTION: acpi_ns_repair_TSS | 488 | * FUNCTION: acpi_ns_repair_TSS |
489 | * | 489 | * |
490 | * PARAMETERS: Data - Pointer to validation data structure | 490 | * PARAMETERS: data - Pointer to validation data structure |
491 | * return_object_ptr - Pointer to the object returned from the | 491 | * return_object_ptr - Pointer to the object returned from the |
492 | * evaluation of a method or object | 492 | * evaluation of a method or object |
493 | * | 493 | * |
@@ -531,7 +531,7 @@ acpi_ns_repair_TSS(struct acpi_predefined_data *data, | |||
531 | * | 531 | * |
532 | * FUNCTION: acpi_ns_repair_PSS | 532 | * FUNCTION: acpi_ns_repair_PSS |
533 | * | 533 | * |
534 | * PARAMETERS: Data - Pointer to validation data structure | 534 | * PARAMETERS: data - Pointer to validation data structure |
535 | * return_object_ptr - Pointer to the object returned from the | 535 | * return_object_ptr - Pointer to the object returned from the |
536 | * evaluation of a method or object | 536 | * evaluation of a method or object |
537 | * | 537 | * |
@@ -600,7 +600,7 @@ acpi_ns_repair_PSS(struct acpi_predefined_data *data, | |||
600 | * | 600 | * |
601 | * FUNCTION: acpi_ns_check_sorted_list | 601 | * FUNCTION: acpi_ns_check_sorted_list |
602 | * | 602 | * |
603 | * PARAMETERS: Data - Pointer to validation data structure | 603 | * PARAMETERS: data - Pointer to validation data structure |
604 | * return_object - Pointer to the top-level returned object | 604 | * return_object - Pointer to the top-level returned object |
605 | * expected_count - Minimum length of each sub-package | 605 | * expected_count - Minimum length of each sub-package |
606 | * sort_index - Sub-package entry to sort on | 606 | * sort_index - Sub-package entry to sort on |
@@ -707,9 +707,9 @@ acpi_ns_check_sorted_list(struct acpi_predefined_data *data, | |||
707 | * | 707 | * |
708 | * FUNCTION: acpi_ns_sort_list | 708 | * FUNCTION: acpi_ns_sort_list |
709 | * | 709 | * |
710 | * PARAMETERS: Elements - Package object element list | 710 | * PARAMETERS: elements - Package object element list |
711 | * Count - Element count for above | 711 | * count - Element count for above |
712 | * Index - Sort by which package element | 712 | * index - Sort by which package element |
713 | * sort_direction - Ascending or Descending sort | 713 | * sort_direction - Ascending or Descending sort |
714 | * | 714 | * |
715 | * RETURN: None | 715 | * RETURN: None |
diff --git a/drivers/acpi/acpica/nssearch.c b/drivers/acpi/acpica/nssearch.c index 507043d66114..456cc859f869 100644 --- a/drivers/acpi/acpica/nssearch.c +++ b/drivers/acpi/acpica/nssearch.c | |||
@@ -65,7 +65,7 @@ acpi_ns_search_parent_tree(u32 target_name, | |||
65 | * | 65 | * |
66 | * PARAMETERS: target_name - Ascii ACPI name to search for | 66 | * PARAMETERS: target_name - Ascii ACPI name to search for |
67 | * parent_node - Starting node where search will begin | 67 | * parent_node - Starting node where search will begin |
68 | * Type - Object type to match | 68 | * type - Object type to match |
69 | * return_node - Where the matched Named obj is returned | 69 | * return_node - Where the matched Named obj is returned |
70 | * | 70 | * |
71 | * RETURN: Status | 71 | * RETURN: Status |
@@ -175,8 +175,8 @@ acpi_ns_search_one_scope(u32 target_name, | |||
175 | * FUNCTION: acpi_ns_search_parent_tree | 175 | * FUNCTION: acpi_ns_search_parent_tree |
176 | * | 176 | * |
177 | * PARAMETERS: target_name - Ascii ACPI name to search for | 177 | * PARAMETERS: target_name - Ascii ACPI name to search for |
178 | * Node - Starting node where search will begin | 178 | * node - Starting node where search will begin |
179 | * Type - Object type to match | 179 | * type - Object type to match |
180 | * return_node - Where the matched Node is returned | 180 | * return_node - Where the matched Node is returned |
181 | * | 181 | * |
182 | * RETURN: Status | 182 | * RETURN: Status |
@@ -264,11 +264,11 @@ acpi_ns_search_parent_tree(u32 target_name, | |||
264 | * | 264 | * |
265 | * PARAMETERS: target_name - Ascii ACPI name to search for (4 chars) | 265 | * PARAMETERS: target_name - Ascii ACPI name to search for (4 chars) |
266 | * walk_state - Current state of the walk | 266 | * walk_state - Current state of the walk |
267 | * Node - Starting node where search will begin | 267 | * node - Starting node where search will begin |
268 | * interpreter_mode - Add names only in ACPI_MODE_LOAD_PASS_x. | 268 | * interpreter_mode - Add names only in ACPI_MODE_LOAD_PASS_x. |
269 | * Otherwise,search only. | 269 | * Otherwise,search only. |
270 | * Type - Object type to match | 270 | * type - Object type to match |
271 | * Flags - Flags describing the search restrictions | 271 | * flags - Flags describing the search restrictions |
272 | * return_node - Where the Node is returned | 272 | * return_node - Where the Node is returned |
273 | * | 273 | * |
274 | * RETURN: Status | 274 | * RETURN: Status |
diff --git a/drivers/acpi/acpica/nsutils.c b/drivers/acpi/acpica/nsutils.c index 75113759f69d..ef753a41e087 100644 --- a/drivers/acpi/acpica/nsutils.c +++ b/drivers/acpi/acpica/nsutils.c | |||
@@ -62,8 +62,8 @@ acpi_name acpi_ns_find_parent_name(struct acpi_namespace_node *node_to_search); | |||
62 | * | 62 | * |
63 | * FUNCTION: acpi_ns_print_node_pathname | 63 | * FUNCTION: acpi_ns_print_node_pathname |
64 | * | 64 | * |
65 | * PARAMETERS: Node - Object | 65 | * PARAMETERS: node - Object |
66 | * Message - Prefix message | 66 | * message - Prefix message |
67 | * | 67 | * |
68 | * DESCRIPTION: Print an object's full namespace pathname | 68 | * DESCRIPTION: Print an object's full namespace pathname |
69 | * Manages allocation/freeing of a pathname buffer | 69 | * Manages allocation/freeing of a pathname buffer |
@@ -101,7 +101,7 @@ acpi_ns_print_node_pathname(struct acpi_namespace_node *node, | |||
101 | * | 101 | * |
102 | * FUNCTION: acpi_ns_valid_root_prefix | 102 | * FUNCTION: acpi_ns_valid_root_prefix |
103 | * | 103 | * |
104 | * PARAMETERS: Prefix - Character to be checked | 104 | * PARAMETERS: prefix - Character to be checked |
105 | * | 105 | * |
106 | * RETURN: TRUE if a valid prefix | 106 | * RETURN: TRUE if a valid prefix |
107 | * | 107 | * |
@@ -119,7 +119,7 @@ u8 acpi_ns_valid_root_prefix(char prefix) | |||
119 | * | 119 | * |
120 | * FUNCTION: acpi_ns_valid_path_separator | 120 | * FUNCTION: acpi_ns_valid_path_separator |
121 | * | 121 | * |
122 | * PARAMETERS: Sep - Character to be checked | 122 | * PARAMETERS: sep - Character to be checked |
123 | * | 123 | * |
124 | * RETURN: TRUE if a valid path separator | 124 | * RETURN: TRUE if a valid path separator |
125 | * | 125 | * |
@@ -137,7 +137,7 @@ static u8 acpi_ns_valid_path_separator(char sep) | |||
137 | * | 137 | * |
138 | * FUNCTION: acpi_ns_get_type | 138 | * FUNCTION: acpi_ns_get_type |
139 | * | 139 | * |
140 | * PARAMETERS: Node - Parent Node to be examined | 140 | * PARAMETERS: node - Parent Node to be examined |
141 | * | 141 | * |
142 | * RETURN: Type field from Node whose handle is passed | 142 | * RETURN: Type field from Node whose handle is passed |
143 | * | 143 | * |
@@ -161,7 +161,7 @@ acpi_object_type acpi_ns_get_type(struct acpi_namespace_node * node) | |||
161 | * | 161 | * |
162 | * FUNCTION: acpi_ns_local | 162 | * FUNCTION: acpi_ns_local |
163 | * | 163 | * |
164 | * PARAMETERS: Type - A namespace object type | 164 | * PARAMETERS: type - A namespace object type |
165 | * | 165 | * |
166 | * RETURN: LOCAL if names must be found locally in objects of the | 166 | * RETURN: LOCAL if names must be found locally in objects of the |
167 | * passed type, 0 if enclosing scopes should be searched | 167 | * passed type, 0 if enclosing scopes should be searched |
@@ -189,7 +189,7 @@ u32 acpi_ns_local(acpi_object_type type) | |||
189 | * | 189 | * |
190 | * FUNCTION: acpi_ns_get_internal_name_length | 190 | * FUNCTION: acpi_ns_get_internal_name_length |
191 | * | 191 | * |
192 | * PARAMETERS: Info - Info struct initialized with the | 192 | * PARAMETERS: info - Info struct initialized with the |
193 | * external name pointer. | 193 | * external name pointer. |
194 | * | 194 | * |
195 | * RETURN: None | 195 | * RETURN: None |
@@ -260,7 +260,7 @@ void acpi_ns_get_internal_name_length(struct acpi_namestring_info *info) | |||
260 | * | 260 | * |
261 | * FUNCTION: acpi_ns_build_internal_name | 261 | * FUNCTION: acpi_ns_build_internal_name |
262 | * | 262 | * |
263 | * PARAMETERS: Info - Info struct fully initialized | 263 | * PARAMETERS: info - Info struct fully initialized |
264 | * | 264 | * |
265 | * RETURN: Status | 265 | * RETURN: Status |
266 | * | 266 | * |
@@ -371,7 +371,7 @@ acpi_status acpi_ns_build_internal_name(struct acpi_namestring_info *info) | |||
371 | * FUNCTION: acpi_ns_internalize_name | 371 | * FUNCTION: acpi_ns_internalize_name |
372 | * | 372 | * |
373 | * PARAMETERS: *external_name - External representation of name | 373 | * PARAMETERS: *external_name - External representation of name |
374 | * **Converted Name - Where to return the resulting | 374 | * **Converted name - Where to return the resulting |
375 | * internal represention of the name | 375 | * internal represention of the name |
376 | * | 376 | * |
377 | * RETURN: Status | 377 | * RETURN: Status |
@@ -575,7 +575,7 @@ acpi_ns_externalize_name(u32 internal_name_length, | |||
575 | * | 575 | * |
576 | * FUNCTION: acpi_ns_validate_handle | 576 | * FUNCTION: acpi_ns_validate_handle |
577 | * | 577 | * |
578 | * PARAMETERS: Handle - Handle to be validated and typecast to a | 578 | * PARAMETERS: handle - Handle to be validated and typecast to a |
579 | * namespace node. | 579 | * namespace node. |
580 | * | 580 | * |
581 | * RETURN: A pointer to a namespace node | 581 | * RETURN: A pointer to a namespace node |
@@ -651,7 +651,7 @@ void acpi_ns_terminate(void) | |||
651 | * | 651 | * |
652 | * FUNCTION: acpi_ns_opens_scope | 652 | * FUNCTION: acpi_ns_opens_scope |
653 | * | 653 | * |
654 | * PARAMETERS: Type - A valid namespace type | 654 | * PARAMETERS: type - A valid namespace type |
655 | * | 655 | * |
656 | * RETURN: NEWSCOPE if the passed type "opens a name scope" according | 656 | * RETURN: NEWSCOPE if the passed type "opens a name scope" according |
657 | * to the ACPI specification, else 0 | 657 | * to the ACPI specification, else 0 |
@@ -677,14 +677,14 @@ u32 acpi_ns_opens_scope(acpi_object_type type) | |||
677 | * | 677 | * |
678 | * FUNCTION: acpi_ns_get_node | 678 | * FUNCTION: acpi_ns_get_node |
679 | * | 679 | * |
680 | * PARAMETERS: *Pathname - Name to be found, in external (ASL) format. The | 680 | * PARAMETERS: *pathname - Name to be found, in external (ASL) format. The |
681 | * \ (backslash) and ^ (carat) prefixes, and the | 681 | * \ (backslash) and ^ (carat) prefixes, and the |
682 | * . (period) to separate segments are supported. | 682 | * . (period) to separate segments are supported. |
683 | * prefix_node - Root of subtree to be searched, or NS_ALL for the | 683 | * prefix_node - Root of subtree to be searched, or NS_ALL for the |
684 | * root of the name space. If Name is fully | 684 | * root of the name space. If Name is fully |
685 | * qualified (first s8 is '\'), the passed value | 685 | * qualified (first s8 is '\'), the passed value |
686 | * of Scope will not be accessed. | 686 | * of Scope will not be accessed. |
687 | * Flags - Used to indicate whether to perform upsearch or | 687 | * flags - Used to indicate whether to perform upsearch or |
688 | * not. | 688 | * not. |
689 | * return_node - Where the Node is returned | 689 | * return_node - Where the Node is returned |
690 | * | 690 | * |
diff --git a/drivers/acpi/acpica/nswalk.c b/drivers/acpi/acpica/nswalk.c index f69895a54895..730bccc5e7f7 100644 --- a/drivers/acpi/acpica/nswalk.c +++ b/drivers/acpi/acpica/nswalk.c | |||
@@ -88,7 +88,7 @@ struct acpi_namespace_node *acpi_ns_get_next_node(struct acpi_namespace_node | |||
88 | * | 88 | * |
89 | * FUNCTION: acpi_ns_get_next_node_typed | 89 | * FUNCTION: acpi_ns_get_next_node_typed |
90 | * | 90 | * |
91 | * PARAMETERS: Type - Type of node to be searched for | 91 | * PARAMETERS: type - Type of node to be searched for |
92 | * parent_node - Parent node whose children we are | 92 | * parent_node - Parent node whose children we are |
93 | * getting | 93 | * getting |
94 | * child_node - Previous child that was found. | 94 | * child_node - Previous child that was found. |
@@ -151,16 +151,16 @@ struct acpi_namespace_node *acpi_ns_get_next_node_typed(acpi_object_type type, | |||
151 | * | 151 | * |
152 | * FUNCTION: acpi_ns_walk_namespace | 152 | * FUNCTION: acpi_ns_walk_namespace |
153 | * | 153 | * |
154 | * PARAMETERS: Type - acpi_object_type to search for | 154 | * PARAMETERS: type - acpi_object_type to search for |
155 | * start_node - Handle in namespace where search begins | 155 | * start_node - Handle in namespace where search begins |
156 | * max_depth - Depth to which search is to reach | 156 | * max_depth - Depth to which search is to reach |
157 | * Flags - Whether to unlock the NS before invoking | 157 | * flags - Whether to unlock the NS before invoking |
158 | * the callback routine | 158 | * the callback routine |
159 | * pre_order_visit - Called during tree pre-order visit | 159 | * pre_order_visit - Called during tree pre-order visit |
160 | * when an object of "Type" is found | 160 | * when an object of "Type" is found |
161 | * post_order_visit - Called during tree post-order visit | 161 | * post_order_visit - Called during tree post-order visit |
162 | * when an object of "Type" is found | 162 | * when an object of "Type" is found |
163 | * Context - Passed to user function(s) above | 163 | * context - Passed to user function(s) above |
164 | * return_value - from the user_function if terminated | 164 | * return_value - from the user_function if terminated |
165 | * early. Otherwise, returns NULL. | 165 | * early. Otherwise, returns NULL. |
166 | * RETURNS: Status | 166 | * RETURNS: Status |
diff --git a/drivers/acpi/acpica/nsxfeval.c b/drivers/acpi/acpica/nsxfeval.c index 71d15f61807b..9692e6702333 100644 --- a/drivers/acpi/acpica/nsxfeval.c +++ b/drivers/acpi/acpica/nsxfeval.c | |||
@@ -58,8 +58,8 @@ static void acpi_ns_resolve_references(struct acpi_evaluate_info *info); | |||
58 | * | 58 | * |
59 | * FUNCTION: acpi_evaluate_object_typed | 59 | * FUNCTION: acpi_evaluate_object_typed |
60 | * | 60 | * |
61 | * PARAMETERS: Handle - Object handle (optional) | 61 | * PARAMETERS: handle - Object handle (optional) |
62 | * Pathname - Object pathname (optional) | 62 | * pathname - Object pathname (optional) |
63 | * external_params - List of parameters to pass to method, | 63 | * external_params - List of parameters to pass to method, |
64 | * terminated by NULL. May be NULL | 64 | * terminated by NULL. May be NULL |
65 | * if no parameters are being passed. | 65 | * if no parameters are being passed. |
@@ -152,8 +152,8 @@ ACPI_EXPORT_SYMBOL(acpi_evaluate_object_typed) | |||
152 | * | 152 | * |
153 | * FUNCTION: acpi_evaluate_object | 153 | * FUNCTION: acpi_evaluate_object |
154 | * | 154 | * |
155 | * PARAMETERS: Handle - Object handle (optional) | 155 | * PARAMETERS: handle - Object handle (optional) |
156 | * Pathname - Object pathname (optional) | 156 | * pathname - Object pathname (optional) |
157 | * external_params - List of parameters to pass to method, | 157 | * external_params - List of parameters to pass to method, |
158 | * terminated by NULL. May be NULL | 158 | * terminated by NULL. May be NULL |
159 | * if no parameters are being passed. | 159 | * if no parameters are being passed. |
@@ -364,7 +364,7 @@ ACPI_EXPORT_SYMBOL(acpi_evaluate_object) | |||
364 | * | 364 | * |
365 | * FUNCTION: acpi_ns_resolve_references | 365 | * FUNCTION: acpi_ns_resolve_references |
366 | * | 366 | * |
367 | * PARAMETERS: Info - Evaluation info block | 367 | * PARAMETERS: info - Evaluation info block |
368 | * | 368 | * |
369 | * RETURN: Info->return_object is replaced with the dereferenced object | 369 | * RETURN: Info->return_object is replaced with the dereferenced object |
370 | * | 370 | * |
@@ -431,14 +431,14 @@ static void acpi_ns_resolve_references(struct acpi_evaluate_info *info) | |||
431 | * | 431 | * |
432 | * FUNCTION: acpi_walk_namespace | 432 | * FUNCTION: acpi_walk_namespace |
433 | * | 433 | * |
434 | * PARAMETERS: Type - acpi_object_type to search for | 434 | * PARAMETERS: type - acpi_object_type to search for |
435 | * start_object - Handle in namespace where search begins | 435 | * start_object - Handle in namespace where search begins |
436 | * max_depth - Depth to which search is to reach | 436 | * max_depth - Depth to which search is to reach |
437 | * pre_order_visit - Called during tree pre-order visit | 437 | * pre_order_visit - Called during tree pre-order visit |
438 | * when an object of "Type" is found | 438 | * when an object of "Type" is found |
439 | * post_order_visit - Called during tree post-order visit | 439 | * post_order_visit - Called during tree post-order visit |
440 | * when an object of "Type" is found | 440 | * when an object of "Type" is found |
441 | * Context - Passed to user function(s) above | 441 | * context - Passed to user function(s) above |
442 | * return_value - Location where return value of | 442 | * return_value - Location where return value of |
443 | * user_function is put if terminated early | 443 | * user_function is put if terminated early |
444 | * | 444 | * |
@@ -646,7 +646,7 @@ acpi_ns_get_device_callback(acpi_handle obj_handle, | |||
646 | * | 646 | * |
647 | * PARAMETERS: HID - HID to search for. Can be NULL. | 647 | * PARAMETERS: HID - HID to search for. Can be NULL. |
648 | * user_function - Called when a matching object is found | 648 | * user_function - Called when a matching object is found |
649 | * Context - Passed to user function | 649 | * context - Passed to user function |
650 | * return_value - Location where return value of | 650 | * return_value - Location where return value of |
651 | * user_function is put if terminated early | 651 | * user_function is put if terminated early |
652 | * | 652 | * |
@@ -716,8 +716,8 @@ ACPI_EXPORT_SYMBOL(acpi_get_devices) | |||
716 | * FUNCTION: acpi_attach_data | 716 | * FUNCTION: acpi_attach_data |
717 | * | 717 | * |
718 | * PARAMETERS: obj_handle - Namespace node | 718 | * PARAMETERS: obj_handle - Namespace node |
719 | * Handler - Handler for this attachment | 719 | * handler - Handler for this attachment |
720 | * Data - Pointer to data to be attached | 720 | * data - Pointer to data to be attached |
721 | * | 721 | * |
722 | * RETURN: Status | 722 | * RETURN: Status |
723 | * | 723 | * |
@@ -764,7 +764,7 @@ ACPI_EXPORT_SYMBOL(acpi_attach_data) | |||
764 | * FUNCTION: acpi_detach_data | 764 | * FUNCTION: acpi_detach_data |
765 | * | 765 | * |
766 | * PARAMETERS: obj_handle - Namespace node handle | 766 | * PARAMETERS: obj_handle - Namespace node handle |
767 | * Handler - Handler used in call to acpi_attach_data | 767 | * handler - Handler used in call to acpi_attach_data |
768 | * | 768 | * |
769 | * RETURN: Status | 769 | * RETURN: Status |
770 | * | 770 | * |
@@ -810,8 +810,8 @@ ACPI_EXPORT_SYMBOL(acpi_detach_data) | |||
810 | * FUNCTION: acpi_get_data | 810 | * FUNCTION: acpi_get_data |
811 | * | 811 | * |
812 | * PARAMETERS: obj_handle - Namespace node | 812 | * PARAMETERS: obj_handle - Namespace node |
813 | * Handler - Handler used in call to attach_data | 813 | * handler - Handler used in call to attach_data |
814 | * Data - Where the data is returned | 814 | * data - Where the data is returned |
815 | * | 815 | * |
816 | * RETURN: Status | 816 | * RETURN: Status |
817 | * | 817 | * |
diff --git a/drivers/acpi/acpica/nsxfname.c b/drivers/acpi/acpica/nsxfname.c index af401c9c4dfc..08e9610b34ca 100644 --- a/drivers/acpi/acpica/nsxfname.c +++ b/drivers/acpi/acpica/nsxfname.c | |||
@@ -61,8 +61,8 @@ static char *acpi_ns_copy_device_id(struct acpica_device_id *dest, | |||
61 | * | 61 | * |
62 | * FUNCTION: acpi_get_handle | 62 | * FUNCTION: acpi_get_handle |
63 | * | 63 | * |
64 | * PARAMETERS: Parent - Object to search under (search scope). | 64 | * PARAMETERS: parent - Object to search under (search scope). |
65 | * Pathname - Pointer to an asciiz string containing the | 65 | * pathname - Pointer to an asciiz string containing the |
66 | * name | 66 | * name |
67 | * ret_handle - Where the return handle is returned | 67 | * ret_handle - Where the return handle is returned |
68 | * | 68 | * |
@@ -142,9 +142,9 @@ ACPI_EXPORT_SYMBOL(acpi_get_handle) | |||
142 | * | 142 | * |
143 | * FUNCTION: acpi_get_name | 143 | * FUNCTION: acpi_get_name |
144 | * | 144 | * |
145 | * PARAMETERS: Handle - Handle to be converted to a pathname | 145 | * PARAMETERS: handle - Handle to be converted to a pathname |
146 | * name_type - Full pathname or single segment | 146 | * name_type - Full pathname or single segment |
147 | * Buffer - Buffer for returned path | 147 | * buffer - Buffer for returned path |
148 | * | 148 | * |
149 | * RETURN: Pointer to a string containing the fully qualified Name. | 149 | * RETURN: Pointer to a string containing the fully qualified Name. |
150 | * | 150 | * |
@@ -219,8 +219,8 @@ ACPI_EXPORT_SYMBOL(acpi_get_name) | |||
219 | * | 219 | * |
220 | * FUNCTION: acpi_ns_copy_device_id | 220 | * FUNCTION: acpi_ns_copy_device_id |
221 | * | 221 | * |
222 | * PARAMETERS: Dest - Pointer to the destination DEVICE_ID | 222 | * PARAMETERS: dest - Pointer to the destination DEVICE_ID |
223 | * Source - Pointer to the source DEVICE_ID | 223 | * source - Pointer to the source DEVICE_ID |
224 | * string_area - Pointer to where to copy the dest string | 224 | * string_area - Pointer to where to copy the dest string |
225 | * | 225 | * |
226 | * RETURN: Pointer to the next string area | 226 | * RETURN: Pointer to the next string area |
@@ -247,7 +247,7 @@ static char *acpi_ns_copy_device_id(struct acpica_device_id *dest, | |||
247 | * | 247 | * |
248 | * FUNCTION: acpi_get_object_info | 248 | * FUNCTION: acpi_get_object_info |
249 | * | 249 | * |
250 | * PARAMETERS: Handle - Object Handle | 250 | * PARAMETERS: handle - Object Handle |
251 | * return_buffer - Where the info is returned | 251 | * return_buffer - Where the info is returned |
252 | * | 252 | * |
253 | * RETURN: Status | 253 | * RETURN: Status |
@@ -493,7 +493,7 @@ ACPI_EXPORT_SYMBOL(acpi_get_object_info) | |||
493 | * | 493 | * |
494 | * FUNCTION: acpi_install_method | 494 | * FUNCTION: acpi_install_method |
495 | * | 495 | * |
496 | * PARAMETERS: Buffer - An ACPI table containing one control method | 496 | * PARAMETERS: buffer - An ACPI table containing one control method |
497 | * | 497 | * |
498 | * RETURN: Status | 498 | * RETURN: Status |
499 | * | 499 | * |
diff --git a/drivers/acpi/acpica/nsxfobj.c b/drivers/acpi/acpica/nsxfobj.c index 880a605cee20..6766fc4f088f 100644 --- a/drivers/acpi/acpica/nsxfobj.c +++ b/drivers/acpi/acpica/nsxfobj.c | |||
@@ -98,7 +98,7 @@ ACPI_EXPORT_SYMBOL(acpi_get_id) | |||
98 | * | 98 | * |
99 | * FUNCTION: acpi_get_type | 99 | * FUNCTION: acpi_get_type |
100 | * | 100 | * |
101 | * PARAMETERS: Handle - Handle of object whose type is desired | 101 | * PARAMETERS: handle - Handle of object whose type is desired |
102 | * ret_type - Where the type will be placed | 102 | * ret_type - Where the type will be placed |
103 | * | 103 | * |
104 | * RETURN: Status | 104 | * RETURN: Status |
@@ -151,7 +151,7 @@ ACPI_EXPORT_SYMBOL(acpi_get_type) | |||
151 | * | 151 | * |
152 | * FUNCTION: acpi_get_parent | 152 | * FUNCTION: acpi_get_parent |
153 | * | 153 | * |
154 | * PARAMETERS: Handle - Handle of object whose parent is desired | 154 | * PARAMETERS: handle - Handle of object whose parent is desired |
155 | * ret_handle - Where the parent handle will be placed | 155 | * ret_handle - Where the parent handle will be placed |
156 | * | 156 | * |
157 | * RETURN: Status | 157 | * RETURN: Status |
@@ -212,8 +212,8 @@ ACPI_EXPORT_SYMBOL(acpi_get_parent) | |||
212 | * | 212 | * |
213 | * FUNCTION: acpi_get_next_object | 213 | * FUNCTION: acpi_get_next_object |
214 | * | 214 | * |
215 | * PARAMETERS: Type - Type of object to be searched for | 215 | * PARAMETERS: type - Type of object to be searched for |
216 | * Parent - Parent object whose children we are getting | 216 | * parent - Parent object whose children we are getting |
217 | * last_child - Previous child that was found. | 217 | * last_child - Previous child that was found. |
218 | * The NEXT child will be returned | 218 | * The NEXT child will be returned |
219 | * ret_handle - Where handle to the next object is placed | 219 | * ret_handle - Where handle to the next object is placed |
diff --git a/drivers/acpi/acpica/psargs.c b/drivers/acpi/acpica/psargs.c index 5ac36aba507c..844464c4f901 100644 --- a/drivers/acpi/acpica/psargs.c +++ b/drivers/acpi/acpica/psargs.c | |||
@@ -210,7 +210,7 @@ char *acpi_ps_get_next_namestring(struct acpi_parse_state *parser_state) | |||
210 | * FUNCTION: acpi_ps_get_next_namepath | 210 | * FUNCTION: acpi_ps_get_next_namepath |
211 | * | 211 | * |
212 | * PARAMETERS: parser_state - Current parser state object | 212 | * PARAMETERS: parser_state - Current parser state object |
213 | * Arg - Where the namepath will be stored | 213 | * arg - Where the namepath will be stored |
214 | * arg_count - If the namepath points to a control method | 214 | * arg_count - If the namepath points to a control method |
215 | * the method's argument is returned here. | 215 | * the method's argument is returned here. |
216 | * possible_method_call - Whether the namepath can possibly be the | 216 | * possible_method_call - Whether the namepath can possibly be the |
@@ -379,7 +379,7 @@ acpi_ps_get_next_namepath(struct acpi_walk_state *walk_state, | |||
379 | * | 379 | * |
380 | * PARAMETERS: parser_state - Current parser state object | 380 | * PARAMETERS: parser_state - Current parser state object |
381 | * arg_type - The argument type (AML_*_ARG) | 381 | * arg_type - The argument type (AML_*_ARG) |
382 | * Arg - Where the argument is returned | 382 | * arg - Where the argument is returned |
383 | * | 383 | * |
384 | * RETURN: None | 384 | * RETURN: None |
385 | * | 385 | * |
@@ -618,6 +618,7 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state | |||
618 | 618 | ||
619 | arg = acpi_ps_alloc_op(AML_INT_BYTELIST_OP); | 619 | arg = acpi_ps_alloc_op(AML_INT_BYTELIST_OP); |
620 | if (!arg) { | 620 | if (!arg) { |
621 | acpi_ps_free_op(field); | ||
621 | return_PTR(NULL); | 622 | return_PTR(NULL); |
622 | } | 623 | } |
623 | 624 | ||
@@ -662,6 +663,7 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state | |||
662 | } else { | 663 | } else { |
663 | arg = acpi_ps_alloc_op(AML_INT_NAMEPATH_OP); | 664 | arg = acpi_ps_alloc_op(AML_INT_NAMEPATH_OP); |
664 | if (!arg) { | 665 | if (!arg) { |
666 | acpi_ps_free_op(field); | ||
665 | return_PTR(NULL); | 667 | return_PTR(NULL); |
666 | } | 668 | } |
667 | 669 | ||
diff --git a/drivers/acpi/acpica/psloop.c b/drivers/acpi/acpica/psloop.c index 9547ad8a620b..799162c1b6df 100644 --- a/drivers/acpi/acpica/psloop.c +++ b/drivers/acpi/acpica/psloop.c | |||
@@ -167,7 +167,7 @@ static acpi_status acpi_ps_get_aml_opcode(struct acpi_walk_state *walk_state) | |||
167 | * PARAMETERS: walk_state - Current state | 167 | * PARAMETERS: walk_state - Current state |
168 | * aml_op_start - Begin of named Op in AML | 168 | * aml_op_start - Begin of named Op in AML |
169 | * unnamed_op - Early Op (not a named Op) | 169 | * unnamed_op - Early Op (not a named Op) |
170 | * Op - Returned Op | 170 | * op - Returned Op |
171 | * | 171 | * |
172 | * RETURN: Status | 172 | * RETURN: Status |
173 | * | 173 | * |
@@ -323,7 +323,7 @@ acpi_ps_create_op(struct acpi_walk_state *walk_state, | |||
323 | 323 | ||
324 | if (walk_state->op_info->flags & AML_CREATE) { | 324 | if (walk_state->op_info->flags & AML_CREATE) { |
325 | /* | 325 | /* |
326 | * Backup to beginning of create_xXXfield declaration | 326 | * Backup to beginning of create_XXXfield declaration |
327 | * body_length is unknown until we parse the body | 327 | * body_length is unknown until we parse the body |
328 | */ | 328 | */ |
329 | op->named.data = aml_op_start; | 329 | op->named.data = aml_op_start; |
@@ -380,7 +380,7 @@ acpi_ps_create_op(struct acpi_walk_state *walk_state, | |||
380 | * | 380 | * |
381 | * PARAMETERS: walk_state - Current state | 381 | * PARAMETERS: walk_state - Current state |
382 | * aml_op_start - Op start in AML | 382 | * aml_op_start - Op start in AML |
383 | * Op - Current Op | 383 | * op - Current Op |
384 | * | 384 | * |
385 | * RETURN: Status | 385 | * RETURN: Status |
386 | * | 386 | * |
@@ -679,8 +679,8 @@ acpi_ps_link_module_code(union acpi_parse_object *parent_op, | |||
679 | * FUNCTION: acpi_ps_complete_op | 679 | * FUNCTION: acpi_ps_complete_op |
680 | * | 680 | * |
681 | * PARAMETERS: walk_state - Current state | 681 | * PARAMETERS: walk_state - Current state |
682 | * Op - Returned Op | 682 | * op - Returned Op |
683 | * Status - Parse status before complete Op | 683 | * status - Parse status before complete Op |
684 | * | 684 | * |
685 | * RETURN: Status | 685 | * RETURN: Status |
686 | * | 686 | * |
@@ -853,8 +853,8 @@ acpi_ps_complete_op(struct acpi_walk_state *walk_state, | |||
853 | * FUNCTION: acpi_ps_complete_final_op | 853 | * FUNCTION: acpi_ps_complete_final_op |
854 | * | 854 | * |
855 | * PARAMETERS: walk_state - Current state | 855 | * PARAMETERS: walk_state - Current state |
856 | * Op - Current Op | 856 | * op - Current Op |
857 | * Status - Current parse status before complete last | 857 | * status - Current parse status before complete last |
858 | * Op | 858 | * Op |
859 | * | 859 | * |
860 | * RETURN: Status | 860 | * RETURN: Status |
@@ -1165,7 +1165,7 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state) | |||
1165 | 1165 | ||
1166 | if (walk_state->op_info->flags & AML_CREATE) { | 1166 | if (walk_state->op_info->flags & AML_CREATE) { |
1167 | /* | 1167 | /* |
1168 | * Backup to beginning of create_xXXfield declaration (1 for | 1168 | * Backup to beginning of create_XXXfield declaration (1 for |
1169 | * Opcode) | 1169 | * Opcode) |
1170 | * | 1170 | * |
1171 | * body_length is unknown until we parse the body | 1171 | * body_length is unknown until we parse the body |
diff --git a/drivers/acpi/acpica/psopcode.c b/drivers/acpi/acpica/psopcode.c index a0226fdcf75c..ed1d457bd5ca 100644 --- a/drivers/acpi/acpica/psopcode.c +++ b/drivers/acpi/acpica/psopcode.c | |||
@@ -724,7 +724,7 @@ static const u8 acpi_gbl_long_op_index[NUM_EXTENDED_OPCODE] = { | |||
724 | * | 724 | * |
725 | * FUNCTION: acpi_ps_get_opcode_info | 725 | * FUNCTION: acpi_ps_get_opcode_info |
726 | * | 726 | * |
727 | * PARAMETERS: Opcode - The AML opcode | 727 | * PARAMETERS: opcode - The AML opcode |
728 | * | 728 | * |
729 | * RETURN: A pointer to the info about the opcode. | 729 | * RETURN: A pointer to the info about the opcode. |
730 | * | 730 | * |
@@ -769,7 +769,7 @@ const struct acpi_opcode_info *acpi_ps_get_opcode_info(u16 opcode) | |||
769 | * | 769 | * |
770 | * FUNCTION: acpi_ps_get_opcode_name | 770 | * FUNCTION: acpi_ps_get_opcode_name |
771 | * | 771 | * |
772 | * PARAMETERS: Opcode - The AML opcode | 772 | * PARAMETERS: opcode - The AML opcode |
773 | * | 773 | * |
774 | * RETURN: A pointer to the name of the opcode (ASCII String) | 774 | * RETURN: A pointer to the name of the opcode (ASCII String) |
775 | * Note: Never returns NULL. | 775 | * Note: Never returns NULL. |
diff --git a/drivers/acpi/acpica/psparse.c b/drivers/acpi/acpica/psparse.c index 2ff9c35a1968..01985703bb98 100644 --- a/drivers/acpi/acpica/psparse.c +++ b/drivers/acpi/acpica/psparse.c | |||
@@ -64,7 +64,7 @@ ACPI_MODULE_NAME("psparse") | |||
64 | * | 64 | * |
65 | * FUNCTION: acpi_ps_get_opcode_size | 65 | * FUNCTION: acpi_ps_get_opcode_size |
66 | * | 66 | * |
67 | * PARAMETERS: Opcode - An AML opcode | 67 | * PARAMETERS: opcode - An AML opcode |
68 | * | 68 | * |
69 | * RETURN: Size of the opcode, in bytes (1 or 2) | 69 | * RETURN: Size of the opcode, in bytes (1 or 2) |
70 | * | 70 | * |
@@ -121,7 +121,7 @@ u16 acpi_ps_peek_opcode(struct acpi_parse_state * parser_state) | |||
121 | * FUNCTION: acpi_ps_complete_this_op | 121 | * FUNCTION: acpi_ps_complete_this_op |
122 | * | 122 | * |
123 | * PARAMETERS: walk_state - Current State | 123 | * PARAMETERS: walk_state - Current State |
124 | * Op - Op to complete | 124 | * op - Op to complete |
125 | * | 125 | * |
126 | * RETURN: Status | 126 | * RETURN: Status |
127 | * | 127 | * |
@@ -311,7 +311,7 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state, | |||
311 | * FUNCTION: acpi_ps_next_parse_state | 311 | * FUNCTION: acpi_ps_next_parse_state |
312 | * | 312 | * |
313 | * PARAMETERS: walk_state - Current state | 313 | * PARAMETERS: walk_state - Current state |
314 | * Op - Current parse op | 314 | * op - Current parse op |
315 | * callback_status - Status from previous operation | 315 | * callback_status - Status from previous operation |
316 | * | 316 | * |
317 | * RETURN: Status | 317 | * RETURN: Status |
diff --git a/drivers/acpi/acpica/psscope.c b/drivers/acpi/acpica/psscope.c index c872aa4b926e..608dc20dc173 100644 --- a/drivers/acpi/acpica/psscope.c +++ b/drivers/acpi/acpica/psscope.c | |||
@@ -93,7 +93,7 @@ u8 acpi_ps_has_completed_scope(struct acpi_parse_state * parser_state) | |||
93 | * FUNCTION: acpi_ps_init_scope | 93 | * FUNCTION: acpi_ps_init_scope |
94 | * | 94 | * |
95 | * PARAMETERS: parser_state - Current parser state object | 95 | * PARAMETERS: parser_state - Current parser state object |
96 | * Root - the Root Node of this new scope | 96 | * root - the Root Node of this new scope |
97 | * | 97 | * |
98 | * RETURN: Status | 98 | * RETURN: Status |
99 | * | 99 | * |
@@ -131,7 +131,7 @@ acpi_ps_init_scope(struct acpi_parse_state * parser_state, | |||
131 | * FUNCTION: acpi_ps_push_scope | 131 | * FUNCTION: acpi_ps_push_scope |
132 | * | 132 | * |
133 | * PARAMETERS: parser_state - Current parser state object | 133 | * PARAMETERS: parser_state - Current parser state object |
134 | * Op - Current op to be pushed | 134 | * op - Current op to be pushed |
135 | * remaining_args - List of args remaining | 135 | * remaining_args - List of args remaining |
136 | * arg_count - Fixed or variable number of args | 136 | * arg_count - Fixed or variable number of args |
137 | * | 137 | * |
@@ -184,7 +184,7 @@ acpi_ps_push_scope(struct acpi_parse_state *parser_state, | |||
184 | * FUNCTION: acpi_ps_pop_scope | 184 | * FUNCTION: acpi_ps_pop_scope |
185 | * | 185 | * |
186 | * PARAMETERS: parser_state - Current parser state object | 186 | * PARAMETERS: parser_state - Current parser state object |
187 | * Op - Where the popped op is returned | 187 | * op - Where the popped op is returned |
188 | * arg_list - Where the popped "next argument" is | 188 | * arg_list - Where the popped "next argument" is |
189 | * returned | 189 | * returned |
190 | * arg_count - Count of objects in arg_list | 190 | * arg_count - Count of objects in arg_list |
diff --git a/drivers/acpi/acpica/pstree.c b/drivers/acpi/acpica/pstree.c index 2b03cdbbe1c0..fdb2e71f3046 100644 --- a/drivers/acpi/acpica/pstree.c +++ b/drivers/acpi/acpica/pstree.c | |||
@@ -58,8 +58,8 @@ union acpi_parse_object *acpi_ps_get_child(union acpi_parse_object *op); | |||
58 | * | 58 | * |
59 | * FUNCTION: acpi_ps_get_arg | 59 | * FUNCTION: acpi_ps_get_arg |
60 | * | 60 | * |
61 | * PARAMETERS: Op - Get an argument for this op | 61 | * PARAMETERS: op - Get an argument for this op |
62 | * Argn - Nth argument to get | 62 | * argn - Nth argument to get |
63 | * | 63 | * |
64 | * RETURN: The argument (as an Op object). NULL if argument does not exist | 64 | * RETURN: The argument (as an Op object). NULL if argument does not exist |
65 | * | 65 | * |
@@ -114,8 +114,8 @@ union acpi_parse_object *acpi_ps_get_arg(union acpi_parse_object *op, u32 argn) | |||
114 | * | 114 | * |
115 | * FUNCTION: acpi_ps_append_arg | 115 | * FUNCTION: acpi_ps_append_arg |
116 | * | 116 | * |
117 | * PARAMETERS: Op - Append an argument to this Op. | 117 | * PARAMETERS: op - Append an argument to this Op. |
118 | * Arg - Argument Op to append | 118 | * arg - Argument Op to append |
119 | * | 119 | * |
120 | * RETURN: None. | 120 | * RETURN: None. |
121 | * | 121 | * |
@@ -188,8 +188,8 @@ acpi_ps_append_arg(union acpi_parse_object *op, union acpi_parse_object *arg) | |||
188 | * | 188 | * |
189 | * FUNCTION: acpi_ps_get_depth_next | 189 | * FUNCTION: acpi_ps_get_depth_next |
190 | * | 190 | * |
191 | * PARAMETERS: Origin - Root of subtree to search | 191 | * PARAMETERS: origin - Root of subtree to search |
192 | * Op - Last (previous) Op that was found | 192 | * op - Last (previous) Op that was found |
193 | * | 193 | * |
194 | * RETURN: Next Op found in the search. | 194 | * RETURN: Next Op found in the search. |
195 | * | 195 | * |
@@ -261,7 +261,7 @@ union acpi_parse_object *acpi_ps_get_depth_next(union acpi_parse_object *origin, | |||
261 | * | 261 | * |
262 | * FUNCTION: acpi_ps_get_child | 262 | * FUNCTION: acpi_ps_get_child |
263 | * | 263 | * |
264 | * PARAMETERS: Op - Get the child of this Op | 264 | * PARAMETERS: op - Get the child of this Op |
265 | * | 265 | * |
266 | * RETURN: Child Op, Null if none is found. | 266 | * RETURN: Child Op, Null if none is found. |
267 | * | 267 | * |
diff --git a/drivers/acpi/acpica/psutils.c b/drivers/acpi/acpica/psutils.c index 13bb131ae125..8736ad5f04d3 100644 --- a/drivers/acpi/acpica/psutils.c +++ b/drivers/acpi/acpica/psutils.c | |||
@@ -77,8 +77,8 @@ union acpi_parse_object *acpi_ps_create_scope_op(void) | |||
77 | * | 77 | * |
78 | * FUNCTION: acpi_ps_init_op | 78 | * FUNCTION: acpi_ps_init_op |
79 | * | 79 | * |
80 | * PARAMETERS: Op - A newly allocated Op object | 80 | * PARAMETERS: op - A newly allocated Op object |
81 | * Opcode - Opcode to store in the Op | 81 | * opcode - Opcode to store in the Op |
82 | * | 82 | * |
83 | * RETURN: None | 83 | * RETURN: None |
84 | * | 84 | * |
@@ -103,7 +103,7 @@ void acpi_ps_init_op(union acpi_parse_object *op, u16 opcode) | |||
103 | * | 103 | * |
104 | * FUNCTION: acpi_ps_alloc_op | 104 | * FUNCTION: acpi_ps_alloc_op |
105 | * | 105 | * |
106 | * PARAMETERS: Opcode - Opcode that will be stored in the new Op | 106 | * PARAMETERS: opcode - Opcode that will be stored in the new Op |
107 | * | 107 | * |
108 | * RETURN: Pointer to the new Op, null on failure | 108 | * RETURN: Pointer to the new Op, null on failure |
109 | * | 109 | * |
@@ -160,7 +160,7 @@ union acpi_parse_object *acpi_ps_alloc_op(u16 opcode) | |||
160 | * | 160 | * |
161 | * FUNCTION: acpi_ps_free_op | 161 | * FUNCTION: acpi_ps_free_op |
162 | * | 162 | * |
163 | * PARAMETERS: Op - Op to be freed | 163 | * PARAMETERS: op - Op to be freed |
164 | * | 164 | * |
165 | * RETURN: None. | 165 | * RETURN: None. |
166 | * | 166 | * |
diff --git a/drivers/acpi/acpica/psxface.c b/drivers/acpi/acpica/psxface.c index 9d98c5ff66a5..963e16225797 100644 --- a/drivers/acpi/acpica/psxface.c +++ b/drivers/acpi/acpica/psxface.c | |||
@@ -66,7 +66,7 @@ acpi_ps_update_parameter_list(struct acpi_evaluate_info *info, u16 action); | |||
66 | * PARAMETERS: method_name - Valid ACPI name string | 66 | * PARAMETERS: method_name - Valid ACPI name string |
67 | * debug_level - Optional level mask. 0 to use default | 67 | * debug_level - Optional level mask. 0 to use default |
68 | * debug_layer - Optional layer mask. 0 to use default | 68 | * debug_layer - Optional layer mask. 0 to use default |
69 | * Flags - bit 1: one shot(1) or persistent(0) | 69 | * flags - bit 1: one shot(1) or persistent(0) |
70 | * | 70 | * |
71 | * RETURN: Status | 71 | * RETURN: Status |
72 | * | 72 | * |
@@ -105,7 +105,7 @@ acpi_debug_trace(char *name, u32 debug_level, u32 debug_layer, u32 flags) | |||
105 | * | 105 | * |
106 | * FUNCTION: acpi_ps_start_trace | 106 | * FUNCTION: acpi_ps_start_trace |
107 | * | 107 | * |
108 | * PARAMETERS: Info - Method info struct | 108 | * PARAMETERS: info - Method info struct |
109 | * | 109 | * |
110 | * RETURN: None | 110 | * RETURN: None |
111 | * | 111 | * |
@@ -150,7 +150,7 @@ static void acpi_ps_start_trace(struct acpi_evaluate_info *info) | |||
150 | * | 150 | * |
151 | * FUNCTION: acpi_ps_stop_trace | 151 | * FUNCTION: acpi_ps_stop_trace |
152 | * | 152 | * |
153 | * PARAMETERS: Info - Method info struct | 153 | * PARAMETERS: info - Method info struct |
154 | * | 154 | * |
155 | * RETURN: None | 155 | * RETURN: None |
156 | * | 156 | * |
@@ -193,10 +193,10 @@ static void acpi_ps_stop_trace(struct acpi_evaluate_info *info) | |||
193 | * | 193 | * |
194 | * FUNCTION: acpi_ps_execute_method | 194 | * FUNCTION: acpi_ps_execute_method |
195 | * | 195 | * |
196 | * PARAMETERS: Info - Method info block, contains: | 196 | * PARAMETERS: info - Method info block, contains: |
197 | * Node - Method Node to execute | 197 | * node - Method Node to execute |
198 | * obj_desc - Method object | 198 | * obj_desc - Method object |
199 | * Parameters - List of parameters to pass to the method, | 199 | * parameters - List of parameters to pass to the method, |
200 | * terminated by NULL. Params itself may be | 200 | * terminated by NULL. Params itself may be |
201 | * NULL if no parameters are being passed. | 201 | * NULL if no parameters are being passed. |
202 | * return_object - Where to put method's return value (if | 202 | * return_object - Where to put method's return value (if |
@@ -361,9 +361,9 @@ acpi_status acpi_ps_execute_method(struct acpi_evaluate_info *info) | |||
361 | * | 361 | * |
362 | * FUNCTION: acpi_ps_update_parameter_list | 362 | * FUNCTION: acpi_ps_update_parameter_list |
363 | * | 363 | * |
364 | * PARAMETERS: Info - See struct acpi_evaluate_info | 364 | * PARAMETERS: info - See struct acpi_evaluate_info |
365 | * (Used: parameter_type and Parameters) | 365 | * (Used: parameter_type and Parameters) |
366 | * Action - Add or Remove reference | 366 | * action - Add or Remove reference |
367 | * | 367 | * |
368 | * RETURN: Status | 368 | * RETURN: Status |
369 | * | 369 | * |
diff --git a/drivers/acpi/acpica/rsaddr.c b/drivers/acpi/acpica/rsaddr.c index a0305652394f..856ff075b6ab 100644 --- a/drivers/acpi/acpica/rsaddr.c +++ b/drivers/acpi/acpica/rsaddr.c | |||
@@ -182,8 +182,8 @@ struct acpi_rsconvert_info acpi_rs_convert_ext_address64[5] = { | |||
182 | 182 | ||
183 | /* Revision ID */ | 183 | /* Revision ID */ |
184 | 184 | ||
185 | {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.ext_address64.revision_iD), | 185 | {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.ext_address64.revision_ID), |
186 | AML_OFFSET(ext_address64.revision_iD), | 186 | AML_OFFSET(ext_address64.revision_ID), |
187 | 1}, | 187 | 1}, |
188 | /* | 188 | /* |
189 | * These fields are contiguous in both the source and destination: | 189 | * These fields are contiguous in both the source and destination: |
@@ -215,7 +215,7 @@ static struct acpi_rsconvert_info acpi_rs_convert_general_flags[6] = { | |||
215 | AML_OFFSET(address.resource_type), | 215 | AML_OFFSET(address.resource_type), |
216 | 1}, | 216 | 1}, |
217 | 217 | ||
218 | /* General Flags - Consume, Decode, min_fixed, max_fixed */ | 218 | /* General flags - Consume, Decode, min_fixed, max_fixed */ |
219 | 219 | ||
220 | {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.address.producer_consumer), | 220 | {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.address.producer_consumer), |
221 | AML_OFFSET(address.flags), | 221 | AML_OFFSET(address.flags), |
@@ -293,8 +293,8 @@ static struct acpi_rsconvert_info acpi_rs_convert_io_flags[4] = { | |||
293 | * | 293 | * |
294 | * FUNCTION: acpi_rs_get_address_common | 294 | * FUNCTION: acpi_rs_get_address_common |
295 | * | 295 | * |
296 | * PARAMETERS: Resource - Pointer to the internal resource struct | 296 | * PARAMETERS: resource - Pointer to the internal resource struct |
297 | * Aml - Pointer to the AML resource descriptor | 297 | * aml - Pointer to the AML resource descriptor |
298 | * | 298 | * |
299 | * RETURN: TRUE if the resource_type field is OK, FALSE otherwise | 299 | * RETURN: TRUE if the resource_type field is OK, FALSE otherwise |
300 | * | 300 | * |
@@ -343,8 +343,8 @@ acpi_rs_get_address_common(struct acpi_resource *resource, | |||
343 | * | 343 | * |
344 | * FUNCTION: acpi_rs_set_address_common | 344 | * FUNCTION: acpi_rs_set_address_common |
345 | * | 345 | * |
346 | * PARAMETERS: Aml - Pointer to the AML resource descriptor | 346 | * PARAMETERS: aml - Pointer to the AML resource descriptor |
347 | * Resource - Pointer to the internal resource struct | 347 | * resource - Pointer to the internal resource struct |
348 | * | 348 | * |
349 | * RETURN: None | 349 | * RETURN: None |
350 | * | 350 | * |
diff --git a/drivers/acpi/acpica/rscalc.c b/drivers/acpi/acpica/rscalc.c index 3c6df4b7eb2d..de12469d1c9c 100644 --- a/drivers/acpi/acpica/rscalc.c +++ b/drivers/acpi/acpica/rscalc.c | |||
@@ -173,7 +173,7 @@ acpi_rs_stream_option_length(u32 resource_length, | |||
173 | * | 173 | * |
174 | * FUNCTION: acpi_rs_get_aml_length | 174 | * FUNCTION: acpi_rs_get_aml_length |
175 | * | 175 | * |
176 | * PARAMETERS: Resource - Pointer to the resource linked list | 176 | * PARAMETERS: resource - Pointer to the resource linked list |
177 | * size_needed - Where the required size is returned | 177 | * size_needed - Where the required size is returned |
178 | * | 178 | * |
179 | * RETURN: Status | 179 | * RETURN: Status |
diff --git a/drivers/acpi/acpica/rscreate.c b/drivers/acpi/acpica/rscreate.c index 46d6eb38ae66..311cbc4f05fa 100644 --- a/drivers/acpi/acpica/rscreate.c +++ b/drivers/acpi/acpica/rscreate.c | |||
@@ -190,8 +190,8 @@ acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer, | |||
190 | * | 190 | * |
191 | * FUNCTION: acpi_rs_create_pci_routing_table | 191 | * FUNCTION: acpi_rs_create_pci_routing_table |
192 | * | 192 | * |
193 | * PARAMETERS: package_object - Pointer to a union acpi_operand_object | 193 | * PARAMETERS: package_object - Pointer to a package containing one |
194 | * package | 194 | * of more ACPI_OPERAND_OBJECTs |
195 | * output_buffer - Pointer to the user's buffer | 195 | * output_buffer - Pointer to the user's buffer |
196 | * | 196 | * |
197 | * RETURN: Status AE_OK if okay, else a valid acpi_status code. | 197 | * RETURN: Status AE_OK if okay, else a valid acpi_status code. |
@@ -199,7 +199,7 @@ acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer, | |||
199 | * AE_BUFFER_OVERFLOW and output_buffer->Length will point | 199 | * AE_BUFFER_OVERFLOW and output_buffer->Length will point |
200 | * to the size buffer needed. | 200 | * to the size buffer needed. |
201 | * | 201 | * |
202 | * DESCRIPTION: Takes the union acpi_operand_object package and creates a | 202 | * DESCRIPTION: Takes the union acpi_operand_object package and creates a |
203 | * linked list of PCI interrupt descriptions | 203 | * linked list of PCI interrupt descriptions |
204 | * | 204 | * |
205 | * NOTE: It is the caller's responsibility to ensure that the start of the | 205 | * NOTE: It is the caller's responsibility to ensure that the start of the |
diff --git a/drivers/acpi/acpica/rsdump.c b/drivers/acpi/acpica/rsdump.c index b4c581132393..4d11b072388c 100644 --- a/drivers/acpi/acpica/rsdump.c +++ b/drivers/acpi/acpica/rsdump.c | |||
@@ -703,7 +703,7 @@ acpi_rs_dump_resource_source(struct acpi_resource_source *resource_source) | |||
703 | * | 703 | * |
704 | * FUNCTION: acpi_rs_dump_address_common | 704 | * FUNCTION: acpi_rs_dump_address_common |
705 | * | 705 | * |
706 | * PARAMETERS: Resource - Pointer to an internal resource descriptor | 706 | * PARAMETERS: resource - Pointer to an internal resource descriptor |
707 | * | 707 | * |
708 | * RETURN: None | 708 | * RETURN: None |
709 | * | 709 | * |
@@ -850,8 +850,8 @@ void acpi_rs_dump_irq_list(u8 * route_table) | |||
850 | * | 850 | * |
851 | * FUNCTION: acpi_rs_out* | 851 | * FUNCTION: acpi_rs_out* |
852 | * | 852 | * |
853 | * PARAMETERS: Title - Name of the resource field | 853 | * PARAMETERS: title - Name of the resource field |
854 | * Value - Value of the resource field | 854 | * value - Value of the resource field |
855 | * | 855 | * |
856 | * RETURN: None | 856 | * RETURN: None |
857 | * | 857 | * |
@@ -898,8 +898,8 @@ static void acpi_rs_out_title(char *title) | |||
898 | * | 898 | * |
899 | * FUNCTION: acpi_rs_dump*List | 899 | * FUNCTION: acpi_rs_dump*List |
900 | * | 900 | * |
901 | * PARAMETERS: Length - Number of elements in the list | 901 | * PARAMETERS: length - Number of elements in the list |
902 | * Data - Start of the list | 902 | * data - Start of the list |
903 | * | 903 | * |
904 | * RETURN: None | 904 | * RETURN: None |
905 | * | 905 | * |
diff --git a/drivers/acpi/acpica/rslist.c b/drivers/acpi/acpica/rslist.c index 9be129f5d6f4..46b5324b22d6 100644 --- a/drivers/acpi/acpica/rslist.c +++ b/drivers/acpi/acpica/rslist.c | |||
@@ -139,7 +139,7 @@ acpi_rs_convert_aml_to_resources(u8 * aml, | |||
139 | * | 139 | * |
140 | * FUNCTION: acpi_rs_convert_resources_to_aml | 140 | * FUNCTION: acpi_rs_convert_resources_to_aml |
141 | * | 141 | * |
142 | * PARAMETERS: Resource - Pointer to the resource linked list | 142 | * PARAMETERS: resource - Pointer to the resource linked list |
143 | * aml_size_needed - Calculated size of the byte stream | 143 | * aml_size_needed - Calculated size of the byte stream |
144 | * needed from calling acpi_rs_get_aml_length() | 144 | * needed from calling acpi_rs_get_aml_length() |
145 | * The size of the output_buffer is | 145 | * The size of the output_buffer is |
diff --git a/drivers/acpi/acpica/rsmisc.c b/drivers/acpi/acpica/rsmisc.c index 8073b371cc7c..c6f291c2bc83 100644 --- a/drivers/acpi/acpica/rsmisc.c +++ b/drivers/acpi/acpica/rsmisc.c | |||
@@ -57,9 +57,9 @@ ACPI_MODULE_NAME("rsmisc") | |||
57 | * | 57 | * |
58 | * FUNCTION: acpi_rs_convert_aml_to_resource | 58 | * FUNCTION: acpi_rs_convert_aml_to_resource |
59 | * | 59 | * |
60 | * PARAMETERS: Resource - Pointer to the resource descriptor | 60 | * PARAMETERS: resource - Pointer to the resource descriptor |
61 | * Aml - Where the AML descriptor is returned | 61 | * aml - Where the AML descriptor is returned |
62 | * Info - Pointer to appropriate conversion table | 62 | * info - Pointer to appropriate conversion table |
63 | * | 63 | * |
64 | * RETURN: Status | 64 | * RETURN: Status |
65 | * | 65 | * |
@@ -406,7 +406,7 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource, | |||
406 | 406 | ||
407 | case ACPI_RSC_EXIT_NE: | 407 | case ACPI_RSC_EXIT_NE: |
408 | /* | 408 | /* |
409 | * Control - Exit conversion if not equal | 409 | * control - Exit conversion if not equal |
410 | */ | 410 | */ |
411 | switch (info->resource_offset) { | 411 | switch (info->resource_offset) { |
412 | case ACPI_RSC_COMPARE_AML_LENGTH: | 412 | case ACPI_RSC_COMPARE_AML_LENGTH: |
@@ -454,9 +454,9 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource, | |||
454 | * | 454 | * |
455 | * FUNCTION: acpi_rs_convert_resource_to_aml | 455 | * FUNCTION: acpi_rs_convert_resource_to_aml |
456 | * | 456 | * |
457 | * PARAMETERS: Resource - Pointer to the resource descriptor | 457 | * PARAMETERS: resource - Pointer to the resource descriptor |
458 | * Aml - Where the AML descriptor is returned | 458 | * aml - Where the AML descriptor is returned |
459 | * Info - Pointer to appropriate conversion table | 459 | * info - Pointer to appropriate conversion table |
460 | * | 460 | * |
461 | * RETURN: Status | 461 | * RETURN: Status |
462 | * | 462 | * |
@@ -726,7 +726,7 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource, | |||
726 | 726 | ||
727 | case ACPI_RSC_EXIT_LE: | 727 | case ACPI_RSC_EXIT_LE: |
728 | /* | 728 | /* |
729 | * Control - Exit conversion if less than or equal | 729 | * control - Exit conversion if less than or equal |
730 | */ | 730 | */ |
731 | if (item_count <= info->value) { | 731 | if (item_count <= info->value) { |
732 | goto exit; | 732 | goto exit; |
@@ -735,7 +735,7 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource, | |||
735 | 735 | ||
736 | case ACPI_RSC_EXIT_NE: | 736 | case ACPI_RSC_EXIT_NE: |
737 | /* | 737 | /* |
738 | * Control - Exit conversion if not equal | 738 | * control - Exit conversion if not equal |
739 | */ | 739 | */ |
740 | switch (COMPARE_OPCODE(info)) { | 740 | switch (COMPARE_OPCODE(info)) { |
741 | case ACPI_RSC_COMPARE_VALUE: | 741 | case ACPI_RSC_COMPARE_VALUE: |
@@ -757,7 +757,7 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource, | |||
757 | 757 | ||
758 | case ACPI_RSC_EXIT_EQ: | 758 | case ACPI_RSC_EXIT_EQ: |
759 | /* | 759 | /* |
760 | * Control - Exit conversion if equal | 760 | * control - Exit conversion if equal |
761 | */ | 761 | */ |
762 | if (*ACPI_ADD_PTR(u8, resource, | 762 | if (*ACPI_ADD_PTR(u8, resource, |
763 | COMPARE_TARGET(info)) == | 763 | COMPARE_TARGET(info)) == |
@@ -783,7 +783,7 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource, | |||
783 | #if 0 | 783 | #if 0 |
784 | /* Previous resource validations */ | 784 | /* Previous resource validations */ |
785 | 785 | ||
786 | if (aml->ext_address64.revision_iD != AML_RESOURCE_EXTENDED_ADDRESS_REVISION) { | 786 | if (aml->ext_address64.revision_ID != AML_RESOURCE_EXTENDED_ADDRESS_REVISION) { |
787 | return_ACPI_STATUS(AE_SUPPORT); | 787 | return_ACPI_STATUS(AE_SUPPORT); |
788 | } | 788 | } |
789 | 789 | ||
diff --git a/drivers/acpi/acpica/rsutils.c b/drivers/acpi/acpica/rsutils.c index 433a375deb93..37d5241c0acf 100644 --- a/drivers/acpi/acpica/rsutils.c +++ b/drivers/acpi/acpica/rsutils.c | |||
@@ -53,8 +53,8 @@ ACPI_MODULE_NAME("rsutils") | |||
53 | * | 53 | * |
54 | * FUNCTION: acpi_rs_decode_bitmask | 54 | * FUNCTION: acpi_rs_decode_bitmask |
55 | * | 55 | * |
56 | * PARAMETERS: Mask - Bitmask to decode | 56 | * PARAMETERS: mask - Bitmask to decode |
57 | * List - Where the converted list is returned | 57 | * list - Where the converted list is returned |
58 | * | 58 | * |
59 | * RETURN: Count of bits set (length of list) | 59 | * RETURN: Count of bits set (length of list) |
60 | * | 60 | * |
@@ -86,8 +86,8 @@ u8 acpi_rs_decode_bitmask(u16 mask, u8 * list) | |||
86 | * | 86 | * |
87 | * FUNCTION: acpi_rs_encode_bitmask | 87 | * FUNCTION: acpi_rs_encode_bitmask |
88 | * | 88 | * |
89 | * PARAMETERS: List - List of values to encode | 89 | * PARAMETERS: list - List of values to encode |
90 | * Count - Length of list | 90 | * count - Length of list |
91 | * | 91 | * |
92 | * RETURN: Encoded bitmask | 92 | * RETURN: Encoded bitmask |
93 | * | 93 | * |
@@ -115,8 +115,8 @@ u16 acpi_rs_encode_bitmask(u8 * list, u8 count) | |||
115 | * | 115 | * |
116 | * FUNCTION: acpi_rs_move_data | 116 | * FUNCTION: acpi_rs_move_data |
117 | * | 117 | * |
118 | * PARAMETERS: Destination - Pointer to the destination descriptor | 118 | * PARAMETERS: destination - Pointer to the destination descriptor |
119 | * Source - Pointer to the source descriptor | 119 | * source - Pointer to the source descriptor |
120 | * item_count - How many items to move | 120 | * item_count - How many items to move |
121 | * move_type - Byte width | 121 | * move_type - Byte width |
122 | * | 122 | * |
@@ -183,7 +183,7 @@ acpi_rs_move_data(void *destination, void *source, u16 item_count, u8 move_type) | |||
183 | * | 183 | * |
184 | * PARAMETERS: total_length - Length of the AML descriptor, including | 184 | * PARAMETERS: total_length - Length of the AML descriptor, including |
185 | * the header and length fields. | 185 | * the header and length fields. |
186 | * Aml - Pointer to the raw AML descriptor | 186 | * aml - Pointer to the raw AML descriptor |
187 | * | 187 | * |
188 | * RETURN: None | 188 | * RETURN: None |
189 | * | 189 | * |
@@ -235,7 +235,7 @@ acpi_rs_set_resource_length(acpi_rsdesc_size total_length, | |||
235 | * PARAMETERS: descriptor_type - Byte to be inserted as the type | 235 | * PARAMETERS: descriptor_type - Byte to be inserted as the type |
236 | * total_length - Length of the AML descriptor, including | 236 | * total_length - Length of the AML descriptor, including |
237 | * the header and length fields. | 237 | * the header and length fields. |
238 | * Aml - Pointer to the raw AML descriptor | 238 | * aml - Pointer to the raw AML descriptor |
239 | * | 239 | * |
240 | * RETURN: None | 240 | * RETURN: None |
241 | * | 241 | * |
@@ -265,8 +265,8 @@ acpi_rs_set_resource_header(u8 descriptor_type, | |||
265 | * | 265 | * |
266 | * FUNCTION: acpi_rs_strcpy | 266 | * FUNCTION: acpi_rs_strcpy |
267 | * | 267 | * |
268 | * PARAMETERS: Destination - Pointer to the destination string | 268 | * PARAMETERS: destination - Pointer to the destination string |
269 | * Source - Pointer to the source string | 269 | * source - Pointer to the source string |
270 | * | 270 | * |
271 | * RETURN: String length, including NULL terminator | 271 | * RETURN: String length, including NULL terminator |
272 | * | 272 | * |
@@ -300,7 +300,7 @@ static u16 acpi_rs_strcpy(char *destination, char *source) | |||
300 | * minimum_length - Minimum length of the descriptor (minus | 300 | * minimum_length - Minimum length of the descriptor (minus |
301 | * any optional fields) | 301 | * any optional fields) |
302 | * resource_source - Where the resource_source is returned | 302 | * resource_source - Where the resource_source is returned |
303 | * Aml - Pointer to the raw AML descriptor | 303 | * aml - Pointer to the raw AML descriptor |
304 | * string_ptr - (optional) where to store the actual | 304 | * string_ptr - (optional) where to store the actual |
305 | * resource_source string | 305 | * resource_source string |
306 | * | 306 | * |
@@ -386,7 +386,7 @@ acpi_rs_get_resource_source(acpi_rs_length resource_length, | |||
386 | * | 386 | * |
387 | * FUNCTION: acpi_rs_set_resource_source | 387 | * FUNCTION: acpi_rs_set_resource_source |
388 | * | 388 | * |
389 | * PARAMETERS: Aml - Pointer to the raw AML descriptor | 389 | * PARAMETERS: aml - Pointer to the raw AML descriptor |
390 | * minimum_length - Minimum length of the descriptor (minus | 390 | * minimum_length - Minimum length of the descriptor (minus |
391 | * any optional fields) | 391 | * any optional fields) |
392 | * resource_source - Internal resource_source | 392 | * resource_source - Internal resource_source |
@@ -445,7 +445,7 @@ acpi_rs_set_resource_source(union aml_resource * aml, | |||
445 | * | 445 | * |
446 | * FUNCTION: acpi_rs_get_prt_method_data | 446 | * FUNCTION: acpi_rs_get_prt_method_data |
447 | * | 447 | * |
448 | * PARAMETERS: Node - Device node | 448 | * PARAMETERS: node - Device node |
449 | * ret_buffer - Pointer to a buffer structure for the | 449 | * ret_buffer - Pointer to a buffer structure for the |
450 | * results | 450 | * results |
451 | * | 451 | * |
@@ -494,7 +494,7 @@ acpi_rs_get_prt_method_data(struct acpi_namespace_node * node, | |||
494 | * | 494 | * |
495 | * FUNCTION: acpi_rs_get_crs_method_data | 495 | * FUNCTION: acpi_rs_get_crs_method_data |
496 | * | 496 | * |
497 | * PARAMETERS: Node - Device node | 497 | * PARAMETERS: node - Device node |
498 | * ret_buffer - Pointer to a buffer structure for the | 498 | * ret_buffer - Pointer to a buffer structure for the |
499 | * results | 499 | * results |
500 | * | 500 | * |
@@ -534,7 +534,7 @@ acpi_rs_get_crs_method_data(struct acpi_namespace_node *node, | |||
534 | */ | 534 | */ |
535 | status = acpi_rs_create_resource_list(obj_desc, ret_buffer); | 535 | status = acpi_rs_create_resource_list(obj_desc, ret_buffer); |
536 | 536 | ||
537 | /* On exit, we must delete the object returned by evaluate_object */ | 537 | /* On exit, we must delete the object returned by evaluateObject */ |
538 | 538 | ||
539 | acpi_ut_remove_reference(obj_desc); | 539 | acpi_ut_remove_reference(obj_desc); |
540 | return_ACPI_STATUS(status); | 540 | return_ACPI_STATUS(status); |
@@ -544,7 +544,7 @@ acpi_rs_get_crs_method_data(struct acpi_namespace_node *node, | |||
544 | * | 544 | * |
545 | * FUNCTION: acpi_rs_get_prs_method_data | 545 | * FUNCTION: acpi_rs_get_prs_method_data |
546 | * | 546 | * |
547 | * PARAMETERS: Node - Device node | 547 | * PARAMETERS: node - Device node |
548 | * ret_buffer - Pointer to a buffer structure for the | 548 | * ret_buffer - Pointer to a buffer structure for the |
549 | * results | 549 | * results |
550 | * | 550 | * |
@@ -585,7 +585,7 @@ acpi_rs_get_prs_method_data(struct acpi_namespace_node *node, | |||
585 | */ | 585 | */ |
586 | status = acpi_rs_create_resource_list(obj_desc, ret_buffer); | 586 | status = acpi_rs_create_resource_list(obj_desc, ret_buffer); |
587 | 587 | ||
588 | /* On exit, we must delete the object returned by evaluate_object */ | 588 | /* On exit, we must delete the object returned by evaluateObject */ |
589 | 589 | ||
590 | acpi_ut_remove_reference(obj_desc); | 590 | acpi_ut_remove_reference(obj_desc); |
591 | return_ACPI_STATUS(status); | 591 | return_ACPI_STATUS(status); |
@@ -596,7 +596,7 @@ acpi_rs_get_prs_method_data(struct acpi_namespace_node *node, | |||
596 | * | 596 | * |
597 | * FUNCTION: acpi_rs_get_aei_method_data | 597 | * FUNCTION: acpi_rs_get_aei_method_data |
598 | * | 598 | * |
599 | * PARAMETERS: Node - Device node | 599 | * PARAMETERS: node - Device node |
600 | * ret_buffer - Pointer to a buffer structure for the | 600 | * ret_buffer - Pointer to a buffer structure for the |
601 | * results | 601 | * results |
602 | * | 602 | * |
@@ -636,7 +636,7 @@ acpi_rs_get_aei_method_data(struct acpi_namespace_node *node, | |||
636 | */ | 636 | */ |
637 | status = acpi_rs_create_resource_list(obj_desc, ret_buffer); | 637 | status = acpi_rs_create_resource_list(obj_desc, ret_buffer); |
638 | 638 | ||
639 | /* On exit, we must delete the object returned by evaluate_object */ | 639 | /* On exit, we must delete the object returned by evaluateObject */ |
640 | 640 | ||
641 | acpi_ut_remove_reference(obj_desc); | 641 | acpi_ut_remove_reference(obj_desc); |
642 | return_ACPI_STATUS(status); | 642 | return_ACPI_STATUS(status); |
@@ -646,8 +646,8 @@ acpi_rs_get_aei_method_data(struct acpi_namespace_node *node, | |||
646 | * | 646 | * |
647 | * FUNCTION: acpi_rs_get_method_data | 647 | * FUNCTION: acpi_rs_get_method_data |
648 | * | 648 | * |
649 | * PARAMETERS: Handle - Handle to the containing object | 649 | * PARAMETERS: handle - Handle to the containing object |
650 | * Path - Path to method, relative to Handle | 650 | * path - Path to method, relative to Handle |
651 | * ret_buffer - Pointer to a buffer structure for the | 651 | * ret_buffer - Pointer to a buffer structure for the |
652 | * results | 652 | * results |
653 | * | 653 | * |
@@ -697,7 +697,7 @@ acpi_rs_get_method_data(acpi_handle handle, | |||
697 | * | 697 | * |
698 | * FUNCTION: acpi_rs_set_srs_method_data | 698 | * FUNCTION: acpi_rs_set_srs_method_data |
699 | * | 699 | * |
700 | * PARAMETERS: Node - Device node | 700 | * PARAMETERS: node - Device node |
701 | * in_buffer - Pointer to a buffer structure of the | 701 | * in_buffer - Pointer to a buffer structure of the |
702 | * parameter | 702 | * parameter |
703 | * | 703 | * |
diff --git a/drivers/acpi/acpica/rsxface.c b/drivers/acpi/acpica/rsxface.c index f58c098c7aeb..5aad744b5b83 100644 --- a/drivers/acpi/acpica/rsxface.c +++ b/drivers/acpi/acpica/rsxface.c | |||
@@ -79,7 +79,7 @@ acpi_rs_validate_parameters(acpi_handle device_handle, | |||
79 | * FUNCTION: acpi_rs_validate_parameters | 79 | * FUNCTION: acpi_rs_validate_parameters |
80 | * | 80 | * |
81 | * PARAMETERS: device_handle - Handle to a device | 81 | * PARAMETERS: device_handle - Handle to a device |
82 | * Buffer - Pointer to a data buffer | 82 | * buffer - Pointer to a data buffer |
83 | * return_node - Pointer to where the device node is returned | 83 | * return_node - Pointer to where the device node is returned |
84 | * | 84 | * |
85 | * RETURN: Status | 85 | * RETURN: Status |
@@ -351,8 +351,8 @@ ACPI_EXPORT_SYMBOL(acpi_get_event_resources) | |||
351 | * | 351 | * |
352 | * FUNCTION: acpi_resource_to_address64 | 352 | * FUNCTION: acpi_resource_to_address64 |
353 | * | 353 | * |
354 | * PARAMETERS: Resource - Pointer to a resource | 354 | * PARAMETERS: resource - Pointer to a resource |
355 | * Out - Pointer to the users's return buffer | 355 | * out - Pointer to the users's return buffer |
356 | * (a struct acpi_resource_address64) | 356 | * (a struct acpi_resource_address64) |
357 | * | 357 | * |
358 | * RETURN: Status | 358 | * RETURN: Status |
@@ -415,9 +415,9 @@ ACPI_EXPORT_SYMBOL(acpi_resource_to_address64) | |||
415 | * FUNCTION: acpi_get_vendor_resource | 415 | * FUNCTION: acpi_get_vendor_resource |
416 | * | 416 | * |
417 | * PARAMETERS: device_handle - Handle for the parent device object | 417 | * PARAMETERS: device_handle - Handle for the parent device object |
418 | * Name - Method name for the parent resource | 418 | * name - Method name for the parent resource |
419 | * (METHOD_NAME__CRS or METHOD_NAME__PRS) | 419 | * (METHOD_NAME__CRS or METHOD_NAME__PRS) |
420 | * Uuid - Pointer to the UUID to be matched. | 420 | * uuid - Pointer to the UUID to be matched. |
421 | * includes both subtype and 16-byte UUID | 421 | * includes both subtype and 16-byte UUID |
422 | * ret_buffer - Where the vendor resource is returned | 422 | * ret_buffer - Where the vendor resource is returned |
423 | * | 423 | * |
@@ -526,11 +526,11 @@ acpi_rs_match_vendor_resource(struct acpi_resource *resource, void *context) | |||
526 | * | 526 | * |
527 | * PARAMETERS: device_handle - Handle to the device object for the | 527 | * PARAMETERS: device_handle - Handle to the device object for the |
528 | * device we are querying | 528 | * device we are querying |
529 | * Name - Method name of the resources we want. | 529 | * name - Method name of the resources we want. |
530 | * (METHOD_NAME__CRS, METHOD_NAME__PRS, or | 530 | * (METHOD_NAME__CRS, METHOD_NAME__PRS, or |
531 | * METHOD_NAME__AEI) | 531 | * METHOD_NAME__AEI) |
532 | * user_function - Called for each resource | 532 | * user_function - Called for each resource |
533 | * Context - Passed to user_function | 533 | * context - Passed to user_function |
534 | * | 534 | * |
535 | * RETURN: Status | 535 | * RETURN: Status |
536 | * | 536 | * |
diff --git a/drivers/acpi/acpica/tbfadt.c b/drivers/acpi/acpica/tbfadt.c index 4c9c760db4a4..390651860bf0 100644 --- a/drivers/acpi/acpica/tbfadt.c +++ b/drivers/acpi/acpica/tbfadt.c | |||
@@ -49,9 +49,10 @@ | |||
49 | ACPI_MODULE_NAME("tbfadt") | 49 | ACPI_MODULE_NAME("tbfadt") |
50 | 50 | ||
51 | /* Local prototypes */ | 51 | /* Local prototypes */ |
52 | static ACPI_INLINE void | 52 | static void |
53 | acpi_tb_init_generic_address(struct acpi_generic_address *generic_address, | 53 | acpi_tb_init_generic_address(struct acpi_generic_address *generic_address, |
54 | u8 space_id, u8 byte_width, u64 address); | 54 | u8 space_id, |
55 | u8 byte_width, u64 address, char *register_name); | ||
55 | 56 | ||
56 | static void acpi_tb_convert_fadt(void); | 57 | static void acpi_tb_convert_fadt(void); |
57 | 58 | ||
@@ -172,7 +173,7 @@ static struct acpi_fadt_pm_info fadt_pm_info_table[] = { | |||
172 | * | 173 | * |
173 | * PARAMETERS: generic_address - GAS struct to be initialized | 174 | * PARAMETERS: generic_address - GAS struct to be initialized |
174 | * byte_width - Width of this register | 175 | * byte_width - Width of this register |
175 | * Address - Address of the register | 176 | * address - Address of the register |
176 | * | 177 | * |
177 | * RETURN: None | 178 | * RETURN: None |
178 | * | 179 | * |
@@ -182,10 +183,25 @@ static struct acpi_fadt_pm_info fadt_pm_info_table[] = { | |||
182 | * | 183 | * |
183 | ******************************************************************************/ | 184 | ******************************************************************************/ |
184 | 185 | ||
185 | static ACPI_INLINE void | 186 | static void |
186 | acpi_tb_init_generic_address(struct acpi_generic_address *generic_address, | 187 | acpi_tb_init_generic_address(struct acpi_generic_address *generic_address, |
187 | u8 space_id, u8 byte_width, u64 address) | 188 | u8 space_id, |
189 | u8 byte_width, u64 address, char *register_name) | ||
188 | { | 190 | { |
191 | u8 bit_width; | ||
192 | |||
193 | /* Bit width field in the GAS is only one byte long, 255 max */ | ||
194 | |||
195 | bit_width = (u8)(byte_width * 8); | ||
196 | |||
197 | if (byte_width > 31) { /* (31*8)=248 */ | ||
198 | ACPI_ERROR((AE_INFO, | ||
199 | "%s - 32-bit FADT register is too long (%u bytes, %u bits) " | ||
200 | "to convert to GAS struct - 255 bits max, truncating", | ||
201 | register_name, byte_width, (byte_width * 8))); | ||
202 | |||
203 | bit_width = 255; | ||
204 | } | ||
189 | 205 | ||
190 | /* | 206 | /* |
191 | * The 64-bit Address field is non-aligned in the byte packed | 207 | * The 64-bit Address field is non-aligned in the byte packed |
@@ -196,7 +212,7 @@ acpi_tb_init_generic_address(struct acpi_generic_address *generic_address, | |||
196 | /* All other fields are byte-wide */ | 212 | /* All other fields are byte-wide */ |
197 | 213 | ||
198 | generic_address->space_id = space_id; | 214 | generic_address->space_id = space_id; |
199 | generic_address->bit_width = (u8)ACPI_MUL_8(byte_width); | 215 | generic_address->bit_width = bit_width; |
200 | generic_address->bit_offset = 0; | 216 | generic_address->bit_offset = 0; |
201 | generic_address->access_width = 0; /* Access width ANY */ | 217 | generic_address->access_width = 0; /* Access width ANY */ |
202 | } | 218 | } |
@@ -267,8 +283,8 @@ void acpi_tb_parse_fadt(u32 table_index) | |||
267 | * | 283 | * |
268 | * FUNCTION: acpi_tb_create_local_fadt | 284 | * FUNCTION: acpi_tb_create_local_fadt |
269 | * | 285 | * |
270 | * PARAMETERS: Table - Pointer to BIOS FADT | 286 | * PARAMETERS: table - Pointer to BIOS FADT |
271 | * Length - Length of the table | 287 | * length - Length of the table |
272 | * | 288 | * |
273 | * RETURN: None | 289 | * RETURN: None |
274 | * | 290 | * |
@@ -287,11 +303,11 @@ void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length) | |||
287 | * a warning. | 303 | * a warning. |
288 | */ | 304 | */ |
289 | if (length > sizeof(struct acpi_table_fadt)) { | 305 | if (length > sizeof(struct acpi_table_fadt)) { |
290 | ACPI_WARNING((AE_INFO, | 306 | ACPI_BIOS_WARNING((AE_INFO, |
291 | "FADT (revision %u) is longer than ACPI 5.0 version, " | 307 | "FADT (revision %u) is longer than ACPI 5.0 version, " |
292 | "truncating length %u to %u", | 308 | "truncating length %u to %u", |
293 | table->revision, length, | 309 | table->revision, length, |
294 | (u32)sizeof(struct acpi_table_fadt))); | 310 | (u32)sizeof(struct acpi_table_fadt))); |
295 | } | 311 | } |
296 | 312 | ||
297 | /* Clear the entire local FADT */ | 313 | /* Clear the entire local FADT */ |
@@ -436,11 +452,13 @@ static void acpi_tb_convert_fadt(void) | |||
436 | * they must match. | 452 | * they must match. |
437 | */ | 453 | */ |
438 | if (address64->address && address32 && | 454 | if (address64->address && address32 && |
439 | (address64->address != (u64) address32)) { | 455 | (address64->address != (u64)address32)) { |
440 | ACPI_ERROR((AE_INFO, | 456 | ACPI_BIOS_ERROR((AE_INFO, |
441 | "32/64X address mismatch in %s: 0x%8.8X/0x%8.8X%8.8X, using 32", | 457 | "32/64X address mismatch in FADT/%s: " |
442 | fadt_info_table[i].name, address32, | 458 | "0x%8.8X/0x%8.8X%8.8X, using 32", |
443 | ACPI_FORMAT_UINT64(address64->address))); | 459 | fadt_info_table[i].name, address32, |
460 | ACPI_FORMAT_UINT64(address64-> | ||
461 | address))); | ||
444 | } | 462 | } |
445 | 463 | ||
446 | /* Always use 32-bit address if it is valid (non-null) */ | 464 | /* Always use 32-bit address if it is valid (non-null) */ |
@@ -456,7 +474,8 @@ static void acpi_tb_convert_fadt(void) | |||
456 | &acpi_gbl_FADT, | 474 | &acpi_gbl_FADT, |
457 | fadt_info_table | 475 | fadt_info_table |
458 | [i].length), | 476 | [i].length), |
459 | (u64) address32); | 477 | (u64) address32, |
478 | fadt_info_table[i].name); | ||
460 | } | 479 | } |
461 | } | 480 | } |
462 | } | 481 | } |
@@ -465,7 +484,7 @@ static void acpi_tb_convert_fadt(void) | |||
465 | * | 484 | * |
466 | * FUNCTION: acpi_tb_validate_fadt | 485 | * FUNCTION: acpi_tb_validate_fadt |
467 | * | 486 | * |
468 | * PARAMETERS: Table - Pointer to the FADT to be validated | 487 | * PARAMETERS: table - Pointer to the FADT to be validated |
469 | * | 488 | * |
470 | * RETURN: None | 489 | * RETURN: None |
471 | * | 490 | * |
@@ -494,25 +513,25 @@ static void acpi_tb_validate_fadt(void) | |||
494 | * DSDT/X_DSDT) would indicate the presence of two FACS or two DSDT tables. | 513 | * DSDT/X_DSDT) would indicate the presence of two FACS or two DSDT tables. |
495 | */ | 514 | */ |
496 | if (acpi_gbl_FADT.facs && | 515 | if (acpi_gbl_FADT.facs && |
497 | (acpi_gbl_FADT.Xfacs != (u64) acpi_gbl_FADT.facs)) { | 516 | (acpi_gbl_FADT.Xfacs != (u64)acpi_gbl_FADT.facs)) { |
498 | ACPI_WARNING((AE_INFO, | 517 | ACPI_BIOS_WARNING((AE_INFO, |
499 | "32/64X FACS address mismatch in FADT - " | 518 | "32/64X FACS address mismatch in FADT - " |
500 | "0x%8.8X/0x%8.8X%8.8X, using 32", | 519 | "0x%8.8X/0x%8.8X%8.8X, using 32", |
501 | acpi_gbl_FADT.facs, | 520 | acpi_gbl_FADT.facs, |
502 | ACPI_FORMAT_UINT64(acpi_gbl_FADT.Xfacs))); | 521 | ACPI_FORMAT_UINT64(acpi_gbl_FADT.Xfacs))); |
503 | 522 | ||
504 | acpi_gbl_FADT.Xfacs = (u64) acpi_gbl_FADT.facs; | 523 | acpi_gbl_FADT.Xfacs = (u64)acpi_gbl_FADT.facs; |
505 | } | 524 | } |
506 | 525 | ||
507 | if (acpi_gbl_FADT.dsdt && | 526 | if (acpi_gbl_FADT.dsdt && |
508 | (acpi_gbl_FADT.Xdsdt != (u64) acpi_gbl_FADT.dsdt)) { | 527 | (acpi_gbl_FADT.Xdsdt != (u64)acpi_gbl_FADT.dsdt)) { |
509 | ACPI_WARNING((AE_INFO, | 528 | ACPI_BIOS_WARNING((AE_INFO, |
510 | "32/64X DSDT address mismatch in FADT - " | 529 | "32/64X DSDT address mismatch in FADT - " |
511 | "0x%8.8X/0x%8.8X%8.8X, using 32", | 530 | "0x%8.8X/0x%8.8X%8.8X, using 32", |
512 | acpi_gbl_FADT.dsdt, | 531 | acpi_gbl_FADT.dsdt, |
513 | ACPI_FORMAT_UINT64(acpi_gbl_FADT.Xdsdt))); | 532 | ACPI_FORMAT_UINT64(acpi_gbl_FADT.Xdsdt))); |
514 | 533 | ||
515 | acpi_gbl_FADT.Xdsdt = (u64) acpi_gbl_FADT.dsdt; | 534 | acpi_gbl_FADT.Xdsdt = (u64)acpi_gbl_FADT.dsdt; |
516 | } | 535 | } |
517 | 536 | ||
518 | /* If Hardware Reduced flag is set, we are all done */ | 537 | /* If Hardware Reduced flag is set, we are all done */ |
@@ -542,10 +561,10 @@ static void acpi_tb_validate_fadt(void) | |||
542 | */ | 561 | */ |
543 | if (address64->address && | 562 | if (address64->address && |
544 | (address64->bit_width != ACPI_MUL_8(length))) { | 563 | (address64->bit_width != ACPI_MUL_8(length))) { |
545 | ACPI_WARNING((AE_INFO, | 564 | ACPI_BIOS_WARNING((AE_INFO, |
546 | "32/64X length mismatch in %s: %u/%u", | 565 | "32/64X length mismatch in FADT/%s: %u/%u", |
547 | name, ACPI_MUL_8(length), | 566 | name, ACPI_MUL_8(length), |
548 | address64->bit_width)); | 567 | address64->bit_width)); |
549 | } | 568 | } |
550 | 569 | ||
551 | if (fadt_info_table[i].type & ACPI_FADT_REQUIRED) { | 570 | if (fadt_info_table[i].type & ACPI_FADT_REQUIRED) { |
@@ -554,29 +573,29 @@ static void acpi_tb_validate_fadt(void) | |||
554 | * Both the address and length must be non-zero. | 573 | * Both the address and length must be non-zero. |
555 | */ | 574 | */ |
556 | if (!address64->address || !length) { | 575 | if (!address64->address || !length) { |
557 | ACPI_ERROR((AE_INFO, | 576 | ACPI_BIOS_ERROR((AE_INFO, |
558 | "Required field %s has zero address and/or length:" | 577 | "Required FADT field %s has zero address and/or length: " |
559 | " 0x%8.8X%8.8X/0x%X", | 578 | "0x%8.8X%8.8X/0x%X", |
560 | name, | 579 | name, |
561 | ACPI_FORMAT_UINT64(address64-> | 580 | ACPI_FORMAT_UINT64(address64-> |
562 | address), | 581 | address), |
563 | length)); | 582 | length)); |
564 | } | 583 | } |
565 | } else if (fadt_info_table[i].type & ACPI_FADT_SEPARATE_LENGTH) { | 584 | } else if (fadt_info_table[i].type & ACPI_FADT_SEPARATE_LENGTH) { |
566 | /* | 585 | /* |
567 | * Field is optional (PM2Control, GPE0, GPE1) AND has its own | 586 | * Field is optional (Pm2_control, GPE0, GPE1) AND has its own |
568 | * length field. If present, both the address and length must | 587 | * length field. If present, both the address and length must |
569 | * be valid. | 588 | * be valid. |
570 | */ | 589 | */ |
571 | if ((address64->address && !length) || | 590 | if ((address64->address && !length) || |
572 | (!address64->address && length)) { | 591 | (!address64->address && length)) { |
573 | ACPI_WARNING((AE_INFO, | 592 | ACPI_BIOS_WARNING((AE_INFO, |
574 | "Optional field %s has zero address or length: " | 593 | "Optional FADT field %s has zero address or length: " |
575 | "0x%8.8X%8.8X/0x%X", | 594 | "0x%8.8X%8.8X/0x%X", |
576 | name, | 595 | name, |
577 | ACPI_FORMAT_UINT64(address64-> | 596 | ACPI_FORMAT_UINT64 |
578 | address), | 597 | (address64->address), |
579 | length)); | 598 | length)); |
580 | } | 599 | } |
581 | } | 600 | } |
582 | } | 601 | } |
@@ -621,12 +640,12 @@ static void acpi_tb_setup_fadt_registers(void) | |||
621 | (fadt_info_table[i].default_length > 0) && | 640 | (fadt_info_table[i].default_length > 0) && |
622 | (fadt_info_table[i].default_length != | 641 | (fadt_info_table[i].default_length != |
623 | target64->bit_width)) { | 642 | target64->bit_width)) { |
624 | ACPI_WARNING((AE_INFO, | 643 | ACPI_BIOS_WARNING((AE_INFO, |
625 | "Invalid length for %s: %u, using default %u", | 644 | "Invalid length for FADT/%s: %u, using default %u", |
626 | fadt_info_table[i].name, | 645 | fadt_info_table[i].name, |
627 | target64->bit_width, | 646 | target64->bit_width, |
628 | fadt_info_table[i]. | 647 | fadt_info_table[i]. |
629 | default_length)); | 648 | default_length)); |
630 | 649 | ||
631 | /* Incorrect size, set width to the default */ | 650 | /* Incorrect size, set width to the default */ |
632 | 651 | ||
@@ -670,7 +689,8 @@ static void acpi_tb_setup_fadt_registers(void) | |||
670 | source64->address + | 689 | source64->address + |
671 | (fadt_pm_info_table[i]. | 690 | (fadt_pm_info_table[i]. |
672 | register_num * | 691 | register_num * |
673 | pm1_register_byte_width)); | 692 | pm1_register_byte_width), |
693 | "PmRegisters"); | ||
674 | } | 694 | } |
675 | } | 695 | } |
676 | } | 696 | } |
diff --git a/drivers/acpi/acpica/tbfind.c b/drivers/acpi/acpica/tbfind.c index 4903e36ea75a..57deae166577 100644 --- a/drivers/acpi/acpica/tbfind.c +++ b/drivers/acpi/acpica/tbfind.c | |||
@@ -52,7 +52,7 @@ ACPI_MODULE_NAME("tbfind") | |||
52 | * | 52 | * |
53 | * FUNCTION: acpi_tb_find_table | 53 | * FUNCTION: acpi_tb_find_table |
54 | * | 54 | * |
55 | * PARAMETERS: Signature - String with ACPI table signature | 55 | * PARAMETERS: signature - String with ACPI table signature |
56 | * oem_id - String with the table OEM ID | 56 | * oem_id - String with the table OEM ID |
57 | * oem_table_id - String with the OEM Table ID | 57 | * oem_table_id - String with the OEM Table ID |
58 | * table_index - Where the table index is returned | 58 | * table_index - Where the table index is returned |
diff --git a/drivers/acpi/acpica/tbinstal.c b/drivers/acpi/acpica/tbinstal.c index c03500b4cc7a..70f9d787c82c 100644 --- a/drivers/acpi/acpica/tbinstal.c +++ b/drivers/acpi/acpica/tbinstal.c | |||
@@ -138,13 +138,14 @@ acpi_tb_add_table(struct acpi_table_desc *table_desc, u32 *table_index) | |||
138 | if ((table_desc->pointer->signature[0] != 0x00) && | 138 | if ((table_desc->pointer->signature[0] != 0x00) && |
139 | (!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_SSDT)) | 139 | (!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_SSDT)) |
140 | && (ACPI_STRNCMP(table_desc->pointer->signature, "OEM", 3))) { | 140 | && (ACPI_STRNCMP(table_desc->pointer->signature, "OEM", 3))) { |
141 | ACPI_ERROR((AE_INFO, | 141 | ACPI_BIOS_ERROR((AE_INFO, |
142 | "Table has invalid signature [%4.4s] (0x%8.8X), must be SSDT or OEMx", | 142 | "Table has invalid signature [%4.4s] (0x%8.8X), " |
143 | acpi_ut_valid_acpi_name(*(u32 *)table_desc-> | 143 | "must be SSDT or OEMx", |
144 | pointer-> | 144 | acpi_ut_valid_acpi_name(*(u32 *)table_desc-> |
145 | signature) ? table_desc-> | 145 | pointer-> |
146 | pointer->signature : "????", | 146 | signature) ? |
147 | *(u32 *)table_desc->pointer->signature)); | 147 | table_desc->pointer->signature : "????", |
148 | *(u32 *)table_desc->pointer->signature)); | ||
148 | 149 | ||
149 | return_ACPI_STATUS(AE_BAD_SIGNATURE); | 150 | return_ACPI_STATUS(AE_BAD_SIGNATURE); |
150 | } | 151 | } |
@@ -349,6 +350,7 @@ struct acpi_table_header *acpi_tb_table_override(struct acpi_table_header | |||
349 | acpi_status acpi_tb_resize_root_table_list(void) | 350 | acpi_status acpi_tb_resize_root_table_list(void) |
350 | { | 351 | { |
351 | struct acpi_table_desc *tables; | 352 | struct acpi_table_desc *tables; |
353 | u32 table_count; | ||
352 | 354 | ||
353 | ACPI_FUNCTION_TRACE(tb_resize_root_table_list); | 355 | ACPI_FUNCTION_TRACE(tb_resize_root_table_list); |
354 | 356 | ||
@@ -362,8 +364,13 @@ acpi_status acpi_tb_resize_root_table_list(void) | |||
362 | 364 | ||
363 | /* Increase the Table Array size */ | 365 | /* Increase the Table Array size */ |
364 | 366 | ||
365 | tables = ACPI_ALLOCATE_ZEROED(((acpi_size) acpi_gbl_root_table_list. | 367 | if (acpi_gbl_root_table_list.flags & ACPI_ROOT_ORIGIN_ALLOCATED) { |
366 | max_table_count + | 368 | table_count = acpi_gbl_root_table_list.max_table_count; |
369 | } else { | ||
370 | table_count = acpi_gbl_root_table_list.current_table_count; | ||
371 | } | ||
372 | |||
373 | tables = ACPI_ALLOCATE_ZEROED(((acpi_size) table_count + | ||
367 | ACPI_ROOT_TABLE_SIZE_INCREMENT) * | 374 | ACPI_ROOT_TABLE_SIZE_INCREMENT) * |
368 | sizeof(struct acpi_table_desc)); | 375 | sizeof(struct acpi_table_desc)); |
369 | if (!tables) { | 376 | if (!tables) { |
@@ -376,8 +383,8 @@ acpi_status acpi_tb_resize_root_table_list(void) | |||
376 | 383 | ||
377 | if (acpi_gbl_root_table_list.tables) { | 384 | if (acpi_gbl_root_table_list.tables) { |
378 | ACPI_MEMCPY(tables, acpi_gbl_root_table_list.tables, | 385 | ACPI_MEMCPY(tables, acpi_gbl_root_table_list.tables, |
379 | (acpi_size) acpi_gbl_root_table_list. | 386 | (acpi_size) table_count * |
380 | max_table_count * sizeof(struct acpi_table_desc)); | 387 | sizeof(struct acpi_table_desc)); |
381 | 388 | ||
382 | if (acpi_gbl_root_table_list.flags & ACPI_ROOT_ORIGIN_ALLOCATED) { | 389 | if (acpi_gbl_root_table_list.flags & ACPI_ROOT_ORIGIN_ALLOCATED) { |
383 | ACPI_FREE(acpi_gbl_root_table_list.tables); | 390 | ACPI_FREE(acpi_gbl_root_table_list.tables); |
@@ -385,9 +392,9 @@ acpi_status acpi_tb_resize_root_table_list(void) | |||
385 | } | 392 | } |
386 | 393 | ||
387 | acpi_gbl_root_table_list.tables = tables; | 394 | acpi_gbl_root_table_list.tables = tables; |
388 | acpi_gbl_root_table_list.max_table_count += | 395 | acpi_gbl_root_table_list.max_table_count = |
389 | ACPI_ROOT_TABLE_SIZE_INCREMENT; | 396 | table_count + ACPI_ROOT_TABLE_SIZE_INCREMENT; |
390 | acpi_gbl_root_table_list.flags |= (u8)ACPI_ROOT_ORIGIN_ALLOCATED; | 397 | acpi_gbl_root_table_list.flags |= ACPI_ROOT_ORIGIN_ALLOCATED; |
391 | 398 | ||
392 | return_ACPI_STATUS(AE_OK); | 399 | return_ACPI_STATUS(AE_OK); |
393 | } | 400 | } |
@@ -396,10 +403,10 @@ acpi_status acpi_tb_resize_root_table_list(void) | |||
396 | * | 403 | * |
397 | * FUNCTION: acpi_tb_store_table | 404 | * FUNCTION: acpi_tb_store_table |
398 | * | 405 | * |
399 | * PARAMETERS: Address - Table address | 406 | * PARAMETERS: address - Table address |
400 | * Table - Table header | 407 | * table - Table header |
401 | * Length - Table length | 408 | * length - Table length |
402 | * Flags - flags | 409 | * flags - flags |
403 | * | 410 | * |
404 | * RETURN: Status and table index. | 411 | * RETURN: Status and table index. |
405 | * | 412 | * |
diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c index 0a706cac37de..b6cea30da638 100644 --- a/drivers/acpi/acpica/tbutils.c +++ b/drivers/acpi/acpica/tbutils.c | |||
@@ -178,8 +178,8 @@ u8 acpi_tb_tables_loaded(void) | |||
178 | * | 178 | * |
179 | * FUNCTION: acpi_tb_fix_string | 179 | * FUNCTION: acpi_tb_fix_string |
180 | * | 180 | * |
181 | * PARAMETERS: String - String to be repaired | 181 | * PARAMETERS: string - String to be repaired |
182 | * Length - Maximum length | 182 | * length - Maximum length |
183 | * | 183 | * |
184 | * RETURN: None | 184 | * RETURN: None |
185 | * | 185 | * |
@@ -205,7 +205,7 @@ static void acpi_tb_fix_string(char *string, acpi_size length) | |||
205 | * FUNCTION: acpi_tb_cleanup_table_header | 205 | * FUNCTION: acpi_tb_cleanup_table_header |
206 | * | 206 | * |
207 | * PARAMETERS: out_header - Where the cleaned header is returned | 207 | * PARAMETERS: out_header - Where the cleaned header is returned |
208 | * Header - Input ACPI table header | 208 | * header - Input ACPI table header |
209 | * | 209 | * |
210 | * RETURN: Returns the cleaned header in out_header | 210 | * RETURN: Returns the cleaned header in out_header |
211 | * | 211 | * |
@@ -231,8 +231,8 @@ acpi_tb_cleanup_table_header(struct acpi_table_header *out_header, | |||
231 | * | 231 | * |
232 | * FUNCTION: acpi_tb_print_table_header | 232 | * FUNCTION: acpi_tb_print_table_header |
233 | * | 233 | * |
234 | * PARAMETERS: Address - Table physical address | 234 | * PARAMETERS: address - Table physical address |
235 | * Header - Table header | 235 | * header - Table header |
236 | * | 236 | * |
237 | * RETURN: None | 237 | * RETURN: None |
238 | * | 238 | * |
@@ -296,8 +296,8 @@ acpi_tb_print_table_header(acpi_physical_address address, | |||
296 | * | 296 | * |
297 | * FUNCTION: acpi_tb_validate_checksum | 297 | * FUNCTION: acpi_tb_validate_checksum |
298 | * | 298 | * |
299 | * PARAMETERS: Table - ACPI table to verify | 299 | * PARAMETERS: table - ACPI table to verify |
300 | * Length - Length of entire table | 300 | * length - Length of entire table |
301 | * | 301 | * |
302 | * RETURN: Status | 302 | * RETURN: Status |
303 | * | 303 | * |
@@ -317,10 +317,11 @@ acpi_status acpi_tb_verify_checksum(struct acpi_table_header *table, u32 length) | |||
317 | /* Checksum ok? (should be zero) */ | 317 | /* Checksum ok? (should be zero) */ |
318 | 318 | ||
319 | if (checksum) { | 319 | if (checksum) { |
320 | ACPI_WARNING((AE_INFO, | 320 | ACPI_BIOS_WARNING((AE_INFO, |
321 | "Incorrect checksum in table [%4.4s] - 0x%2.2X, should be 0x%2.2X", | 321 | "Incorrect checksum in table [%4.4s] - 0x%2.2X, " |
322 | table->signature, table->checksum, | 322 | "should be 0x%2.2X", |
323 | (u8) (table->checksum - checksum))); | 323 | table->signature, table->checksum, |
324 | (u8)(table->checksum - checksum))); | ||
324 | 325 | ||
325 | #if (ACPI_CHECKSUM_ABORT) | 326 | #if (ACPI_CHECKSUM_ABORT) |
326 | 327 | ||
@@ -335,8 +336,8 @@ acpi_status acpi_tb_verify_checksum(struct acpi_table_header *table, u32 length) | |||
335 | * | 336 | * |
336 | * FUNCTION: acpi_tb_checksum | 337 | * FUNCTION: acpi_tb_checksum |
337 | * | 338 | * |
338 | * PARAMETERS: Buffer - Pointer to memory region to be checked | 339 | * PARAMETERS: buffer - Pointer to memory region to be checked |
339 | * Length - Length of this memory region | 340 | * length - Length of this memory region |
340 | * | 341 | * |
341 | * RETURN: Checksum (u8) | 342 | * RETURN: Checksum (u8) |
342 | * | 343 | * |
@@ -377,8 +378,9 @@ void acpi_tb_check_dsdt_header(void) | |||
377 | 378 | ||
378 | if (acpi_gbl_original_dsdt_header.length != acpi_gbl_DSDT->length || | 379 | if (acpi_gbl_original_dsdt_header.length != acpi_gbl_DSDT->length || |
379 | acpi_gbl_original_dsdt_header.checksum != acpi_gbl_DSDT->checksum) { | 380 | acpi_gbl_original_dsdt_header.checksum != acpi_gbl_DSDT->checksum) { |
380 | ACPI_ERROR((AE_INFO, | 381 | ACPI_BIOS_ERROR((AE_INFO, |
381 | "The DSDT has been corrupted or replaced - old, new headers below")); | 382 | "The DSDT has been corrupted or replaced - " |
383 | "old, new headers below")); | ||
382 | acpi_tb_print_table_header(0, &acpi_gbl_original_dsdt_header); | 384 | acpi_tb_print_table_header(0, &acpi_gbl_original_dsdt_header); |
383 | acpi_tb_print_table_header(0, acpi_gbl_DSDT); | 385 | acpi_tb_print_table_header(0, acpi_gbl_DSDT); |
384 | 386 | ||
@@ -438,8 +440,8 @@ struct acpi_table_header *acpi_tb_copy_dsdt(u32 table_index) | |||
438 | * | 440 | * |
439 | * FUNCTION: acpi_tb_install_table | 441 | * FUNCTION: acpi_tb_install_table |
440 | * | 442 | * |
441 | * PARAMETERS: Address - Physical address of DSDT or FACS | 443 | * PARAMETERS: address - Physical address of DSDT or FACS |
442 | * Signature - Table signature, NULL if no need to | 444 | * signature - Table signature, NULL if no need to |
443 | * match | 445 | * match |
444 | * table_index - Index into root table array | 446 | * table_index - Index into root table array |
445 | * | 447 | * |
@@ -480,9 +482,10 @@ acpi_tb_install_table(acpi_physical_address address, | |||
480 | /* If a particular signature is expected (DSDT/FACS), it must match */ | 482 | /* If a particular signature is expected (DSDT/FACS), it must match */ |
481 | 483 | ||
482 | if (signature && !ACPI_COMPARE_NAME(table->signature, signature)) { | 484 | if (signature && !ACPI_COMPARE_NAME(table->signature, signature)) { |
483 | ACPI_ERROR((AE_INFO, | 485 | ACPI_BIOS_ERROR((AE_INFO, |
484 | "Invalid signature 0x%X for ACPI table, expected [%s]", | 486 | "Invalid signature 0x%X for ACPI table, expected [%s]", |
485 | *ACPI_CAST_PTR(u32, table->signature), signature)); | 487 | *ACPI_CAST_PTR(u32, table->signature), |
488 | signature)); | ||
486 | goto unmap_and_exit; | 489 | goto unmap_and_exit; |
487 | } | 490 | } |
488 | 491 | ||
@@ -589,10 +592,10 @@ acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size) | |||
589 | 592 | ||
590 | /* Will truncate 64-bit address to 32 bits, issue warning */ | 593 | /* Will truncate 64-bit address to 32 bits, issue warning */ |
591 | 594 | ||
592 | ACPI_WARNING((AE_INFO, | 595 | ACPI_BIOS_WARNING((AE_INFO, |
593 | "64-bit Physical Address in XSDT is too large (0x%8.8X%8.8X)," | 596 | "64-bit Physical Address in XSDT is too large (0x%8.8X%8.8X)," |
594 | " truncating", | 597 | " truncating", |
595 | ACPI_FORMAT_UINT64(address64))); | 598 | ACPI_FORMAT_UINT64(address64))); |
596 | } | 599 | } |
597 | #endif | 600 | #endif |
598 | return ((acpi_physical_address) (address64)); | 601 | return ((acpi_physical_address) (address64)); |
@@ -603,7 +606,7 @@ acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size) | |||
603 | * | 606 | * |
604 | * FUNCTION: acpi_tb_parse_root_table | 607 | * FUNCTION: acpi_tb_parse_root_table |
605 | * | 608 | * |
606 | * PARAMETERS: Rsdp - Pointer to the RSDP | 609 | * PARAMETERS: rsdp - Pointer to the RSDP |
607 | * | 610 | * |
608 | * RETURN: Status | 611 | * RETURN: Status |
609 | * | 612 | * |
@@ -694,8 +697,9 @@ acpi_tb_parse_root_table(acpi_physical_address rsdp_address) | |||
694 | acpi_os_unmap_memory(table, sizeof(struct acpi_table_header)); | 697 | acpi_os_unmap_memory(table, sizeof(struct acpi_table_header)); |
695 | 698 | ||
696 | if (length < sizeof(struct acpi_table_header)) { | 699 | if (length < sizeof(struct acpi_table_header)) { |
697 | ACPI_ERROR((AE_INFO, "Invalid length 0x%X in RSDT/XSDT", | 700 | ACPI_BIOS_ERROR((AE_INFO, |
698 | length)); | 701 | "Invalid table length 0x%X in RSDT/XSDT", |
702 | length)); | ||
699 | return_ACPI_STATUS(AE_INVALID_TABLE_LENGTH); | 703 | return_ACPI_STATUS(AE_INVALID_TABLE_LENGTH); |
700 | } | 704 | } |
701 | 705 | ||
diff --git a/drivers/acpi/acpica/tbxface.c b/drivers/acpi/acpica/tbxface.c index abcc6412c244..21101262e47a 100644 --- a/drivers/acpi/acpica/tbxface.c +++ b/drivers/acpi/acpica/tbxface.c | |||
@@ -1,7 +1,6 @@ | |||
1 | /****************************************************************************** | 1 | /****************************************************************************** |
2 | * | 2 | * |
3 | * Module Name: tbxface - Public interfaces to the ACPI subsystem | 3 | * Module Name: tbxface - ACPI table oriented external interfaces |
4 | * ACPI table oriented interfaces | ||
5 | * | 4 | * |
6 | *****************************************************************************/ | 5 | *****************************************************************************/ |
7 | 6 | ||
@@ -51,11 +50,6 @@ | |||
51 | #define _COMPONENT ACPI_TABLES | 50 | #define _COMPONENT ACPI_TABLES |
52 | ACPI_MODULE_NAME("tbxface") | 51 | ACPI_MODULE_NAME("tbxface") |
53 | 52 | ||
54 | /* Local prototypes */ | ||
55 | static acpi_status acpi_tb_load_namespace(void); | ||
56 | |||
57 | static int no_auto_ssdt; | ||
58 | |||
59 | /******************************************************************************* | 53 | /******************************************************************************* |
60 | * | 54 | * |
61 | * FUNCTION: acpi_allocate_root_table | 55 | * FUNCTION: acpi_allocate_root_table |
@@ -65,11 +59,10 @@ static int no_auto_ssdt; | |||
65 | * | 59 | * |
66 | * RETURN: Status | 60 | * RETURN: Status |
67 | * | 61 | * |
68 | * DESCRIPTION: Allocate a root table array. Used by i_aSL compiler and | 62 | * DESCRIPTION: Allocate a root table array. Used by iASL compiler and |
69 | * acpi_initialize_tables. | 63 | * acpi_initialize_tables. |
70 | * | 64 | * |
71 | ******************************************************************************/ | 65 | ******************************************************************************/ |
72 | |||
73 | acpi_status acpi_allocate_root_table(u32 initial_table_count) | 66 | acpi_status acpi_allocate_root_table(u32 initial_table_count) |
74 | { | 67 | { |
75 | 68 | ||
@@ -166,14 +159,12 @@ acpi_initialize_tables(struct acpi_table_desc * initial_table_array, | |||
166 | * DESCRIPTION: Reallocate Root Table List into dynamic memory. Copies the | 159 | * DESCRIPTION: Reallocate Root Table List into dynamic memory. Copies the |
167 | * root list from the previously provided scratch area. Should | 160 | * root list from the previously provided scratch area. Should |
168 | * be called once dynamic memory allocation is available in the | 161 | * be called once dynamic memory allocation is available in the |
169 | * kernel | 162 | * kernel. |
170 | * | 163 | * |
171 | ******************************************************************************/ | 164 | ******************************************************************************/ |
172 | acpi_status acpi_reallocate_root_table(void) | 165 | acpi_status acpi_reallocate_root_table(void) |
173 | { | 166 | { |
174 | struct acpi_table_desc *tables; | 167 | acpi_status status; |
175 | acpi_size new_size; | ||
176 | acpi_size current_size; | ||
177 | 168 | ||
178 | ACPI_FUNCTION_TRACE(acpi_reallocate_root_table); | 169 | ACPI_FUNCTION_TRACE(acpi_reallocate_root_table); |
179 | 170 | ||
@@ -185,89 +176,18 @@ acpi_status acpi_reallocate_root_table(void) | |||
185 | return_ACPI_STATUS(AE_SUPPORT); | 176 | return_ACPI_STATUS(AE_SUPPORT); |
186 | } | 177 | } |
187 | 178 | ||
188 | /* | 179 | acpi_gbl_root_table_list.flags |= ACPI_ROOT_ALLOW_RESIZE; |
189 | * Get the current size of the root table and add the default | ||
190 | * increment to create the new table size. | ||
191 | */ | ||
192 | current_size = (acpi_size) | ||
193 | acpi_gbl_root_table_list.current_table_count * | ||
194 | sizeof(struct acpi_table_desc); | ||
195 | |||
196 | new_size = current_size + | ||
197 | (ACPI_ROOT_TABLE_SIZE_INCREMENT * sizeof(struct acpi_table_desc)); | ||
198 | |||
199 | /* Create new array and copy the old array */ | ||
200 | |||
201 | tables = ACPI_ALLOCATE_ZEROED(new_size); | ||
202 | if (!tables) { | ||
203 | return_ACPI_STATUS(AE_NO_MEMORY); | ||
204 | } | ||
205 | |||
206 | ACPI_MEMCPY(tables, acpi_gbl_root_table_list.tables, current_size); | ||
207 | |||
208 | /* | ||
209 | * Update the root table descriptor. The new size will be the current | ||
210 | * number of tables plus the increment, independent of the reserved | ||
211 | * size of the original table list. | ||
212 | */ | ||
213 | acpi_gbl_root_table_list.tables = tables; | ||
214 | acpi_gbl_root_table_list.max_table_count = | ||
215 | acpi_gbl_root_table_list.current_table_count + | ||
216 | ACPI_ROOT_TABLE_SIZE_INCREMENT; | ||
217 | acpi_gbl_root_table_list.flags = | ||
218 | ACPI_ROOT_ORIGIN_ALLOCATED | ACPI_ROOT_ALLOW_RESIZE; | ||
219 | |||
220 | return_ACPI_STATUS(AE_OK); | ||
221 | } | ||
222 | |||
223 | /******************************************************************************* | ||
224 | * | ||
225 | * FUNCTION: acpi_load_table | ||
226 | * | ||
227 | * PARAMETERS: table_ptr - pointer to a buffer containing the entire | ||
228 | * table to be loaded | ||
229 | * | ||
230 | * RETURN: Status | ||
231 | * | ||
232 | * DESCRIPTION: This function is called to load a table from the caller's | ||
233 | * buffer. The buffer must contain an entire ACPI Table including | ||
234 | * a valid header. The header fields will be verified, and if it | ||
235 | * is determined that the table is invalid, the call will fail. | ||
236 | * | ||
237 | ******************************************************************************/ | ||
238 | acpi_status acpi_load_table(struct acpi_table_header *table_ptr) | ||
239 | { | ||
240 | acpi_status status; | ||
241 | u32 table_index; | ||
242 | struct acpi_table_desc table_desc; | ||
243 | |||
244 | if (!table_ptr) | ||
245 | return AE_BAD_PARAMETER; | ||
246 | |||
247 | ACPI_MEMSET(&table_desc, 0, sizeof(struct acpi_table_desc)); | ||
248 | table_desc.pointer = table_ptr; | ||
249 | table_desc.length = table_ptr->length; | ||
250 | table_desc.flags = ACPI_TABLE_ORIGIN_UNKNOWN; | ||
251 | 180 | ||
252 | /* | 181 | status = acpi_tb_resize_root_table_list(); |
253 | * Install the new table into the local data structures | 182 | return_ACPI_STATUS(status); |
254 | */ | ||
255 | status = acpi_tb_add_table(&table_desc, &table_index); | ||
256 | if (ACPI_FAILURE(status)) { | ||
257 | return status; | ||
258 | } | ||
259 | status = acpi_ns_load_table(table_index, acpi_gbl_root_node); | ||
260 | return status; | ||
261 | } | 183 | } |
262 | 184 | ||
263 | ACPI_EXPORT_SYMBOL(acpi_load_table) | ||
264 | |||
265 | /******************************************************************************* | 185 | /******************************************************************************* |
266 | * | 186 | * |
267 | * FUNCTION: acpi_get_table_header | 187 | * FUNCTION: acpi_get_table_header |
268 | * | 188 | * |
269 | * PARAMETERS: Signature - ACPI signature of needed table | 189 | * PARAMETERS: signature - ACPI signature of needed table |
270 | * Instance - Which instance (for SSDTs) | 190 | * instance - Which instance (for SSDTs) |
271 | * out_table_header - The pointer to the table header to fill | 191 | * out_table_header - The pointer to the table header to fill |
272 | * | 192 | * |
273 | * RETURN: Status and pointer to mapped table header | 193 | * RETURN: Status and pointer to mapped table header |
@@ -382,8 +302,8 @@ ACPI_EXPORT_SYMBOL(acpi_unload_table_id) | |||
382 | * | 302 | * |
383 | * FUNCTION: acpi_get_table_with_size | 303 | * FUNCTION: acpi_get_table_with_size |
384 | * | 304 | * |
385 | * PARAMETERS: Signature - ACPI signature of needed table | 305 | * PARAMETERS: signature - ACPI signature of needed table |
386 | * Instance - Which instance (for SSDTs) | 306 | * instance - Which instance (for SSDTs) |
387 | * out_table - Where the pointer to the table is returned | 307 | * out_table - Where the pointer to the table is returned |
388 | * | 308 | * |
389 | * RETURN: Status and pointer to table | 309 | * RETURN: Status and pointer to table |
@@ -436,6 +356,7 @@ acpi_get_table_with_size(char *signature, | |||
436 | 356 | ||
437 | return (AE_NOT_FOUND); | 357 | return (AE_NOT_FOUND); |
438 | } | 358 | } |
359 | ACPI_EXPORT_SYMBOL(acpi_get_table_with_size) | ||
439 | 360 | ||
440 | acpi_status | 361 | acpi_status |
441 | acpi_get_table(char *signature, | 362 | acpi_get_table(char *signature, |
@@ -453,7 +374,7 @@ ACPI_EXPORT_SYMBOL(acpi_get_table) | |||
453 | * FUNCTION: acpi_get_table_by_index | 374 | * FUNCTION: acpi_get_table_by_index |
454 | * | 375 | * |
455 | * PARAMETERS: table_index - Table index | 376 | * PARAMETERS: table_index - Table index |
456 | * Table - Where the pointer to the table is returned | 377 | * table - Where the pointer to the table is returned |
457 | * | 378 | * |
458 | * RETURN: Status and pointer to the table | 379 | * RETURN: Status and pointer to the table |
459 | * | 380 | * |
@@ -502,157 +423,13 @@ acpi_get_table_by_index(u32 table_index, struct acpi_table_header **table) | |||
502 | 423 | ||
503 | ACPI_EXPORT_SYMBOL(acpi_get_table_by_index) | 424 | ACPI_EXPORT_SYMBOL(acpi_get_table_by_index) |
504 | 425 | ||
505 | /******************************************************************************* | ||
506 | * | ||
507 | * FUNCTION: acpi_tb_load_namespace | ||
508 | * | ||
509 | * PARAMETERS: None | ||
510 | * | ||
511 | * RETURN: Status | ||
512 | * | ||
513 | * DESCRIPTION: Load the namespace from the DSDT and all SSDTs/PSDTs found in | ||
514 | * the RSDT/XSDT. | ||
515 | * | ||
516 | ******************************************************************************/ | ||
517 | static acpi_status acpi_tb_load_namespace(void) | ||
518 | { | ||
519 | acpi_status status; | ||
520 | u32 i; | ||
521 | struct acpi_table_header *new_dsdt; | ||
522 | |||
523 | ACPI_FUNCTION_TRACE(tb_load_namespace); | ||
524 | |||
525 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | ||
526 | |||
527 | /* | ||
528 | * Load the namespace. The DSDT is required, but any SSDT and | ||
529 | * PSDT tables are optional. Verify the DSDT. | ||
530 | */ | ||
531 | if (!acpi_gbl_root_table_list.current_table_count || | ||
532 | !ACPI_COMPARE_NAME(& | ||
533 | (acpi_gbl_root_table_list. | ||
534 | tables[ACPI_TABLE_INDEX_DSDT].signature), | ||
535 | ACPI_SIG_DSDT) | ||
536 | || | ||
537 | ACPI_FAILURE(acpi_tb_verify_table | ||
538 | (&acpi_gbl_root_table_list. | ||
539 | tables[ACPI_TABLE_INDEX_DSDT]))) { | ||
540 | status = AE_NO_ACPI_TABLES; | ||
541 | goto unlock_and_exit; | ||
542 | } | ||
543 | |||
544 | /* | ||
545 | * Save the DSDT pointer for simple access. This is the mapped memory | ||
546 | * address. We must take care here because the address of the .Tables | ||
547 | * array can change dynamically as tables are loaded at run-time. Note: | ||
548 | * .Pointer field is not validated until after call to acpi_tb_verify_table. | ||
549 | */ | ||
550 | acpi_gbl_DSDT = | ||
551 | acpi_gbl_root_table_list.tables[ACPI_TABLE_INDEX_DSDT].pointer; | ||
552 | |||
553 | /* | ||
554 | * Optionally copy the entire DSDT to local memory (instead of simply | ||
555 | * mapping it.) There are some BIOSs that corrupt or replace the original | ||
556 | * DSDT, creating the need for this option. Default is FALSE, do not copy | ||
557 | * the DSDT. | ||
558 | */ | ||
559 | if (acpi_gbl_copy_dsdt_locally) { | ||
560 | new_dsdt = acpi_tb_copy_dsdt(ACPI_TABLE_INDEX_DSDT); | ||
561 | if (new_dsdt) { | ||
562 | acpi_gbl_DSDT = new_dsdt; | ||
563 | } | ||
564 | } | ||
565 | |||
566 | /* | ||
567 | * Save the original DSDT header for detection of table corruption | ||
568 | * and/or replacement of the DSDT from outside the OS. | ||
569 | */ | ||
570 | ACPI_MEMCPY(&acpi_gbl_original_dsdt_header, acpi_gbl_DSDT, | ||
571 | sizeof(struct acpi_table_header)); | ||
572 | |||
573 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | ||
574 | |||
575 | /* Load and parse tables */ | ||
576 | |||
577 | status = acpi_ns_load_table(ACPI_TABLE_INDEX_DSDT, acpi_gbl_root_node); | ||
578 | if (ACPI_FAILURE(status)) { | ||
579 | return_ACPI_STATUS(status); | ||
580 | } | ||
581 | |||
582 | /* Load any SSDT or PSDT tables. Note: Loop leaves tables locked */ | ||
583 | |||
584 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | ||
585 | for (i = 0; i < acpi_gbl_root_table_list.current_table_count; ++i) { | ||
586 | if ((!ACPI_COMPARE_NAME | ||
587 | (&(acpi_gbl_root_table_list.tables[i].signature), | ||
588 | ACPI_SIG_SSDT) | ||
589 | && | ||
590 | !ACPI_COMPARE_NAME(& | ||
591 | (acpi_gbl_root_table_list.tables[i]. | ||
592 | signature), ACPI_SIG_PSDT)) | ||
593 | || | ||
594 | ACPI_FAILURE(acpi_tb_verify_table | ||
595 | (&acpi_gbl_root_table_list.tables[i]))) { | ||
596 | continue; | ||
597 | } | ||
598 | |||
599 | if (no_auto_ssdt) { | ||
600 | printk(KERN_WARNING "ACPI: SSDT ignored due to \"acpi_no_auto_ssdt\"\n"); | ||
601 | continue; | ||
602 | } | ||
603 | |||
604 | /* Ignore errors while loading tables, get as many as possible */ | ||
605 | |||
606 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | ||
607 | (void)acpi_ns_load_table(i, acpi_gbl_root_node); | ||
608 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | ||
609 | } | ||
610 | |||
611 | ACPI_DEBUG_PRINT((ACPI_DB_INIT, "ACPI Tables successfully acquired\n")); | ||
612 | |||
613 | unlock_and_exit: | ||
614 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | ||
615 | return_ACPI_STATUS(status); | ||
616 | } | ||
617 | |||
618 | /******************************************************************************* | ||
619 | * | ||
620 | * FUNCTION: acpi_load_tables | ||
621 | * | ||
622 | * PARAMETERS: None | ||
623 | * | ||
624 | * RETURN: Status | ||
625 | * | ||
626 | * DESCRIPTION: Load the ACPI tables from the RSDT/XSDT | ||
627 | * | ||
628 | ******************************************************************************/ | ||
629 | |||
630 | acpi_status acpi_load_tables(void) | ||
631 | { | ||
632 | acpi_status status; | ||
633 | |||
634 | ACPI_FUNCTION_TRACE(acpi_load_tables); | ||
635 | |||
636 | /* Load the namespace from the tables */ | ||
637 | |||
638 | status = acpi_tb_load_namespace(); | ||
639 | if (ACPI_FAILURE(status)) { | ||
640 | ACPI_EXCEPTION((AE_INFO, status, | ||
641 | "While loading namespace from ACPI tables")); | ||
642 | } | ||
643 | |||
644 | return_ACPI_STATUS(status); | ||
645 | } | ||
646 | |||
647 | ACPI_EXPORT_SYMBOL(acpi_load_tables) | ||
648 | |||
649 | 426 | ||
650 | /******************************************************************************* | 427 | /******************************************************************************* |
651 | * | 428 | * |
652 | * FUNCTION: acpi_install_table_handler | 429 | * FUNCTION: acpi_install_table_handler |
653 | * | 430 | * |
654 | * PARAMETERS: Handler - Table event handler | 431 | * PARAMETERS: handler - Table event handler |
655 | * Context - Value passed to the handler on each event | 432 | * context - Value passed to the handler on each event |
656 | * | 433 | * |
657 | * RETURN: Status | 434 | * RETURN: Status |
658 | * | 435 | * |
@@ -698,7 +475,7 @@ ACPI_EXPORT_SYMBOL(acpi_install_table_handler) | |||
698 | * | 475 | * |
699 | * FUNCTION: acpi_remove_table_handler | 476 | * FUNCTION: acpi_remove_table_handler |
700 | * | 477 | * |
701 | * PARAMETERS: Handler - Table event handler that was installed | 478 | * PARAMETERS: handler - Table event handler that was installed |
702 | * previously. | 479 | * previously. |
703 | * | 480 | * |
704 | * RETURN: Status | 481 | * RETURN: Status |
@@ -734,15 +511,3 @@ acpi_status acpi_remove_table_handler(acpi_tbl_handler handler) | |||
734 | } | 511 | } |
735 | 512 | ||
736 | ACPI_EXPORT_SYMBOL(acpi_remove_table_handler) | 513 | ACPI_EXPORT_SYMBOL(acpi_remove_table_handler) |
737 | |||
738 | |||
739 | static int __init acpi_no_auto_ssdt_setup(char *s) { | ||
740 | |||
741 | printk(KERN_NOTICE "ACPI: SSDT auto-load disabled\n"); | ||
742 | |||
743 | no_auto_ssdt = 1; | ||
744 | |||
745 | return 1; | ||
746 | } | ||
747 | |||
748 | __setup("acpi_no_auto_ssdt", acpi_no_auto_ssdt_setup); | ||
diff --git a/drivers/acpi/acpica/tbxfload.c b/drivers/acpi/acpica/tbxfload.c new file mode 100644 index 000000000000..f87cc63e69a1 --- /dev/null +++ b/drivers/acpi/acpica/tbxfload.c | |||
@@ -0,0 +1,389 @@ | |||
1 | /****************************************************************************** | ||
2 | * | ||
3 | * Module Name: tbxfload - Table load/unload external interfaces | ||
4 | * | ||
5 | *****************************************************************************/ | ||
6 | |||
7 | /* | ||
8 | * Copyright (C) 2000 - 2012, Intel Corp. | ||
9 | * All rights reserved. | ||
10 | * | ||
11 | * Redistribution and use in source and binary forms, with or without | ||
12 | * modification, are permitted provided that the following conditions | ||
13 | * are met: | ||
14 | * 1. Redistributions of source code must retain the above copyright | ||
15 | * notice, this list of conditions, and the following disclaimer, | ||
16 | * without modification. | ||
17 | * 2. Redistributions in binary form must reproduce at minimum a disclaimer | ||
18 | * substantially similar to the "NO WARRANTY" disclaimer below | ||
19 | * ("Disclaimer") and any redistribution must be conditioned upon | ||
20 | * including a substantially similar Disclaimer requirement for further | ||
21 | * binary redistribution. | ||
22 | * 3. Neither the names of the above-listed copyright holders nor the names | ||
23 | * of any contributors may be used to endorse or promote products derived | ||
24 | * from this software without specific prior written permission. | ||
25 | * | ||
26 | * Alternatively, this software may be distributed under the terms of the | ||
27 | * GNU General Public License ("GPL") version 2 as published by the Free | ||
28 | * Software Foundation. | ||
29 | * | ||
30 | * NO WARRANTY | ||
31 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
32 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
33 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR | ||
34 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
35 | * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
36 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
37 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
38 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
39 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | ||
40 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
41 | * POSSIBILITY OF SUCH DAMAGES. | ||
42 | */ | ||
43 | |||
44 | #include <linux/export.h> | ||
45 | #include <acpi/acpi.h> | ||
46 | #include "accommon.h" | ||
47 | #include "acnamesp.h" | ||
48 | #include "actables.h" | ||
49 | |||
50 | #define _COMPONENT ACPI_TABLES | ||
51 | ACPI_MODULE_NAME("tbxfload") | ||
52 | |||
53 | /* Local prototypes */ | ||
54 | static acpi_status acpi_tb_load_namespace(void); | ||
55 | |||
56 | static int no_auto_ssdt; | ||
57 | |||
58 | /******************************************************************************* | ||
59 | * | ||
60 | * FUNCTION: acpi_load_tables | ||
61 | * | ||
62 | * PARAMETERS: None | ||
63 | * | ||
64 | * RETURN: Status | ||
65 | * | ||
66 | * DESCRIPTION: Load the ACPI tables from the RSDT/XSDT | ||
67 | * | ||
68 | ******************************************************************************/ | ||
69 | |||
70 | acpi_status acpi_load_tables(void) | ||
71 | { | ||
72 | acpi_status status; | ||
73 | |||
74 | ACPI_FUNCTION_TRACE(acpi_load_tables); | ||
75 | |||
76 | /* Load the namespace from the tables */ | ||
77 | |||
78 | status = acpi_tb_load_namespace(); | ||
79 | if (ACPI_FAILURE(status)) { | ||
80 | ACPI_EXCEPTION((AE_INFO, status, | ||
81 | "While loading namespace from ACPI tables")); | ||
82 | } | ||
83 | |||
84 | return_ACPI_STATUS(status); | ||
85 | } | ||
86 | |||
87 | ACPI_EXPORT_SYMBOL(acpi_load_tables) | ||
88 | |||
89 | /******************************************************************************* | ||
90 | * | ||
91 | * FUNCTION: acpi_tb_load_namespace | ||
92 | * | ||
93 | * PARAMETERS: None | ||
94 | * | ||
95 | * RETURN: Status | ||
96 | * | ||
97 | * DESCRIPTION: Load the namespace from the DSDT and all SSDTs/PSDTs found in | ||
98 | * the RSDT/XSDT. | ||
99 | * | ||
100 | ******************************************************************************/ | ||
101 | static acpi_status acpi_tb_load_namespace(void) | ||
102 | { | ||
103 | acpi_status status; | ||
104 | u32 i; | ||
105 | struct acpi_table_header *new_dsdt; | ||
106 | |||
107 | ACPI_FUNCTION_TRACE(tb_load_namespace); | ||
108 | |||
109 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | ||
110 | |||
111 | /* | ||
112 | * Load the namespace. The DSDT is required, but any SSDT and | ||
113 | * PSDT tables are optional. Verify the DSDT. | ||
114 | */ | ||
115 | if (!acpi_gbl_root_table_list.current_table_count || | ||
116 | !ACPI_COMPARE_NAME(& | ||
117 | (acpi_gbl_root_table_list. | ||
118 | tables[ACPI_TABLE_INDEX_DSDT].signature), | ||
119 | ACPI_SIG_DSDT) | ||
120 | || | ||
121 | ACPI_FAILURE(acpi_tb_verify_table | ||
122 | (&acpi_gbl_root_table_list. | ||
123 | tables[ACPI_TABLE_INDEX_DSDT]))) { | ||
124 | status = AE_NO_ACPI_TABLES; | ||
125 | goto unlock_and_exit; | ||
126 | } | ||
127 | |||
128 | /* | ||
129 | * Save the DSDT pointer for simple access. This is the mapped memory | ||
130 | * address. We must take care here because the address of the .Tables | ||
131 | * array can change dynamically as tables are loaded at run-time. Note: | ||
132 | * .Pointer field is not validated until after call to acpi_tb_verify_table. | ||
133 | */ | ||
134 | acpi_gbl_DSDT = | ||
135 | acpi_gbl_root_table_list.tables[ACPI_TABLE_INDEX_DSDT].pointer; | ||
136 | |||
137 | /* | ||
138 | * Optionally copy the entire DSDT to local memory (instead of simply | ||
139 | * mapping it.) There are some BIOSs that corrupt or replace the original | ||
140 | * DSDT, creating the need for this option. Default is FALSE, do not copy | ||
141 | * the DSDT. | ||
142 | */ | ||
143 | if (acpi_gbl_copy_dsdt_locally) { | ||
144 | new_dsdt = acpi_tb_copy_dsdt(ACPI_TABLE_INDEX_DSDT); | ||
145 | if (new_dsdt) { | ||
146 | acpi_gbl_DSDT = new_dsdt; | ||
147 | } | ||
148 | } | ||
149 | |||
150 | /* | ||
151 | * Save the original DSDT header for detection of table corruption | ||
152 | * and/or replacement of the DSDT from outside the OS. | ||
153 | */ | ||
154 | ACPI_MEMCPY(&acpi_gbl_original_dsdt_header, acpi_gbl_DSDT, | ||
155 | sizeof(struct acpi_table_header)); | ||
156 | |||
157 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | ||
158 | |||
159 | /* Load and parse tables */ | ||
160 | |||
161 | status = acpi_ns_load_table(ACPI_TABLE_INDEX_DSDT, acpi_gbl_root_node); | ||
162 | if (ACPI_FAILURE(status)) { | ||
163 | return_ACPI_STATUS(status); | ||
164 | } | ||
165 | |||
166 | /* Load any SSDT or PSDT tables. Note: Loop leaves tables locked */ | ||
167 | |||
168 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | ||
169 | for (i = 0; i < acpi_gbl_root_table_list.current_table_count; ++i) { | ||
170 | if ((!ACPI_COMPARE_NAME | ||
171 | (&(acpi_gbl_root_table_list.tables[i].signature), | ||
172 | ACPI_SIG_SSDT) | ||
173 | && | ||
174 | !ACPI_COMPARE_NAME(& | ||
175 | (acpi_gbl_root_table_list.tables[i]. | ||
176 | signature), ACPI_SIG_PSDT)) | ||
177 | || | ||
178 | ACPI_FAILURE(acpi_tb_verify_table | ||
179 | (&acpi_gbl_root_table_list.tables[i]))) { | ||
180 | continue; | ||
181 | } | ||
182 | |||
183 | if (no_auto_ssdt) { | ||
184 | printk(KERN_WARNING "ACPI: SSDT ignored due to \"acpi_no_auto_ssdt\"\n"); | ||
185 | continue; | ||
186 | } | ||
187 | |||
188 | /* Ignore errors while loading tables, get as many as possible */ | ||
189 | |||
190 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | ||
191 | (void)acpi_ns_load_table(i, acpi_gbl_root_node); | ||
192 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | ||
193 | } | ||
194 | |||
195 | ACPI_DEBUG_PRINT((ACPI_DB_INIT, "ACPI Tables successfully acquired\n")); | ||
196 | |||
197 | unlock_and_exit: | ||
198 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | ||
199 | return_ACPI_STATUS(status); | ||
200 | } | ||
201 | |||
202 | /******************************************************************************* | ||
203 | * | ||
204 | * FUNCTION: acpi_load_table | ||
205 | * | ||
206 | * PARAMETERS: table - Pointer to a buffer containing the ACPI | ||
207 | * table to be loaded. | ||
208 | * | ||
209 | * RETURN: Status | ||
210 | * | ||
211 | * DESCRIPTION: Dynamically load an ACPI table from the caller's buffer. Must | ||
212 | * be a valid ACPI table with a valid ACPI table header. | ||
213 | * Note1: Mainly intended to support hotplug addition of SSDTs. | ||
214 | * Note2: Does not copy the incoming table. User is reponsible | ||
215 | * to ensure that the table is not deleted or unmapped. | ||
216 | * | ||
217 | ******************************************************************************/ | ||
218 | |||
219 | acpi_status acpi_load_table(struct acpi_table_header *table) | ||
220 | { | ||
221 | acpi_status status; | ||
222 | struct acpi_table_desc table_desc; | ||
223 | u32 table_index; | ||
224 | |||
225 | ACPI_FUNCTION_TRACE(acpi_load_table); | ||
226 | |||
227 | /* Parameter validation */ | ||
228 | |||
229 | if (!table) { | ||
230 | return_ACPI_STATUS(AE_BAD_PARAMETER); | ||
231 | } | ||
232 | |||
233 | /* Init local table descriptor */ | ||
234 | |||
235 | ACPI_MEMSET(&table_desc, 0, sizeof(struct acpi_table_desc)); | ||
236 | table_desc.address = ACPI_PTR_TO_PHYSADDR(table); | ||
237 | table_desc.pointer = table; | ||
238 | table_desc.length = table->length; | ||
239 | table_desc.flags = ACPI_TABLE_ORIGIN_UNKNOWN; | ||
240 | |||
241 | /* Must acquire the interpreter lock during this operation */ | ||
242 | |||
243 | status = acpi_ut_acquire_mutex(ACPI_MTX_INTERPRETER); | ||
244 | if (ACPI_FAILURE(status)) { | ||
245 | return_ACPI_STATUS(status); | ||
246 | } | ||
247 | |||
248 | /* Install the table and load it into the namespace */ | ||
249 | |||
250 | ACPI_INFO((AE_INFO, "Host-directed Dynamic ACPI Table Load:")); | ||
251 | status = acpi_tb_add_table(&table_desc, &table_index); | ||
252 | if (ACPI_FAILURE(status)) { | ||
253 | goto unlock_and_exit; | ||
254 | } | ||
255 | |||
256 | status = acpi_ns_load_table(table_index, acpi_gbl_root_node); | ||
257 | |||
258 | /* Invoke table handler if present */ | ||
259 | |||
260 | if (acpi_gbl_table_handler) { | ||
261 | (void)acpi_gbl_table_handler(ACPI_TABLE_EVENT_LOAD, table, | ||
262 | acpi_gbl_table_handler_context); | ||
263 | } | ||
264 | |||
265 | unlock_and_exit: | ||
266 | (void)acpi_ut_release_mutex(ACPI_MTX_INTERPRETER); | ||
267 | return_ACPI_STATUS(status); | ||
268 | } | ||
269 | |||
270 | ACPI_EXPORT_SYMBOL(acpi_load_table) | ||
271 | |||
272 | /******************************************************************************* | ||
273 | * | ||
274 | * FUNCTION: acpi_unload_parent_table | ||
275 | * | ||
276 | * PARAMETERS: object - Handle to any namespace object owned by | ||
277 | * the table to be unloaded | ||
278 | * | ||
279 | * RETURN: Status | ||
280 | * | ||
281 | * DESCRIPTION: Via any namespace object within an SSDT or OEMx table, unloads | ||
282 | * the table and deletes all namespace objects associated with | ||
283 | * that table. Unloading of the DSDT is not allowed. | ||
284 | * Note: Mainly intended to support hotplug removal of SSDTs. | ||
285 | * | ||
286 | ******************************************************************************/ | ||
287 | acpi_status acpi_unload_parent_table(acpi_handle object) | ||
288 | { | ||
289 | struct acpi_namespace_node *node = | ||
290 | ACPI_CAST_PTR(struct acpi_namespace_node, object); | ||
291 | acpi_status status = AE_NOT_EXIST; | ||
292 | acpi_owner_id owner_id; | ||
293 | u32 i; | ||
294 | |||
295 | ACPI_FUNCTION_TRACE(acpi_unload_parent_table); | ||
296 | |||
297 | /* Parameter validation */ | ||
298 | |||
299 | if (!object) { | ||
300 | return_ACPI_STATUS(AE_BAD_PARAMETER); | ||
301 | } | ||
302 | |||
303 | /* | ||
304 | * The node owner_id is currently the same as the parent table ID. | ||
305 | * However, this could change in the future. | ||
306 | */ | ||
307 | owner_id = node->owner_id; | ||
308 | if (!owner_id) { | ||
309 | |||
310 | /* owner_id==0 means DSDT is the owner. DSDT cannot be unloaded */ | ||
311 | |||
312 | return_ACPI_STATUS(AE_TYPE); | ||
313 | } | ||
314 | |||
315 | /* Must acquire the interpreter lock during this operation */ | ||
316 | |||
317 | status = acpi_ut_acquire_mutex(ACPI_MTX_INTERPRETER); | ||
318 | if (ACPI_FAILURE(status)) { | ||
319 | return_ACPI_STATUS(status); | ||
320 | } | ||
321 | |||
322 | /* Find the table in the global table list */ | ||
323 | |||
324 | for (i = 0; i < acpi_gbl_root_table_list.current_table_count; i++) { | ||
325 | if (owner_id != acpi_gbl_root_table_list.tables[i].owner_id) { | ||
326 | continue; | ||
327 | } | ||
328 | |||
329 | /* | ||
330 | * Allow unload of SSDT and OEMx tables only. Do not allow unload | ||
331 | * of the DSDT. No other types of tables should get here, since | ||
332 | * only these types can contain AML and thus are the only types | ||
333 | * that can create namespace objects. | ||
334 | */ | ||
335 | if (ACPI_COMPARE_NAME | ||
336 | (acpi_gbl_root_table_list.tables[i].signature.ascii, | ||
337 | ACPI_SIG_DSDT)) { | ||
338 | status = AE_TYPE; | ||
339 | break; | ||
340 | } | ||
341 | |||
342 | /* Ensure the table is actually loaded */ | ||
343 | |||
344 | if (!acpi_tb_is_table_loaded(i)) { | ||
345 | status = AE_NOT_EXIST; | ||
346 | break; | ||
347 | } | ||
348 | |||
349 | /* Invoke table handler if present */ | ||
350 | |||
351 | if (acpi_gbl_table_handler) { | ||
352 | (void)acpi_gbl_table_handler(ACPI_TABLE_EVENT_UNLOAD, | ||
353 | acpi_gbl_root_table_list. | ||
354 | tables[i].pointer, | ||
355 | acpi_gbl_table_handler_context); | ||
356 | } | ||
357 | |||
358 | /* | ||
359 | * Delete all namespace objects owned by this table. Note that | ||
360 | * these objects can appear anywhere in the namespace by virtue | ||
361 | * of the AML "Scope" operator. Thus, we need to track ownership | ||
362 | * by an ID, not simply a position within the hierarchy. | ||
363 | */ | ||
364 | status = acpi_tb_delete_namespace_by_owner(i); | ||
365 | if (ACPI_FAILURE(status)) { | ||
366 | break; | ||
367 | } | ||
368 | |||
369 | status = acpi_tb_release_owner_id(i); | ||
370 | acpi_tb_set_table_loaded_flag(i, FALSE); | ||
371 | break; | ||
372 | } | ||
373 | |||
374 | (void)acpi_ut_release_mutex(ACPI_MTX_INTERPRETER); | ||
375 | return_ACPI_STATUS(status); | ||
376 | } | ||
377 | |||
378 | ACPI_EXPORT_SYMBOL(acpi_unload_parent_table) | ||
379 | |||
380 | static int __init acpi_no_auto_ssdt_setup(char *s) { | ||
381 | |||
382 | printk(KERN_NOTICE "ACPI: SSDT auto-load disabled\n"); | ||
383 | |||
384 | no_auto_ssdt = 1; | ||
385 | |||
386 | return 1; | ||
387 | } | ||
388 | |||
389 | __setup("acpi_no_auto_ssdt", acpi_no_auto_ssdt_setup); | ||
diff --git a/drivers/acpi/acpica/tbxfroot.c b/drivers/acpi/acpica/tbxfroot.c index 4258f647ca3d..74e720800037 100644 --- a/drivers/acpi/acpica/tbxfroot.c +++ b/drivers/acpi/acpica/tbxfroot.c | |||
@@ -57,7 +57,7 @@ static acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp); | |||
57 | * | 57 | * |
58 | * FUNCTION: acpi_tb_validate_rsdp | 58 | * FUNCTION: acpi_tb_validate_rsdp |
59 | * | 59 | * |
60 | * PARAMETERS: Rsdp - Pointer to unvalidated RSDP | 60 | * PARAMETERS: rsdp - Pointer to unvalidated RSDP |
61 | * | 61 | * |
62 | * RETURN: Status | 62 | * RETURN: Status |
63 | * | 63 | * |
@@ -107,10 +107,10 @@ static acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp) | |||
107 | * | 107 | * |
108 | * RETURN: Status, RSDP physical address | 108 | * RETURN: Status, RSDP physical address |
109 | * | 109 | * |
110 | * DESCRIPTION: Search lower 1_mbyte of memory for the root system descriptor | 110 | * DESCRIPTION: Search lower 1Mbyte of memory for the root system descriptor |
111 | * pointer structure. If it is found, set *RSDP to point to it. | 111 | * pointer structure. If it is found, set *RSDP to point to it. |
112 | * | 112 | * |
113 | * NOTE1: The RSDP must be either in the first 1_k of the Extended | 113 | * NOTE1: The RSDP must be either in the first 1K of the Extended |
114 | * BIOS Data Area or between E0000 and FFFFF (From ACPI Spec.) | 114 | * BIOS Data Area or between E0000 and FFFFF (From ACPI Spec.) |
115 | * Only a 32-bit physical address is necessary. | 115 | * Only a 32-bit physical address is necessary. |
116 | * | 116 | * |
@@ -152,7 +152,7 @@ acpi_status acpi_find_root_pointer(acpi_size *table_address) | |||
152 | if (physical_address > 0x400) { | 152 | if (physical_address > 0x400) { |
153 | /* | 153 | /* |
154 | * 1b) Search EBDA paragraphs (EBDA is required to be a | 154 | * 1b) Search EBDA paragraphs (EBDA is required to be a |
155 | * minimum of 1_k length) | 155 | * minimum of 1K length) |
156 | */ | 156 | */ |
157 | table_ptr = acpi_os_map_memory((acpi_physical_address) | 157 | table_ptr = acpi_os_map_memory((acpi_physical_address) |
158 | physical_address, | 158 | physical_address, |
@@ -216,7 +216,7 @@ acpi_status acpi_find_root_pointer(acpi_size *table_address) | |||
216 | 216 | ||
217 | /* A valid RSDP was not found */ | 217 | /* A valid RSDP was not found */ |
218 | 218 | ||
219 | ACPI_ERROR((AE_INFO, "A valid RSDP was not found")); | 219 | ACPI_BIOS_ERROR((AE_INFO, "A valid RSDP was not found")); |
220 | return_ACPI_STATUS(AE_NOT_FOUND); | 220 | return_ACPI_STATUS(AE_NOT_FOUND); |
221 | } | 221 | } |
222 | 222 | ||
@@ -225,7 +225,7 @@ acpi_status acpi_find_root_pointer(acpi_size *table_address) | |||
225 | * FUNCTION: acpi_tb_scan_memory_for_rsdp | 225 | * FUNCTION: acpi_tb_scan_memory_for_rsdp |
226 | * | 226 | * |
227 | * PARAMETERS: start_address - Starting pointer for search | 227 | * PARAMETERS: start_address - Starting pointer for search |
228 | * Length - Maximum length to search | 228 | * length - Maximum length to search |
229 | * | 229 | * |
230 | * RETURN: Pointer to the RSDP if found, otherwise NULL. | 230 | * RETURN: Pointer to the RSDP if found, otherwise NULL. |
231 | * | 231 | * |
diff --git a/drivers/acpi/acpica/utaddress.c b/drivers/acpi/acpica/utaddress.c index 67932aebe6dd..64880306133d 100644 --- a/drivers/acpi/acpica/utaddress.c +++ b/drivers/acpi/acpica/utaddress.c | |||
@@ -53,8 +53,8 @@ ACPI_MODULE_NAME("utaddress") | |||
53 | * FUNCTION: acpi_ut_add_address_range | 53 | * FUNCTION: acpi_ut_add_address_range |
54 | * | 54 | * |
55 | * PARAMETERS: space_id - Address space ID | 55 | * PARAMETERS: space_id - Address space ID |
56 | * Address - op_region start address | 56 | * address - op_region start address |
57 | * Length - op_region length | 57 | * length - op_region length |
58 | * region_node - op_region namespace node | 58 | * region_node - op_region namespace node |
59 | * | 59 | * |
60 | * RETURN: Status | 60 | * RETURN: Status |
@@ -186,9 +186,9 @@ acpi_ut_remove_address_range(acpi_adr_space_type space_id, | |||
186 | * FUNCTION: acpi_ut_check_address_range | 186 | * FUNCTION: acpi_ut_check_address_range |
187 | * | 187 | * |
188 | * PARAMETERS: space_id - Address space ID | 188 | * PARAMETERS: space_id - Address space ID |
189 | * Address - Start address | 189 | * address - Start address |
190 | * Length - Length of address range | 190 | * length - Length of address range |
191 | * Warn - TRUE if warning on overlap desired | 191 | * warn - TRUE if warning on overlap desired |
192 | * | 192 | * |
193 | * RETURN: Count of the number of conflicts detected. Zero is always | 193 | * RETURN: Count of the number of conflicts detected. Zero is always |
194 | * returned for Space IDs other than Memory or I/O. | 194 | * returned for Space IDs other than Memory or I/O. |
diff --git a/drivers/acpi/acpica/utalloc.c b/drivers/acpi/acpica/utalloc.c index 9982d2ea66fb..ed29d474095e 100644 --- a/drivers/acpi/acpica/utalloc.c +++ b/drivers/acpi/acpica/utalloc.c | |||
@@ -189,7 +189,7 @@ acpi_status acpi_ut_delete_caches(void) | |||
189 | * | 189 | * |
190 | * FUNCTION: acpi_ut_validate_buffer | 190 | * FUNCTION: acpi_ut_validate_buffer |
191 | * | 191 | * |
192 | * PARAMETERS: Buffer - Buffer descriptor to be validated | 192 | * PARAMETERS: buffer - Buffer descriptor to be validated |
193 | * | 193 | * |
194 | * RETURN: Status | 194 | * RETURN: Status |
195 | * | 195 | * |
@@ -227,7 +227,7 @@ acpi_status acpi_ut_validate_buffer(struct acpi_buffer * buffer) | |||
227 | * | 227 | * |
228 | * FUNCTION: acpi_ut_initialize_buffer | 228 | * FUNCTION: acpi_ut_initialize_buffer |
229 | * | 229 | * |
230 | * PARAMETERS: Buffer - Buffer to be validated | 230 | * PARAMETERS: buffer - Buffer to be validated |
231 | * required_length - Length needed | 231 | * required_length - Length needed |
232 | * | 232 | * |
233 | * RETURN: Status | 233 | * RETURN: Status |
@@ -308,10 +308,10 @@ acpi_ut_initialize_buffer(struct acpi_buffer * buffer, | |||
308 | * | 308 | * |
309 | * FUNCTION: acpi_ut_allocate | 309 | * FUNCTION: acpi_ut_allocate |
310 | * | 310 | * |
311 | * PARAMETERS: Size - Size of the allocation | 311 | * PARAMETERS: size - Size of the allocation |
312 | * Component - Component type of caller | 312 | * component - Component type of caller |
313 | * Module - Source file name of caller | 313 | * module - Source file name of caller |
314 | * Line - Line number of caller | 314 | * line - Line number of caller |
315 | * | 315 | * |
316 | * RETURN: Address of the allocated memory on success, NULL on failure. | 316 | * RETURN: Address of the allocated memory on success, NULL on failure. |
317 | * | 317 | * |
@@ -352,10 +352,10 @@ void *acpi_ut_allocate(acpi_size size, | |||
352 | * | 352 | * |
353 | * FUNCTION: acpi_ut_allocate_zeroed | 353 | * FUNCTION: acpi_ut_allocate_zeroed |
354 | * | 354 | * |
355 | * PARAMETERS: Size - Size of the allocation | 355 | * PARAMETERS: size - Size of the allocation |
356 | * Component - Component type of caller | 356 | * component - Component type of caller |
357 | * Module - Source file name of caller | 357 | * module - Source file name of caller |
358 | * Line - Line number of caller | 358 | * line - Line number of caller |
359 | * | 359 | * |
360 | * RETURN: Address of the allocated memory on success, NULL on failure. | 360 | * RETURN: Address of the allocated memory on success, NULL on failure. |
361 | * | 361 | * |
diff --git a/drivers/acpi/acpica/utcopy.c b/drivers/acpi/acpica/utcopy.c index 3317c0a406ee..294692ae76e9 100644 --- a/drivers/acpi/acpica/utcopy.c +++ b/drivers/acpi/acpica/utcopy.c | |||
@@ -317,7 +317,7 @@ acpi_ut_copy_ielement_to_eelement(u8 object_type, | |||
317 | * FUNCTION: acpi_ut_copy_ipackage_to_epackage | 317 | * FUNCTION: acpi_ut_copy_ipackage_to_epackage |
318 | * | 318 | * |
319 | * PARAMETERS: internal_object - Pointer to the object we are returning | 319 | * PARAMETERS: internal_object - Pointer to the object we are returning |
320 | * Buffer - Where the object is returned | 320 | * buffer - Where the object is returned |
321 | * space_used - Where the object length is returned | 321 | * space_used - Where the object length is returned |
322 | * | 322 | * |
323 | * RETURN: Status | 323 | * RETURN: Status |
diff --git a/drivers/acpi/acpica/utdebug.c b/drivers/acpi/acpica/utdebug.c index a0998a886318..e810894149ae 100644 --- a/drivers/acpi/acpica/utdebug.c +++ b/drivers/acpi/acpica/utdebug.c | |||
@@ -145,7 +145,7 @@ static const char *acpi_ut_trim_function_name(const char *function_name) | |||
145 | * function_name - Caller's procedure name | 145 | * function_name - Caller's procedure name |
146 | * module_name - Caller's module name | 146 | * module_name - Caller's module name |
147 | * component_id - Caller's component ID | 147 | * component_id - Caller's component ID |
148 | * Format - Printf format field | 148 | * format - Printf format field |
149 | * ... - Optional printf arguments | 149 | * ... - Optional printf arguments |
150 | * | 150 | * |
151 | * RETURN: None | 151 | * RETURN: None |
@@ -217,7 +217,7 @@ ACPI_EXPORT_SYMBOL(acpi_debug_print) | |||
217 | * function_name - Caller's procedure name | 217 | * function_name - Caller's procedure name |
218 | * module_name - Caller's module name | 218 | * module_name - Caller's module name |
219 | * component_id - Caller's component ID | 219 | * component_id - Caller's component ID |
220 | * Format - Printf format field | 220 | * format - Printf format field |
221 | * ... - Optional printf arguments | 221 | * ... - Optional printf arguments |
222 | * | 222 | * |
223 | * RETURN: None | 223 | * RETURN: None |
@@ -286,7 +286,7 @@ ACPI_EXPORT_SYMBOL(acpi_ut_trace) | |||
286 | * function_name - Caller's procedure name | 286 | * function_name - Caller's procedure name |
287 | * module_name - Caller's module name | 287 | * module_name - Caller's module name |
288 | * component_id - Caller's component ID | 288 | * component_id - Caller's component ID |
289 | * Pointer - Pointer to display | 289 | * pointer - Pointer to display |
290 | * | 290 | * |
291 | * RETURN: None | 291 | * RETURN: None |
292 | * | 292 | * |
@@ -315,7 +315,7 @@ acpi_ut_trace_ptr(u32 line_number, | |||
315 | * function_name - Caller's procedure name | 315 | * function_name - Caller's procedure name |
316 | * module_name - Caller's module name | 316 | * module_name - Caller's module name |
317 | * component_id - Caller's component ID | 317 | * component_id - Caller's component ID |
318 | * String - Additional string to display | 318 | * string - Additional string to display |
319 | * | 319 | * |
320 | * RETURN: None | 320 | * RETURN: None |
321 | * | 321 | * |
@@ -346,7 +346,7 @@ acpi_ut_trace_str(u32 line_number, | |||
346 | * function_name - Caller's procedure name | 346 | * function_name - Caller's procedure name |
347 | * module_name - Caller's module name | 347 | * module_name - Caller's module name |
348 | * component_id - Caller's component ID | 348 | * component_id - Caller's component ID |
349 | * Integer - Integer to display | 349 | * integer - Integer to display |
350 | * | 350 | * |
351 | * RETURN: None | 351 | * RETURN: None |
352 | * | 352 | * |
@@ -408,7 +408,7 @@ ACPI_EXPORT_SYMBOL(acpi_ut_exit) | |||
408 | * function_name - Caller's procedure name | 408 | * function_name - Caller's procedure name |
409 | * module_name - Caller's module name | 409 | * module_name - Caller's module name |
410 | * component_id - Caller's component ID | 410 | * component_id - Caller's component ID |
411 | * Status - Exit status code | 411 | * status - Exit status code |
412 | * | 412 | * |
413 | * RETURN: None | 413 | * RETURN: None |
414 | * | 414 | * |
@@ -449,7 +449,7 @@ ACPI_EXPORT_SYMBOL(acpi_ut_status_exit) | |||
449 | * function_name - Caller's procedure name | 449 | * function_name - Caller's procedure name |
450 | * module_name - Caller's module name | 450 | * module_name - Caller's module name |
451 | * component_id - Caller's component ID | 451 | * component_id - Caller's component ID |
452 | * Value - Value to be printed with exit msg | 452 | * value - Value to be printed with exit msg |
453 | * | 453 | * |
454 | * RETURN: None | 454 | * RETURN: None |
455 | * | 455 | * |
@@ -481,7 +481,7 @@ ACPI_EXPORT_SYMBOL(acpi_ut_value_exit) | |||
481 | * function_name - Caller's procedure name | 481 | * function_name - Caller's procedure name |
482 | * module_name - Caller's module name | 482 | * module_name - Caller's module name |
483 | * component_id - Caller's component ID | 483 | * component_id - Caller's component ID |
484 | * Ptr - Pointer to display | 484 | * ptr - Pointer to display |
485 | * | 485 | * |
486 | * RETURN: None | 486 | * RETURN: None |
487 | * | 487 | * |
@@ -508,10 +508,10 @@ acpi_ut_ptr_exit(u32 line_number, | |||
508 | * | 508 | * |
509 | * FUNCTION: acpi_ut_dump_buffer | 509 | * FUNCTION: acpi_ut_dump_buffer |
510 | * | 510 | * |
511 | * PARAMETERS: Buffer - Buffer to dump | 511 | * PARAMETERS: buffer - Buffer to dump |
512 | * Count - Amount to dump, in bytes | 512 | * count - Amount to dump, in bytes |
513 | * Display - BYTE, WORD, DWORD, or QWORD display | 513 | * display - BYTE, WORD, DWORD, or QWORD display |
514 | * component_iD - Caller's component ID | 514 | * component_ID - Caller's component ID |
515 | * | 515 | * |
516 | * RETURN: None | 516 | * RETURN: None |
517 | * | 517 | * |
@@ -625,10 +625,10 @@ void acpi_ut_dump_buffer2(u8 * buffer, u32 count, u32 display) | |||
625 | * | 625 | * |
626 | * FUNCTION: acpi_ut_dump_buffer | 626 | * FUNCTION: acpi_ut_dump_buffer |
627 | * | 627 | * |
628 | * PARAMETERS: Buffer - Buffer to dump | 628 | * PARAMETERS: buffer - Buffer to dump |
629 | * Count - Amount to dump, in bytes | 629 | * count - Amount to dump, in bytes |
630 | * Display - BYTE, WORD, DWORD, or QWORD display | 630 | * display - BYTE, WORD, DWORD, or QWORD display |
631 | * component_iD - Caller's component ID | 631 | * component_ID - Caller's component ID |
632 | * | 632 | * |
633 | * RETURN: None | 633 | * RETURN: None |
634 | * | 634 | * |
diff --git a/drivers/acpi/acpica/utdecode.c b/drivers/acpi/acpica/utdecode.c index 684849949bf3..60a158472d82 100644 --- a/drivers/acpi/acpica/utdecode.c +++ b/drivers/acpi/acpica/utdecode.c | |||
@@ -49,41 +49,6 @@ | |||
49 | #define _COMPONENT ACPI_UTILITIES | 49 | #define _COMPONENT ACPI_UTILITIES |
50 | ACPI_MODULE_NAME("utdecode") | 50 | ACPI_MODULE_NAME("utdecode") |
51 | 51 | ||
52 | /******************************************************************************* | ||
53 | * | ||
54 | * FUNCTION: acpi_format_exception | ||
55 | * | ||
56 | * PARAMETERS: Status - The acpi_status code to be formatted | ||
57 | * | ||
58 | * RETURN: A string containing the exception text. A valid pointer is | ||
59 | * always returned. | ||
60 | * | ||
61 | * DESCRIPTION: This function translates an ACPI exception into an ASCII string | ||
62 | * It is here instead of utxface.c so it is always present. | ||
63 | * | ||
64 | ******************************************************************************/ | ||
65 | const char *acpi_format_exception(acpi_status status) | ||
66 | { | ||
67 | const char *exception = NULL; | ||
68 | |||
69 | ACPI_FUNCTION_ENTRY(); | ||
70 | |||
71 | exception = acpi_ut_validate_exception(status); | ||
72 | if (!exception) { | ||
73 | |||
74 | /* Exception code was not recognized */ | ||
75 | |||
76 | ACPI_ERROR((AE_INFO, | ||
77 | "Unknown exception code: 0x%8.8X", status)); | ||
78 | |||
79 | exception = "UNKNOWN_STATUS_CODE"; | ||
80 | } | ||
81 | |||
82 | return (ACPI_CAST_PTR(const char, exception)); | ||
83 | } | ||
84 | |||
85 | ACPI_EXPORT_SYMBOL(acpi_format_exception) | ||
86 | |||
87 | /* | 52 | /* |
88 | * Properties of the ACPI Object Types, both internal and external. | 53 | * Properties of the ACPI Object Types, both internal and external. |
89 | * The table is indexed by values of acpi_object_type | 54 | * The table is indexed by values of acpi_object_type |
@@ -126,8 +91,8 @@ const u8 acpi_gbl_ns_properties[ACPI_NUM_NS_TYPES] = { | |||
126 | * | 91 | * |
127 | * FUNCTION: acpi_ut_hex_to_ascii_char | 92 | * FUNCTION: acpi_ut_hex_to_ascii_char |
128 | * | 93 | * |
129 | * PARAMETERS: Integer - Contains the hex digit | 94 | * PARAMETERS: integer - Contains the hex digit |
130 | * Position - bit position of the digit within the | 95 | * position - bit position of the digit within the |
131 | * integer (multiple of 4) | 96 | * integer (multiple of 4) |
132 | * | 97 | * |
133 | * RETURN: The converted Ascii character | 98 | * RETURN: The converted Ascii character |
@@ -164,16 +129,17 @@ char acpi_ut_hex_to_ascii_char(u64 integer, u32 position) | |||
164 | /* Region type decoding */ | 129 | /* Region type decoding */ |
165 | 130 | ||
166 | const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] = { | 131 | const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] = { |
167 | "SystemMemory", | 132 | "SystemMemory", /* 0x00 */ |
168 | "SystemIO", | 133 | "SystemIO", /* 0x01 */ |
169 | "PCI_Config", | 134 | "PCI_Config", /* 0x02 */ |
170 | "EmbeddedControl", | 135 | "EmbeddedControl", /* 0x03 */ |
171 | "SMBus", | 136 | "SMBus", /* 0x04 */ |
172 | "SystemCMOS", | 137 | "SystemCMOS", /* 0x05 */ |
173 | "PCIBARTarget", | 138 | "PCIBARTarget", /* 0x06 */ |
174 | "IPMI", | 139 | "IPMI", /* 0x07 */ |
175 | "GeneralPurposeIo", | 140 | "GeneralPurposeIo", /* 0x08 */ |
176 | "GenericSerialBus" | 141 | "GenericSerialBus", /* 0x09 */ |
142 | "PCC" /* 0x0A */ | ||
177 | }; | 143 | }; |
178 | 144 | ||
179 | char *acpi_ut_get_region_name(u8 space_id) | 145 | char *acpi_ut_get_region_name(u8 space_id) |
@@ -228,7 +194,7 @@ char *acpi_ut_get_event_name(u32 event_id) | |||
228 | * | 194 | * |
229 | * FUNCTION: acpi_ut_get_type_name | 195 | * FUNCTION: acpi_ut_get_type_name |
230 | * | 196 | * |
231 | * PARAMETERS: Type - An ACPI object type | 197 | * PARAMETERS: type - An ACPI object type |
232 | * | 198 | * |
233 | * RETURN: Decoded ACPI object type name | 199 | * RETURN: Decoded ACPI object type name |
234 | * | 200 | * |
@@ -306,7 +272,7 @@ char *acpi_ut_get_object_type_name(union acpi_operand_object *obj_desc) | |||
306 | * | 272 | * |
307 | * FUNCTION: acpi_ut_get_node_name | 273 | * FUNCTION: acpi_ut_get_node_name |
308 | * | 274 | * |
309 | * PARAMETERS: Object - A namespace node | 275 | * PARAMETERS: object - A namespace node |
310 | * | 276 | * |
311 | * RETURN: ASCII name of the node | 277 | * RETURN: ASCII name of the node |
312 | * | 278 | * |
@@ -351,7 +317,7 @@ char *acpi_ut_get_node_name(void *object) | |||
351 | * | 317 | * |
352 | * FUNCTION: acpi_ut_get_descriptor_name | 318 | * FUNCTION: acpi_ut_get_descriptor_name |
353 | * | 319 | * |
354 | * PARAMETERS: Object - An ACPI object | 320 | * PARAMETERS: object - An ACPI object |
355 | * | 321 | * |
356 | * RETURN: Decoded name of the descriptor type | 322 | * RETURN: Decoded name of the descriptor type |
357 | * | 323 | * |
@@ -401,7 +367,7 @@ char *acpi_ut_get_descriptor_name(void *object) | |||
401 | * | 367 | * |
402 | * FUNCTION: acpi_ut_get_reference_name | 368 | * FUNCTION: acpi_ut_get_reference_name |
403 | * | 369 | * |
404 | * PARAMETERS: Object - An ACPI reference object | 370 | * PARAMETERS: object - An ACPI reference object |
405 | * | 371 | * |
406 | * RETURN: Decoded name of the type of reference | 372 | * RETURN: Decoded name of the type of reference |
407 | * | 373 | * |
@@ -532,7 +498,7 @@ const char *acpi_ut_get_notify_name(u32 notify_value) | |||
532 | * | 498 | * |
533 | * FUNCTION: acpi_ut_valid_object_type | 499 | * FUNCTION: acpi_ut_valid_object_type |
534 | * | 500 | * |
535 | * PARAMETERS: Type - Object type to be validated | 501 | * PARAMETERS: type - Object type to be validated |
536 | * | 502 | * |
537 | * RETURN: TRUE if valid object type, FALSE otherwise | 503 | * RETURN: TRUE if valid object type, FALSE otherwise |
538 | * | 504 | * |
diff --git a/drivers/acpi/acpica/utdelete.c b/drivers/acpi/acpica/utdelete.c index 2a6c3e183697..798105443d0f 100644 --- a/drivers/acpi/acpica/utdelete.c +++ b/drivers/acpi/acpica/utdelete.c | |||
@@ -60,7 +60,7 @@ acpi_ut_update_ref_count(union acpi_operand_object *object, u32 action); | |||
60 | * | 60 | * |
61 | * FUNCTION: acpi_ut_delete_internal_obj | 61 | * FUNCTION: acpi_ut_delete_internal_obj |
62 | * | 62 | * |
63 | * PARAMETERS: Object - Object to be deleted | 63 | * PARAMETERS: object - Object to be deleted |
64 | * | 64 | * |
65 | * RETURN: None | 65 | * RETURN: None |
66 | * | 66 | * |
@@ -152,7 +152,7 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object) | |||
152 | case ACPI_TYPE_PROCESSOR: | 152 | case ACPI_TYPE_PROCESSOR: |
153 | case ACPI_TYPE_THERMAL: | 153 | case ACPI_TYPE_THERMAL: |
154 | 154 | ||
155 | /* Walk the notify handler list for this object */ | 155 | /* Walk the address handler list for this object */ |
156 | 156 | ||
157 | handler_desc = object->common_notify.handler; | 157 | handler_desc = object->common_notify.handler; |
158 | while (handler_desc) { | 158 | while (handler_desc) { |
@@ -358,8 +358,8 @@ void acpi_ut_delete_internal_object_list(union acpi_operand_object **obj_list) | |||
358 | * | 358 | * |
359 | * FUNCTION: acpi_ut_update_ref_count | 359 | * FUNCTION: acpi_ut_update_ref_count |
360 | * | 360 | * |
361 | * PARAMETERS: Object - Object whose ref count is to be updated | 361 | * PARAMETERS: object - Object whose ref count is to be updated |
362 | * Action - What to do | 362 | * action - What to do |
363 | * | 363 | * |
364 | * RETURN: New ref count | 364 | * RETURN: New ref count |
365 | * | 365 | * |
@@ -456,9 +456,9 @@ acpi_ut_update_ref_count(union acpi_operand_object *object, u32 action) | |||
456 | * | 456 | * |
457 | * FUNCTION: acpi_ut_update_object_reference | 457 | * FUNCTION: acpi_ut_update_object_reference |
458 | * | 458 | * |
459 | * PARAMETERS: Object - Increment ref count for this object | 459 | * PARAMETERS: object - Increment ref count for this object |
460 | * and all sub-objects | 460 | * and all sub-objects |
461 | * Action - Either REF_INCREMENT or REF_DECREMENT or | 461 | * action - Either REF_INCREMENT or REF_DECREMENT or |
462 | * REF_FORCE_DELETE | 462 | * REF_FORCE_DELETE |
463 | * | 463 | * |
464 | * RETURN: Status | 464 | * RETURN: Status |
@@ -480,6 +480,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action) | |||
480 | acpi_status status = AE_OK; | 480 | acpi_status status = AE_OK; |
481 | union acpi_generic_state *state_list = NULL; | 481 | union acpi_generic_state *state_list = NULL; |
482 | union acpi_operand_object *next_object = NULL; | 482 | union acpi_operand_object *next_object = NULL; |
483 | union acpi_operand_object *prev_object; | ||
483 | union acpi_generic_state *state; | 484 | union acpi_generic_state *state; |
484 | u32 i; | 485 | u32 i; |
485 | 486 | ||
@@ -505,12 +506,21 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action) | |||
505 | case ACPI_TYPE_POWER: | 506 | case ACPI_TYPE_POWER: |
506 | case ACPI_TYPE_THERMAL: | 507 | case ACPI_TYPE_THERMAL: |
507 | 508 | ||
508 | /* Update the notify objects for these types (if present) */ | 509 | /* |
509 | 510 | * Update the notify objects for these types (if present) | |
510 | acpi_ut_update_ref_count(object->common_notify. | 511 | * Two lists, system and device notify handlers. |
511 | system_notify, action); | 512 | */ |
512 | acpi_ut_update_ref_count(object->common_notify. | 513 | for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++) { |
513 | device_notify, action); | 514 | prev_object = |
515 | object->common_notify.notify_list[i]; | ||
516 | while (prev_object) { | ||
517 | next_object = | ||
518 | prev_object->notify.next[i]; | ||
519 | acpi_ut_update_ref_count(prev_object, | ||
520 | action); | ||
521 | prev_object = next_object; | ||
522 | } | ||
523 | } | ||
514 | break; | 524 | break; |
515 | 525 | ||
516 | case ACPI_TYPE_PACKAGE: | 526 | case ACPI_TYPE_PACKAGE: |
@@ -630,7 +640,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action) | |||
630 | * | 640 | * |
631 | * FUNCTION: acpi_ut_add_reference | 641 | * FUNCTION: acpi_ut_add_reference |
632 | * | 642 | * |
633 | * PARAMETERS: Object - Object whose reference count is to be | 643 | * PARAMETERS: object - Object whose reference count is to be |
634 | * incremented | 644 | * incremented |
635 | * | 645 | * |
636 | * RETURN: None | 646 | * RETURN: None |
@@ -664,7 +674,7 @@ void acpi_ut_add_reference(union acpi_operand_object *object) | |||
664 | * | 674 | * |
665 | * FUNCTION: acpi_ut_remove_reference | 675 | * FUNCTION: acpi_ut_remove_reference |
666 | * | 676 | * |
667 | * PARAMETERS: Object - Object whose ref count will be decremented | 677 | * PARAMETERS: object - Object whose ref count will be decremented |
668 | * | 678 | * |
669 | * RETURN: None | 679 | * RETURN: None |
670 | * | 680 | * |
diff --git a/drivers/acpi/acpica/uteval.c b/drivers/acpi/acpica/uteval.c index 479f32b33415..a9c65fbea5f4 100644 --- a/drivers/acpi/acpica/uteval.c +++ b/drivers/acpi/acpica/uteval.c | |||
@@ -53,7 +53,7 @@ ACPI_MODULE_NAME("uteval") | |||
53 | * FUNCTION: acpi_ut_evaluate_object | 53 | * FUNCTION: acpi_ut_evaluate_object |
54 | * | 54 | * |
55 | * PARAMETERS: prefix_node - Starting node | 55 | * PARAMETERS: prefix_node - Starting node |
56 | * Path - Path to object from starting node | 56 | * path - Path to object from starting node |
57 | * expected_return_types - Bitmap of allowed return types | 57 | * expected_return_types - Bitmap of allowed return types |
58 | * return_desc - Where a return value is stored | 58 | * return_desc - Where a return value is stored |
59 | * | 59 | * |
@@ -187,7 +187,7 @@ acpi_ut_evaluate_object(struct acpi_namespace_node *prefix_node, | |||
187 | * | 187 | * |
188 | * PARAMETERS: object_name - Object name to be evaluated | 188 | * PARAMETERS: object_name - Object name to be evaluated |
189 | * device_node - Node for the device | 189 | * device_node - Node for the device |
190 | * Value - Where the value is returned | 190 | * value - Where the value is returned |
191 | * | 191 | * |
192 | * RETURN: Status | 192 | * RETURN: Status |
193 | * | 193 | * |
@@ -229,7 +229,7 @@ acpi_ut_evaluate_numeric_object(char *object_name, | |||
229 | * FUNCTION: acpi_ut_execute_STA | 229 | * FUNCTION: acpi_ut_execute_STA |
230 | * | 230 | * |
231 | * PARAMETERS: device_node - Node for the device | 231 | * PARAMETERS: device_node - Node for the device |
232 | * Flags - Where the status flags are returned | 232 | * flags - Where the status flags are returned |
233 | * | 233 | * |
234 | * RETURN: Status | 234 | * RETURN: Status |
235 | * | 235 | * |
diff --git a/drivers/acpi/acpica/utexcep.c b/drivers/acpi/acpica/utexcep.c new file mode 100644 index 000000000000..23b98945f6b7 --- /dev/null +++ b/drivers/acpi/acpica/utexcep.c | |||
@@ -0,0 +1,153 @@ | |||
1 | /******************************************************************************* | ||
2 | * | ||
3 | * Module Name: utexcep - Exception code support | ||
4 | * | ||
5 | ******************************************************************************/ | ||
6 | |||
7 | /* | ||
8 | * Copyright (C) 2000 - 2012, Intel Corp. | ||
9 | * All rights reserved. | ||
10 | * | ||
11 | * Redistribution and use in source and binary forms, with or without | ||
12 | * modification, are permitted provided that the following conditions | ||
13 | * are met: | ||
14 | * 1. Redistributions of source code must retain the above copyright | ||
15 | * notice, this list of conditions, and the following disclaimer, | ||
16 | * without modification. | ||
17 | * 2. Redistributions in binary form must reproduce at minimum a disclaimer | ||
18 | * substantially similar to the "NO WARRANTY" disclaimer below | ||
19 | * ("Disclaimer") and any redistribution must be conditioned upon | ||
20 | * including a substantially similar Disclaimer requirement for further | ||
21 | * binary redistribution. | ||
22 | * 3. Neither the names of the above-listed copyright holders nor the names | ||
23 | * of any contributors may be used to endorse or promote products derived | ||
24 | * from this software without specific prior written permission. | ||
25 | * | ||
26 | * Alternatively, this software may be distributed under the terms of the | ||
27 | * GNU General Public License ("GPL") version 2 as published by the Free | ||
28 | * Software Foundation. | ||
29 | * | ||
30 | * NO WARRANTY | ||
31 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
32 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
33 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR | ||
34 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
35 | * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
36 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
37 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
38 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
39 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | ||
40 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
41 | * POSSIBILITY OF SUCH DAMAGES. | ||
42 | */ | ||
43 | |||
44 | #define ACPI_DEFINE_EXCEPTION_TABLE | ||
45 | #include <linux/export.h> | ||
46 | #include <acpi/acpi.h> | ||
47 | #include "accommon.h" | ||
48 | |||
49 | #define _COMPONENT ACPI_UTILITIES | ||
50 | ACPI_MODULE_NAME("utexcep") | ||
51 | |||
52 | /******************************************************************************* | ||
53 | * | ||
54 | * FUNCTION: acpi_format_exception | ||
55 | * | ||
56 | * PARAMETERS: status - The acpi_status code to be formatted | ||
57 | * | ||
58 | * RETURN: A string containing the exception text. A valid pointer is | ||
59 | * always returned. | ||
60 | * | ||
61 | * DESCRIPTION: This function translates an ACPI exception into an ASCII | ||
62 | * string. Returns "unknown status" string for invalid codes. | ||
63 | * | ||
64 | ******************************************************************************/ | ||
65 | const char *acpi_format_exception(acpi_status status) | ||
66 | { | ||
67 | const char *exception = NULL; | ||
68 | |||
69 | ACPI_FUNCTION_ENTRY(); | ||
70 | |||
71 | exception = acpi_ut_validate_exception(status); | ||
72 | if (!exception) { | ||
73 | |||
74 | /* Exception code was not recognized */ | ||
75 | |||
76 | ACPI_ERROR((AE_INFO, | ||
77 | "Unknown exception code: 0x%8.8X", status)); | ||
78 | |||
79 | exception = "UNKNOWN_STATUS_CODE"; | ||
80 | } | ||
81 | |||
82 | return (ACPI_CAST_PTR(const char, exception)); | ||
83 | } | ||
84 | |||
85 | ACPI_EXPORT_SYMBOL(acpi_format_exception) | ||
86 | |||
87 | /******************************************************************************* | ||
88 | * | ||
89 | * FUNCTION: acpi_ut_validate_exception | ||
90 | * | ||
91 | * PARAMETERS: status - The acpi_status code to be formatted | ||
92 | * | ||
93 | * RETURN: A string containing the exception text. NULL if exception is | ||
94 | * not valid. | ||
95 | * | ||
96 | * DESCRIPTION: This function validates and translates an ACPI exception into | ||
97 | * an ASCII string. | ||
98 | * | ||
99 | ******************************************************************************/ | ||
100 | const char *acpi_ut_validate_exception(acpi_status status) | ||
101 | { | ||
102 | u32 sub_status; | ||
103 | const char *exception = NULL; | ||
104 | |||
105 | ACPI_FUNCTION_ENTRY(); | ||
106 | |||
107 | /* | ||
108 | * Status is composed of two parts, a "type" and an actual code | ||
109 | */ | ||
110 | sub_status = (status & ~AE_CODE_MASK); | ||
111 | |||
112 | switch (status & AE_CODE_MASK) { | ||
113 | case AE_CODE_ENVIRONMENTAL: | ||
114 | |||
115 | if (sub_status <= AE_CODE_ENV_MAX) { | ||
116 | exception = acpi_gbl_exception_names_env[sub_status]; | ||
117 | } | ||
118 | break; | ||
119 | |||
120 | case AE_CODE_PROGRAMMER: | ||
121 | |||
122 | if (sub_status <= AE_CODE_PGM_MAX) { | ||
123 | exception = acpi_gbl_exception_names_pgm[sub_status]; | ||
124 | } | ||
125 | break; | ||
126 | |||
127 | case AE_CODE_ACPI_TABLES: | ||
128 | |||
129 | if (sub_status <= AE_CODE_TBL_MAX) { | ||
130 | exception = acpi_gbl_exception_names_tbl[sub_status]; | ||
131 | } | ||
132 | break; | ||
133 | |||
134 | case AE_CODE_AML: | ||
135 | |||
136 | if (sub_status <= AE_CODE_AML_MAX) { | ||
137 | exception = acpi_gbl_exception_names_aml[sub_status]; | ||
138 | } | ||
139 | break; | ||
140 | |||
141 | case AE_CODE_CONTROL: | ||
142 | |||
143 | if (sub_status <= AE_CODE_CTRL_MAX) { | ||
144 | exception = acpi_gbl_exception_names_ctrl[sub_status]; | ||
145 | } | ||
146 | break; | ||
147 | |||
148 | default: | ||
149 | break; | ||
150 | } | ||
151 | |||
152 | return (ACPI_CAST_PTR(const char, exception)); | ||
153 | } | ||
diff --git a/drivers/acpi/acpica/utglobal.c b/drivers/acpi/acpica/utglobal.c index 90f53b42eca9..ed1893155f8b 100644 --- a/drivers/acpi/acpica/utglobal.c +++ b/drivers/acpi/acpica/utglobal.c | |||
@@ -247,8 +247,9 @@ struct acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS] = | |||
247 | * | 247 | * |
248 | * RETURN: Status | 248 | * RETURN: Status |
249 | * | 249 | * |
250 | * DESCRIPTION: Init library globals. All globals that require specific | 250 | * DESCRIPTION: Initialize ACPICA globals. All globals that require specific |
251 | * initialization should be initialized here! | 251 | * initialization should be initialized here. This allows for |
252 | * a warm restart. | ||
252 | * | 253 | * |
253 | ******************************************************************************/ | 254 | ******************************************************************************/ |
254 | 255 | ||
@@ -284,7 +285,7 @@ acpi_status acpi_ut_init_globals(void) | |||
284 | acpi_gbl_owner_id_mask[i] = 0; | 285 | acpi_gbl_owner_id_mask[i] = 0; |
285 | } | 286 | } |
286 | 287 | ||
287 | /* Last owner_iD is never valid */ | 288 | /* Last owner_ID is never valid */ |
288 | 289 | ||
289 | acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000; | 290 | acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000; |
290 | 291 | ||
@@ -304,8 +305,8 @@ acpi_status acpi_ut_init_globals(void) | |||
304 | 305 | ||
305 | /* Global handlers */ | 306 | /* Global handlers */ |
306 | 307 | ||
307 | acpi_gbl_system_notify.handler = NULL; | 308 | acpi_gbl_global_notify[0].handler = NULL; |
308 | acpi_gbl_device_notify.handler = NULL; | 309 | acpi_gbl_global_notify[1].handler = NULL; |
309 | acpi_gbl_exception_handler = NULL; | 310 | acpi_gbl_exception_handler = NULL; |
310 | acpi_gbl_init_handler = NULL; | 311 | acpi_gbl_init_handler = NULL; |
311 | acpi_gbl_table_handler = NULL; | 312 | acpi_gbl_table_handler = NULL; |
diff --git a/drivers/acpi/acpica/utids.c b/drivers/acpi/acpica/utids.c index c92eb1d93785..5d84e1954575 100644 --- a/drivers/acpi/acpica/utids.c +++ b/drivers/acpi/acpica/utids.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /****************************************************************************** | 1 | /****************************************************************************** |
2 | * | 2 | * |
3 | * Module Name: utids - support for device IDs - HID, UID, CID | 3 | * Module Name: utids - support for device Ids - HID, UID, CID |
4 | * | 4 | * |
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
diff --git a/drivers/acpi/acpica/utlock.c b/drivers/acpi/acpica/utlock.c index 155fd786d0f2..b1eb7f17e110 100644 --- a/drivers/acpi/acpica/utlock.c +++ b/drivers/acpi/acpica/utlock.c | |||
@@ -52,7 +52,7 @@ ACPI_MODULE_NAME("utlock") | |||
52 | * FUNCTION: acpi_ut_create_rw_lock | 52 | * FUNCTION: acpi_ut_create_rw_lock |
53 | * acpi_ut_delete_rw_lock | 53 | * acpi_ut_delete_rw_lock |
54 | * | 54 | * |
55 | * PARAMETERS: Lock - Pointer to a valid RW lock | 55 | * PARAMETERS: lock - Pointer to a valid RW lock |
56 | * | 56 | * |
57 | * RETURN: Status | 57 | * RETURN: Status |
58 | * | 58 | * |
@@ -89,7 +89,7 @@ void acpi_ut_delete_rw_lock(struct acpi_rw_lock *lock) | |||
89 | * FUNCTION: acpi_ut_acquire_read_lock | 89 | * FUNCTION: acpi_ut_acquire_read_lock |
90 | * acpi_ut_release_read_lock | 90 | * acpi_ut_release_read_lock |
91 | * | 91 | * |
92 | * PARAMETERS: Lock - Pointer to a valid RW lock | 92 | * PARAMETERS: lock - Pointer to a valid RW lock |
93 | * | 93 | * |
94 | * RETURN: Status | 94 | * RETURN: Status |
95 | * | 95 | * |
@@ -149,7 +149,7 @@ acpi_status acpi_ut_release_read_lock(struct acpi_rw_lock *lock) | |||
149 | * FUNCTION: acpi_ut_acquire_write_lock | 149 | * FUNCTION: acpi_ut_acquire_write_lock |
150 | * acpi_ut_release_write_lock | 150 | * acpi_ut_release_write_lock |
151 | * | 151 | * |
152 | * PARAMETERS: Lock - Pointer to a valid RW lock | 152 | * PARAMETERS: lock - Pointer to a valid RW lock |
153 | * | 153 | * |
154 | * RETURN: Status | 154 | * RETURN: Status |
155 | * | 155 | * |
diff --git a/drivers/acpi/acpica/utmath.c b/drivers/acpi/acpica/utmath.c index 2491a552b0e6..d88a8aaab2a6 100644 --- a/drivers/acpi/acpica/utmath.c +++ b/drivers/acpi/acpica/utmath.c | |||
@@ -73,8 +73,8 @@ typedef union uint64_overlay { | |||
73 | * | 73 | * |
74 | * FUNCTION: acpi_ut_short_divide | 74 | * FUNCTION: acpi_ut_short_divide |
75 | * | 75 | * |
76 | * PARAMETERS: Dividend - 64-bit dividend | 76 | * PARAMETERS: dividend - 64-bit dividend |
77 | * Divisor - 32-bit divisor | 77 | * divisor - 32-bit divisor |
78 | * out_quotient - Pointer to where the quotient is returned | 78 | * out_quotient - Pointer to where the quotient is returned |
79 | * out_remainder - Pointer to where the remainder is returned | 79 | * out_remainder - Pointer to where the remainder is returned |
80 | * | 80 | * |
diff --git a/drivers/acpi/acpica/utmisc.c b/drivers/acpi/acpica/utmisc.c index 86f19db74e05..33c6cf7ff467 100644 --- a/drivers/acpi/acpica/utmisc.c +++ b/drivers/acpi/acpica/utmisc.c | |||
@@ -50,79 +50,41 @@ | |||
50 | #define _COMPONENT ACPI_UTILITIES | 50 | #define _COMPONENT ACPI_UTILITIES |
51 | ACPI_MODULE_NAME("utmisc") | 51 | ACPI_MODULE_NAME("utmisc") |
52 | 52 | ||
53 | #if defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP | ||
53 | /******************************************************************************* | 54 | /******************************************************************************* |
54 | * | 55 | * |
55 | * FUNCTION: acpi_ut_validate_exception | 56 | * FUNCTION: ut_convert_backslashes |
56 | * | 57 | * |
57 | * PARAMETERS: Status - The acpi_status code to be formatted | 58 | * PARAMETERS: pathname - File pathname string to be converted |
58 | * | 59 | * |
59 | * RETURN: A string containing the exception text. NULL if exception is | 60 | * RETURN: Modifies the input Pathname |
60 | * not valid. | ||
61 | * | 61 | * |
62 | * DESCRIPTION: This function validates and translates an ACPI exception into | 62 | * DESCRIPTION: Convert all backslashes (0x5C) to forward slashes (0x2F) within |
63 | * an ASCII string. | 63 | * the entire input file pathname string. |
64 | * | 64 | * |
65 | ******************************************************************************/ | 65 | ******************************************************************************/ |
66 | const char *acpi_ut_validate_exception(acpi_status status) | 66 | void ut_convert_backslashes(char *pathname) |
67 | { | 67 | { |
68 | u32 sub_status; | ||
69 | const char *exception = NULL; | ||
70 | 68 | ||
71 | ACPI_FUNCTION_ENTRY(); | 69 | if (!pathname) { |
72 | 70 | return; | |
73 | /* | 71 | } |
74 | * Status is composed of two parts, a "type" and an actual code | ||
75 | */ | ||
76 | sub_status = (status & ~AE_CODE_MASK); | ||
77 | |||
78 | switch (status & AE_CODE_MASK) { | ||
79 | case AE_CODE_ENVIRONMENTAL: | ||
80 | |||
81 | if (sub_status <= AE_CODE_ENV_MAX) { | ||
82 | exception = acpi_gbl_exception_names_env[sub_status]; | ||
83 | } | ||
84 | break; | ||
85 | |||
86 | case AE_CODE_PROGRAMMER: | ||
87 | |||
88 | if (sub_status <= AE_CODE_PGM_MAX) { | ||
89 | exception = acpi_gbl_exception_names_pgm[sub_status]; | ||
90 | } | ||
91 | break; | ||
92 | |||
93 | case AE_CODE_ACPI_TABLES: | ||
94 | |||
95 | if (sub_status <= AE_CODE_TBL_MAX) { | ||
96 | exception = acpi_gbl_exception_names_tbl[sub_status]; | ||
97 | } | ||
98 | break; | ||
99 | |||
100 | case AE_CODE_AML: | ||
101 | |||
102 | if (sub_status <= AE_CODE_AML_MAX) { | ||
103 | exception = acpi_gbl_exception_names_aml[sub_status]; | ||
104 | } | ||
105 | break; | ||
106 | |||
107 | case AE_CODE_CONTROL: | ||
108 | 72 | ||
109 | if (sub_status <= AE_CODE_CTRL_MAX) { | 73 | while (*pathname) { |
110 | exception = acpi_gbl_exception_names_ctrl[sub_status]; | 74 | if (*pathname == '\\') { |
75 | *pathname = '/'; | ||
111 | } | 76 | } |
112 | break; | ||
113 | 77 | ||
114 | default: | 78 | pathname++; |
115 | break; | ||
116 | } | 79 | } |
117 | |||
118 | return (ACPI_CAST_PTR(const char, exception)); | ||
119 | } | 80 | } |
81 | #endif | ||
120 | 82 | ||
121 | /******************************************************************************* | 83 | /******************************************************************************* |
122 | * | 84 | * |
123 | * FUNCTION: acpi_ut_is_pci_root_bridge | 85 | * FUNCTION: acpi_ut_is_pci_root_bridge |
124 | * | 86 | * |
125 | * PARAMETERS: Id - The HID/CID in string format | 87 | * PARAMETERS: id - The HID/CID in string format |
126 | * | 88 | * |
127 | * RETURN: TRUE if the Id is a match for a PCI/PCI-Express Root Bridge | 89 | * RETURN: TRUE if the Id is a match for a PCI/PCI-Express Root Bridge |
128 | * | 90 | * |
@@ -150,7 +112,7 @@ u8 acpi_ut_is_pci_root_bridge(char *id) | |||
150 | * | 112 | * |
151 | * FUNCTION: acpi_ut_is_aml_table | 113 | * FUNCTION: acpi_ut_is_aml_table |
152 | * | 114 | * |
153 | * PARAMETERS: Table - An ACPI table | 115 | * PARAMETERS: table - An ACPI table |
154 | * | 116 | * |
155 | * RETURN: TRUE if table contains executable AML; FALSE otherwise | 117 | * RETURN: TRUE if table contains executable AML; FALSE otherwise |
156 | * | 118 | * |
@@ -284,7 +246,7 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id) | |||
284 | * | 246 | * |
285 | * FUNCTION: acpi_ut_release_owner_id | 247 | * FUNCTION: acpi_ut_release_owner_id |
286 | * | 248 | * |
287 | * PARAMETERS: owner_id_ptr - Pointer to a previously allocated owner_iD | 249 | * PARAMETERS: owner_id_ptr - Pointer to a previously allocated owner_ID |
288 | * | 250 | * |
289 | * RETURN: None. No error is returned because we are either exiting a | 251 | * RETURN: None. No error is returned because we are either exiting a |
290 | * control method or unloading a table. Either way, we would | 252 | * control method or unloading a table. Either way, we would |
@@ -307,7 +269,7 @@ void acpi_ut_release_owner_id(acpi_owner_id * owner_id_ptr) | |||
307 | 269 | ||
308 | *owner_id_ptr = 0; | 270 | *owner_id_ptr = 0; |
309 | 271 | ||
310 | /* Zero is not a valid owner_iD */ | 272 | /* Zero is not a valid owner_ID */ |
311 | 273 | ||
312 | if (owner_id == 0) { | 274 | if (owner_id == 0) { |
313 | ACPI_ERROR((AE_INFO, "Invalid OwnerId: 0x%2.2X", owner_id)); | 275 | ACPI_ERROR((AE_INFO, "Invalid OwnerId: 0x%2.2X", owner_id)); |
@@ -381,7 +343,7 @@ void acpi_ut_strupr(char *src_string) | |||
381 | * | 343 | * |
382 | * FUNCTION: acpi_ut_print_string | 344 | * FUNCTION: acpi_ut_print_string |
383 | * | 345 | * |
384 | * PARAMETERS: String - Null terminated ASCII string | 346 | * PARAMETERS: string - Null terminated ASCII string |
385 | * max_length - Maximum output length | 347 | * max_length - Maximum output length |
386 | * | 348 | * |
387 | * RETURN: None | 349 | * RETURN: None |
@@ -467,7 +429,7 @@ void acpi_ut_print_string(char *string, u8 max_length) | |||
467 | * | 429 | * |
468 | * FUNCTION: acpi_ut_dword_byte_swap | 430 | * FUNCTION: acpi_ut_dword_byte_swap |
469 | * | 431 | * |
470 | * PARAMETERS: Value - Value to be converted | 432 | * PARAMETERS: value - Value to be converted |
471 | * | 433 | * |
472 | * RETURN: u32 integer with bytes swapped | 434 | * RETURN: u32 integer with bytes swapped |
473 | * | 435 | * |
@@ -537,9 +499,9 @@ void acpi_ut_set_integer_width(u8 revision) | |||
537 | * | 499 | * |
538 | * FUNCTION: acpi_ut_display_init_pathname | 500 | * FUNCTION: acpi_ut_display_init_pathname |
539 | * | 501 | * |
540 | * PARAMETERS: Type - Object type of the node | 502 | * PARAMETERS: type - Object type of the node |
541 | * obj_handle - Handle whose pathname will be displayed | 503 | * obj_handle - Handle whose pathname will be displayed |
542 | * Path - Additional path string to be appended. | 504 | * path - Additional path string to be appended. |
543 | * (NULL if no extra path) | 505 | * (NULL if no extra path) |
544 | * | 506 | * |
545 | * RETURN: acpi_status | 507 | * RETURN: acpi_status |
@@ -604,8 +566,8 @@ acpi_ut_display_init_pathname(u8 type, | |||
604 | * | 566 | * |
605 | * FUNCTION: acpi_ut_valid_acpi_char | 567 | * FUNCTION: acpi_ut_valid_acpi_char |
606 | * | 568 | * |
607 | * PARAMETERS: Char - The character to be examined | 569 | * PARAMETERS: char - The character to be examined |
608 | * Position - Byte position (0-3) | 570 | * position - Byte position (0-3) |
609 | * | 571 | * |
610 | * RETURN: TRUE if the character is valid, FALSE otherwise | 572 | * RETURN: TRUE if the character is valid, FALSE otherwise |
611 | * | 573 | * |
@@ -640,7 +602,7 @@ u8 acpi_ut_valid_acpi_char(char character, u32 position) | |||
640 | * | 602 | * |
641 | * FUNCTION: acpi_ut_valid_acpi_name | 603 | * FUNCTION: acpi_ut_valid_acpi_name |
642 | * | 604 | * |
643 | * PARAMETERS: Name - The name to be examined | 605 | * PARAMETERS: name - The name to be examined |
644 | * | 606 | * |
645 | * RETURN: TRUE if the name is valid, FALSE otherwise | 607 | * RETURN: TRUE if the name is valid, FALSE otherwise |
646 | * | 608 | * |
@@ -671,7 +633,7 @@ u8 acpi_ut_valid_acpi_name(u32 name) | |||
671 | * | 633 | * |
672 | * FUNCTION: acpi_ut_repair_name | 634 | * FUNCTION: acpi_ut_repair_name |
673 | * | 635 | * |
674 | * PARAMETERS: Name - The ACPI name to be repaired | 636 | * PARAMETERS: name - The ACPI name to be repaired |
675 | * | 637 | * |
676 | * RETURN: Repaired version of the name | 638 | * RETURN: Repaired version of the name |
677 | * | 639 | * |
@@ -705,8 +667,8 @@ acpi_name acpi_ut_repair_name(char *name) | |||
705 | * | 667 | * |
706 | * FUNCTION: acpi_ut_strtoul64 | 668 | * FUNCTION: acpi_ut_strtoul64 |
707 | * | 669 | * |
708 | * PARAMETERS: String - Null terminated string | 670 | * PARAMETERS: string - Null terminated string |
709 | * Base - Radix of the string: 16 or ACPI_ANY_BASE; | 671 | * base - Radix of the string: 16 or ACPI_ANY_BASE; |
710 | * ACPI_ANY_BASE means 'in behalf of to_integer' | 672 | * ACPI_ANY_BASE means 'in behalf of to_integer' |
711 | * ret_integer - Where the converted integer is returned | 673 | * ret_integer - Where the converted integer is returned |
712 | * | 674 | * |
@@ -755,7 +717,7 @@ acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 * ret_integer) | |||
755 | 717 | ||
756 | if (to_integer_op) { | 718 | if (to_integer_op) { |
757 | /* | 719 | /* |
758 | * Base equal to ACPI_ANY_BASE means 'to_integer operation case'. | 720 | * Base equal to ACPI_ANY_BASE means 'ToInteger operation case'. |
759 | * We need to determine if it is decimal or hexadecimal. | 721 | * We need to determine if it is decimal or hexadecimal. |
760 | */ | 722 | */ |
761 | if ((*string == '0') && (ACPI_TOLOWER(*(string + 1)) == 'x')) { | 723 | if ((*string == '0') && (ACPI_TOLOWER(*(string + 1)) == 'x')) { |
@@ -878,8 +840,8 @@ acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 * ret_integer) | |||
878 | * | 840 | * |
879 | * FUNCTION: acpi_ut_create_update_state_and_push | 841 | * FUNCTION: acpi_ut_create_update_state_and_push |
880 | * | 842 | * |
881 | * PARAMETERS: Object - Object to be added to the new state | 843 | * PARAMETERS: object - Object to be added to the new state |
882 | * Action - Increment/Decrement | 844 | * action - Increment/Decrement |
883 | * state_list - List the state will be added to | 845 | * state_list - List the state will be added to |
884 | * | 846 | * |
885 | * RETURN: Status | 847 | * RETURN: Status |
@@ -919,7 +881,7 @@ acpi_ut_create_update_state_and_push(union acpi_operand_object *object, | |||
919 | * PARAMETERS: source_object - The package to walk | 881 | * PARAMETERS: source_object - The package to walk |
920 | * target_object - Target object (if package is being copied) | 882 | * target_object - Target object (if package is being copied) |
921 | * walk_callback - Called once for each package element | 883 | * walk_callback - Called once for each package element |
922 | * Context - Passed to the callback function | 884 | * context - Passed to the callback function |
923 | * | 885 | * |
924 | * RETURN: Status | 886 | * RETURN: Status |
925 | * | 887 | * |
diff --git a/drivers/acpi/acpica/utmutex.c b/drivers/acpi/acpica/utmutex.c index 43174df33121..296baa676bc5 100644 --- a/drivers/acpi/acpica/utmutex.c +++ b/drivers/acpi/acpica/utmutex.c | |||
@@ -147,7 +147,7 @@ void acpi_ut_mutex_terminate(void) | |||
147 | * | 147 | * |
148 | * FUNCTION: acpi_ut_create_mutex | 148 | * FUNCTION: acpi_ut_create_mutex |
149 | * | 149 | * |
150 | * PARAMETERS: mutex_iD - ID of the mutex to be created | 150 | * PARAMETERS: mutex_ID - ID of the mutex to be created |
151 | * | 151 | * |
152 | * RETURN: Status | 152 | * RETURN: Status |
153 | * | 153 | * |
@@ -176,7 +176,7 @@ static acpi_status acpi_ut_create_mutex(acpi_mutex_handle mutex_id) | |||
176 | * | 176 | * |
177 | * FUNCTION: acpi_ut_delete_mutex | 177 | * FUNCTION: acpi_ut_delete_mutex |
178 | * | 178 | * |
179 | * PARAMETERS: mutex_iD - ID of the mutex to be deleted | 179 | * PARAMETERS: mutex_ID - ID of the mutex to be deleted |
180 | * | 180 | * |
181 | * RETURN: Status | 181 | * RETURN: Status |
182 | * | 182 | * |
@@ -199,7 +199,7 @@ static void acpi_ut_delete_mutex(acpi_mutex_handle mutex_id) | |||
199 | * | 199 | * |
200 | * FUNCTION: acpi_ut_acquire_mutex | 200 | * FUNCTION: acpi_ut_acquire_mutex |
201 | * | 201 | * |
202 | * PARAMETERS: mutex_iD - ID of the mutex to be acquired | 202 | * PARAMETERS: mutex_ID - ID of the mutex to be acquired |
203 | * | 203 | * |
204 | * RETURN: Status | 204 | * RETURN: Status |
205 | * | 205 | * |
@@ -283,7 +283,7 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id) | |||
283 | * | 283 | * |
284 | * FUNCTION: acpi_ut_release_mutex | 284 | * FUNCTION: acpi_ut_release_mutex |
285 | * | 285 | * |
286 | * PARAMETERS: mutex_iD - ID of the mutex to be released | 286 | * PARAMETERS: mutex_ID - ID of the mutex to be released |
287 | * | 287 | * |
288 | * RETURN: Status | 288 | * RETURN: Status |
289 | * | 289 | * |
diff --git a/drivers/acpi/acpica/utobject.c b/drivers/acpi/acpica/utobject.c index b112744fc9ae..655f0799a391 100644 --- a/drivers/acpi/acpica/utobject.c +++ b/drivers/acpi/acpica/utobject.c | |||
@@ -69,7 +69,7 @@ acpi_ut_get_element_length(u8 object_type, | |||
69 | * PARAMETERS: module_name - Source file name of caller | 69 | * PARAMETERS: module_name - Source file name of caller |
70 | * line_number - Line number of caller | 70 | * line_number - Line number of caller |
71 | * component_id - Component type of caller | 71 | * component_id - Component type of caller |
72 | * Type - ACPI Type of the new object | 72 | * type - ACPI Type of the new object |
73 | * | 73 | * |
74 | * RETURN: A new internal object, null on failure | 74 | * RETURN: A new internal object, null on failure |
75 | * | 75 | * |
@@ -150,7 +150,7 @@ union acpi_operand_object *acpi_ut_create_internal_object_dbg(const char | |||
150 | * | 150 | * |
151 | * FUNCTION: acpi_ut_create_package_object | 151 | * FUNCTION: acpi_ut_create_package_object |
152 | * | 152 | * |
153 | * PARAMETERS: Count - Number of package elements | 153 | * PARAMETERS: count - Number of package elements |
154 | * | 154 | * |
155 | * RETURN: Pointer to a new Package object, null on failure | 155 | * RETURN: Pointer to a new Package object, null on failure |
156 | * | 156 | * |
@@ -323,11 +323,11 @@ union acpi_operand_object *acpi_ut_create_string_object(acpi_size string_size) | |||
323 | * | 323 | * |
324 | * FUNCTION: acpi_ut_valid_internal_object | 324 | * FUNCTION: acpi_ut_valid_internal_object |
325 | * | 325 | * |
326 | * PARAMETERS: Object - Object to be validated | 326 | * PARAMETERS: object - Object to be validated |
327 | * | 327 | * |
328 | * RETURN: TRUE if object is valid, FALSE otherwise | 328 | * RETURN: TRUE if object is valid, FALSE otherwise |
329 | * | 329 | * |
330 | * DESCRIPTION: Validate a pointer to be a union acpi_operand_object | 330 | * DESCRIPTION: Validate a pointer to be of type union acpi_operand_object |
331 | * | 331 | * |
332 | ******************************************************************************/ | 332 | ******************************************************************************/ |
333 | 333 | ||
@@ -348,7 +348,7 @@ u8 acpi_ut_valid_internal_object(void *object) | |||
348 | switch (ACPI_GET_DESCRIPTOR_TYPE(object)) { | 348 | switch (ACPI_GET_DESCRIPTOR_TYPE(object)) { |
349 | case ACPI_DESC_TYPE_OPERAND: | 349 | case ACPI_DESC_TYPE_OPERAND: |
350 | 350 | ||
351 | /* The object appears to be a valid union acpi_operand_object */ | 351 | /* The object appears to be a valid union acpi_operand_object */ |
352 | 352 | ||
353 | return (TRUE); | 353 | return (TRUE); |
354 | 354 | ||
@@ -407,7 +407,7 @@ void *acpi_ut_allocate_object_desc_dbg(const char *module_name, | |||
407 | * | 407 | * |
408 | * FUNCTION: acpi_ut_delete_object_desc | 408 | * FUNCTION: acpi_ut_delete_object_desc |
409 | * | 409 | * |
410 | * PARAMETERS: Object - An Acpi internal object to be deleted | 410 | * PARAMETERS: object - An Acpi internal object to be deleted |
411 | * | 411 | * |
412 | * RETURN: None. | 412 | * RETURN: None. |
413 | * | 413 | * |
@@ -419,7 +419,7 @@ void acpi_ut_delete_object_desc(union acpi_operand_object *object) | |||
419 | { | 419 | { |
420 | ACPI_FUNCTION_TRACE_PTR(ut_delete_object_desc, object); | 420 | ACPI_FUNCTION_TRACE_PTR(ut_delete_object_desc, object); |
421 | 421 | ||
422 | /* Object must be a union acpi_operand_object */ | 422 | /* Object must be a union acpi_operand_object */ |
423 | 423 | ||
424 | if (ACPI_GET_DESCRIPTOR_TYPE(object) != ACPI_DESC_TYPE_OPERAND) { | 424 | if (ACPI_GET_DESCRIPTOR_TYPE(object) != ACPI_DESC_TYPE_OPERAND) { |
425 | ACPI_ERROR((AE_INFO, | 425 | ACPI_ERROR((AE_INFO, |
diff --git a/drivers/acpi/acpica/utosi.c b/drivers/acpi/acpica/utosi.c index 2360cf70c18c..676285d6116d 100644 --- a/drivers/acpi/acpica/utosi.c +++ b/drivers/acpi/acpica/utosi.c | |||
@@ -68,11 +68,12 @@ static struct acpi_interface_info acpi_default_supported_interfaces[] = { | |||
68 | {"Windows 2001.1", NULL, 0, ACPI_OSI_WINSRV_2003}, /* Windows Server 2003 */ | 68 | {"Windows 2001.1", NULL, 0, ACPI_OSI_WINSRV_2003}, /* Windows Server 2003 */ |
69 | {"Windows 2001 SP2", NULL, 0, ACPI_OSI_WIN_XP_SP2}, /* Windows XP SP2 */ | 69 | {"Windows 2001 SP2", NULL, 0, ACPI_OSI_WIN_XP_SP2}, /* Windows XP SP2 */ |
70 | {"Windows 2001.1 SP1", NULL, 0, ACPI_OSI_WINSRV_2003_SP1}, /* Windows Server 2003 SP1 - Added 03/2006 */ | 70 | {"Windows 2001.1 SP1", NULL, 0, ACPI_OSI_WINSRV_2003_SP1}, /* Windows Server 2003 SP1 - Added 03/2006 */ |
71 | {"Windows 2006", NULL, 0, ACPI_OSI_WIN_VISTA}, /* Windows Vista - Added 03/2006 */ | 71 | {"Windows 2006", NULL, 0, ACPI_OSI_WIN_VISTA}, /* Windows vista - Added 03/2006 */ |
72 | {"Windows 2006.1", NULL, 0, ACPI_OSI_WINSRV_2008}, /* Windows Server 2008 - Added 09/2009 */ | 72 | {"Windows 2006.1", NULL, 0, ACPI_OSI_WINSRV_2008}, /* Windows Server 2008 - Added 09/2009 */ |
73 | {"Windows 2006 SP1", NULL, 0, ACPI_OSI_WIN_VISTA_SP1}, /* Windows Vista SP1 - Added 09/2009 */ | 73 | {"Windows 2006 SP1", NULL, 0, ACPI_OSI_WIN_VISTA_SP1}, /* Windows Vista SP1 - Added 09/2009 */ |
74 | {"Windows 2006 SP2", NULL, 0, ACPI_OSI_WIN_VISTA_SP2}, /* Windows Vista SP2 - Added 09/2010 */ | 74 | {"Windows 2006 SP2", NULL, 0, ACPI_OSI_WIN_VISTA_SP2}, /* Windows Vista SP2 - Added 09/2010 */ |
75 | {"Windows 2009", NULL, 0, ACPI_OSI_WIN_7}, /* Windows 7 and Server 2008 R2 - Added 09/2009 */ | 75 | {"Windows 2009", NULL, 0, ACPI_OSI_WIN_7}, /* Windows 7 and Server 2008 R2 - Added 09/2009 */ |
76 | {"Windows 2012", NULL, 0, ACPI_OSI_WIN_8}, /* Windows 8 and Server 2012 - Added 08/2012 */ | ||
76 | 77 | ||
77 | /* Feature Group Strings */ | 78 | /* Feature Group Strings */ |
78 | 79 | ||
diff --git a/drivers/acpi/acpica/utresrc.c b/drivers/acpi/acpica/utresrc.c index 9d441ea70305..e38bef4980bc 100644 --- a/drivers/acpi/acpica/utresrc.c +++ b/drivers/acpi/acpica/utresrc.c | |||
@@ -356,13 +356,13 @@ static const u8 acpi_gbl_resource_types[] = { | |||
356 | ACPI_SMALL_VARIABLE_LENGTH, /* 06 start_dependent_functions */ | 356 | ACPI_SMALL_VARIABLE_LENGTH, /* 06 start_dependent_functions */ |
357 | ACPI_FIXED_LENGTH, /* 07 end_dependent_functions */ | 357 | ACPI_FIXED_LENGTH, /* 07 end_dependent_functions */ |
358 | ACPI_FIXED_LENGTH, /* 08 IO */ | 358 | ACPI_FIXED_LENGTH, /* 08 IO */ |
359 | ACPI_FIXED_LENGTH, /* 09 fixed_iO */ | 359 | ACPI_FIXED_LENGTH, /* 09 fixed_IO */ |
360 | ACPI_FIXED_LENGTH, /* 0_a fixed_dMA */ | 360 | ACPI_FIXED_LENGTH, /* 0A fixed_DMA */ |
361 | 0, | 361 | 0, |
362 | 0, | 362 | 0, |
363 | 0, | 363 | 0, |
364 | ACPI_VARIABLE_LENGTH, /* 0_e vendor_short */ | 364 | ACPI_VARIABLE_LENGTH, /* 0E vendor_short */ |
365 | ACPI_FIXED_LENGTH, /* 0_f end_tag */ | 365 | ACPI_FIXED_LENGTH, /* 0F end_tag */ |
366 | 366 | ||
367 | /* Large descriptors */ | 367 | /* Large descriptors */ |
368 | 368 | ||
@@ -375,16 +375,16 @@ static const u8 acpi_gbl_resource_types[] = { | |||
375 | ACPI_FIXED_LENGTH, /* 06 memory32_fixed */ | 375 | ACPI_FIXED_LENGTH, /* 06 memory32_fixed */ |
376 | ACPI_VARIABLE_LENGTH, /* 07 Dword* address */ | 376 | ACPI_VARIABLE_LENGTH, /* 07 Dword* address */ |
377 | ACPI_VARIABLE_LENGTH, /* 08 Word* address */ | 377 | ACPI_VARIABLE_LENGTH, /* 08 Word* address */ |
378 | ACPI_VARIABLE_LENGTH, /* 09 extended_iRQ */ | 378 | ACPI_VARIABLE_LENGTH, /* 09 extended_IRQ */ |
379 | ACPI_VARIABLE_LENGTH, /* 0_a Qword* address */ | 379 | ACPI_VARIABLE_LENGTH, /* 0A Qword* address */ |
380 | ACPI_FIXED_LENGTH, /* 0_b Extended* address */ | 380 | ACPI_FIXED_LENGTH, /* 0B Extended* address */ |
381 | ACPI_VARIABLE_LENGTH, /* 0_c Gpio* */ | 381 | ACPI_VARIABLE_LENGTH, /* 0C Gpio* */ |
382 | 0, | 382 | 0, |
383 | ACPI_VARIABLE_LENGTH /* 0_e *serial_bus */ | 383 | ACPI_VARIABLE_LENGTH /* 0E *serial_bus */ |
384 | }; | 384 | }; |
385 | 385 | ||
386 | /* | 386 | /* |
387 | * For the i_aSL compiler/disassembler, we don't want any error messages | 387 | * For the iASL compiler/disassembler, we don't want any error messages |
388 | * because the disassembler uses the resource validation code to determine | 388 | * because the disassembler uses the resource validation code to determine |
389 | * if Buffer objects are actually Resource Templates. | 389 | * if Buffer objects are actually Resource Templates. |
390 | */ | 390 | */ |
@@ -398,11 +398,11 @@ static const u8 acpi_gbl_resource_types[] = { | |||
398 | * | 398 | * |
399 | * FUNCTION: acpi_ut_walk_aml_resources | 399 | * FUNCTION: acpi_ut_walk_aml_resources |
400 | * | 400 | * |
401 | * PARAMETERS: Aml - Pointer to the raw AML resource template | 401 | * PARAMETERS: aml - Pointer to the raw AML resource template |
402 | * aml_length - Length of the entire template | 402 | * aml_length - Length of the entire template |
403 | * user_function - Called once for each descriptor found. If | 403 | * user_function - Called once for each descriptor found. If |
404 | * NULL, a pointer to the end_tag is returned | 404 | * NULL, a pointer to the end_tag is returned |
405 | * Context - Passed to user_function | 405 | * context - Passed to user_function |
406 | * | 406 | * |
407 | * RETURN: Status | 407 | * RETURN: Status |
408 | * | 408 | * |
@@ -513,7 +513,7 @@ acpi_ut_walk_aml_resources(u8 * aml, | |||
513 | * | 513 | * |
514 | * FUNCTION: acpi_ut_validate_resource | 514 | * FUNCTION: acpi_ut_validate_resource |
515 | * | 515 | * |
516 | * PARAMETERS: Aml - Pointer to the raw AML resource descriptor | 516 | * PARAMETERS: aml - Pointer to the raw AML resource descriptor |
517 | * return_index - Where the resource index is returned. NULL | 517 | * return_index - Where the resource index is returned. NULL |
518 | * if the index is not required. | 518 | * if the index is not required. |
519 | * | 519 | * |
@@ -664,7 +664,7 @@ acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index) | |||
664 | * | 664 | * |
665 | * FUNCTION: acpi_ut_get_resource_type | 665 | * FUNCTION: acpi_ut_get_resource_type |
666 | * | 666 | * |
667 | * PARAMETERS: Aml - Pointer to the raw AML resource descriptor | 667 | * PARAMETERS: aml - Pointer to the raw AML resource descriptor |
668 | * | 668 | * |
669 | * RETURN: The Resource Type with no extraneous bits (except the | 669 | * RETURN: The Resource Type with no extraneous bits (except the |
670 | * Large/Small descriptor bit -- this is left alone) | 670 | * Large/Small descriptor bit -- this is left alone) |
@@ -698,7 +698,7 @@ u8 acpi_ut_get_resource_type(void *aml) | |||
698 | * | 698 | * |
699 | * FUNCTION: acpi_ut_get_resource_length | 699 | * FUNCTION: acpi_ut_get_resource_length |
700 | * | 700 | * |
701 | * PARAMETERS: Aml - Pointer to the raw AML resource descriptor | 701 | * PARAMETERS: aml - Pointer to the raw AML resource descriptor |
702 | * | 702 | * |
703 | * RETURN: Byte Length | 703 | * RETURN: Byte Length |
704 | * | 704 | * |
@@ -738,7 +738,7 @@ u16 acpi_ut_get_resource_length(void *aml) | |||
738 | * | 738 | * |
739 | * FUNCTION: acpi_ut_get_resource_header_length | 739 | * FUNCTION: acpi_ut_get_resource_header_length |
740 | * | 740 | * |
741 | * PARAMETERS: Aml - Pointer to the raw AML resource descriptor | 741 | * PARAMETERS: aml - Pointer to the raw AML resource descriptor |
742 | * | 742 | * |
743 | * RETURN: Length of the AML header (depends on large/small descriptor) | 743 | * RETURN: Length of the AML header (depends on large/small descriptor) |
744 | * | 744 | * |
@@ -763,7 +763,7 @@ u8 acpi_ut_get_resource_header_length(void *aml) | |||
763 | * | 763 | * |
764 | * FUNCTION: acpi_ut_get_descriptor_length | 764 | * FUNCTION: acpi_ut_get_descriptor_length |
765 | * | 765 | * |
766 | * PARAMETERS: Aml - Pointer to the raw AML resource descriptor | 766 | * PARAMETERS: aml - Pointer to the raw AML resource descriptor |
767 | * | 767 | * |
768 | * RETURN: Byte length | 768 | * RETURN: Byte length |
769 | * | 769 | * |
diff --git a/drivers/acpi/acpica/utstate.c b/drivers/acpi/acpica/utstate.c index 4267477c2797..a1c988260073 100644 --- a/drivers/acpi/acpica/utstate.c +++ b/drivers/acpi/acpica/utstate.c | |||
@@ -51,8 +51,8 @@ ACPI_MODULE_NAME("utstate") | |||
51 | * | 51 | * |
52 | * FUNCTION: acpi_ut_create_pkg_state_and_push | 52 | * FUNCTION: acpi_ut_create_pkg_state_and_push |
53 | * | 53 | * |
54 | * PARAMETERS: Object - Object to be added to the new state | 54 | * PARAMETERS: object - Object to be added to the new state |
55 | * Action - Increment/Decrement | 55 | * action - Increment/Decrement |
56 | * state_list - List the state will be added to | 56 | * state_list - List the state will be added to |
57 | * | 57 | * |
58 | * RETURN: Status | 58 | * RETURN: Status |
@@ -85,7 +85,7 @@ acpi_ut_create_pkg_state_and_push(void *internal_object, | |||
85 | * FUNCTION: acpi_ut_push_generic_state | 85 | * FUNCTION: acpi_ut_push_generic_state |
86 | * | 86 | * |
87 | * PARAMETERS: list_head - Head of the state stack | 87 | * PARAMETERS: list_head - Head of the state stack |
88 | * State - State object to push | 88 | * state - State object to push |
89 | * | 89 | * |
90 | * RETURN: None | 90 | * RETURN: None |
91 | * | 91 | * |
@@ -214,8 +214,8 @@ struct acpi_thread_state *acpi_ut_create_thread_state(void) | |||
214 | * | 214 | * |
215 | * FUNCTION: acpi_ut_create_update_state | 215 | * FUNCTION: acpi_ut_create_update_state |
216 | * | 216 | * |
217 | * PARAMETERS: Object - Initial Object to be installed in the state | 217 | * PARAMETERS: object - Initial Object to be installed in the state |
218 | * Action - Update action to be performed | 218 | * action - Update action to be performed |
219 | * | 219 | * |
220 | * RETURN: New state object, null on failure | 220 | * RETURN: New state object, null on failure |
221 | * | 221 | * |
@@ -252,8 +252,8 @@ union acpi_generic_state *acpi_ut_create_update_state(union acpi_operand_object | |||
252 | * | 252 | * |
253 | * FUNCTION: acpi_ut_create_pkg_state | 253 | * FUNCTION: acpi_ut_create_pkg_state |
254 | * | 254 | * |
255 | * PARAMETERS: Object - Initial Object to be installed in the state | 255 | * PARAMETERS: object - Initial Object to be installed in the state |
256 | * Action - Update action to be performed | 256 | * action - Update action to be performed |
257 | * | 257 | * |
258 | * RETURN: New state object, null on failure | 258 | * RETURN: New state object, null on failure |
259 | * | 259 | * |
@@ -325,7 +325,7 @@ union acpi_generic_state *acpi_ut_create_control_state(void) | |||
325 | * | 325 | * |
326 | * FUNCTION: acpi_ut_delete_generic_state | 326 | * FUNCTION: acpi_ut_delete_generic_state |
327 | * | 327 | * |
328 | * PARAMETERS: State - The state object to be deleted | 328 | * PARAMETERS: state - The state object to be deleted |
329 | * | 329 | * |
330 | * RETURN: None | 330 | * RETURN: None |
331 | * | 331 | * |
diff --git a/drivers/acpi/acpica/utxface.c b/drivers/acpi/acpica/utxface.c index afa94f51ff0b..b09632b4f5b3 100644 --- a/drivers/acpi/acpica/utxface.c +++ b/drivers/acpi/acpica/utxface.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /****************************************************************************** | 1 | /****************************************************************************** |
2 | * | 2 | * |
3 | * Module Name: utxface - External interfaces for "global" ACPI functions | 3 | * Module Name: utxface - External interfaces, miscellaneous utility functions |
4 | * | 4 | * |
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
@@ -53,271 +53,6 @@ | |||
53 | #define _COMPONENT ACPI_UTILITIES | 53 | #define _COMPONENT ACPI_UTILITIES |
54 | ACPI_MODULE_NAME("utxface") | 54 | ACPI_MODULE_NAME("utxface") |
55 | 55 | ||
56 | #ifndef ACPI_ASL_COMPILER | ||
57 | /******************************************************************************* | ||
58 | * | ||
59 | * FUNCTION: acpi_initialize_subsystem | ||
60 | * | ||
61 | * PARAMETERS: None | ||
62 | * | ||
63 | * RETURN: Status | ||
64 | * | ||
65 | * DESCRIPTION: Initializes all global variables. This is the first function | ||
66 | * called, so any early initialization belongs here. | ||
67 | * | ||
68 | ******************************************************************************/ | ||
69 | acpi_status __init acpi_initialize_subsystem(void) | ||
70 | { | ||
71 | acpi_status status; | ||
72 | |||
73 | ACPI_FUNCTION_TRACE(acpi_initialize_subsystem); | ||
74 | |||
75 | acpi_gbl_startup_flags = ACPI_SUBSYSTEM_INITIALIZE; | ||
76 | ACPI_DEBUG_EXEC(acpi_ut_init_stack_ptr_trace()); | ||
77 | |||
78 | /* Initialize the OS-Dependent layer */ | ||
79 | |||
80 | status = acpi_os_initialize(); | ||
81 | if (ACPI_FAILURE(status)) { | ||
82 | ACPI_EXCEPTION((AE_INFO, status, "During OSL initialization")); | ||
83 | return_ACPI_STATUS(status); | ||
84 | } | ||
85 | |||
86 | /* Initialize all globals used by the subsystem */ | ||
87 | |||
88 | status = acpi_ut_init_globals(); | ||
89 | if (ACPI_FAILURE(status)) { | ||
90 | ACPI_EXCEPTION((AE_INFO, status, | ||
91 | "During initialization of globals")); | ||
92 | return_ACPI_STATUS(status); | ||
93 | } | ||
94 | |||
95 | /* Create the default mutex objects */ | ||
96 | |||
97 | status = acpi_ut_mutex_initialize(); | ||
98 | if (ACPI_FAILURE(status)) { | ||
99 | ACPI_EXCEPTION((AE_INFO, status, | ||
100 | "During Global Mutex creation")); | ||
101 | return_ACPI_STATUS(status); | ||
102 | } | ||
103 | |||
104 | /* | ||
105 | * Initialize the namespace manager and | ||
106 | * the root of the namespace tree | ||
107 | */ | ||
108 | status = acpi_ns_root_initialize(); | ||
109 | if (ACPI_FAILURE(status)) { | ||
110 | ACPI_EXCEPTION((AE_INFO, status, | ||
111 | "During Namespace initialization")); | ||
112 | return_ACPI_STATUS(status); | ||
113 | } | ||
114 | |||
115 | /* Initialize the global OSI interfaces list with the static names */ | ||
116 | |||
117 | status = acpi_ut_initialize_interfaces(); | ||
118 | if (ACPI_FAILURE(status)) { | ||
119 | ACPI_EXCEPTION((AE_INFO, status, | ||
120 | "During OSI interfaces initialization")); | ||
121 | return_ACPI_STATUS(status); | ||
122 | } | ||
123 | |||
124 | /* If configured, initialize the AML debugger */ | ||
125 | |||
126 | ACPI_DEBUGGER_EXEC(status = acpi_db_initialize()); | ||
127 | return_ACPI_STATUS(status); | ||
128 | } | ||
129 | |||
130 | /******************************************************************************* | ||
131 | * | ||
132 | * FUNCTION: acpi_enable_subsystem | ||
133 | * | ||
134 | * PARAMETERS: Flags - Init/enable Options | ||
135 | * | ||
136 | * RETURN: Status | ||
137 | * | ||
138 | * DESCRIPTION: Completes the subsystem initialization including hardware. | ||
139 | * Puts system into ACPI mode if it isn't already. | ||
140 | * | ||
141 | ******************************************************************************/ | ||
142 | acpi_status acpi_enable_subsystem(u32 flags) | ||
143 | { | ||
144 | acpi_status status = AE_OK; | ||
145 | |||
146 | ACPI_FUNCTION_TRACE(acpi_enable_subsystem); | ||
147 | |||
148 | #if (!ACPI_REDUCED_HARDWARE) | ||
149 | |||
150 | /* Enable ACPI mode */ | ||
151 | |||
152 | if (!(flags & ACPI_NO_ACPI_ENABLE)) { | ||
153 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, | ||
154 | "[Init] Going into ACPI mode\n")); | ||
155 | |||
156 | acpi_gbl_original_mode = acpi_hw_get_mode(); | ||
157 | |||
158 | status = acpi_enable(); | ||
159 | if (ACPI_FAILURE(status)) { | ||
160 | ACPI_WARNING((AE_INFO, "AcpiEnable failed")); | ||
161 | return_ACPI_STATUS(status); | ||
162 | } | ||
163 | } | ||
164 | |||
165 | /* | ||
166 | * Obtain a permanent mapping for the FACS. This is required for the | ||
167 | * Global Lock and the Firmware Waking Vector | ||
168 | */ | ||
169 | status = acpi_tb_initialize_facs(); | ||
170 | if (ACPI_FAILURE(status)) { | ||
171 | ACPI_WARNING((AE_INFO, "Could not map the FACS table")); | ||
172 | return_ACPI_STATUS(status); | ||
173 | } | ||
174 | #endif /* !ACPI_REDUCED_HARDWARE */ | ||
175 | |||
176 | /* | ||
177 | * Install the default op_region handlers. These are installed unless | ||
178 | * other handlers have already been installed via the | ||
179 | * install_address_space_handler interface. | ||
180 | */ | ||
181 | if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) { | ||
182 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, | ||
183 | "[Init] Installing default address space handlers\n")); | ||
184 | |||
185 | status = acpi_ev_install_region_handlers(); | ||
186 | if (ACPI_FAILURE(status)) { | ||
187 | return_ACPI_STATUS(status); | ||
188 | } | ||
189 | } | ||
190 | #if (!ACPI_REDUCED_HARDWARE) | ||
191 | /* | ||
192 | * Initialize ACPI Event handling (Fixed and General Purpose) | ||
193 | * | ||
194 | * Note1: We must have the hardware and events initialized before we can | ||
195 | * execute any control methods safely. Any control method can require | ||
196 | * ACPI hardware support, so the hardware must be fully initialized before | ||
197 | * any method execution! | ||
198 | * | ||
199 | * Note2: Fixed events are initialized and enabled here. GPEs are | ||
200 | * initialized, but cannot be enabled until after the hardware is | ||
201 | * completely initialized (SCI and global_lock activated) | ||
202 | */ | ||
203 | if (!(flags & ACPI_NO_EVENT_INIT)) { | ||
204 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, | ||
205 | "[Init] Initializing ACPI events\n")); | ||
206 | |||
207 | status = acpi_ev_initialize_events(); | ||
208 | if (ACPI_FAILURE(status)) { | ||
209 | return_ACPI_STATUS(status); | ||
210 | } | ||
211 | } | ||
212 | |||
213 | /* | ||
214 | * Install the SCI handler and Global Lock handler. This completes the | ||
215 | * hardware initialization. | ||
216 | */ | ||
217 | if (!(flags & ACPI_NO_HANDLER_INIT)) { | ||
218 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, | ||
219 | "[Init] Installing SCI/GL handlers\n")); | ||
220 | |||
221 | status = acpi_ev_install_xrupt_handlers(); | ||
222 | if (ACPI_FAILURE(status)) { | ||
223 | return_ACPI_STATUS(status); | ||
224 | } | ||
225 | } | ||
226 | #endif /* !ACPI_REDUCED_HARDWARE */ | ||
227 | |||
228 | return_ACPI_STATUS(status); | ||
229 | } | ||
230 | |||
231 | ACPI_EXPORT_SYMBOL(acpi_enable_subsystem) | ||
232 | |||
233 | /******************************************************************************* | ||
234 | * | ||
235 | * FUNCTION: acpi_initialize_objects | ||
236 | * | ||
237 | * PARAMETERS: Flags - Init/enable Options | ||
238 | * | ||
239 | * RETURN: Status | ||
240 | * | ||
241 | * DESCRIPTION: Completes namespace initialization by initializing device | ||
242 | * objects and executing AML code for Regions, buffers, etc. | ||
243 | * | ||
244 | ******************************************************************************/ | ||
245 | acpi_status acpi_initialize_objects(u32 flags) | ||
246 | { | ||
247 | acpi_status status = AE_OK; | ||
248 | |||
249 | ACPI_FUNCTION_TRACE(acpi_initialize_objects); | ||
250 | |||
251 | /* | ||
252 | * Run all _REG methods | ||
253 | * | ||
254 | * Note: Any objects accessed by the _REG methods will be automatically | ||
255 | * initialized, even if they contain executable AML (see the call to | ||
256 | * acpi_ns_initialize_objects below). | ||
257 | */ | ||
258 | if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) { | ||
259 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, | ||
260 | "[Init] Executing _REG OpRegion methods\n")); | ||
261 | |||
262 | status = acpi_ev_initialize_op_regions(); | ||
263 | if (ACPI_FAILURE(status)) { | ||
264 | return_ACPI_STATUS(status); | ||
265 | } | ||
266 | } | ||
267 | |||
268 | /* | ||
269 | * Execute any module-level code that was detected during the table load | ||
270 | * phase. Although illegal since ACPI 2.0, there are many machines that | ||
271 | * contain this type of code. Each block of detected executable AML code | ||
272 | * outside of any control method is wrapped with a temporary control | ||
273 | * method object and placed on a global list. The methods on this list | ||
274 | * are executed below. | ||
275 | */ | ||
276 | acpi_ns_exec_module_code_list(); | ||
277 | |||
278 | /* | ||
279 | * Initialize the objects that remain uninitialized. This runs the | ||
280 | * executable AML that may be part of the declaration of these objects: | ||
281 | * operation_regions, buffer_fields, Buffers, and Packages. | ||
282 | */ | ||
283 | if (!(flags & ACPI_NO_OBJECT_INIT)) { | ||
284 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, | ||
285 | "[Init] Completing Initialization of ACPI Objects\n")); | ||
286 | |||
287 | status = acpi_ns_initialize_objects(); | ||
288 | if (ACPI_FAILURE(status)) { | ||
289 | return_ACPI_STATUS(status); | ||
290 | } | ||
291 | } | ||
292 | |||
293 | /* | ||
294 | * Initialize all device objects in the namespace. This runs the device | ||
295 | * _STA and _INI methods. | ||
296 | */ | ||
297 | if (!(flags & ACPI_NO_DEVICE_INIT)) { | ||
298 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, | ||
299 | "[Init] Initializing ACPI Devices\n")); | ||
300 | |||
301 | status = acpi_ns_initialize_devices(); | ||
302 | if (ACPI_FAILURE(status)) { | ||
303 | return_ACPI_STATUS(status); | ||
304 | } | ||
305 | } | ||
306 | |||
307 | /* | ||
308 | * Empty the caches (delete the cached objects) on the assumption that | ||
309 | * the table load filled them up more than they will be at runtime -- | ||
310 | * thus wasting non-paged memory. | ||
311 | */ | ||
312 | status = acpi_purge_cached_objects(); | ||
313 | |||
314 | acpi_gbl_startup_flags |= ACPI_INITIALIZED_OK; | ||
315 | return_ACPI_STATUS(status); | ||
316 | } | ||
317 | |||
318 | ACPI_EXPORT_SYMBOL(acpi_initialize_objects) | ||
319 | |||
320 | #endif | ||
321 | /******************************************************************************* | 56 | /******************************************************************************* |
322 | * | 57 | * |
323 | * FUNCTION: acpi_terminate | 58 | * FUNCTION: acpi_terminate |
@@ -409,7 +144,7 @@ ACPI_EXPORT_SYMBOL(acpi_subsystem_status) | |||
409 | * PARAMETERS: out_buffer - A buffer to receive the resources for the | 144 | * PARAMETERS: out_buffer - A buffer to receive the resources for the |
410 | * device | 145 | * device |
411 | * | 146 | * |
412 | * RETURN: Status - the status of the call | 147 | * RETURN: status - the status of the call |
413 | * | 148 | * |
414 | * DESCRIPTION: This function is called to get information about the current | 149 | * DESCRIPTION: This function is called to get information about the current |
415 | * state of the ACPI subsystem. It will return system information | 150 | * state of the ACPI subsystem. It will return system information |
@@ -480,8 +215,8 @@ ACPI_EXPORT_SYMBOL(acpi_get_system_info) | |||
480 | * | 215 | * |
481 | * FUNCTION: acpi_install_initialization_handler | 216 | * FUNCTION: acpi_install_initialization_handler |
482 | * | 217 | * |
483 | * PARAMETERS: Handler - Callback procedure | 218 | * PARAMETERS: handler - Callback procedure |
484 | * Function - Not (currently) used, see below | 219 | * function - Not (currently) used, see below |
485 | * | 220 | * |
486 | * RETURN: Status | 221 | * RETURN: Status |
487 | * | 222 | * |
@@ -618,7 +353,7 @@ ACPI_EXPORT_SYMBOL(acpi_remove_interface) | |||
618 | * | 353 | * |
619 | * FUNCTION: acpi_install_interface_handler | 354 | * FUNCTION: acpi_install_interface_handler |
620 | * | 355 | * |
621 | * PARAMETERS: Handler - The _OSI interface handler to install | 356 | * PARAMETERS: handler - The _OSI interface handler to install |
622 | * NULL means "remove existing handler" | 357 | * NULL means "remove existing handler" |
623 | * | 358 | * |
624 | * RETURN: Status | 359 | * RETURN: Status |
@@ -651,9 +386,9 @@ ACPI_EXPORT_SYMBOL(acpi_install_interface_handler) | |||
651 | * FUNCTION: acpi_check_address_range | 386 | * FUNCTION: acpi_check_address_range |
652 | * | 387 | * |
653 | * PARAMETERS: space_id - Address space ID | 388 | * PARAMETERS: space_id - Address space ID |
654 | * Address - Start address | 389 | * address - Start address |
655 | * Length - Length | 390 | * length - Length |
656 | * Warn - TRUE if warning on overlap desired | 391 | * warn - TRUE if warning on overlap desired |
657 | * | 392 | * |
658 | * RETURN: Count of the number of conflicts detected. | 393 | * RETURN: Count of the number of conflicts detected. |
659 | * | 394 | * |
@@ -683,3 +418,90 @@ acpi_check_address_range(acpi_adr_space_type space_id, | |||
683 | 418 | ||
684 | ACPI_EXPORT_SYMBOL(acpi_check_address_range) | 419 | ACPI_EXPORT_SYMBOL(acpi_check_address_range) |
685 | #endif /* !ACPI_ASL_COMPILER */ | 420 | #endif /* !ACPI_ASL_COMPILER */ |
421 | /******************************************************************************* | ||
422 | * | ||
423 | * FUNCTION: acpi_decode_pld_buffer | ||
424 | * | ||
425 | * PARAMETERS: in_buffer - Buffer returned by _PLD method | ||
426 | * length - Length of the in_buffer | ||
427 | * return_buffer - Where the decode buffer is returned | ||
428 | * | ||
429 | * RETURN: Status and the decoded _PLD buffer. User must deallocate | ||
430 | * the buffer via ACPI_FREE. | ||
431 | * | ||
432 | * DESCRIPTION: Decode the bit-packed buffer returned by the _PLD method into | ||
433 | * a local struct that is much more useful to an ACPI driver. | ||
434 | * | ||
435 | ******************************************************************************/ | ||
436 | acpi_status | ||
437 | acpi_decode_pld_buffer(u8 *in_buffer, | ||
438 | acpi_size length, struct acpi_pld_info ** return_buffer) | ||
439 | { | ||
440 | struct acpi_pld_info *pld_info; | ||
441 | u32 *buffer = ACPI_CAST_PTR(u32, in_buffer); | ||
442 | u32 dword; | ||
443 | |||
444 | /* Parameter validation */ | ||
445 | |||
446 | if (!in_buffer || !return_buffer || (length < 16)) { | ||
447 | return (AE_BAD_PARAMETER); | ||
448 | } | ||
449 | |||
450 | pld_info = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_pld_info)); | ||
451 | if (!pld_info) { | ||
452 | return (AE_NO_MEMORY); | ||
453 | } | ||
454 | |||
455 | /* First 32-bit DWord */ | ||
456 | |||
457 | ACPI_MOVE_32_TO_32(&dword, &buffer[0]); | ||
458 | pld_info->revision = ACPI_PLD_GET_REVISION(&dword); | ||
459 | pld_info->ignore_color = ACPI_PLD_GET_IGNORE_COLOR(&dword); | ||
460 | pld_info->color = ACPI_PLD_GET_COLOR(&dword); | ||
461 | |||
462 | /* Second 32-bit DWord */ | ||
463 | |||
464 | ACPI_MOVE_32_TO_32(&dword, &buffer[1]); | ||
465 | pld_info->width = ACPI_PLD_GET_WIDTH(&dword); | ||
466 | pld_info->height = ACPI_PLD_GET_HEIGHT(&dword); | ||
467 | |||
468 | /* Third 32-bit DWord */ | ||
469 | |||
470 | ACPI_MOVE_32_TO_32(&dword, &buffer[2]); | ||
471 | pld_info->user_visible = ACPI_PLD_GET_USER_VISIBLE(&dword); | ||
472 | pld_info->dock = ACPI_PLD_GET_DOCK(&dword); | ||
473 | pld_info->lid = ACPI_PLD_GET_LID(&dword); | ||
474 | pld_info->panel = ACPI_PLD_GET_PANEL(&dword); | ||
475 | pld_info->vertical_position = ACPI_PLD_GET_VERTICAL(&dword); | ||
476 | pld_info->horizontal_position = ACPI_PLD_GET_HORIZONTAL(&dword); | ||
477 | pld_info->shape = ACPI_PLD_GET_SHAPE(&dword); | ||
478 | pld_info->group_orientation = ACPI_PLD_GET_ORIENTATION(&dword); | ||
479 | pld_info->group_token = ACPI_PLD_GET_TOKEN(&dword); | ||
480 | pld_info->group_position = ACPI_PLD_GET_POSITION(&dword); | ||
481 | pld_info->bay = ACPI_PLD_GET_BAY(&dword); | ||
482 | |||
483 | /* Fourth 32-bit DWord */ | ||
484 | |||
485 | ACPI_MOVE_32_TO_32(&dword, &buffer[3]); | ||
486 | pld_info->ejectable = ACPI_PLD_GET_EJECTABLE(&dword); | ||
487 | pld_info->ospm_eject_required = ACPI_PLD_GET_OSPM_EJECT(&dword); | ||
488 | pld_info->cabinet_number = ACPI_PLD_GET_CABINET(&dword); | ||
489 | pld_info->card_cage_number = ACPI_PLD_GET_CARD_CAGE(&dword); | ||
490 | pld_info->reference = ACPI_PLD_GET_REFERENCE(&dword); | ||
491 | pld_info->rotation = ACPI_PLD_GET_ROTATION(&dword); | ||
492 | pld_info->order = ACPI_PLD_GET_ORDER(&dword); | ||
493 | |||
494 | if (length >= ACPI_PLD_BUFFER_SIZE) { | ||
495 | |||
496 | /* Fifth 32-bit DWord (Revision 2 of _PLD) */ | ||
497 | |||
498 | ACPI_MOVE_32_TO_32(&dword, &buffer[4]); | ||
499 | pld_info->vertical_offset = ACPI_PLD_GET_VERT_OFFSET(&dword); | ||
500 | pld_info->horizontal_offset = ACPI_PLD_GET_HORIZ_OFFSET(&dword); | ||
501 | } | ||
502 | |||
503 | *return_buffer = pld_info; | ||
504 | return (AE_OK); | ||
505 | } | ||
506 | |||
507 | ACPI_EXPORT_SYMBOL(acpi_decode_pld_buffer) | ||
diff --git a/drivers/acpi/acpica/utxferror.c b/drivers/acpi/acpica/utxferror.c index 52b568af1819..6d63cc39b9ae 100644 --- a/drivers/acpi/acpica/utxferror.c +++ b/drivers/acpi/acpica/utxferror.c | |||
@@ -53,7 +53,7 @@ ACPI_MODULE_NAME("utxferror") | |||
53 | * This module is used for the in-kernel ACPICA as well as the ACPICA | 53 | * This module is used for the in-kernel ACPICA as well as the ACPICA |
54 | * tools/applications. | 54 | * tools/applications. |
55 | * | 55 | * |
56 | * For the i_aSL compiler case, the output is redirected to stderr so that | 56 | * For the iASL compiler case, the output is redirected to stderr so that |
57 | * any of the various ACPI errors and warnings do not appear in the output | 57 | * any of the various ACPI errors and warnings do not appear in the output |
58 | * files, for either the compiler or disassembler portions of the tool. | 58 | * files, for either the compiler or disassembler portions of the tool. |
59 | */ | 59 | */ |
@@ -70,7 +70,7 @@ extern FILE *acpi_gbl_output_file; | |||
70 | 70 | ||
71 | #else | 71 | #else |
72 | /* | 72 | /* |
73 | * non-i_aSL case - no redirection, nothing to do | 73 | * non-iASL case - no redirection, nothing to do |
74 | */ | 74 | */ |
75 | #define ACPI_MSG_REDIRECT_BEGIN | 75 | #define ACPI_MSG_REDIRECT_BEGIN |
76 | #define ACPI_MSG_REDIRECT_END | 76 | #define ACPI_MSG_REDIRECT_END |
@@ -82,6 +82,8 @@ extern FILE *acpi_gbl_output_file; | |||
82 | #define ACPI_MSG_EXCEPTION "ACPI Exception: " | 82 | #define ACPI_MSG_EXCEPTION "ACPI Exception: " |
83 | #define ACPI_MSG_WARNING "ACPI Warning: " | 83 | #define ACPI_MSG_WARNING "ACPI Warning: " |
84 | #define ACPI_MSG_INFO "ACPI: " | 84 | #define ACPI_MSG_INFO "ACPI: " |
85 | #define ACPI_MSG_BIOS_ERROR "ACPI BIOS Bug: Error: " | ||
86 | #define ACPI_MSG_BIOS_WARNING "ACPI BIOS Bug: Warning: " | ||
85 | /* | 87 | /* |
86 | * Common message suffix | 88 | * Common message suffix |
87 | */ | 89 | */ |
@@ -93,7 +95,7 @@ extern FILE *acpi_gbl_output_file; | |||
93 | * | 95 | * |
94 | * PARAMETERS: module_name - Caller's module name (for error output) | 96 | * PARAMETERS: module_name - Caller's module name (for error output) |
95 | * line_number - Caller's line number (for error output) | 97 | * line_number - Caller's line number (for error output) |
96 | * Format - Printf format string + additional args | 98 | * format - Printf format string + additional args |
97 | * | 99 | * |
98 | * RETURN: None | 100 | * RETURN: None |
99 | * | 101 | * |
@@ -124,8 +126,8 @@ ACPI_EXPORT_SYMBOL(acpi_error) | |||
124 | * | 126 | * |
125 | * PARAMETERS: module_name - Caller's module name (for error output) | 127 | * PARAMETERS: module_name - Caller's module name (for error output) |
126 | * line_number - Caller's line number (for error output) | 128 | * line_number - Caller's line number (for error output) |
127 | * Status - Status to be formatted | 129 | * status - Status to be formatted |
128 | * Format - Printf format string + additional args | 130 | * format - Printf format string + additional args |
129 | * | 131 | * |
130 | * RETURN: None | 132 | * RETURN: None |
131 | * | 133 | * |
@@ -159,7 +161,7 @@ ACPI_EXPORT_SYMBOL(acpi_exception) | |||
159 | * | 161 | * |
160 | * PARAMETERS: module_name - Caller's module name (for error output) | 162 | * PARAMETERS: module_name - Caller's module name (for error output) |
161 | * line_number - Caller's line number (for error output) | 163 | * line_number - Caller's line number (for error output) |
162 | * Format - Printf format string + additional args | 164 | * format - Printf format string + additional args |
163 | * | 165 | * |
164 | * RETURN: None | 166 | * RETURN: None |
165 | * | 167 | * |
@@ -190,7 +192,7 @@ ACPI_EXPORT_SYMBOL(acpi_warning) | |||
190 | * | 192 | * |
191 | * PARAMETERS: module_name - Caller's module name (for error output) | 193 | * PARAMETERS: module_name - Caller's module name (for error output) |
192 | * line_number - Caller's line number (for error output) | 194 | * line_number - Caller's line number (for error output) |
193 | * Format - Printf format string + additional args | 195 | * format - Printf format string + additional args |
194 | * | 196 | * |
195 | * RETURN: None | 197 | * RETURN: None |
196 | * | 198 | * |
@@ -218,6 +220,72 @@ acpi_info(const char *module_name, u32 line_number, const char *format, ...) | |||
218 | 220 | ||
219 | ACPI_EXPORT_SYMBOL(acpi_info) | 221 | ACPI_EXPORT_SYMBOL(acpi_info) |
220 | 222 | ||
223 | /******************************************************************************* | ||
224 | * | ||
225 | * FUNCTION: acpi_bios_error | ||
226 | * | ||
227 | * PARAMETERS: module_name - Caller's module name (for error output) | ||
228 | * line_number - Caller's line number (for error output) | ||
229 | * format - Printf format string + additional args | ||
230 | * | ||
231 | * RETURN: None | ||
232 | * | ||
233 | * DESCRIPTION: Print "ACPI Firmware Error" message with module/line/version | ||
234 | * info | ||
235 | * | ||
236 | ******************************************************************************/ | ||
237 | void ACPI_INTERNAL_VAR_XFACE | ||
238 | acpi_bios_error(const char *module_name, | ||
239 | u32 line_number, const char *format, ...) | ||
240 | { | ||
241 | va_list arg_list; | ||
242 | |||
243 | ACPI_MSG_REDIRECT_BEGIN; | ||
244 | acpi_os_printf(ACPI_MSG_BIOS_ERROR); | ||
245 | |||
246 | va_start(arg_list, format); | ||
247 | acpi_os_vprintf(format, arg_list); | ||
248 | ACPI_MSG_SUFFIX; | ||
249 | va_end(arg_list); | ||
250 | |||
251 | ACPI_MSG_REDIRECT_END; | ||
252 | } | ||
253 | |||
254 | ACPI_EXPORT_SYMBOL(acpi_bios_error) | ||
255 | |||
256 | /******************************************************************************* | ||
257 | * | ||
258 | * FUNCTION: acpi_bios_warning | ||
259 | * | ||
260 | * PARAMETERS: module_name - Caller's module name (for error output) | ||
261 | * line_number - Caller's line number (for error output) | ||
262 | * format - Printf format string + additional args | ||
263 | * | ||
264 | * RETURN: None | ||
265 | * | ||
266 | * DESCRIPTION: Print "ACPI Firmware Warning" message with module/line/version | ||
267 | * info | ||
268 | * | ||
269 | ******************************************************************************/ | ||
270 | void ACPI_INTERNAL_VAR_XFACE | ||
271 | acpi_bios_warning(const char *module_name, | ||
272 | u32 line_number, const char *format, ...) | ||
273 | { | ||
274 | va_list arg_list; | ||
275 | |||
276 | ACPI_MSG_REDIRECT_BEGIN; | ||
277 | acpi_os_printf(ACPI_MSG_BIOS_WARNING); | ||
278 | |||
279 | va_start(arg_list, format); | ||
280 | acpi_os_vprintf(format, arg_list); | ||
281 | ACPI_MSG_SUFFIX; | ||
282 | va_end(arg_list); | ||
283 | |||
284 | ACPI_MSG_REDIRECT_END; | ||
285 | } | ||
286 | |||
287 | ACPI_EXPORT_SYMBOL(acpi_bios_warning) | ||
288 | |||
221 | /* | 289 | /* |
222 | * The remainder of this module contains internal error functions that may | 290 | * The remainder of this module contains internal error functions that may |
223 | * be configured out. | 291 | * be configured out. |
@@ -271,9 +339,9 @@ acpi_ut_predefined_warning(const char *module_name, | |||
271 | * | 339 | * |
272 | * PARAMETERS: module_name - Caller's module name (for error output) | 340 | * PARAMETERS: module_name - Caller's module name (for error output) |
273 | * line_number - Caller's line number (for error output) | 341 | * line_number - Caller's line number (for error output) |
274 | * Pathname - Full pathname to the node | 342 | * pathname - Full pathname to the node |
275 | * node_flags - From Namespace node for the method/object | 343 | * node_flags - From Namespace node for the method/object |
276 | * Format - Printf format string + additional args | 344 | * format - Printf format string + additional args |
277 | * | 345 | * |
278 | * RETURN: None | 346 | * RETURN: None |
279 | * | 347 | * |
@@ -373,9 +441,9 @@ acpi_ut_namespace_error(const char *module_name, | |||
373 | * | 441 | * |
374 | * PARAMETERS: module_name - Caller's module name (for error output) | 442 | * PARAMETERS: module_name - Caller's module name (for error output) |
375 | * line_number - Caller's line number (for error output) | 443 | * line_number - Caller's line number (for error output) |
376 | * Message - Error message to use on failure | 444 | * message - Error message to use on failure |
377 | * prefix_node - Prefix relative to the path | 445 | * prefix_node - Prefix relative to the path |
378 | * Path - Path to the node (optional) | 446 | * path - Path to the node (optional) |
379 | * method_status - Execution status | 447 | * method_status - Execution status |
380 | * | 448 | * |
381 | * RETURN: None | 449 | * RETURN: None |
diff --git a/drivers/acpi/acpica/utxfinit.c b/drivers/acpi/acpica/utxfinit.c new file mode 100644 index 000000000000..14f523627a5e --- /dev/null +++ b/drivers/acpi/acpica/utxfinit.c | |||
@@ -0,0 +1,317 @@ | |||
1 | /****************************************************************************** | ||
2 | * | ||
3 | * Module Name: utxfinit - External interfaces for ACPICA initialization | ||
4 | * | ||
5 | *****************************************************************************/ | ||
6 | |||
7 | /* | ||
8 | * Copyright (C) 2000 - 2012, Intel Corp. | ||
9 | * All rights reserved. | ||
10 | * | ||
11 | * Redistribution and use in source and binary forms, with or without | ||
12 | * modification, are permitted provided that the following conditions | ||
13 | * are met: | ||
14 | * 1. Redistributions of source code must retain the above copyright | ||
15 | * notice, this list of conditions, and the following disclaimer, | ||
16 | * without modification. | ||
17 | * 2. Redistributions in binary form must reproduce at minimum a disclaimer | ||
18 | * substantially similar to the "NO WARRANTY" disclaimer below | ||
19 | * ("Disclaimer") and any redistribution must be conditioned upon | ||
20 | * including a substantially similar Disclaimer requirement for further | ||
21 | * binary redistribution. | ||
22 | * 3. Neither the names of the above-listed copyright holders nor the names | ||
23 | * of any contributors may be used to endorse or promote products derived | ||
24 | * from this software without specific prior written permission. | ||
25 | * | ||
26 | * Alternatively, this software may be distributed under the terms of the | ||
27 | * GNU General Public License ("GPL") version 2 as published by the Free | ||
28 | * Software Foundation. | ||
29 | * | ||
30 | * NO WARRANTY | ||
31 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
32 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
33 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR | ||
34 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
35 | * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
36 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
37 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
38 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
39 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | ||
40 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
41 | * POSSIBILITY OF SUCH DAMAGES. | ||
42 | */ | ||
43 | |||
44 | #include <linux/export.h> | ||
45 | #include <acpi/acpi.h> | ||
46 | #include "accommon.h" | ||
47 | #include "acevents.h" | ||
48 | #include "acnamesp.h" | ||
49 | #include "acdebug.h" | ||
50 | #include "actables.h" | ||
51 | |||
52 | #define _COMPONENT ACPI_UTILITIES | ||
53 | ACPI_MODULE_NAME("utxfinit") | ||
54 | |||
55 | /******************************************************************************* | ||
56 | * | ||
57 | * FUNCTION: acpi_initialize_subsystem | ||
58 | * | ||
59 | * PARAMETERS: None | ||
60 | * | ||
61 | * RETURN: Status | ||
62 | * | ||
63 | * DESCRIPTION: Initializes all global variables. This is the first function | ||
64 | * called, so any early initialization belongs here. | ||
65 | * | ||
66 | ******************************************************************************/ | ||
67 | acpi_status acpi_initialize_subsystem(void) | ||
68 | { | ||
69 | acpi_status status; | ||
70 | |||
71 | ACPI_FUNCTION_TRACE(acpi_initialize_subsystem); | ||
72 | |||
73 | acpi_gbl_startup_flags = ACPI_SUBSYSTEM_INITIALIZE; | ||
74 | ACPI_DEBUG_EXEC(acpi_ut_init_stack_ptr_trace()); | ||
75 | |||
76 | /* Initialize the OS-Dependent layer */ | ||
77 | |||
78 | status = acpi_os_initialize(); | ||
79 | if (ACPI_FAILURE(status)) { | ||
80 | ACPI_EXCEPTION((AE_INFO, status, "During OSL initialization")); | ||
81 | return_ACPI_STATUS(status); | ||
82 | } | ||
83 | |||
84 | /* Initialize all globals used by the subsystem */ | ||
85 | |||
86 | status = acpi_ut_init_globals(); | ||
87 | if (ACPI_FAILURE(status)) { | ||
88 | ACPI_EXCEPTION((AE_INFO, status, | ||
89 | "During initialization of globals")); | ||
90 | return_ACPI_STATUS(status); | ||
91 | } | ||
92 | |||
93 | /* Create the default mutex objects */ | ||
94 | |||
95 | status = acpi_ut_mutex_initialize(); | ||
96 | if (ACPI_FAILURE(status)) { | ||
97 | ACPI_EXCEPTION((AE_INFO, status, | ||
98 | "During Global Mutex creation")); | ||
99 | return_ACPI_STATUS(status); | ||
100 | } | ||
101 | |||
102 | /* | ||
103 | * Initialize the namespace manager and | ||
104 | * the root of the namespace tree | ||
105 | */ | ||
106 | status = acpi_ns_root_initialize(); | ||
107 | if (ACPI_FAILURE(status)) { | ||
108 | ACPI_EXCEPTION((AE_INFO, status, | ||
109 | "During Namespace initialization")); | ||
110 | return_ACPI_STATUS(status); | ||
111 | } | ||
112 | |||
113 | /* Initialize the global OSI interfaces list with the static names */ | ||
114 | |||
115 | status = acpi_ut_initialize_interfaces(); | ||
116 | if (ACPI_FAILURE(status)) { | ||
117 | ACPI_EXCEPTION((AE_INFO, status, | ||
118 | "During OSI interfaces initialization")); | ||
119 | return_ACPI_STATUS(status); | ||
120 | } | ||
121 | |||
122 | /* If configured, initialize the AML debugger */ | ||
123 | |||
124 | ACPI_DEBUGGER_EXEC(status = acpi_db_initialize()); | ||
125 | return_ACPI_STATUS(status); | ||
126 | } | ||
127 | ACPI_EXPORT_SYMBOL(acpi_initialize_subsystem) | ||
128 | |||
129 | /******************************************************************************* | ||
130 | * | ||
131 | * FUNCTION: acpi_enable_subsystem | ||
132 | * | ||
133 | * PARAMETERS: flags - Init/enable Options | ||
134 | * | ||
135 | * RETURN: Status | ||
136 | * | ||
137 | * DESCRIPTION: Completes the subsystem initialization including hardware. | ||
138 | * Puts system into ACPI mode if it isn't already. | ||
139 | * | ||
140 | ******************************************************************************/ | ||
141 | acpi_status acpi_enable_subsystem(u32 flags) | ||
142 | { | ||
143 | acpi_status status = AE_OK; | ||
144 | |||
145 | ACPI_FUNCTION_TRACE(acpi_enable_subsystem); | ||
146 | |||
147 | #if (!ACPI_REDUCED_HARDWARE) | ||
148 | |||
149 | /* Enable ACPI mode */ | ||
150 | |||
151 | if (!(flags & ACPI_NO_ACPI_ENABLE)) { | ||
152 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, | ||
153 | "[Init] Going into ACPI mode\n")); | ||
154 | |||
155 | acpi_gbl_original_mode = acpi_hw_get_mode(); | ||
156 | |||
157 | status = acpi_enable(); | ||
158 | if (ACPI_FAILURE(status)) { | ||
159 | ACPI_WARNING((AE_INFO, "AcpiEnable failed")); | ||
160 | return_ACPI_STATUS(status); | ||
161 | } | ||
162 | } | ||
163 | |||
164 | /* | ||
165 | * Obtain a permanent mapping for the FACS. This is required for the | ||
166 | * Global Lock and the Firmware Waking Vector | ||
167 | */ | ||
168 | status = acpi_tb_initialize_facs(); | ||
169 | if (ACPI_FAILURE(status)) { | ||
170 | ACPI_WARNING((AE_INFO, "Could not map the FACS table")); | ||
171 | return_ACPI_STATUS(status); | ||
172 | } | ||
173 | #endif /* !ACPI_REDUCED_HARDWARE */ | ||
174 | |||
175 | /* | ||
176 | * Install the default op_region handlers. These are installed unless | ||
177 | * other handlers have already been installed via the | ||
178 | * install_address_space_handler interface. | ||
179 | */ | ||
180 | if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) { | ||
181 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, | ||
182 | "[Init] Installing default address space handlers\n")); | ||
183 | |||
184 | status = acpi_ev_install_region_handlers(); | ||
185 | if (ACPI_FAILURE(status)) { | ||
186 | return_ACPI_STATUS(status); | ||
187 | } | ||
188 | } | ||
189 | #if (!ACPI_REDUCED_HARDWARE) | ||
190 | /* | ||
191 | * Initialize ACPI Event handling (Fixed and General Purpose) | ||
192 | * | ||
193 | * Note1: We must have the hardware and events initialized before we can | ||
194 | * execute any control methods safely. Any control method can require | ||
195 | * ACPI hardware support, so the hardware must be fully initialized before | ||
196 | * any method execution! | ||
197 | * | ||
198 | * Note2: Fixed events are initialized and enabled here. GPEs are | ||
199 | * initialized, but cannot be enabled until after the hardware is | ||
200 | * completely initialized (SCI and global_lock activated) and the various | ||
201 | * initialization control methods are run (_REG, _STA, _INI) on the | ||
202 | * entire namespace. | ||
203 | */ | ||
204 | if (!(flags & ACPI_NO_EVENT_INIT)) { | ||
205 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, | ||
206 | "[Init] Initializing ACPI events\n")); | ||
207 | |||
208 | status = acpi_ev_initialize_events(); | ||
209 | if (ACPI_FAILURE(status)) { | ||
210 | return_ACPI_STATUS(status); | ||
211 | } | ||
212 | } | ||
213 | |||
214 | /* | ||
215 | * Install the SCI handler and Global Lock handler. This completes the | ||
216 | * hardware initialization. | ||
217 | */ | ||
218 | if (!(flags & ACPI_NO_HANDLER_INIT)) { | ||
219 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, | ||
220 | "[Init] Installing SCI/GL handlers\n")); | ||
221 | |||
222 | status = acpi_ev_install_xrupt_handlers(); | ||
223 | if (ACPI_FAILURE(status)) { | ||
224 | return_ACPI_STATUS(status); | ||
225 | } | ||
226 | } | ||
227 | #endif /* !ACPI_REDUCED_HARDWARE */ | ||
228 | |||
229 | return_ACPI_STATUS(status); | ||
230 | } | ||
231 | ACPI_EXPORT_SYMBOL(acpi_enable_subsystem) | ||
232 | |||
233 | /******************************************************************************* | ||
234 | * | ||
235 | * FUNCTION: acpi_initialize_objects | ||
236 | * | ||
237 | * PARAMETERS: flags - Init/enable Options | ||
238 | * | ||
239 | * RETURN: Status | ||
240 | * | ||
241 | * DESCRIPTION: Completes namespace initialization by initializing device | ||
242 | * objects and executing AML code for Regions, buffers, etc. | ||
243 | * | ||
244 | ******************************************************************************/ | ||
245 | acpi_status acpi_initialize_objects(u32 flags) | ||
246 | { | ||
247 | acpi_status status = AE_OK; | ||
248 | |||
249 | ACPI_FUNCTION_TRACE(acpi_initialize_objects); | ||
250 | |||
251 | /* | ||
252 | * Run all _REG methods | ||
253 | * | ||
254 | * Note: Any objects accessed by the _REG methods will be automatically | ||
255 | * initialized, even if they contain executable AML (see the call to | ||
256 | * acpi_ns_initialize_objects below). | ||
257 | */ | ||
258 | if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) { | ||
259 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, | ||
260 | "[Init] Executing _REG OpRegion methods\n")); | ||
261 | |||
262 | status = acpi_ev_initialize_op_regions(); | ||
263 | if (ACPI_FAILURE(status)) { | ||
264 | return_ACPI_STATUS(status); | ||
265 | } | ||
266 | } | ||
267 | |||
268 | /* | ||
269 | * Execute any module-level code that was detected during the table load | ||
270 | * phase. Although illegal since ACPI 2.0, there are many machines that | ||
271 | * contain this type of code. Each block of detected executable AML code | ||
272 | * outside of any control method is wrapped with a temporary control | ||
273 | * method object and placed on a global list. The methods on this list | ||
274 | * are executed below. | ||
275 | */ | ||
276 | acpi_ns_exec_module_code_list(); | ||
277 | |||
278 | /* | ||
279 | * Initialize the objects that remain uninitialized. This runs the | ||
280 | * executable AML that may be part of the declaration of these objects: | ||
281 | * operation_regions, buffer_fields, Buffers, and Packages. | ||
282 | */ | ||
283 | if (!(flags & ACPI_NO_OBJECT_INIT)) { | ||
284 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, | ||
285 | "[Init] Completing Initialization of ACPI Objects\n")); | ||
286 | |||
287 | status = acpi_ns_initialize_objects(); | ||
288 | if (ACPI_FAILURE(status)) { | ||
289 | return_ACPI_STATUS(status); | ||
290 | } | ||
291 | } | ||
292 | |||
293 | /* | ||
294 | * Initialize all device objects in the namespace. This runs the device | ||
295 | * _STA and _INI methods. | ||
296 | */ | ||
297 | if (!(flags & ACPI_NO_DEVICE_INIT)) { | ||
298 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, | ||
299 | "[Init] Initializing ACPI Devices\n")); | ||
300 | |||
301 | status = acpi_ns_initialize_devices(); | ||
302 | if (ACPI_FAILURE(status)) { | ||
303 | return_ACPI_STATUS(status); | ||
304 | } | ||
305 | } | ||
306 | |||
307 | /* | ||
308 | * Empty the caches (delete the cached objects) on the assumption that | ||
309 | * the table load filled them up more than they will be at runtime -- | ||
310 | * thus wasting non-paged memory. | ||
311 | */ | ||
312 | status = acpi_purge_cached_objects(); | ||
313 | |||
314 | acpi_gbl_startup_flags |= ACPI_INITIALIZED_OK; | ||
315 | return_ACPI_STATUS(status); | ||
316 | } | ||
317 | ACPI_EXPORT_SYMBOL(acpi_initialize_objects) | ||
diff --git a/drivers/acpi/acpica/utxfmutex.c b/drivers/acpi/acpica/utxfmutex.c index 1427d191d15a..0a40a851b354 100644 --- a/drivers/acpi/acpica/utxfmutex.c +++ b/drivers/acpi/acpica/utxfmutex.c | |||
@@ -58,8 +58,8 @@ acpi_ut_get_mutex_object(acpi_handle handle, | |||
58 | * | 58 | * |
59 | * FUNCTION: acpi_ut_get_mutex_object | 59 | * FUNCTION: acpi_ut_get_mutex_object |
60 | * | 60 | * |
61 | * PARAMETERS: Handle - Mutex or prefix handle (optional) | 61 | * PARAMETERS: handle - Mutex or prefix handle (optional) |
62 | * Pathname - Mutex pathname (optional) | 62 | * pathname - Mutex pathname (optional) |
63 | * ret_obj - Where the mutex object is returned | 63 | * ret_obj - Where the mutex object is returned |
64 | * | 64 | * |
65 | * RETURN: Status | 65 | * RETURN: Status |
@@ -118,9 +118,9 @@ acpi_ut_get_mutex_object(acpi_handle handle, | |||
118 | * | 118 | * |
119 | * FUNCTION: acpi_acquire_mutex | 119 | * FUNCTION: acpi_acquire_mutex |
120 | * | 120 | * |
121 | * PARAMETERS: Handle - Mutex or prefix handle (optional) | 121 | * PARAMETERS: handle - Mutex or prefix handle (optional) |
122 | * Pathname - Mutex pathname (optional) | 122 | * pathname - Mutex pathname (optional) |
123 | * Timeout - Max time to wait for the lock (millisec) | 123 | * timeout - Max time to wait for the lock (millisec) |
124 | * | 124 | * |
125 | * RETURN: Status | 125 | * RETURN: Status |
126 | * | 126 | * |
@@ -155,8 +155,8 @@ acpi_acquire_mutex(acpi_handle handle, acpi_string pathname, u16 timeout) | |||
155 | * | 155 | * |
156 | * FUNCTION: acpi_release_mutex | 156 | * FUNCTION: acpi_release_mutex |
157 | * | 157 | * |
158 | * PARAMETERS: Handle - Mutex or prefix handle (optional) | 158 | * PARAMETERS: handle - Mutex or prefix handle (optional) |
159 | * Pathname - Mutex pathname (optional) | 159 | * pathname - Mutex pathname (optional) |
160 | * | 160 | * |
161 | * RETURN: Status | 161 | * RETURN: Status |
162 | * | 162 | * |
diff --git a/drivers/acpi/apei/apei-base.c b/drivers/acpi/apei/apei-base.c index 6686b1eaf13e..00a783661d0b 100644 --- a/drivers/acpi/apei/apei-base.c +++ b/drivers/acpi/apei/apei-base.c | |||
@@ -586,6 +586,11 @@ static int apei_check_gar(struct acpi_generic_address *reg, u64 *paddr, | |||
586 | } | 586 | } |
587 | *access_bit_width = 1UL << (access_size_code + 2); | 587 | *access_bit_width = 1UL << (access_size_code + 2); |
588 | 588 | ||
589 | /* Fixup common BIOS bug */ | ||
590 | if (bit_width == 32 && bit_offset == 0 && (*paddr & 0x03) == 0 && | ||
591 | *access_bit_width < 32) | ||
592 | *access_bit_width = 32; | ||
593 | |||
589 | if ((bit_width + bit_offset) > *access_bit_width) { | 594 | if ((bit_width + bit_offset) > *access_bit_width) { |
590 | pr_warning(FW_BUG APEI_PFX | 595 | pr_warning(FW_BUG APEI_PFX |
591 | "Invalid bit width + offset in GAR [0x%llx/%u/%u/%u/%u]\n", | 596 | "Invalid bit width + offset in GAR [0x%llx/%u/%u/%u/%u]\n", |
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 7dd3f9fb9f3f..45e3e1759fb8 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
@@ -250,6 +250,13 @@ static int acpi_battery_get_property(struct power_supply *psy, | |||
250 | else | 250 | else |
251 | val->intval = battery->capacity_now * 1000; | 251 | val->intval = battery->capacity_now * 1000; |
252 | break; | 252 | break; |
253 | case POWER_SUPPLY_PROP_CAPACITY: | ||
254 | if (battery->capacity_now && battery->full_charge_capacity) | ||
255 | val->intval = battery->capacity_now * 100/ | ||
256 | battery->full_charge_capacity; | ||
257 | else | ||
258 | val->intval = 0; | ||
259 | break; | ||
253 | case POWER_SUPPLY_PROP_MODEL_NAME: | 260 | case POWER_SUPPLY_PROP_MODEL_NAME: |
254 | val->strval = battery->model_number; | 261 | val->strval = battery->model_number; |
255 | break; | 262 | break; |
@@ -276,6 +283,7 @@ static enum power_supply_property charge_battery_props[] = { | |||
276 | POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN, | 283 | POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN, |
277 | POWER_SUPPLY_PROP_CHARGE_FULL, | 284 | POWER_SUPPLY_PROP_CHARGE_FULL, |
278 | POWER_SUPPLY_PROP_CHARGE_NOW, | 285 | POWER_SUPPLY_PROP_CHARGE_NOW, |
286 | POWER_SUPPLY_PROP_CAPACITY, | ||
279 | POWER_SUPPLY_PROP_MODEL_NAME, | 287 | POWER_SUPPLY_PROP_MODEL_NAME, |
280 | POWER_SUPPLY_PROP_MANUFACTURER, | 288 | POWER_SUPPLY_PROP_MANUFACTURER, |
281 | POWER_SUPPLY_PROP_SERIAL_NUMBER, | 289 | POWER_SUPPLY_PROP_SERIAL_NUMBER, |
@@ -292,6 +300,7 @@ static enum power_supply_property energy_battery_props[] = { | |||
292 | POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN, | 300 | POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN, |
293 | POWER_SUPPLY_PROP_ENERGY_FULL, | 301 | POWER_SUPPLY_PROP_ENERGY_FULL, |
294 | POWER_SUPPLY_PROP_ENERGY_NOW, | 302 | POWER_SUPPLY_PROP_ENERGY_NOW, |
303 | POWER_SUPPLY_PROP_CAPACITY, | ||
295 | POWER_SUPPLY_PROP_MODEL_NAME, | 304 | POWER_SUPPLY_PROP_MODEL_NAME, |
296 | POWER_SUPPLY_PROP_MANUFACTURER, | 305 | POWER_SUPPLY_PROP_MANUFACTURER, |
297 | POWER_SUPPLY_PROP_SERIAL_NUMBER, | 306 | POWER_SUPPLY_PROP_SERIAL_NUMBER, |
@@ -1043,17 +1052,26 @@ static int acpi_battery_remove(struct acpi_device *device, int type) | |||
1043 | return 0; | 1052 | return 0; |
1044 | } | 1053 | } |
1045 | 1054 | ||
1055 | #ifdef CONFIG_PM_SLEEP | ||
1046 | /* this is needed to learn about changes made in suspended state */ | 1056 | /* this is needed to learn about changes made in suspended state */ |
1047 | static int acpi_battery_resume(struct acpi_device *device) | 1057 | static int acpi_battery_resume(struct device *dev) |
1048 | { | 1058 | { |
1049 | struct acpi_battery *battery; | 1059 | struct acpi_battery *battery; |
1050 | if (!device) | 1060 | |
1061 | if (!dev) | ||
1051 | return -EINVAL; | 1062 | return -EINVAL; |
1052 | battery = acpi_driver_data(device); | 1063 | |
1064 | battery = acpi_driver_data(to_acpi_device(dev)); | ||
1065 | if (!battery) | ||
1066 | return -EINVAL; | ||
1067 | |||
1053 | battery->update_time = 0; | 1068 | battery->update_time = 0; |
1054 | acpi_battery_update(battery); | 1069 | acpi_battery_update(battery); |
1055 | return 0; | 1070 | return 0; |
1056 | } | 1071 | } |
1072 | #endif | ||
1073 | |||
1074 | static SIMPLE_DEV_PM_OPS(acpi_battery_pm, NULL, acpi_battery_resume); | ||
1057 | 1075 | ||
1058 | static struct acpi_driver acpi_battery_driver = { | 1076 | static struct acpi_driver acpi_battery_driver = { |
1059 | .name = "battery", | 1077 | .name = "battery", |
@@ -1062,10 +1080,10 @@ static struct acpi_driver acpi_battery_driver = { | |||
1062 | .flags = ACPI_DRIVER_ALL_NOTIFY_EVENTS, | 1080 | .flags = ACPI_DRIVER_ALL_NOTIFY_EVENTS, |
1063 | .ops = { | 1081 | .ops = { |
1064 | .add = acpi_battery_add, | 1082 | .add = acpi_battery_add, |
1065 | .resume = acpi_battery_resume, | ||
1066 | .remove = acpi_battery_remove, | 1083 | .remove = acpi_battery_remove, |
1067 | .notify = acpi_battery_notify, | 1084 | .notify = acpi_battery_notify, |
1068 | }, | 1085 | }, |
1086 | .drv.pm = &acpi_battery_pm, | ||
1069 | }; | 1087 | }; |
1070 | 1088 | ||
1071 | static void __init acpi_battery_init_async(void *unused, async_cookie_t cookie) | 1089 | static void __init acpi_battery_init_async(void *unused, async_cookie_t cookie) |
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index adceafda9c17..e0596954290b 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c | |||
@@ -237,6 +237,16 @@ static int __acpi_bus_get_power(struct acpi_device *device, int *state) | |||
237 | } else if (result == ACPI_STATE_D3_HOT) { | 237 | } else if (result == ACPI_STATE_D3_HOT) { |
238 | result = ACPI_STATE_D3; | 238 | result = ACPI_STATE_D3; |
239 | } | 239 | } |
240 | |||
241 | /* | ||
242 | * If we were unsure about the device parent's power state up to this | ||
243 | * point, the fact that the device is in D0 implies that the parent has | ||
244 | * to be in D0 too. | ||
245 | */ | ||
246 | if (device->parent && device->parent->power.state == ACPI_STATE_UNKNOWN | ||
247 | && result == ACPI_STATE_D0) | ||
248 | device->parent->power.state = ACPI_STATE_D0; | ||
249 | |||
240 | *state = result; | 250 | *state = result; |
241 | 251 | ||
242 | out: | 252 | out: |
@@ -574,6 +584,10 @@ static void acpi_bus_osc_support(void) | |||
574 | capbuf[OSC_SUPPORT_TYPE] |= OSC_SB_PPC_OST_SUPPORT; | 584 | capbuf[OSC_SUPPORT_TYPE] |= OSC_SB_PPC_OST_SUPPORT; |
575 | #endif | 585 | #endif |
576 | 586 | ||
587 | #ifdef ACPI_HOTPLUG_OST | ||
588 | capbuf[OSC_SUPPORT_TYPE] |= OSC_SB_HOTPLUG_OST_SUPPORT; | ||
589 | #endif | ||
590 | |||
577 | if (!ghes_disable) | 591 | if (!ghes_disable) |
578 | capbuf[OSC_SUPPORT_TYPE] |= OSC_SB_APEI_SUPPORT; | 592 | capbuf[OSC_SUPPORT_TYPE] |= OSC_SB_APEI_SUPPORT; |
579 | if (ACPI_FAILURE(acpi_get_handle(NULL, "\\_SB", &handle))) | 593 | if (ACPI_FAILURE(acpi_get_handle(NULL, "\\_SB", &handle))) |
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index d27d072472f9..314a3b84bbc7 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c | |||
@@ -76,19 +76,23 @@ MODULE_DEVICE_TABLE(acpi, button_device_ids); | |||
76 | 76 | ||
77 | static int acpi_button_add(struct acpi_device *device); | 77 | static int acpi_button_add(struct acpi_device *device); |
78 | static int acpi_button_remove(struct acpi_device *device, int type); | 78 | static int acpi_button_remove(struct acpi_device *device, int type); |
79 | static int acpi_button_resume(struct acpi_device *device); | ||
80 | static void acpi_button_notify(struct acpi_device *device, u32 event); | 79 | static void acpi_button_notify(struct acpi_device *device, u32 event); |
81 | 80 | ||
81 | #ifdef CONFIG_PM_SLEEP | ||
82 | static int acpi_button_resume(struct device *dev); | ||
83 | #endif | ||
84 | static SIMPLE_DEV_PM_OPS(acpi_button_pm, NULL, acpi_button_resume); | ||
85 | |||
82 | static struct acpi_driver acpi_button_driver = { | 86 | static struct acpi_driver acpi_button_driver = { |
83 | .name = "button", | 87 | .name = "button", |
84 | .class = ACPI_BUTTON_CLASS, | 88 | .class = ACPI_BUTTON_CLASS, |
85 | .ids = button_device_ids, | 89 | .ids = button_device_ids, |
86 | .ops = { | 90 | .ops = { |
87 | .add = acpi_button_add, | 91 | .add = acpi_button_add, |
88 | .resume = acpi_button_resume, | ||
89 | .remove = acpi_button_remove, | 92 | .remove = acpi_button_remove, |
90 | .notify = acpi_button_notify, | 93 | .notify = acpi_button_notify, |
91 | }, | 94 | }, |
95 | .drv.pm = &acpi_button_pm, | ||
92 | }; | 96 | }; |
93 | 97 | ||
94 | struct acpi_button { | 98 | struct acpi_button { |
@@ -308,14 +312,17 @@ static void acpi_button_notify(struct acpi_device *device, u32 event) | |||
308 | } | 312 | } |
309 | } | 313 | } |
310 | 314 | ||
311 | static int acpi_button_resume(struct acpi_device *device) | 315 | #ifdef CONFIG_PM_SLEEP |
316 | static int acpi_button_resume(struct device *dev) | ||
312 | { | 317 | { |
318 | struct acpi_device *device = to_acpi_device(dev); | ||
313 | struct acpi_button *button = acpi_driver_data(device); | 319 | struct acpi_button *button = acpi_driver_data(device); |
314 | 320 | ||
315 | if (button->type == ACPI_BUTTON_TYPE_LID) | 321 | if (button->type == ACPI_BUTTON_TYPE_LID) |
316 | return acpi_lid_send_state(device); | 322 | return acpi_lid_send_state(device); |
317 | return 0; | 323 | return 0; |
318 | } | 324 | } |
325 | #endif | ||
319 | 326 | ||
320 | static int acpi_button_add(struct acpi_device *device) | 327 | static int acpi_button_add(struct acpi_device *device) |
321 | { | 328 | { |
diff --git a/drivers/acpi/container.c b/drivers/acpi/container.c index 45cd03b4630e..1f9f7d7d7bc5 100644 --- a/drivers/acpi/container.c +++ b/drivers/acpi/container.c | |||
@@ -158,9 +158,7 @@ static void container_notify_cb(acpi_handle handle, u32 type, void *context) | |||
158 | int result; | 158 | int result; |
159 | int present; | 159 | int present; |
160 | acpi_status status; | 160 | acpi_status status; |
161 | 161 | u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */ | |
162 | |||
163 | present = is_device_present(handle); | ||
164 | 162 | ||
165 | switch (type) { | 163 | switch (type) { |
166 | case ACPI_NOTIFY_BUS_CHECK: | 164 | case ACPI_NOTIFY_BUS_CHECK: |
@@ -169,32 +167,47 @@ static void container_notify_cb(acpi_handle handle, u32 type, void *context) | |||
169 | printk(KERN_WARNING "Container driver received %s event\n", | 167 | printk(KERN_WARNING "Container driver received %s event\n", |
170 | (type == ACPI_NOTIFY_BUS_CHECK) ? | 168 | (type == ACPI_NOTIFY_BUS_CHECK) ? |
171 | "ACPI_NOTIFY_BUS_CHECK" : "ACPI_NOTIFY_DEVICE_CHECK"); | 169 | "ACPI_NOTIFY_BUS_CHECK" : "ACPI_NOTIFY_DEVICE_CHECK"); |
170 | |||
171 | present = is_device_present(handle); | ||
172 | status = acpi_bus_get_device(handle, &device); | 172 | status = acpi_bus_get_device(handle, &device); |
173 | if (present) { | 173 | if (!present) { |
174 | if (ACPI_FAILURE(status) || !device) { | ||
175 | result = container_device_add(&device, handle); | ||
176 | if (!result) | ||
177 | kobject_uevent(&device->dev.kobj, | ||
178 | KOBJ_ONLINE); | ||
179 | else | ||
180 | printk(KERN_WARNING | ||
181 | "Failed to add container\n"); | ||
182 | } | ||
183 | } else { | ||
184 | if (ACPI_SUCCESS(status)) { | 174 | if (ACPI_SUCCESS(status)) { |
185 | /* device exist and this is a remove request */ | 175 | /* device exist and this is a remove request */ |
176 | device->flags.eject_pending = 1; | ||
186 | kobject_uevent(&device->dev.kobj, KOBJ_OFFLINE); | 177 | kobject_uevent(&device->dev.kobj, KOBJ_OFFLINE); |
178 | return; | ||
187 | } | 179 | } |
180 | break; | ||
181 | } | ||
182 | |||
183 | if (!ACPI_FAILURE(status) || device) | ||
184 | break; | ||
185 | |||
186 | result = container_device_add(&device, handle); | ||
187 | if (result) { | ||
188 | printk(KERN_WARNING "Failed to add container\n"); | ||
189 | break; | ||
188 | } | 190 | } |
191 | |||
192 | kobject_uevent(&device->dev.kobj, KOBJ_ONLINE); | ||
193 | ost_code = ACPI_OST_SC_SUCCESS; | ||
189 | break; | 194 | break; |
195 | |||
190 | case ACPI_NOTIFY_EJECT_REQUEST: | 196 | case ACPI_NOTIFY_EJECT_REQUEST: |
191 | if (!acpi_bus_get_device(handle, &device) && device) { | 197 | if (!acpi_bus_get_device(handle, &device) && device) { |
198 | device->flags.eject_pending = 1; | ||
192 | kobject_uevent(&device->dev.kobj, KOBJ_OFFLINE); | 199 | kobject_uevent(&device->dev.kobj, KOBJ_OFFLINE); |
200 | return; | ||
193 | } | 201 | } |
194 | break; | 202 | break; |
203 | |||
195 | default: | 204 | default: |
196 | break; | 205 | /* non-hotplug event; possibly handled by other handler */ |
206 | return; | ||
197 | } | 207 | } |
208 | |||
209 | /* Inform firmware that the hotplug operation has completed */ | ||
210 | (void) acpi_evaluate_hotplug_ost(handle, type, ost_code, NULL); | ||
198 | return; | 211 | return; |
199 | } | 212 | } |
200 | 213 | ||
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c index 0f0356ca1a9e..bc36a476f1ab 100644 --- a/drivers/acpi/fan.c +++ b/drivers/acpi/fan.c | |||
@@ -46,8 +46,6 @@ MODULE_LICENSE("GPL"); | |||
46 | 46 | ||
47 | static int acpi_fan_add(struct acpi_device *device); | 47 | static int acpi_fan_add(struct acpi_device *device); |
48 | static int acpi_fan_remove(struct acpi_device *device, int type); | 48 | static int acpi_fan_remove(struct acpi_device *device, int type); |
49 | static int acpi_fan_suspend(struct acpi_device *device, pm_message_t state); | ||
50 | static int acpi_fan_resume(struct acpi_device *device); | ||
51 | 49 | ||
52 | static const struct acpi_device_id fan_device_ids[] = { | 50 | static const struct acpi_device_id fan_device_ids[] = { |
53 | {"PNP0C0B", 0}, | 51 | {"PNP0C0B", 0}, |
@@ -55,6 +53,12 @@ static const struct acpi_device_id fan_device_ids[] = { | |||
55 | }; | 53 | }; |
56 | MODULE_DEVICE_TABLE(acpi, fan_device_ids); | 54 | MODULE_DEVICE_TABLE(acpi, fan_device_ids); |
57 | 55 | ||
56 | #ifdef CONFIG_PM_SLEEP | ||
57 | static int acpi_fan_suspend(struct device *dev); | ||
58 | static int acpi_fan_resume(struct device *dev); | ||
59 | #endif | ||
60 | static SIMPLE_DEV_PM_OPS(acpi_fan_pm, acpi_fan_suspend, acpi_fan_resume); | ||
61 | |||
58 | static struct acpi_driver acpi_fan_driver = { | 62 | static struct acpi_driver acpi_fan_driver = { |
59 | .name = "fan", | 63 | .name = "fan", |
60 | .class = ACPI_FAN_CLASS, | 64 | .class = ACPI_FAN_CLASS, |
@@ -62,9 +66,8 @@ static struct acpi_driver acpi_fan_driver = { | |||
62 | .ops = { | 66 | .ops = { |
63 | .add = acpi_fan_add, | 67 | .add = acpi_fan_add, |
64 | .remove = acpi_fan_remove, | 68 | .remove = acpi_fan_remove, |
65 | .suspend = acpi_fan_suspend, | ||
66 | .resume = acpi_fan_resume, | ||
67 | }, | 69 | }, |
70 | .drv.pm = &acpi_fan_pm, | ||
68 | }; | 71 | }; |
69 | 72 | ||
70 | /* thermal cooling device callbacks */ | 73 | /* thermal cooling device callbacks */ |
@@ -183,29 +186,31 @@ static int acpi_fan_remove(struct acpi_device *device, int type) | |||
183 | return 0; | 186 | return 0; |
184 | } | 187 | } |
185 | 188 | ||
186 | static int acpi_fan_suspend(struct acpi_device *device, pm_message_t state) | 189 | #ifdef CONFIG_PM_SLEEP |
190 | static int acpi_fan_suspend(struct device *dev) | ||
187 | { | 191 | { |
188 | if (!device) | 192 | if (!dev) |
189 | return -EINVAL; | 193 | return -EINVAL; |
190 | 194 | ||
191 | acpi_bus_set_power(device->handle, ACPI_STATE_D0); | 195 | acpi_bus_set_power(to_acpi_device(dev)->handle, ACPI_STATE_D0); |
192 | 196 | ||
193 | return AE_OK; | 197 | return AE_OK; |
194 | } | 198 | } |
195 | 199 | ||
196 | static int acpi_fan_resume(struct acpi_device *device) | 200 | static int acpi_fan_resume(struct device *dev) |
197 | { | 201 | { |
198 | int result; | 202 | int result; |
199 | 203 | ||
200 | if (!device) | 204 | if (!dev) |
201 | return -EINVAL; | 205 | return -EINVAL; |
202 | 206 | ||
203 | result = acpi_bus_update_power(device->handle, NULL); | 207 | result = acpi_bus_update_power(to_acpi_device(dev)->handle, NULL); |
204 | if (result) | 208 | if (result) |
205 | printk(KERN_ERR PREFIX "Error updating fan power state\n"); | 209 | printk(KERN_ERR PREFIX "Error updating fan power state\n"); |
206 | 210 | ||
207 | return result; | 211 | return result; |
208 | } | 212 | } |
213 | #endif | ||
209 | 214 | ||
210 | static int __init acpi_fan_init(void) | 215 | static int __init acpi_fan_init(void) |
211 | { | 216 | { |
diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c index 1564e0927c21..243ee85e4d2e 100644 --- a/drivers/acpi/glue.c +++ b/drivers/acpi/glue.c | |||
@@ -39,6 +39,7 @@ int register_acpi_bus_type(struct acpi_bus_type *type) | |||
39 | } | 39 | } |
40 | return -ENODEV; | 40 | return -ENODEV; |
41 | } | 41 | } |
42 | EXPORT_SYMBOL_GPL(register_acpi_bus_type); | ||
42 | 43 | ||
43 | int unregister_acpi_bus_type(struct acpi_bus_type *type) | 44 | int unregister_acpi_bus_type(struct acpi_bus_type *type) |
44 | { | 45 | { |
@@ -54,6 +55,7 @@ int unregister_acpi_bus_type(struct acpi_bus_type *type) | |||
54 | } | 55 | } |
55 | return -ENODEV; | 56 | return -ENODEV; |
56 | } | 57 | } |
58 | EXPORT_SYMBOL_GPL(unregister_acpi_bus_type); | ||
57 | 59 | ||
58 | static struct acpi_bus_type *acpi_get_bus_type(struct bus_type *type) | 60 | static struct acpi_bus_type *acpi_get_bus_type(struct bus_type *type) |
59 | { | 61 | { |
@@ -69,7 +71,6 @@ static struct acpi_bus_type *acpi_get_bus_type(struct bus_type *type) | |||
69 | up_read(&bus_type_sem); | 71 | up_read(&bus_type_sem); |
70 | return ret; | 72 | return ret; |
71 | } | 73 | } |
72 | EXPORT_SYMBOL_GPL(register_acpi_bus_type); | ||
73 | 74 | ||
74 | static int acpi_find_bridge_device(struct device *dev, acpi_handle * handle) | 75 | static int acpi_find_bridge_device(struct device *dev, acpi_handle * handle) |
75 | { | 76 | { |
@@ -86,7 +87,6 @@ static int acpi_find_bridge_device(struct device *dev, acpi_handle * handle) | |||
86 | up_read(&bus_type_sem); | 87 | up_read(&bus_type_sem); |
87 | return ret; | 88 | return ret; |
88 | } | 89 | } |
89 | EXPORT_SYMBOL_GPL(unregister_acpi_bus_type); | ||
90 | 90 | ||
91 | /* Get device's handler per its address under its parent */ | 91 | /* Get device's handler per its address under its parent */ |
92 | struct acpi_find_child { | 92 | struct acpi_find_child { |
diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c index e56f3be7b07d..cb31298ca684 100644 --- a/drivers/acpi/numa.c +++ b/drivers/acpi/numa.c | |||
@@ -237,6 +237,8 @@ acpi_parse_processor_affinity(struct acpi_subtable_header *header, | |||
237 | return 0; | 237 | return 0; |
238 | } | 238 | } |
239 | 239 | ||
240 | static int __initdata parsed_numa_memblks; | ||
241 | |||
240 | static int __init | 242 | static int __init |
241 | acpi_parse_memory_affinity(struct acpi_subtable_header * header, | 243 | acpi_parse_memory_affinity(struct acpi_subtable_header * header, |
242 | const unsigned long end) | 244 | const unsigned long end) |
@@ -250,8 +252,8 @@ acpi_parse_memory_affinity(struct acpi_subtable_header * header, | |||
250 | acpi_table_print_srat_entry(header); | 252 | acpi_table_print_srat_entry(header); |
251 | 253 | ||
252 | /* let architecture-dependent part to do it */ | 254 | /* let architecture-dependent part to do it */ |
253 | acpi_numa_memory_affinity_init(memory_affinity); | 255 | if (!acpi_numa_memory_affinity_init(memory_affinity)) |
254 | 256 | parsed_numa_memblks++; | |
255 | return 0; | 257 | return 0; |
256 | } | 258 | } |
257 | 259 | ||
@@ -304,8 +306,10 @@ int __init acpi_numa_init(void) | |||
304 | 306 | ||
305 | acpi_numa_arch_fixup(); | 307 | acpi_numa_arch_fixup(); |
306 | 308 | ||
307 | if (cnt <= 0) | 309 | if (cnt < 0) |
308 | return cnt ?: -ENOENT; | 310 | return cnt; |
311 | else if (!parsed_numa_memblks) | ||
312 | return -ENOENT; | ||
309 | return 0; | 313 | return 0; |
310 | } | 314 | } |
311 | 315 | ||
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index c3881b2eb8b2..9eaf708f5885 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c | |||
@@ -891,7 +891,7 @@ static void acpi_os_execute_deferred(struct work_struct *work) | |||
891 | struct acpi_os_dpc *dpc = container_of(work, struct acpi_os_dpc, work); | 891 | struct acpi_os_dpc *dpc = container_of(work, struct acpi_os_dpc, work); |
892 | 892 | ||
893 | if (dpc->wait) | 893 | if (dpc->wait) |
894 | acpi_os_wait_events_complete(NULL); | 894 | acpi_os_wait_events_complete(); |
895 | 895 | ||
896 | dpc->function(dpc->context); | 896 | dpc->function(dpc->context); |
897 | kfree(dpc); | 897 | kfree(dpc); |
@@ -987,7 +987,7 @@ acpi_status acpi_os_hotplug_execute(acpi_osd_exec_callback function, | |||
987 | return __acpi_os_execute(0, function, context, 1); | 987 | return __acpi_os_execute(0, function, context, 1); |
988 | } | 988 | } |
989 | 989 | ||
990 | void acpi_os_wait_events_complete(void *context) | 990 | void acpi_os_wait_events_complete(void) |
991 | { | 991 | { |
992 | flush_workqueue(kacpid_wq); | 992 | flush_workqueue(kacpid_wq); |
993 | flush_workqueue(kacpi_notify_wq); | 993 | flush_workqueue(kacpi_notify_wq); |
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 7aff6312ce7c..72a2c98bc429 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c | |||
@@ -505,6 +505,8 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device) | |||
505 | strcpy(acpi_device_class(device), ACPI_PCI_ROOT_CLASS); | 505 | strcpy(acpi_device_class(device), ACPI_PCI_ROOT_CLASS); |
506 | device->driver_data = root; | 506 | device->driver_data = root; |
507 | 507 | ||
508 | root->mcfg_addr = acpi_pci_root_get_mcfg_addr(device->handle); | ||
509 | |||
508 | /* | 510 | /* |
509 | * All supported architectures that use ACPI have support for | 511 | * All supported architectures that use ACPI have support for |
510 | * PCI domains, so we indicate this in _OSC support capabilities. | 512 | * PCI domains, so we indicate this in _OSC support capabilities. |
@@ -571,8 +573,15 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device) | |||
571 | OSC_CLOCK_PWR_CAPABILITY_SUPPORT; | 573 | OSC_CLOCK_PWR_CAPABILITY_SUPPORT; |
572 | if (pci_msi_enabled()) | 574 | if (pci_msi_enabled()) |
573 | flags |= OSC_MSI_SUPPORT; | 575 | flags |= OSC_MSI_SUPPORT; |
574 | if (flags != base_flags) | 576 | if (flags != base_flags) { |
575 | acpi_pci_osc_support(root, flags); | 577 | status = acpi_pci_osc_support(root, flags); |
578 | if (ACPI_FAILURE(status)) { | ||
579 | dev_info(root->bus->bridge, "ACPI _OSC support " | ||
580 | "notification failed, disabling PCIe ASPM\n"); | ||
581 | pcie_no_aspm(); | ||
582 | flags = base_flags; | ||
583 | } | ||
584 | } | ||
576 | 585 | ||
577 | if (!pcie_ports_disabled | 586 | if (!pcie_ports_disabled |
578 | && (flags & ACPI_PCIE_REQ_SUPPORT) == ACPI_PCIE_REQ_SUPPORT) { | 587 | && (flags & ACPI_PCIE_REQ_SUPPORT) == ACPI_PCIE_REQ_SUPPORT) { |
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c index dd6d6a3c6780..40e38a06ba85 100644 --- a/drivers/acpi/power.c +++ b/drivers/acpi/power.c | |||
@@ -60,7 +60,6 @@ ACPI_MODULE_NAME("power"); | |||
60 | 60 | ||
61 | static int acpi_power_add(struct acpi_device *device); | 61 | static int acpi_power_add(struct acpi_device *device); |
62 | static int acpi_power_remove(struct acpi_device *device, int type); | 62 | static int acpi_power_remove(struct acpi_device *device, int type); |
63 | static int acpi_power_resume(struct acpi_device *device); | ||
64 | 63 | ||
65 | static const struct acpi_device_id power_device_ids[] = { | 64 | static const struct acpi_device_id power_device_ids[] = { |
66 | {ACPI_POWER_HID, 0}, | 65 | {ACPI_POWER_HID, 0}, |
@@ -68,6 +67,11 @@ static const struct acpi_device_id power_device_ids[] = { | |||
68 | }; | 67 | }; |
69 | MODULE_DEVICE_TABLE(acpi, power_device_ids); | 68 | MODULE_DEVICE_TABLE(acpi, power_device_ids); |
70 | 69 | ||
70 | #ifdef CONFIG_PM_SLEEP | ||
71 | static int acpi_power_resume(struct device *dev); | ||
72 | #endif | ||
73 | static SIMPLE_DEV_PM_OPS(acpi_power_pm, NULL, acpi_power_resume); | ||
74 | |||
71 | static struct acpi_driver acpi_power_driver = { | 75 | static struct acpi_driver acpi_power_driver = { |
72 | .name = "power", | 76 | .name = "power", |
73 | .class = ACPI_POWER_CLASS, | 77 | .class = ACPI_POWER_CLASS, |
@@ -75,8 +79,8 @@ static struct acpi_driver acpi_power_driver = { | |||
75 | .ops = { | 79 | .ops = { |
76 | .add = acpi_power_add, | 80 | .add = acpi_power_add, |
77 | .remove = acpi_power_remove, | 81 | .remove = acpi_power_remove, |
78 | .resume = acpi_power_resume, | ||
79 | }, | 82 | }, |
83 | .drv.pm = &acpi_power_pm, | ||
80 | }; | 84 | }; |
81 | 85 | ||
82 | /* | 86 | /* |
@@ -103,6 +107,7 @@ struct acpi_power_resource { | |||
103 | 107 | ||
104 | /* List of devices relying on this power resource */ | 108 | /* List of devices relying on this power resource */ |
105 | struct acpi_power_resource_device *devices; | 109 | struct acpi_power_resource_device *devices; |
110 | struct mutex devices_lock; | ||
106 | }; | 111 | }; |
107 | 112 | ||
108 | static struct list_head acpi_power_resource_list; | 113 | static struct list_head acpi_power_resource_list; |
@@ -221,7 +226,6 @@ static void acpi_power_on_device(struct acpi_power_managed_device *device) | |||
221 | 226 | ||
222 | static int __acpi_power_on(struct acpi_power_resource *resource) | 227 | static int __acpi_power_on(struct acpi_power_resource *resource) |
223 | { | 228 | { |
224 | struct acpi_power_resource_device *device_list = resource->devices; | ||
225 | acpi_status status = AE_OK; | 229 | acpi_status status = AE_OK; |
226 | 230 | ||
227 | status = acpi_evaluate_object(resource->device->handle, "_ON", NULL, NULL); | 231 | status = acpi_evaluate_object(resource->device->handle, "_ON", NULL, NULL); |
@@ -234,19 +238,15 @@ static int __acpi_power_on(struct acpi_power_resource *resource) | |||
234 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Power resource [%s] turned on\n", | 238 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Power resource [%s] turned on\n", |
235 | resource->name)); | 239 | resource->name)); |
236 | 240 | ||
237 | while (device_list) { | ||
238 | acpi_power_on_device(device_list->device); | ||
239 | |||
240 | device_list = device_list->next; | ||
241 | } | ||
242 | |||
243 | return 0; | 241 | return 0; |
244 | } | 242 | } |
245 | 243 | ||
246 | static int acpi_power_on(acpi_handle handle) | 244 | static int acpi_power_on(acpi_handle handle) |
247 | { | 245 | { |
248 | int result = 0; | 246 | int result = 0; |
247 | bool resume_device = false; | ||
249 | struct acpi_power_resource *resource = NULL; | 248 | struct acpi_power_resource *resource = NULL; |
249 | struct acpi_power_resource_device *device_list; | ||
250 | 250 | ||
251 | result = acpi_power_get_context(handle, &resource); | 251 | result = acpi_power_get_context(handle, &resource); |
252 | if (result) | 252 | if (result) |
@@ -262,10 +262,25 @@ static int acpi_power_on(acpi_handle handle) | |||
262 | result = __acpi_power_on(resource); | 262 | result = __acpi_power_on(resource); |
263 | if (result) | 263 | if (result) |
264 | resource->ref_count--; | 264 | resource->ref_count--; |
265 | else | ||
266 | resume_device = true; | ||
265 | } | 267 | } |
266 | 268 | ||
267 | mutex_unlock(&resource->resource_lock); | 269 | mutex_unlock(&resource->resource_lock); |
268 | 270 | ||
271 | if (!resume_device) | ||
272 | return result; | ||
273 | |||
274 | mutex_lock(&resource->devices_lock); | ||
275 | |||
276 | device_list = resource->devices; | ||
277 | while (device_list) { | ||
278 | acpi_power_on_device(device_list->device); | ||
279 | device_list = device_list->next; | ||
280 | } | ||
281 | |||
282 | mutex_unlock(&resource->devices_lock); | ||
283 | |||
269 | return result; | 284 | return result; |
270 | } | 285 | } |
271 | 286 | ||
@@ -351,7 +366,7 @@ static void __acpi_power_resource_unregister_device(struct device *dev, | |||
351 | if (acpi_power_get_context(res_handle, &resource)) | 366 | if (acpi_power_get_context(res_handle, &resource)) |
352 | return; | 367 | return; |
353 | 368 | ||
354 | mutex_lock(&resource->resource_lock); | 369 | mutex_lock(&resource->devices_lock); |
355 | prev = NULL; | 370 | prev = NULL; |
356 | curr = resource->devices; | 371 | curr = resource->devices; |
357 | while (curr) { | 372 | while (curr) { |
@@ -368,7 +383,7 @@ static void __acpi_power_resource_unregister_device(struct device *dev, | |||
368 | prev = curr; | 383 | prev = curr; |
369 | curr = curr->next; | 384 | curr = curr->next; |
370 | } | 385 | } |
371 | mutex_unlock(&resource->resource_lock); | 386 | mutex_unlock(&resource->devices_lock); |
372 | } | 387 | } |
373 | 388 | ||
374 | /* Unlink dev from all power resources in _PR0 */ | 389 | /* Unlink dev from all power resources in _PR0 */ |
@@ -390,6 +405,7 @@ void acpi_power_resource_unregister_device(struct device *dev, acpi_handle handl | |||
390 | __acpi_power_resource_unregister_device(dev, | 405 | __acpi_power_resource_unregister_device(dev, |
391 | list->handles[i]); | 406 | list->handles[i]); |
392 | } | 407 | } |
408 | EXPORT_SYMBOL_GPL(acpi_power_resource_unregister_device); | ||
393 | 409 | ||
394 | static int __acpi_power_resource_register_device( | 410 | static int __acpi_power_resource_register_device( |
395 | struct acpi_power_managed_device *powered_device, acpi_handle handle) | 411 | struct acpi_power_managed_device *powered_device, acpi_handle handle) |
@@ -409,10 +425,10 @@ static int __acpi_power_resource_register_device( | |||
409 | 425 | ||
410 | power_resource_device->device = powered_device; | 426 | power_resource_device->device = powered_device; |
411 | 427 | ||
412 | mutex_lock(&resource->resource_lock); | 428 | mutex_lock(&resource->devices_lock); |
413 | power_resource_device->next = resource->devices; | 429 | power_resource_device->next = resource->devices; |
414 | resource->devices = power_resource_device; | 430 | resource->devices = power_resource_device; |
415 | mutex_unlock(&resource->resource_lock); | 431 | mutex_unlock(&resource->devices_lock); |
416 | 432 | ||
417 | return 0; | 433 | return 0; |
418 | } | 434 | } |
@@ -457,9 +473,10 @@ int acpi_power_resource_register_device(struct device *dev, acpi_handle handle) | |||
457 | return ret; | 473 | return ret; |
458 | 474 | ||
459 | no_power_resource: | 475 | no_power_resource: |
460 | printk(KERN_WARNING PREFIX "Invalid Power Resource to register!"); | 476 | printk(KERN_DEBUG PREFIX "Invalid Power Resource to register!"); |
461 | return -ENODEV; | 477 | return -ENODEV; |
462 | } | 478 | } |
479 | EXPORT_SYMBOL_GPL(acpi_power_resource_register_device); | ||
463 | 480 | ||
464 | /** | 481 | /** |
465 | * acpi_device_sleep_wake - execute _DSW (Device Sleep Wake) or (deprecated in | 482 | * acpi_device_sleep_wake - execute _DSW (Device Sleep Wake) or (deprecated in |
@@ -715,6 +732,7 @@ static int acpi_power_add(struct acpi_device *device) | |||
715 | 732 | ||
716 | resource->device = device; | 733 | resource->device = device; |
717 | mutex_init(&resource->resource_lock); | 734 | mutex_init(&resource->resource_lock); |
735 | mutex_init(&resource->devices_lock); | ||
718 | strcpy(resource->name, device->pnp.bus_id); | 736 | strcpy(resource->name, device->pnp.bus_id); |
719 | strcpy(acpi_device_name(device), ACPI_POWER_DEVICE_NAME); | 737 | strcpy(acpi_device_name(device), ACPI_POWER_DEVICE_NAME); |
720 | strcpy(acpi_device_class(device), ACPI_POWER_CLASS); | 738 | strcpy(acpi_device_class(device), ACPI_POWER_CLASS); |
@@ -771,14 +789,17 @@ static int acpi_power_remove(struct acpi_device *device, int type) | |||
771 | return 0; | 789 | return 0; |
772 | } | 790 | } |
773 | 791 | ||
774 | static int acpi_power_resume(struct acpi_device *device) | 792 | #ifdef CONFIG_PM_SLEEP |
793 | static int acpi_power_resume(struct device *dev) | ||
775 | { | 794 | { |
776 | int result = 0, state; | 795 | int result = 0, state; |
796 | struct acpi_device *device; | ||
777 | struct acpi_power_resource *resource; | 797 | struct acpi_power_resource *resource; |
778 | 798 | ||
779 | if (!device) | 799 | if (!dev) |
780 | return -EINVAL; | 800 | return -EINVAL; |
781 | 801 | ||
802 | device = to_acpi_device(dev); | ||
782 | resource = acpi_driver_data(device); | 803 | resource = acpi_driver_data(device); |
783 | if (!resource) | 804 | if (!resource) |
784 | return -EINVAL; | 805 | return -EINVAL; |
@@ -797,6 +818,7 @@ static int acpi_power_resume(struct acpi_device *device) | |||
797 | 818 | ||
798 | return result; | 819 | return result; |
799 | } | 820 | } |
821 | #endif | ||
800 | 822 | ||
801 | int __init acpi_power_init(void) | 823 | int __init acpi_power_init(void) |
802 | { | 824 | { |
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c index 0734086537b8..bfc31cb0dd3e 100644 --- a/drivers/acpi/processor_driver.c +++ b/drivers/acpi/processor_driver.c | |||
@@ -93,6 +93,9 @@ static const struct acpi_device_id processor_device_ids[] = { | |||
93 | }; | 93 | }; |
94 | MODULE_DEVICE_TABLE(acpi, processor_device_ids); | 94 | MODULE_DEVICE_TABLE(acpi, processor_device_ids); |
95 | 95 | ||
96 | static SIMPLE_DEV_PM_OPS(acpi_processor_pm, | ||
97 | acpi_processor_suspend, acpi_processor_resume); | ||
98 | |||
96 | static struct acpi_driver acpi_processor_driver = { | 99 | static struct acpi_driver acpi_processor_driver = { |
97 | .name = "processor", | 100 | .name = "processor", |
98 | .class = ACPI_PROCESSOR_CLASS, | 101 | .class = ACPI_PROCESSOR_CLASS, |
@@ -100,10 +103,9 @@ static struct acpi_driver acpi_processor_driver = { | |||
100 | .ops = { | 103 | .ops = { |
101 | .add = acpi_processor_add, | 104 | .add = acpi_processor_add, |
102 | .remove = acpi_processor_remove, | 105 | .remove = acpi_processor_remove, |
103 | .suspend = acpi_processor_suspend, | ||
104 | .resume = acpi_processor_resume, | ||
105 | .notify = acpi_processor_notify, | 106 | .notify = acpi_processor_notify, |
106 | }, | 107 | }, |
108 | .drv.pm = &acpi_processor_pm, | ||
107 | }; | 109 | }; |
108 | 110 | ||
109 | #define INSTALL_NOTIFY_HANDLER 1 | 111 | #define INSTALL_NOTIFY_HANDLER 1 |
@@ -427,22 +429,15 @@ static int acpi_cpu_soft_notify(struct notifier_block *nfb, | |||
427 | * Initialize missing things | 429 | * Initialize missing things |
428 | */ | 430 | */ |
429 | if (pr->flags.need_hotplug_init) { | 431 | if (pr->flags.need_hotplug_init) { |
430 | struct cpuidle_driver *idle_driver = | ||
431 | cpuidle_get_driver(); | ||
432 | |||
433 | printk(KERN_INFO "Will online and init hotplugged " | 432 | printk(KERN_INFO "Will online and init hotplugged " |
434 | "CPU: %d\n", pr->id); | 433 | "CPU: %d\n", pr->id); |
435 | WARN(acpi_processor_start(pr), "Failed to start CPU:" | 434 | WARN(acpi_processor_start(pr), "Failed to start CPU:" |
436 | " %d\n", pr->id); | 435 | " %d\n", pr->id); |
437 | pr->flags.need_hotplug_init = 0; | 436 | pr->flags.need_hotplug_init = 0; |
438 | if (idle_driver && !strcmp(idle_driver->name, | ||
439 | "intel_idle")) { | ||
440 | intel_idle_cpu_init(pr->id); | ||
441 | } | ||
442 | /* Normal CPU soft online event */ | 437 | /* Normal CPU soft online event */ |
443 | } else { | 438 | } else { |
444 | acpi_processor_ppc_has_changed(pr, 0); | 439 | acpi_processor_ppc_has_changed(pr, 0); |
445 | acpi_processor_cst_has_changed(pr); | 440 | acpi_processor_hotplug(pr); |
446 | acpi_processor_reevaluate_tstate(pr, action); | 441 | acpi_processor_reevaluate_tstate(pr, action); |
447 | acpi_processor_tstate_has_changed(pr); | 442 | acpi_processor_tstate_has_changed(pr); |
448 | } | 443 | } |
@@ -701,9 +696,9 @@ static void acpi_processor_hotplug_notify(acpi_handle handle, | |||
701 | { | 696 | { |
702 | struct acpi_processor *pr; | 697 | struct acpi_processor *pr; |
703 | struct acpi_device *device = NULL; | 698 | struct acpi_device *device = NULL; |
699 | u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */ | ||
704 | int result; | 700 | int result; |
705 | 701 | ||
706 | |||
707 | switch (event) { | 702 | switch (event) { |
708 | case ACPI_NOTIFY_BUS_CHECK: | 703 | case ACPI_NOTIFY_BUS_CHECK: |
709 | case ACPI_NOTIFY_DEVICE_CHECK: | 704 | case ACPI_NOTIFY_DEVICE_CHECK: |
@@ -715,14 +710,18 @@ static void acpi_processor_hotplug_notify(acpi_handle handle, | |||
715 | if (!is_processor_present(handle)) | 710 | if (!is_processor_present(handle)) |
716 | break; | 711 | break; |
717 | 712 | ||
718 | if (acpi_bus_get_device(handle, &device)) { | 713 | if (!acpi_bus_get_device(handle, &device)) |
719 | result = acpi_processor_device_add(handle, &device); | 714 | break; |
720 | if (result) | 715 | |
721 | printk(KERN_ERR PREFIX | 716 | result = acpi_processor_device_add(handle, &device); |
722 | "Unable to add the device\n"); | 717 | if (result) { |
718 | printk(KERN_ERR PREFIX "Unable to add the device\n"); | ||
723 | break; | 719 | break; |
724 | } | 720 | } |
721 | |||
722 | ost_code = ACPI_OST_SC_SUCCESS; | ||
725 | break; | 723 | break; |
724 | |||
726 | case ACPI_NOTIFY_EJECT_REQUEST: | 725 | case ACPI_NOTIFY_EJECT_REQUEST: |
727 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 726 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
728 | "received ACPI_NOTIFY_EJECT_REQUEST\n")); | 727 | "received ACPI_NOTIFY_EJECT_REQUEST\n")); |
@@ -736,15 +735,23 @@ static void acpi_processor_hotplug_notify(acpi_handle handle, | |||
736 | if (!pr) { | 735 | if (!pr) { |
737 | printk(KERN_ERR PREFIX | 736 | printk(KERN_ERR PREFIX |
738 | "Driver data is NULL, dropping EJECT\n"); | 737 | "Driver data is NULL, dropping EJECT\n"); |
739 | return; | 738 | break; |
740 | } | 739 | } |
740 | |||
741 | /* REVISIT: update when eject is supported */ | ||
742 | ost_code = ACPI_OST_SC_EJECT_NOT_SUPPORTED; | ||
741 | break; | 743 | break; |
744 | |||
742 | default: | 745 | default: |
743 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 746 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
744 | "Unsupported event [0x%x]\n", event)); | 747 | "Unsupported event [0x%x]\n", event)); |
745 | break; | 748 | |
749 | /* non-hotplug event; possibly handled by other handler */ | ||
750 | return; | ||
746 | } | 751 | } |
747 | 752 | ||
753 | /* Inform firmware that the hotplug operation has completed */ | ||
754 | (void) acpi_evaluate_hotplug_ost(handle, event, ost_code, NULL); | ||
748 | return; | 755 | return; |
749 | } | 756 | } |
750 | 757 | ||
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 47a8caa89dbe..ad3730b4038b 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -221,10 +221,6 @@ static void lapic_timer_state_broadcast(struct acpi_processor *pr, | |||
221 | 221 | ||
222 | #endif | 222 | #endif |
223 | 223 | ||
224 | /* | ||
225 | * Suspend / resume control | ||
226 | */ | ||
227 | static int acpi_idle_suspend; | ||
228 | static u32 saved_bm_rld; | 224 | static u32 saved_bm_rld; |
229 | 225 | ||
230 | static void acpi_idle_bm_rld_save(void) | 226 | static void acpi_idle_bm_rld_save(void) |
@@ -241,23 +237,15 @@ static void acpi_idle_bm_rld_restore(void) | |||
241 | acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_RLD, saved_bm_rld); | 237 | acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_RLD, saved_bm_rld); |
242 | } | 238 | } |
243 | 239 | ||
244 | int acpi_processor_suspend(struct acpi_device * device, pm_message_t state) | 240 | int acpi_processor_suspend(struct device *dev) |
245 | { | 241 | { |
246 | if (acpi_idle_suspend == 1) | ||
247 | return 0; | ||
248 | |||
249 | acpi_idle_bm_rld_save(); | 242 | acpi_idle_bm_rld_save(); |
250 | acpi_idle_suspend = 1; | ||
251 | return 0; | 243 | return 0; |
252 | } | 244 | } |
253 | 245 | ||
254 | int acpi_processor_resume(struct acpi_device * device) | 246 | int acpi_processor_resume(struct device *dev) |
255 | { | 247 | { |
256 | if (acpi_idle_suspend == 0) | ||
257 | return 0; | ||
258 | |||
259 | acpi_idle_bm_rld_restore(); | 248 | acpi_idle_bm_rld_restore(); |
260 | acpi_idle_suspend = 0; | ||
261 | return 0; | 249 | return 0; |
262 | } | 250 | } |
263 | 251 | ||
@@ -313,16 +301,16 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) | |||
313 | pr->power.states[ACPI_STATE_C3].address = pr->pblk + 5; | 301 | pr->power.states[ACPI_STATE_C3].address = pr->pblk + 5; |
314 | 302 | ||
315 | /* determine latencies from FADT */ | 303 | /* determine latencies from FADT */ |
316 | pr->power.states[ACPI_STATE_C2].latency = acpi_gbl_FADT.C2latency; | 304 | pr->power.states[ACPI_STATE_C2].latency = acpi_gbl_FADT.c2_latency; |
317 | pr->power.states[ACPI_STATE_C3].latency = acpi_gbl_FADT.C3latency; | 305 | pr->power.states[ACPI_STATE_C3].latency = acpi_gbl_FADT.c3_latency; |
318 | 306 | ||
319 | /* | 307 | /* |
320 | * FADT specified C2 latency must be less than or equal to | 308 | * FADT specified C2 latency must be less than or equal to |
321 | * 100 microseconds. | 309 | * 100 microseconds. |
322 | */ | 310 | */ |
323 | if (acpi_gbl_FADT.C2latency > ACPI_PROCESSOR_MAX_C2_LATENCY) { | 311 | if (acpi_gbl_FADT.c2_latency > ACPI_PROCESSOR_MAX_C2_LATENCY) { |
324 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 312 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
325 | "C2 latency too large [%d]\n", acpi_gbl_FADT.C2latency)); | 313 | "C2 latency too large [%d]\n", acpi_gbl_FADT.c2_latency)); |
326 | /* invalidate C2 */ | 314 | /* invalidate C2 */ |
327 | pr->power.states[ACPI_STATE_C2].address = 0; | 315 | pr->power.states[ACPI_STATE_C2].address = 0; |
328 | } | 316 | } |
@@ -331,9 +319,9 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) | |||
331 | * FADT supplied C3 latency must be less than or equal to | 319 | * FADT supplied C3 latency must be less than or equal to |
332 | * 1000 microseconds. | 320 | * 1000 microseconds. |
333 | */ | 321 | */ |
334 | if (acpi_gbl_FADT.C3latency > ACPI_PROCESSOR_MAX_C3_LATENCY) { | 322 | if (acpi_gbl_FADT.c3_latency > ACPI_PROCESSOR_MAX_C3_LATENCY) { |
335 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 323 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
336 | "C3 latency too large [%d]\n", acpi_gbl_FADT.C3latency)); | 324 | "C3 latency too large [%d]\n", acpi_gbl_FADT.c3_latency)); |
337 | /* invalidate C3 */ | 325 | /* invalidate C3 */ |
338 | pr->power.states[ACPI_STATE_C3].address = 0; | 326 | pr->power.states[ACPI_STATE_C3].address = 0; |
339 | } | 327 | } |
@@ -595,7 +583,6 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr, | |||
595 | */ | 583 | */ |
596 | cx->valid = 1; | 584 | cx->valid = 1; |
597 | 585 | ||
598 | cx->latency_ticks = cx->latency; | ||
599 | /* | 586 | /* |
600 | * On older chipsets, BM_RLD needs to be set | 587 | * On older chipsets, BM_RLD needs to be set |
601 | * in order for Bus Master activity to wake the | 588 | * in order for Bus Master activity to wake the |
@@ -628,7 +615,6 @@ static int acpi_processor_power_verify(struct acpi_processor *pr) | |||
628 | if (!cx->address) | 615 | if (!cx->address) |
629 | break; | 616 | break; |
630 | cx->valid = 1; | 617 | cx->valid = 1; |
631 | cx->latency_ticks = cx->latency; /* Normalize latency */ | ||
632 | break; | 618 | break; |
633 | 619 | ||
634 | case ACPI_STATE_C3: | 620 | case ACPI_STATE_C3: |
@@ -763,11 +749,6 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev, | |||
763 | 749 | ||
764 | local_irq_disable(); | 750 | local_irq_disable(); |
765 | 751 | ||
766 | if (acpi_idle_suspend) { | ||
767 | local_irq_enable(); | ||
768 | cpu_relax(); | ||
769 | return -EBUSY; | ||
770 | } | ||
771 | 752 | ||
772 | lapic_timer_state_broadcast(pr, cx, 1); | 753 | lapic_timer_state_broadcast(pr, cx, 1); |
773 | kt1 = ktime_get_real(); | 754 | kt1 = ktime_get_real(); |
@@ -779,7 +760,6 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev, | |||
779 | dev->last_residency = (int)idle_time; | 760 | dev->last_residency = (int)idle_time; |
780 | 761 | ||
781 | local_irq_enable(); | 762 | local_irq_enable(); |
782 | cx->usage++; | ||
783 | lapic_timer_state_broadcast(pr, cx, 0); | 763 | lapic_timer_state_broadcast(pr, cx, 0); |
784 | 764 | ||
785 | return index; | 765 | return index; |
@@ -838,11 +818,6 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev, | |||
838 | 818 | ||
839 | local_irq_disable(); | 819 | local_irq_disable(); |
840 | 820 | ||
841 | if (acpi_idle_suspend) { | ||
842 | local_irq_enable(); | ||
843 | cpu_relax(); | ||
844 | return -EBUSY; | ||
845 | } | ||
846 | 821 | ||
847 | if (cx->entry_method != ACPI_CSTATE_FFH) { | 822 | if (cx->entry_method != ACPI_CSTATE_FFH) { |
848 | current_thread_info()->status &= ~TS_POLLING; | 823 | current_thread_info()->status &= ~TS_POLLING; |
@@ -887,10 +862,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev, | |||
887 | if (cx->entry_method != ACPI_CSTATE_FFH) | 862 | if (cx->entry_method != ACPI_CSTATE_FFH) |
888 | current_thread_info()->status |= TS_POLLING; | 863 | current_thread_info()->status |= TS_POLLING; |
889 | 864 | ||
890 | cx->usage++; | ||
891 | |||
892 | lapic_timer_state_broadcast(pr, cx, 0); | 865 | lapic_timer_state_broadcast(pr, cx, 0); |
893 | cx->time += idle_time; | ||
894 | return index; | 866 | return index; |
895 | } | 867 | } |
896 | 868 | ||
@@ -928,8 +900,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, | |||
928 | drv, drv->safe_state_index); | 900 | drv, drv->safe_state_index); |
929 | } else { | 901 | } else { |
930 | local_irq_disable(); | 902 | local_irq_disable(); |
931 | if (!acpi_idle_suspend) | 903 | acpi_safe_halt(); |
932 | acpi_safe_halt(); | ||
933 | local_irq_enable(); | 904 | local_irq_enable(); |
934 | return -EBUSY; | 905 | return -EBUSY; |
935 | } | 906 | } |
@@ -937,11 +908,6 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, | |||
937 | 908 | ||
938 | local_irq_disable(); | 909 | local_irq_disable(); |
939 | 910 | ||
940 | if (acpi_idle_suspend) { | ||
941 | local_irq_enable(); | ||
942 | cpu_relax(); | ||
943 | return -EBUSY; | ||
944 | } | ||
945 | 911 | ||
946 | if (cx->entry_method != ACPI_CSTATE_FFH) { | 912 | if (cx->entry_method != ACPI_CSTATE_FFH) { |
947 | current_thread_info()->status &= ~TS_POLLING; | 913 | current_thread_info()->status &= ~TS_POLLING; |
@@ -1014,10 +980,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, | |||
1014 | if (cx->entry_method != ACPI_CSTATE_FFH) | 980 | if (cx->entry_method != ACPI_CSTATE_FFH) |
1015 | current_thread_info()->status |= TS_POLLING; | 981 | current_thread_info()->status |= TS_POLLING; |
1016 | 982 | ||
1017 | cx->usage++; | ||
1018 | |||
1019 | lapic_timer_state_broadcast(pr, cx, 0); | 983 | lapic_timer_state_broadcast(pr, cx, 0); |
1020 | cx->time += idle_time; | ||
1021 | return index; | 984 | return index; |
1022 | } | 985 | } |
1023 | 986 | ||
diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c index 6e36d0c0057c..ff0740e0a9c2 100644 --- a/drivers/acpi/sbs.c +++ b/drivers/acpi/sbs.c | |||
@@ -988,15 +988,19 @@ static void acpi_sbs_rmdirs(void) | |||
988 | #endif | 988 | #endif |
989 | } | 989 | } |
990 | 990 | ||
991 | static int acpi_sbs_resume(struct acpi_device *device) | 991 | #ifdef CONFIG_PM_SLEEP |
992 | static int acpi_sbs_resume(struct device *dev) | ||
992 | { | 993 | { |
993 | struct acpi_sbs *sbs; | 994 | struct acpi_sbs *sbs; |
994 | if (!device) | 995 | if (!dev) |
995 | return -EINVAL; | 996 | return -EINVAL; |
996 | sbs = device->driver_data; | 997 | sbs = to_acpi_device(dev)->driver_data; |
997 | acpi_sbs_callback(sbs); | 998 | acpi_sbs_callback(sbs); |
998 | return 0; | 999 | return 0; |
999 | } | 1000 | } |
1001 | #endif | ||
1002 | |||
1003 | static SIMPLE_DEV_PM_OPS(acpi_sbs_pm, NULL, acpi_sbs_resume); | ||
1000 | 1004 | ||
1001 | static struct acpi_driver acpi_sbs_driver = { | 1005 | static struct acpi_driver acpi_sbs_driver = { |
1002 | .name = "sbs", | 1006 | .name = "sbs", |
@@ -1005,8 +1009,8 @@ static struct acpi_driver acpi_sbs_driver = { | |||
1005 | .ops = { | 1009 | .ops = { |
1006 | .add = acpi_sbs_add, | 1010 | .add = acpi_sbs_add, |
1007 | .remove = acpi_sbs_remove, | 1011 | .remove = acpi_sbs_remove, |
1008 | .resume = acpi_sbs_resume, | ||
1009 | }, | 1012 | }, |
1013 | .drv.pm = &acpi_sbs_pm, | ||
1010 | }; | 1014 | }; |
1011 | 1015 | ||
1012 | static int __init acpi_sbs_init(void) | 1016 | static int __init acpi_sbs_init(void) |
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index c8a1f3b68110..d1ecca2b641a 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -83,19 +83,29 @@ acpi_device_modalias_show(struct device *dev, struct device_attribute *attr, cha | |||
83 | } | 83 | } |
84 | static DEVICE_ATTR(modalias, 0444, acpi_device_modalias_show, NULL); | 84 | static DEVICE_ATTR(modalias, 0444, acpi_device_modalias_show, NULL); |
85 | 85 | ||
86 | static void acpi_bus_hot_remove_device(void *context) | 86 | /** |
87 | * acpi_bus_hot_remove_device: hot-remove a device and its children | ||
88 | * @context: struct acpi_eject_event pointer (freed in this func) | ||
89 | * | ||
90 | * Hot-remove a device and its children. This function frees up the | ||
91 | * memory space passed by arg context, so that the caller may call | ||
92 | * this function asynchronously through acpi_os_hotplug_execute(). | ||
93 | */ | ||
94 | void acpi_bus_hot_remove_device(void *context) | ||
87 | { | 95 | { |
96 | struct acpi_eject_event *ej_event = (struct acpi_eject_event *) context; | ||
88 | struct acpi_device *device; | 97 | struct acpi_device *device; |
89 | acpi_handle handle = context; | 98 | acpi_handle handle = ej_event->handle; |
90 | struct acpi_object_list arg_list; | 99 | struct acpi_object_list arg_list; |
91 | union acpi_object arg; | 100 | union acpi_object arg; |
92 | acpi_status status = AE_OK; | 101 | acpi_status status = AE_OK; |
102 | u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */ | ||
93 | 103 | ||
94 | if (acpi_bus_get_device(handle, &device)) | 104 | if (acpi_bus_get_device(handle, &device)) |
95 | return; | 105 | goto err_out; |
96 | 106 | ||
97 | if (!device) | 107 | if (!device) |
98 | return; | 108 | goto err_out; |
99 | 109 | ||
100 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 110 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
101 | "Hot-removing device %s...\n", dev_name(&device->dev))); | 111 | "Hot-removing device %s...\n", dev_name(&device->dev))); |
@@ -103,7 +113,7 @@ static void acpi_bus_hot_remove_device(void *context) | |||
103 | if (acpi_bus_trim(device, 1)) { | 113 | if (acpi_bus_trim(device, 1)) { |
104 | printk(KERN_ERR PREFIX | 114 | printk(KERN_ERR PREFIX |
105 | "Removing device failed\n"); | 115 | "Removing device failed\n"); |
106 | return; | 116 | goto err_out; |
107 | } | 117 | } |
108 | 118 | ||
109 | /* power off device */ | 119 | /* power off device */ |
@@ -129,10 +139,21 @@ static void acpi_bus_hot_remove_device(void *context) | |||
129 | * TBD: _EJD support. | 139 | * TBD: _EJD support. |
130 | */ | 140 | */ |
131 | status = acpi_evaluate_object(handle, "_EJ0", &arg_list, NULL); | 141 | status = acpi_evaluate_object(handle, "_EJ0", &arg_list, NULL); |
132 | if (ACPI_FAILURE(status)) | 142 | if (ACPI_FAILURE(status)) { |
133 | printk(KERN_WARNING PREFIX | 143 | if (status != AE_NOT_FOUND) |
134 | "Eject device failed\n"); | 144 | printk(KERN_WARNING PREFIX |
145 | "Eject device failed\n"); | ||
146 | goto err_out; | ||
147 | } | ||
148 | |||
149 | kfree(context); | ||
150 | return; | ||
135 | 151 | ||
152 | err_out: | ||
153 | /* Inform firmware the hot-remove operation has completed w/ error */ | ||
154 | (void) acpi_evaluate_hotplug_ost(handle, | ||
155 | ej_event->event, ost_code, NULL); | ||
156 | kfree(context); | ||
136 | return; | 157 | return; |
137 | } | 158 | } |
138 | 159 | ||
@@ -144,6 +165,7 @@ acpi_eject_store(struct device *d, struct device_attribute *attr, | |||
144 | acpi_status status; | 165 | acpi_status status; |
145 | acpi_object_type type = 0; | 166 | acpi_object_type type = 0; |
146 | struct acpi_device *acpi_device = to_acpi_device(d); | 167 | struct acpi_device *acpi_device = to_acpi_device(d); |
168 | struct acpi_eject_event *ej_event; | ||
147 | 169 | ||
148 | if ((!count) || (buf[0] != '1')) { | 170 | if ((!count) || (buf[0] != '1')) { |
149 | return -EINVAL; | 171 | return -EINVAL; |
@@ -160,7 +182,25 @@ acpi_eject_store(struct device *d, struct device_attribute *attr, | |||
160 | goto err; | 182 | goto err; |
161 | } | 183 | } |
162 | 184 | ||
163 | acpi_os_hotplug_execute(acpi_bus_hot_remove_device, acpi_device->handle); | 185 | ej_event = kmalloc(sizeof(*ej_event), GFP_KERNEL); |
186 | if (!ej_event) { | ||
187 | ret = -ENOMEM; | ||
188 | goto err; | ||
189 | } | ||
190 | |||
191 | ej_event->handle = acpi_device->handle; | ||
192 | if (acpi_device->flags.eject_pending) { | ||
193 | /* event originated from ACPI eject notification */ | ||
194 | ej_event->event = ACPI_NOTIFY_EJECT_REQUEST; | ||
195 | acpi_device->flags.eject_pending = 0; | ||
196 | } else { | ||
197 | /* event originated from user */ | ||
198 | ej_event->event = ACPI_OST_EC_OSPM_EJECT; | ||
199 | (void) acpi_evaluate_hotplug_ost(ej_event->handle, | ||
200 | ej_event->event, ACPI_OST_SC_EJECT_IN_PROGRESS, NULL); | ||
201 | } | ||
202 | |||
203 | acpi_os_hotplug_execute(acpi_bus_hot_remove_device, (void *)ej_event); | ||
164 | err: | 204 | err: |
165 | return ret; | 205 | return ret; |
166 | } | 206 | } |
@@ -290,26 +330,6 @@ static void acpi_device_release(struct device *dev) | |||
290 | kfree(acpi_dev); | 330 | kfree(acpi_dev); |
291 | } | 331 | } |
292 | 332 | ||
293 | static int acpi_device_suspend(struct device *dev, pm_message_t state) | ||
294 | { | ||
295 | struct acpi_device *acpi_dev = to_acpi_device(dev); | ||
296 | struct acpi_driver *acpi_drv = acpi_dev->driver; | ||
297 | |||
298 | if (acpi_drv && acpi_drv->ops.suspend) | ||
299 | return acpi_drv->ops.suspend(acpi_dev, state); | ||
300 | return 0; | ||
301 | } | ||
302 | |||
303 | static int acpi_device_resume(struct device *dev) | ||
304 | { | ||
305 | struct acpi_device *acpi_dev = to_acpi_device(dev); | ||
306 | struct acpi_driver *acpi_drv = acpi_dev->driver; | ||
307 | |||
308 | if (acpi_drv && acpi_drv->ops.resume) | ||
309 | return acpi_drv->ops.resume(acpi_dev); | ||
310 | return 0; | ||
311 | } | ||
312 | |||
313 | static int acpi_bus_match(struct device *dev, struct device_driver *drv) | 333 | static int acpi_bus_match(struct device *dev, struct device_driver *drv) |
314 | { | 334 | { |
315 | struct acpi_device *acpi_dev = to_acpi_device(dev); | 335 | struct acpi_device *acpi_dev = to_acpi_device(dev); |
@@ -441,8 +461,6 @@ static int acpi_device_remove(struct device * dev) | |||
441 | 461 | ||
442 | struct bus_type acpi_bus_type = { | 462 | struct bus_type acpi_bus_type = { |
443 | .name = "acpi", | 463 | .name = "acpi", |
444 | .suspend = acpi_device_suspend, | ||
445 | .resume = acpi_device_resume, | ||
446 | .match = acpi_bus_match, | 464 | .match = acpi_bus_match, |
447 | .probe = acpi_device_probe, | 465 | .probe = acpi_device_probe, |
448 | .remove = acpi_device_remove, | 466 | .remove = acpi_device_remove, |
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index 88561029cca8..fdcdbb652915 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c | |||
@@ -28,36 +28,7 @@ | |||
28 | #include "internal.h" | 28 | #include "internal.h" |
29 | #include "sleep.h" | 29 | #include "sleep.h" |
30 | 30 | ||
31 | u8 wake_sleep_flags = ACPI_NO_OPTIONAL_METHODS; | ||
32 | static unsigned int gts, bfs; | ||
33 | static int set_param_wake_flag(const char *val, struct kernel_param *kp) | ||
34 | { | ||
35 | int ret = param_set_int(val, kp); | ||
36 | |||
37 | if (ret) | ||
38 | return ret; | ||
39 | |||
40 | if (kp->arg == (const char *)>s) { | ||
41 | if (gts) | ||
42 | wake_sleep_flags |= ACPI_EXECUTE_GTS; | ||
43 | else | ||
44 | wake_sleep_flags &= ~ACPI_EXECUTE_GTS; | ||
45 | } | ||
46 | if (kp->arg == (const char *)&bfs) { | ||
47 | if (bfs) | ||
48 | wake_sleep_flags |= ACPI_EXECUTE_BFS; | ||
49 | else | ||
50 | wake_sleep_flags &= ~ACPI_EXECUTE_BFS; | ||
51 | } | ||
52 | return ret; | ||
53 | } | ||
54 | module_param_call(gts, set_param_wake_flag, param_get_int, >s, 0644); | ||
55 | module_param_call(bfs, set_param_wake_flag, param_get_int, &bfs, 0644); | ||
56 | MODULE_PARM_DESC(gts, "Enable evaluation of _GTS on suspend."); | ||
57 | MODULE_PARM_DESC(bfs, "Enable evaluation of _BFS on resume".); | ||
58 | |||
59 | static u8 sleep_states[ACPI_S_STATE_COUNT]; | 31 | static u8 sleep_states[ACPI_S_STATE_COUNT]; |
60 | static bool pwr_btn_event_pending; | ||
61 | 32 | ||
62 | static void acpi_sleep_tts_switch(u32 acpi_state) | 33 | static void acpi_sleep_tts_switch(u32 acpi_state) |
63 | { | 34 | { |
@@ -110,6 +81,7 @@ static int acpi_sleep_prepare(u32 acpi_state) | |||
110 | 81 | ||
111 | #ifdef CONFIG_ACPI_SLEEP | 82 | #ifdef CONFIG_ACPI_SLEEP |
112 | static u32 acpi_target_sleep_state = ACPI_STATE_S0; | 83 | static u32 acpi_target_sleep_state = ACPI_STATE_S0; |
84 | static bool pwr_btn_event_pending; | ||
113 | 85 | ||
114 | /* | 86 | /* |
115 | * The ACPI specification wants us to save NVS memory regions during hibernation | 87 | * The ACPI specification wants us to save NVS memory regions during hibernation |
@@ -143,7 +115,7 @@ void __init acpi_old_suspend_ordering(void) | |||
143 | static int acpi_pm_freeze(void) | 115 | static int acpi_pm_freeze(void) |
144 | { | 116 | { |
145 | acpi_disable_all_gpes(); | 117 | acpi_disable_all_gpes(); |
146 | acpi_os_wait_events_complete(NULL); | 118 | acpi_os_wait_events_complete(); |
147 | acpi_ec_block_transactions(); | 119 | acpi_ec_block_transactions(); |
148 | return 0; | 120 | return 0; |
149 | } | 121 | } |
@@ -305,7 +277,7 @@ static int acpi_suspend_enter(suspend_state_t pm_state) | |||
305 | switch (acpi_state) { | 277 | switch (acpi_state) { |
306 | case ACPI_STATE_S1: | 278 | case ACPI_STATE_S1: |
307 | barrier(); | 279 | barrier(); |
308 | status = acpi_enter_sleep_state(acpi_state, wake_sleep_flags); | 280 | status = acpi_enter_sleep_state(acpi_state); |
309 | break; | 281 | break; |
310 | 282 | ||
311 | case ACPI_STATE_S3: | 283 | case ACPI_STATE_S3: |
@@ -319,8 +291,8 @@ static int acpi_suspend_enter(suspend_state_t pm_state) | |||
319 | /* This violates the spec but is required for bug compatibility. */ | 291 | /* This violates the spec but is required for bug compatibility. */ |
320 | acpi_write_bit_register(ACPI_BITREG_SCI_ENABLE, 1); | 292 | acpi_write_bit_register(ACPI_BITREG_SCI_ENABLE, 1); |
321 | 293 | ||
322 | /* Reprogram control registers and execute _BFS */ | 294 | /* Reprogram control registers */ |
323 | acpi_leave_sleep_state_prep(acpi_state, wake_sleep_flags); | 295 | acpi_leave_sleep_state_prep(acpi_state); |
324 | 296 | ||
325 | /* ACPI 3.0 specs (P62) says that it's the responsibility | 297 | /* ACPI 3.0 specs (P62) says that it's the responsibility |
326 | * of the OSPM to clear the status bit [ implying that the | 298 | * of the OSPM to clear the status bit [ implying that the |
@@ -603,9 +575,9 @@ static int acpi_hibernation_enter(void) | |||
603 | ACPI_FLUSH_CPU_CACHE(); | 575 | ACPI_FLUSH_CPU_CACHE(); |
604 | 576 | ||
605 | /* This shouldn't return. If it returns, we have a problem */ | 577 | /* This shouldn't return. If it returns, we have a problem */ |
606 | status = acpi_enter_sleep_state(ACPI_STATE_S4, wake_sleep_flags); | 578 | status = acpi_enter_sleep_state(ACPI_STATE_S4); |
607 | /* Reprogram control registers and execute _BFS */ | 579 | /* Reprogram control registers */ |
608 | acpi_leave_sleep_state_prep(ACPI_STATE_S4, wake_sleep_flags); | 580 | acpi_leave_sleep_state_prep(ACPI_STATE_S4); |
609 | 581 | ||
610 | return ACPI_SUCCESS(status) ? 0 : -EFAULT; | 582 | return ACPI_SUCCESS(status) ? 0 : -EFAULT; |
611 | } | 583 | } |
@@ -617,8 +589,8 @@ static void acpi_hibernation_leave(void) | |||
617 | * enable it here. | 589 | * enable it here. |
618 | */ | 590 | */ |
619 | acpi_enable(); | 591 | acpi_enable(); |
620 | /* Reprogram control registers and execute _BFS */ | 592 | /* Reprogram control registers */ |
621 | acpi_leave_sleep_state_prep(ACPI_STATE_S4, wake_sleep_flags); | 593 | acpi_leave_sleep_state_prep(ACPI_STATE_S4); |
622 | /* Check the hardware signature */ | 594 | /* Check the hardware signature */ |
623 | if (facs && s4_hardware_signature != facs->hardware_signature) { | 595 | if (facs && s4_hardware_signature != facs->hardware_signature) { |
624 | printk(KERN_EMERG "ACPI: Hardware changed while hibernated, " | 596 | printk(KERN_EMERG "ACPI: Hardware changed while hibernated, " |
@@ -716,8 +688,9 @@ int acpi_suspend(u32 acpi_state) | |||
716 | * @dev: device to examine; its driver model wakeup flags control | 688 | * @dev: device to examine; its driver model wakeup flags control |
717 | * whether it should be able to wake up the system | 689 | * whether it should be able to wake up the system |
718 | * @d_min_p: used to store the upper limit of allowed states range | 690 | * @d_min_p: used to store the upper limit of allowed states range |
719 | * Return value: preferred power state of the device on success, -ENODEV on | 691 | * @d_max_in: specify the lowest allowed states |
720 | * failure (ie. if there's no 'struct acpi_device' for @dev) | 692 | * Return value: preferred power state of the device on success, -ENODEV |
693 | * (ie. if there's no 'struct acpi_device' for @dev) or -EINVAL on failure | ||
721 | * | 694 | * |
722 | * Find the lowest power (highest number) ACPI device power state that | 695 | * Find the lowest power (highest number) ACPI device power state that |
723 | * device @dev can be in while the system is in the sleep state represented | 696 | * device @dev can be in while the system is in the sleep state represented |
@@ -732,13 +705,15 @@ int acpi_suspend(u32 acpi_state) | |||
732 | * via @wake. | 705 | * via @wake. |
733 | */ | 706 | */ |
734 | 707 | ||
735 | int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p) | 708 | int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p, int d_max_in) |
736 | { | 709 | { |
737 | acpi_handle handle = DEVICE_ACPI_HANDLE(dev); | 710 | acpi_handle handle = DEVICE_ACPI_HANDLE(dev); |
738 | struct acpi_device *adev; | 711 | struct acpi_device *adev; |
739 | char acpi_method[] = "_SxD"; | 712 | char acpi_method[] = "_SxD"; |
740 | unsigned long long d_min, d_max; | 713 | unsigned long long d_min, d_max; |
741 | 714 | ||
715 | if (d_max_in < ACPI_STATE_D0 || d_max_in > ACPI_STATE_D3) | ||
716 | return -EINVAL; | ||
742 | if (!handle || ACPI_FAILURE(acpi_bus_get_device(handle, &adev))) { | 717 | if (!handle || ACPI_FAILURE(acpi_bus_get_device(handle, &adev))) { |
743 | printk(KERN_DEBUG "ACPI handle has no context!\n"); | 718 | printk(KERN_DEBUG "ACPI handle has no context!\n"); |
744 | return -ENODEV; | 719 | return -ENODEV; |
@@ -746,8 +721,10 @@ int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p) | |||
746 | 721 | ||
747 | acpi_method[2] = '0' + acpi_target_sleep_state; | 722 | acpi_method[2] = '0' + acpi_target_sleep_state; |
748 | /* | 723 | /* |
749 | * If the sleep state is S0, we will return D3, but if the device has | 724 | * If the sleep state is S0, the lowest limit from ACPI is D3, |
750 | * _S0W, we will use the value from _S0W | 725 | * but if the device has _S0W, we will use the value from _S0W |
726 | * as the lowest limit from ACPI. Finally, we will constrain | ||
727 | * the lowest limit with the specified one. | ||
751 | */ | 728 | */ |
752 | d_min = ACPI_STATE_D0; | 729 | d_min = ACPI_STATE_D0; |
753 | d_max = ACPI_STATE_D3; | 730 | d_max = ACPI_STATE_D3; |
@@ -791,10 +768,20 @@ int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p) | |||
791 | } | 768 | } |
792 | } | 769 | } |
793 | 770 | ||
771 | if (d_max_in < d_min) | ||
772 | return -EINVAL; | ||
794 | if (d_min_p) | 773 | if (d_min_p) |
795 | *d_min_p = d_min; | 774 | *d_min_p = d_min; |
775 | /* constrain d_max with specified lowest limit (max number) */ | ||
776 | if (d_max > d_max_in) { | ||
777 | for (d_max = d_max_in; d_max > d_min; d_max--) { | ||
778 | if (adev->power.states[d_max].flags.valid) | ||
779 | break; | ||
780 | } | ||
781 | } | ||
796 | return d_max; | 782 | return d_max; |
797 | } | 783 | } |
784 | EXPORT_SYMBOL(acpi_pm_device_sleep_state); | ||
798 | #endif /* CONFIG_PM */ | 785 | #endif /* CONFIG_PM */ |
799 | 786 | ||
800 | #ifdef CONFIG_PM_SLEEP | 787 | #ifdef CONFIG_PM_SLEEP |
@@ -831,6 +818,7 @@ int acpi_pm_device_run_wake(struct device *phys_dev, bool enable) | |||
831 | 818 | ||
832 | return 0; | 819 | return 0; |
833 | } | 820 | } |
821 | EXPORT_SYMBOL(acpi_pm_device_run_wake); | ||
834 | 822 | ||
835 | /** | 823 | /** |
836 | * acpi_pm_device_sleep_wake - enable or disable the system wake-up | 824 | * acpi_pm_device_sleep_wake - enable or disable the system wake-up |
@@ -876,33 +864,7 @@ static void acpi_power_off(void) | |||
876 | /* acpi_sleep_prepare(ACPI_STATE_S5) should have already been called */ | 864 | /* acpi_sleep_prepare(ACPI_STATE_S5) should have already been called */ |
877 | printk(KERN_DEBUG "%s called\n", __func__); | 865 | printk(KERN_DEBUG "%s called\n", __func__); |
878 | local_irq_disable(); | 866 | local_irq_disable(); |
879 | acpi_enter_sleep_state(ACPI_STATE_S5, wake_sleep_flags); | 867 | acpi_enter_sleep_state(ACPI_STATE_S5); |
880 | } | ||
881 | |||
882 | /* | ||
883 | * ACPI 2.0 created the optional _GTS and _BFS, | ||
884 | * but industry adoption has been neither rapid nor broad. | ||
885 | * | ||
886 | * Linux gets into trouble when it executes poorly validated | ||
887 | * paths through the BIOS, so disable _GTS and _BFS by default, | ||
888 | * but do speak up and offer the option to enable them. | ||
889 | */ | ||
890 | static void __init acpi_gts_bfs_check(void) | ||
891 | { | ||
892 | acpi_handle dummy; | ||
893 | |||
894 | if (ACPI_SUCCESS(acpi_get_handle(ACPI_ROOT_OBJECT, METHOD_PATHNAME__GTS, &dummy))) | ||
895 | { | ||
896 | printk(KERN_NOTICE PREFIX "BIOS offers _GTS\n"); | ||
897 | printk(KERN_NOTICE PREFIX "If \"acpi.gts=1\" improves suspend, " | ||
898 | "please notify linux-acpi@vger.kernel.org\n"); | ||
899 | } | ||
900 | if (ACPI_SUCCESS(acpi_get_handle(ACPI_ROOT_OBJECT, METHOD_PATHNAME__BFS, &dummy))) | ||
901 | { | ||
902 | printk(KERN_NOTICE PREFIX "BIOS offers _BFS\n"); | ||
903 | printk(KERN_NOTICE PREFIX "If \"acpi.bfs=1\" improves resume, " | ||
904 | "please notify linux-acpi@vger.kernel.org\n"); | ||
905 | } | ||
906 | } | 868 | } |
907 | 869 | ||
908 | int __init acpi_sleep_init(void) | 870 | int __init acpi_sleep_init(void) |
@@ -963,6 +925,5 @@ int __init acpi_sleep_init(void) | |||
963 | * object can also be evaluated when the system enters S5. | 925 | * object can also be evaluated when the system enters S5. |
964 | */ | 926 | */ |
965 | register_reboot_notifier(&tts_notifier); | 927 | register_reboot_notifier(&tts_notifier); |
966 | acpi_gts_bfs_check(); | ||
967 | return 0; | 928 | return 0; |
968 | } | 929 | } |
diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c index 240a24400976..7c3f98ba4afe 100644 --- a/drivers/acpi/sysfs.c +++ b/drivers/acpi/sysfs.c | |||
@@ -173,7 +173,7 @@ static int param_set_trace_state(const char *val, struct kernel_param *kp) | |||
173 | { | 173 | { |
174 | int result = 0; | 174 | int result = 0; |
175 | 175 | ||
176 | if (!strncmp(val, "enable", strlen("enable"))) { | 176 | if (!strncmp(val, "enable", sizeof("enable") - 1)) { |
177 | result = acpi_debug_trace(trace_method_name, trace_debug_level, | 177 | result = acpi_debug_trace(trace_method_name, trace_debug_level, |
178 | trace_debug_layer, 0); | 178 | trace_debug_layer, 0); |
179 | if (result) | 179 | if (result) |
@@ -181,7 +181,7 @@ static int param_set_trace_state(const char *val, struct kernel_param *kp) | |||
181 | goto exit; | 181 | goto exit; |
182 | } | 182 | } |
183 | 183 | ||
184 | if (!strncmp(val, "disable", strlen("disable"))) { | 184 | if (!strncmp(val, "disable", sizeof("disable") - 1)) { |
185 | int name = 0; | 185 | int name = 0; |
186 | result = acpi_debug_trace((char *)&name, trace_debug_level, | 186 | result = acpi_debug_trace((char *)&name, trace_debug_level, |
187 | trace_debug_layer, 0); | 187 | trace_debug_layer, 0); |
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 7dbebea1ec31..edda74a43406 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c | |||
@@ -98,7 +98,6 @@ MODULE_PARM_DESC(psv, "Disable or override all passive trip points."); | |||
98 | 98 | ||
99 | static int acpi_thermal_add(struct acpi_device *device); | 99 | static int acpi_thermal_add(struct acpi_device *device); |
100 | static int acpi_thermal_remove(struct acpi_device *device, int type); | 100 | static int acpi_thermal_remove(struct acpi_device *device, int type); |
101 | static int acpi_thermal_resume(struct acpi_device *device); | ||
102 | static void acpi_thermal_notify(struct acpi_device *device, u32 event); | 101 | static void acpi_thermal_notify(struct acpi_device *device, u32 event); |
103 | 102 | ||
104 | static const struct acpi_device_id thermal_device_ids[] = { | 103 | static const struct acpi_device_id thermal_device_ids[] = { |
@@ -107,6 +106,11 @@ static const struct acpi_device_id thermal_device_ids[] = { | |||
107 | }; | 106 | }; |
108 | MODULE_DEVICE_TABLE(acpi, thermal_device_ids); | 107 | MODULE_DEVICE_TABLE(acpi, thermal_device_ids); |
109 | 108 | ||
109 | #ifdef CONFIG_PM_SLEEP | ||
110 | static int acpi_thermal_resume(struct device *dev); | ||
111 | #endif | ||
112 | static SIMPLE_DEV_PM_OPS(acpi_thermal_pm, NULL, acpi_thermal_resume); | ||
113 | |||
110 | static struct acpi_driver acpi_thermal_driver = { | 114 | static struct acpi_driver acpi_thermal_driver = { |
111 | .name = "thermal", | 115 | .name = "thermal", |
112 | .class = ACPI_THERMAL_CLASS, | 116 | .class = ACPI_THERMAL_CLASS, |
@@ -114,9 +118,9 @@ static struct acpi_driver acpi_thermal_driver = { | |||
114 | .ops = { | 118 | .ops = { |
115 | .add = acpi_thermal_add, | 119 | .add = acpi_thermal_add, |
116 | .remove = acpi_thermal_remove, | 120 | .remove = acpi_thermal_remove, |
117 | .resume = acpi_thermal_resume, | ||
118 | .notify = acpi_thermal_notify, | 121 | .notify = acpi_thermal_notify, |
119 | }, | 122 | }, |
123 | .drv.pm = &acpi_thermal_pm, | ||
120 | }; | 124 | }; |
121 | 125 | ||
122 | struct acpi_thermal_state { | 126 | struct acpi_thermal_state { |
@@ -550,8 +554,6 @@ static int thermal_get_temp(struct thermal_zone_device *thermal, | |||
550 | return 0; | 554 | return 0; |
551 | } | 555 | } |
552 | 556 | ||
553 | static const char enabled[] = "kernel"; | ||
554 | static const char disabled[] = "user"; | ||
555 | static int thermal_get_mode(struct thermal_zone_device *thermal, | 557 | static int thermal_get_mode(struct thermal_zone_device *thermal, |
556 | enum thermal_device_mode *mode) | 558 | enum thermal_device_mode *mode) |
557 | { | 559 | { |
@@ -588,8 +590,8 @@ static int thermal_set_mode(struct thermal_zone_device *thermal, | |||
588 | if (enable != tz->tz_enabled) { | 590 | if (enable != tz->tz_enabled) { |
589 | tz->tz_enabled = enable; | 591 | tz->tz_enabled = enable; |
590 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 592 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
591 | "%s ACPI thermal control\n", | 593 | "%s kernel ACPI thermal control\n", |
592 | tz->tz_enabled ? enabled : disabled)); | 594 | tz->tz_enabled ? "Enable" : "Disable")); |
593 | acpi_thermal_check(tz); | 595 | acpi_thermal_check(tz); |
594 | } | 596 | } |
595 | return 0; | 597 | return 0; |
@@ -845,7 +847,7 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz) | |||
845 | 847 | ||
846 | if (tz->trips.passive.flags.valid) | 848 | if (tz->trips.passive.flags.valid) |
847 | tz->thermal_zone = | 849 | tz->thermal_zone = |
848 | thermal_zone_device_register("acpitz", trips, tz, | 850 | thermal_zone_device_register("acpitz", trips, 0, tz, |
849 | &acpi_thermal_zone_ops, | 851 | &acpi_thermal_zone_ops, |
850 | tz->trips.passive.tc1, | 852 | tz->trips.passive.tc1, |
851 | tz->trips.passive.tc2, | 853 | tz->trips.passive.tc2, |
@@ -853,7 +855,7 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz) | |||
853 | tz->polling_frequency*100); | 855 | tz->polling_frequency*100); |
854 | else | 856 | else |
855 | tz->thermal_zone = | 857 | tz->thermal_zone = |
856 | thermal_zone_device_register("acpitz", trips, tz, | 858 | thermal_zone_device_register("acpitz", trips, 0, tz, |
857 | &acpi_thermal_zone_ops, | 859 | &acpi_thermal_zone_ops, |
858 | 0, 0, 0, | 860 | 0, 0, 0, |
859 | tz->polling_frequency*100); | 861 | tz->polling_frequency*100); |
@@ -1041,16 +1043,18 @@ static int acpi_thermal_remove(struct acpi_device *device, int type) | |||
1041 | return 0; | 1043 | return 0; |
1042 | } | 1044 | } |
1043 | 1045 | ||
1044 | static int acpi_thermal_resume(struct acpi_device *device) | 1046 | #ifdef CONFIG_PM_SLEEP |
1047 | static int acpi_thermal_resume(struct device *dev) | ||
1045 | { | 1048 | { |
1046 | struct acpi_thermal *tz = NULL; | 1049 | struct acpi_thermal *tz; |
1047 | int i, j, power_state, result; | 1050 | int i, j, power_state, result; |
1048 | 1051 | ||
1049 | 1052 | if (!dev) | |
1050 | if (!device || !acpi_driver_data(device)) | ||
1051 | return -EINVAL; | 1053 | return -EINVAL; |
1052 | 1054 | ||
1053 | tz = acpi_driver_data(device); | 1055 | tz = acpi_driver_data(to_acpi_device(dev)); |
1056 | if (!tz) | ||
1057 | return -EINVAL; | ||
1054 | 1058 | ||
1055 | for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) { | 1059 | for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) { |
1056 | if (!(&tz->trips.active[i])) | 1060 | if (!(&tz->trips.active[i])) |
@@ -1074,6 +1078,7 @@ static int acpi_thermal_resume(struct acpi_device *device) | |||
1074 | 1078 | ||
1075 | return AE_OK; | 1079 | return AE_OK; |
1076 | } | 1080 | } |
1081 | #endif | ||
1077 | 1082 | ||
1078 | static int thermal_act(const struct dmi_system_id *d) { | 1083 | static int thermal_act(const struct dmi_system_id *d) { |
1079 | 1084 | ||
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index adbbc1c80a26..462f7e300363 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c | |||
@@ -384,7 +384,7 @@ acpi_evaluate_reference(acpi_handle handle, | |||
384 | EXPORT_SYMBOL(acpi_evaluate_reference); | 384 | EXPORT_SYMBOL(acpi_evaluate_reference); |
385 | 385 | ||
386 | acpi_status | 386 | acpi_status |
387 | acpi_get_physical_device_location(acpi_handle handle, struct acpi_pld *pld) | 387 | acpi_get_physical_device_location(acpi_handle handle, struct acpi_pld_info **pld) |
388 | { | 388 | { |
389 | acpi_status status; | 389 | acpi_status status; |
390 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; | 390 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; |
@@ -400,15 +400,60 @@ acpi_get_physical_device_location(acpi_handle handle, struct acpi_pld *pld) | |||
400 | if (!output || output->type != ACPI_TYPE_PACKAGE | 400 | if (!output || output->type != ACPI_TYPE_PACKAGE |
401 | || !output->package.count | 401 | || !output->package.count |
402 | || output->package.elements[0].type != ACPI_TYPE_BUFFER | 402 | || output->package.elements[0].type != ACPI_TYPE_BUFFER |
403 | || output->package.elements[0].buffer.length > sizeof(*pld)) { | 403 | || output->package.elements[0].buffer.length < ACPI_PLD_REV1_BUFFER_SIZE) { |
404 | status = AE_TYPE; | 404 | status = AE_TYPE; |
405 | goto out; | 405 | goto out; |
406 | } | 406 | } |
407 | 407 | ||
408 | memcpy(pld, output->package.elements[0].buffer.pointer, | 408 | status = acpi_decode_pld_buffer( |
409 | output->package.elements[0].buffer.length); | 409 | output->package.elements[0].buffer.pointer, |
410 | output->package.elements[0].buffer.length, | ||
411 | pld); | ||
412 | |||
410 | out: | 413 | out: |
411 | kfree(buffer.pointer); | 414 | kfree(buffer.pointer); |
412 | return status; | 415 | return status; |
413 | } | 416 | } |
414 | EXPORT_SYMBOL(acpi_get_physical_device_location); | 417 | EXPORT_SYMBOL(acpi_get_physical_device_location); |
418 | |||
419 | /** | ||
420 | * acpi_evaluate_hotplug_ost: Evaluate _OST for hotplug operations | ||
421 | * @handle: ACPI device handle | ||
422 | * @source_event: source event code | ||
423 | * @status_code: status code | ||
424 | * @status_buf: optional detailed information (NULL if none) | ||
425 | * | ||
426 | * Evaluate _OST for hotplug operations. All ACPI hotplug handlers | ||
427 | * must call this function when evaluating _OST for hotplug operations. | ||
428 | * When the platform does not support _OST, this function has no effect. | ||
429 | */ | ||
430 | acpi_status | ||
431 | acpi_evaluate_hotplug_ost(acpi_handle handle, u32 source_event, | ||
432 | u32 status_code, struct acpi_buffer *status_buf) | ||
433 | { | ||
434 | #ifdef ACPI_HOTPLUG_OST | ||
435 | union acpi_object params[3] = { | ||
436 | {.type = ACPI_TYPE_INTEGER,}, | ||
437 | {.type = ACPI_TYPE_INTEGER,}, | ||
438 | {.type = ACPI_TYPE_BUFFER,} | ||
439 | }; | ||
440 | struct acpi_object_list arg_list = {3, params}; | ||
441 | acpi_status status; | ||
442 | |||
443 | params[0].integer.value = source_event; | ||
444 | params[1].integer.value = status_code; | ||
445 | if (status_buf != NULL) { | ||
446 | params[2].buffer.pointer = status_buf->pointer; | ||
447 | params[2].buffer.length = status_buf->length; | ||
448 | } else { | ||
449 | params[2].buffer.pointer = NULL; | ||
450 | params[2].buffer.length = 0; | ||
451 | } | ||
452 | |||
453 | status = acpi_evaluate_object(handle, "_OST", &arg_list, NULL); | ||
454 | return status; | ||
455 | #else | ||
456 | return AE_OK; | ||
457 | #endif | ||
458 | } | ||
459 | EXPORT_SYMBOL(acpi_evaluate_hotplug_ost); | ||
diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c index 45d8097ef4cf..b728880ef10e 100644 --- a/drivers/acpi/video_detect.c +++ b/drivers/acpi/video_detect.c | |||
@@ -132,6 +132,33 @@ find_video(acpi_handle handle, u32 lvl, void *context, void **rv) | |||
132 | return AE_OK; | 132 | return AE_OK; |
133 | } | 133 | } |
134 | 134 | ||
135 | /* Force to use vendor driver when the ACPI device is known to be | ||
136 | * buggy */ | ||
137 | static int video_detect_force_vendor(const struct dmi_system_id *d) | ||
138 | { | ||
139 | acpi_video_support |= ACPI_VIDEO_BACKLIGHT_DMI_VENDOR; | ||
140 | return 0; | ||
141 | } | ||
142 | |||
143 | static struct dmi_system_id video_detect_dmi_table[] = { | ||
144 | /* On Samsung X360, the BIOS will set a flag (VDRV) if generic | ||
145 | * ACPI backlight device is used. This flag will definitively break | ||
146 | * the backlight interface (even the vendor interface) untill next | ||
147 | * reboot. It's why we should prevent video.ko from being used here | ||
148 | * and we can't rely on a later call to acpi_video_unregister(). | ||
149 | */ | ||
150 | { | ||
151 | .callback = video_detect_force_vendor, | ||
152 | .ident = "X360", | ||
153 | .matches = { | ||
154 | DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), | ||
155 | DMI_MATCH(DMI_PRODUCT_NAME, "X360"), | ||
156 | DMI_MATCH(DMI_BOARD_NAME, "X360"), | ||
157 | }, | ||
158 | }, | ||
159 | { }, | ||
160 | }; | ||
161 | |||
135 | /* | 162 | /* |
136 | * Returns the video capabilities of a specific ACPI graphics device | 163 | * Returns the video capabilities of a specific ACPI graphics device |
137 | * | 164 | * |
@@ -164,6 +191,8 @@ long acpi_video_get_capabilities(acpi_handle graphics_handle) | |||
164 | * ACPI_VIDEO_BACKLIGHT_DMI_VENDOR; | 191 | * ACPI_VIDEO_BACKLIGHT_DMI_VENDOR; |
165 | *} | 192 | *} |
166 | */ | 193 | */ |
194 | |||
195 | dmi_check_system(video_detect_dmi_table); | ||
167 | } else { | 196 | } else { |
168 | status = acpi_bus_get_device(graphics_handle, &tmp_dev); | 197 | status = acpi_bus_get_device(graphics_handle, &tmp_dev); |
169 | if (ACPI_FAILURE(status)) { | 198 | if (ACPI_FAILURE(status)) { |
@@ -182,8 +211,7 @@ long acpi_video_get_capabilities(acpi_handle graphics_handle) | |||
182 | } | 211 | } |
183 | EXPORT_SYMBOL(acpi_video_get_capabilities); | 212 | EXPORT_SYMBOL(acpi_video_get_capabilities); |
184 | 213 | ||
185 | /* Returns true if video.ko can do backlight switching */ | 214 | static void acpi_video_caps_check(void) |
186 | int acpi_video_backlight_support(void) | ||
187 | { | 215 | { |
188 | /* | 216 | /* |
189 | * We must check whether the ACPI graphics device is physically plugged | 217 | * We must check whether the ACPI graphics device is physically plugged |
@@ -191,6 +219,34 @@ int acpi_video_backlight_support(void) | |||
191 | */ | 219 | */ |
192 | if (!acpi_video_caps_checked) | 220 | if (!acpi_video_caps_checked) |
193 | acpi_video_get_capabilities(NULL); | 221 | acpi_video_get_capabilities(NULL); |
222 | } | ||
223 | |||
224 | /* Promote the vendor interface instead of the generic video module. | ||
225 | * This function allow DMI blacklists to be implemented by externals | ||
226 | * platform drivers instead of putting a big blacklist in video_detect.c | ||
227 | * After calling this function you will probably want to call | ||
228 | * acpi_video_unregister() to make sure the video module is not loaded | ||
229 | */ | ||
230 | void acpi_video_dmi_promote_vendor(void) | ||
231 | { | ||
232 | acpi_video_caps_check(); | ||
233 | acpi_video_support |= ACPI_VIDEO_BACKLIGHT_DMI_VENDOR; | ||
234 | } | ||
235 | EXPORT_SYMBOL(acpi_video_dmi_promote_vendor); | ||
236 | |||
237 | /* To be called when a driver who previously promoted the vendor | ||
238 | * interface */ | ||
239 | void acpi_video_dmi_demote_vendor(void) | ||
240 | { | ||
241 | acpi_video_caps_check(); | ||
242 | acpi_video_support &= ~ACPI_VIDEO_BACKLIGHT_DMI_VENDOR; | ||
243 | } | ||
244 | EXPORT_SYMBOL(acpi_video_dmi_demote_vendor); | ||
245 | |||
246 | /* Returns true if video.ko can do backlight switching */ | ||
247 | int acpi_video_backlight_support(void) | ||
248 | { | ||
249 | acpi_video_caps_check(); | ||
194 | 250 | ||
195 | /* First check for boot param -> highest prio */ | 251 | /* First check for boot param -> highest prio */ |
196 | if (acpi_video_support & ACPI_VIDEO_BACKLIGHT_FORCE_VENDOR) | 252 | if (acpi_video_support & ACPI_VIDEO_BACKLIGHT_FORCE_VENDOR) |