aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/utilities/utglobal.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-06-23 10:52:36 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-23 10:52:36 -0400
commit37224470c8c6d90a4062e76a08d4dc1fcf91fc89 (patch)
tree627f537177bf8e951c12bec04c4a85f0125f5ece /drivers/acpi/utilities/utglobal.c
parente83319510b04dd51a60da8a0b4ccf8b92b3ab1ad (diff)
parentae6c859b7dcd708efadf1c76279c33db213e3506 (diff)
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (65 commits) ACPI: suppress power button event on S3 resume ACPI: resolve merge conflict between sem2mutex and processor_perflib.c ACPI: use for_each_possible_cpu() instead of for_each_cpu() ACPI: delete newly added debugging macros in processor_perflib.c ACPI: UP build fix for bugzilla-5737 Enable P-state software coordination via _PDC P-state software coordination for speedstep-centrino P-state software coordination for acpi-cpufreq P-state software coordination for ACPI core ACPI: create acpi_thermal_resume() ACPI: create acpi_fan_suspend()/acpi_fan_resume() ACPI: pass pm_message_t from acpi_device_suspend() to root_suspend() ACPI: create acpi_device_suspend()/acpi_device_resume() ACPI: replace spin_lock_irq with mutex for ec poll mode ACPI: Allow a WAN module enable/disable on a Thinkpad X60. sem2mutex: acpi, acpi_link_lock ACPI: delete unused acpi_bus_drivers_lock sem2mutex: drivers/acpi/processor_perflib.c ACPI add ia64 exports to build acpi_memhotplug as a module ACPI: asus_acpi_init(): propagate correct return value ... Manual resolve of conflicts in: arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c include/acpi/processor.h
Diffstat (limited to 'drivers/acpi/utilities/utglobal.c')
-rw-r--r--drivers/acpi/utilities/utglobal.c62
1 files changed, 17 insertions, 45 deletions
diff --git a/drivers/acpi/utilities/utglobal.c b/drivers/acpi/utilities/utglobal.c
index ffd13383a325..e5999c65c0b8 100644
--- a/drivers/acpi/utilities/utglobal.c
+++ b/drivers/acpi/utilities/utglobal.c
@@ -43,7 +43,6 @@
43 43
44#define DEFINE_ACPI_GLOBALS 44#define DEFINE_ACPI_GLOBALS
45 45
46#include <linux/module.h>
47#include <acpi/acpi.h> 46#include <acpi/acpi.h>
48#include <acpi/acnamesp.h> 47#include <acpi/acnamesp.h>
49 48
@@ -119,6 +118,7 @@ const char *acpi_format_exception(acpi_status status)
119 } 118 }
120 119
121 if (!exception) { 120 if (!exception) {
121
122 /* Exception code was not recognized */ 122 /* Exception code was not recognized */
123 123
124 ACPI_ERROR((AE_INFO, 124 ACPI_ERROR((AE_INFO,
@@ -143,12 +143,10 @@ const char *acpi_format_exception(acpi_status status)
143 143
144/* Debug switch - level and trace mask */ 144/* Debug switch - level and trace mask */
145u32 acpi_dbg_level = ACPI_DEBUG_DEFAULT; 145u32 acpi_dbg_level = ACPI_DEBUG_DEFAULT;
146EXPORT_SYMBOL(acpi_dbg_level);
147 146
148/* Debug switch - layer (component) mask */ 147/* Debug switch - layer (component) mask */
149 148
150u32 acpi_dbg_layer = ACPI_COMPONENT_DEFAULT | ACPI_ALL_DRIVERS; 149u32 acpi_dbg_layer = ACPI_COMPONENT_DEFAULT | ACPI_ALL_DRIVERS;
151EXPORT_SYMBOL(acpi_dbg_layer);
152u32 acpi_gbl_nesting_level = 0; 150u32 acpi_gbl_nesting_level = 0;
153 151
154/* Debugger globals */ 152/* Debugger globals */
@@ -183,28 +181,6 @@ const char *acpi_gbl_highest_dstate_names[4] = {
183 "_S4D" 181 "_S4D"
184}; 182};
185 183
186/*
187 * Strings supported by the _OSI predefined (internal) method.
188 * When adding strings, be sure to update ACPI_NUM_OSI_STRINGS.
189 */
190const char *acpi_gbl_valid_osi_strings[ACPI_NUM_OSI_STRINGS] = {
191 /* Operating System Vendor Strings */
192
193 "Linux",
194 "Windows 2000",
195 "Windows 2001",
196 "Windows 2001.1",
197 "Windows 2001 SP0",
198 "Windows 2001 SP1",
199 "Windows 2001 SP2",
200 "Windows 2001 SP3",
201 "Windows 2001 SP4",
202
203 /* Feature Group Strings */
204
205 "Extended Address Space Descriptor"
206};
207
208/******************************************************************************* 184/*******************************************************************************
209 * 185 *
210 * Namespace globals 186 * Namespace globals
@@ -317,9 +293,9 @@ char acpi_ut_hex_to_ascii_char(acpi_integer integer, u32 position)
317 * 293 *
318 ******************************************************************************/ 294 ******************************************************************************/
319 295
320struct acpi_table_list acpi_gbl_table_lists[NUM_ACPI_TABLE_TYPES]; 296struct acpi_table_list acpi_gbl_table_lists[ACPI_TABLE_ID_MAX + 1];
321 297
322struct acpi_table_support acpi_gbl_table_data[NUM_ACPI_TABLE_TYPES] = { 298struct acpi_table_support acpi_gbl_table_data[ACPI_TABLE_ID_MAX + 1] = {
323 /*********** Name, Signature, Global typed pointer Signature size, Type How many allowed?, Contains valid AML? */ 299 /*********** Name, Signature, Global typed pointer Signature size, Type How many allowed?, Contains valid AML? */
324 300
325 /* RSDP 0 */ {RSDP_NAME, RSDP_SIG, NULL, sizeof(RSDP_SIG) - 1, 301 /* RSDP 0 */ {RSDP_NAME, RSDP_SIG, NULL, sizeof(RSDP_SIG) - 1,
@@ -467,7 +443,6 @@ struct acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS] =
467/* Region type decoding */ 443/* Region type decoding */
468 444
469const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] = { 445const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] = {
470/*! [Begin] no source code translation (keep these ASL Keywords as-is) */
471 "SystemMemory", 446 "SystemMemory",
472 "SystemIO", 447 "SystemIO",
473 "PCI_Config", 448 "PCI_Config",
@@ -476,16 +451,15 @@ const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] = {
476 "CMOS", 451 "CMOS",
477 "PCIBARTarget", 452 "PCIBARTarget",
478 "DataTable" 453 "DataTable"
479/*! [End] no source code translation !*/
480}; 454};
481 455
482char *acpi_ut_get_region_name(u8 space_id) 456char *acpi_ut_get_region_name(u8 space_id)
483{ 457{
484 458
485 if (space_id >= ACPI_USER_REGION_BEGIN) { 459 if (space_id >= ACPI_USER_REGION_BEGIN) {
486 return ("user_defined_region"); 460 return ("UserDefinedRegion");
487 } else if (space_id >= ACPI_NUM_PREDEFINED_REGIONS) { 461 } else if (space_id >= ACPI_NUM_PREDEFINED_REGIONS) {
488 return ("invalid_space_id"); 462 return ("InvalidSpaceId");
489 } 463 }
490 464
491 return (ACPI_CAST_PTR(char, acpi_gbl_region_types[space_id])); 465 return (ACPI_CAST_PTR(char, acpi_gbl_region_types[space_id]));
@@ -506,20 +480,18 @@ char *acpi_ut_get_region_name(u8 space_id)
506/* Event type decoding */ 480/* Event type decoding */
507 481
508static const char *acpi_gbl_event_types[ACPI_NUM_FIXED_EVENTS] = { 482static const char *acpi_gbl_event_types[ACPI_NUM_FIXED_EVENTS] = {
509/*! [Begin] no source code translation (keep these strings as-is) */
510 "PM_Timer", 483 "PM_Timer",
511 "GlobalLock", 484 "GlobalLock",
512 "PowerButton", 485 "PowerButton",
513 "SleepButton", 486 "SleepButton",
514 "RealTimeClock", 487 "RealTimeClock",
515/*! [End] no source code translation !*/
516}; 488};
517 489
518char *acpi_ut_get_event_name(u32 event_id) 490char *acpi_ut_get_event_name(u32 event_id)
519{ 491{
520 492
521 if (event_id > ACPI_EVENT_MAX) { 493 if (event_id > ACPI_EVENT_MAX) {
522 return ("invalid_event_iD"); 494 return ("InvalidEventID");
523 } 495 }
524 496
525 return (ACPI_CAST_PTR(char, acpi_gbl_event_types[event_id])); 497 return (ACPI_CAST_PTR(char, acpi_gbl_event_types[event_id]));
@@ -550,7 +522,6 @@ static const char acpi_gbl_bad_type[] = "UNDEFINED";
550/* Printable names of the ACPI object types */ 522/* Printable names of the ACPI object types */
551 523
552static const char *acpi_gbl_ns_type_names[] = { 524static const char *acpi_gbl_ns_type_names[] = {
553/*! [Begin] no source code translation (keep these strings as-is) */
554 /* 00 */ "Untyped", 525 /* 00 */ "Untyped",
555 /* 01 */ "Integer", 526 /* 01 */ "Integer",
556 /* 02 */ "String", 527 /* 02 */ "String",
@@ -582,7 +553,6 @@ static const char *acpi_gbl_ns_type_names[] = {
582 /* 28 */ "Extra", 553 /* 28 */ "Extra",
583 /* 29 */ "Data", 554 /* 29 */ "Data",
584 /* 30 */ "Invalid" 555 /* 30 */ "Invalid"
585/*! [End] no source code translation !*/
586}; 556};
587 557
588char *acpi_ut_get_type_name(acpi_object_type type) 558char *acpi_ut_get_type_name(acpi_object_type type)
@@ -635,14 +605,14 @@ char *acpi_ut_get_node_name(void *object)
635 605
636 /* Descriptor must be a namespace node */ 606 /* Descriptor must be a namespace node */
637 607
638 if (node->descriptor != ACPI_DESC_TYPE_NAMED) { 608 if (ACPI_GET_DESCRIPTOR_TYPE(node) != ACPI_DESC_TYPE_NAMED) {
639 return ("####"); 609 return ("####");
640 } 610 }
641 611
642 /* Name must be a valid ACPI name */ 612 /* Name must be a valid ACPI name */
643 613
644 if (!acpi_ut_valid_acpi_name(node->name.integer)) { 614 if (!acpi_ut_valid_acpi_name(node->name.integer)) {
645 return ("????"); 615 node->name.integer = acpi_ut_repair_name(node->name.integer);
646 } 616 }
647 617
648 /* Return the name */ 618 /* Return the name */
@@ -665,7 +635,6 @@ char *acpi_ut_get_node_name(void *object)
665/* Printable names of object descriptor types */ 635/* Printable names of object descriptor types */
666 636
667static const char *acpi_gbl_desc_type_names[] = { 637static const char *acpi_gbl_desc_type_names[] = {
668/*! [Begin] no source code translation (keep these ASL Keywords as-is) */
669 /* 00 */ "Invalid", 638 /* 00 */ "Invalid",
670 /* 01 */ "Cached", 639 /* 01 */ "Cached",
671 /* 02 */ "State-Generic", 640 /* 02 */ "State-Generic",
@@ -682,7 +651,6 @@ static const char *acpi_gbl_desc_type_names[] = {
682 /* 13 */ "Parser", 651 /* 13 */ "Parser",
683 /* 14 */ "Operand", 652 /* 14 */ "Operand",
684 /* 15 */ "Node" 653 /* 15 */ "Node"
685/*! [End] no source code translation !*/
686}; 654};
687 655
688char *acpi_ut_get_descriptor_name(void *object) 656char *acpi_ut_get_descriptor_name(void *object)
@@ -723,7 +691,7 @@ char *acpi_ut_get_descriptor_name(void *object)
723char *acpi_ut_get_mutex_name(u32 mutex_id) 691char *acpi_ut_get_mutex_name(u32 mutex_id)
724{ 692{
725 693
726 if (mutex_id > MAX_MUTEX) { 694 if (mutex_id > ACPI_MAX_MUTEX) {
727 return ("Invalid Mutex ID"); 695 return ("Invalid Mutex ID");
728 } 696 }
729 697
@@ -747,6 +715,7 @@ u8 acpi_ut_valid_object_type(acpi_object_type type)
747{ 715{
748 716
749 if (type > ACPI_TYPE_LOCAL_MAX) { 717 if (type > ACPI_TYPE_LOCAL_MAX) {
718
750 /* Note: Assumes all TYPEs are contiguous (external/local) */ 719 /* Note: Assumes all TYPEs are contiguous (external/local) */
751 720
752 return (FALSE); 721 return (FALSE);
@@ -773,7 +742,7 @@ void acpi_ut_init_globals(void)
773 acpi_status status; 742 acpi_status status;
774 u32 i; 743 u32 i;
775 744
776 ACPI_FUNCTION_TRACE("ut_init_globals"); 745 ACPI_FUNCTION_TRACE(ut_init_globals);
777 746
778 /* Create all memory caches */ 747 /* Create all memory caches */
779 748
@@ -784,14 +753,14 @@ void acpi_ut_init_globals(void)
784 753
785 /* ACPI table structure */ 754 /* ACPI table structure */
786 755
787 for (i = 0; i < NUM_ACPI_TABLE_TYPES; i++) { 756 for (i = 0; i < (ACPI_TABLE_ID_MAX + 1); i++) {
788 acpi_gbl_table_lists[i].next = NULL; 757 acpi_gbl_table_lists[i].next = NULL;
789 acpi_gbl_table_lists[i].count = 0; 758 acpi_gbl_table_lists[i].count = 0;
790 } 759 }
791 760
792 /* Mutex locked flags */ 761 /* Mutex locked flags */
793 762
794 for (i = 0; i < NUM_MUTEX; i++) { 763 for (i = 0; i < ACPI_NUM_MUTEX; i++) {
795 acpi_gbl_mutex_info[i].mutex = NULL; 764 acpi_gbl_mutex_info[i].mutex = NULL;
796 acpi_gbl_mutex_info[i].thread_id = ACPI_MUTEX_NOT_ACQUIRED; 765 acpi_gbl_mutex_info[i].thread_id = ACPI_MUTEX_NOT_ACQUIRED;
797 acpi_gbl_mutex_info[i].use_count = 0; 766 acpi_gbl_mutex_info[i].use_count = 0;
@@ -856,7 +825,7 @@ void acpi_ut_init_globals(void)
856 825
857 acpi_gbl_root_node = NULL; 826 acpi_gbl_root_node = NULL;
858 acpi_gbl_root_node_struct.name.integer = ACPI_ROOT_NAME; 827 acpi_gbl_root_node_struct.name.integer = ACPI_ROOT_NAME;
859 acpi_gbl_root_node_struct.descriptor = ACPI_DESC_TYPE_NAMED; 828 acpi_gbl_root_node_struct.descriptor_type = ACPI_DESC_TYPE_NAMED;
860 acpi_gbl_root_node_struct.type = ACPI_TYPE_DEVICE; 829 acpi_gbl_root_node_struct.type = ACPI_TYPE_DEVICE;
861 acpi_gbl_root_node_struct.child = NULL; 830 acpi_gbl_root_node_struct.child = NULL;
862 acpi_gbl_root_node_struct.peer = NULL; 831 acpi_gbl_root_node_struct.peer = NULL;
@@ -869,3 +838,6 @@ void acpi_ut_init_globals(void)
869 838
870 return_VOID; 839 return_VOID;
871} 840}
841
842ACPI_EXPORT_SYMBOL(acpi_dbg_level)
843ACPI_EXPORT_SYMBOL(acpi_dbg_layer)