aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/utilities
diff options
context:
space:
mode:
authorRobert Moore <robert.moore@intel.com>2005-04-18 22:49:35 -0400
committerLen Brown <len.brown@intel.com>2005-07-12 00:08:52 -0400
commit44f6c01242da4e162f28d8e1216a8c7a91174605 (patch)
tree53f724764f1bd9036dfb049a643d198125cc9edc /drivers/acpi/utilities
parentebb6e1a6122fd6b7c96470cfd4ce0f04150e5084 (diff)
ACPICA 20050408 from Bob Moore
Fixed three cases in the interpreter where an "index" argument to an ASL function was still (internally) 32 bits instead of the required 64 bits. This was the Index argument to the Index, Mid, and Match operators. The "strupr" function is now permanently local (acpi_ut_strupr), since this is not a POSIX-defined function and not present in most kernel-level C libraries. References to the C library strupr function have been removed from the headers. Completed the deployment of static functions/prototypes. All prototypes with the static attribute have been moved from the headers to the owning C file. ACPICA 20050329 from Bob Moore An error is now generated if an attempt is made to create a Buffer Field of length zero (A CreateField with a length operand of zero.) The interpreter now issues a warning whenever executable code at the module level is detected during ACPI table load. This will give some idea of the prevalence of this type of code. Implemented support for references to named objects (other than control methods) within package objects. Enhanced package object output for the debug object. Package objects are now completely dumped, showing all elements. Enhanced miscellaneous object output for the debug object. Any object can now be written to the debug object (for example, a device object can be written, and the type of the object will be displayed.) The "static" qualifier has been added to all local functions across the core subsystem. The number of "long" lines (> 80 chars) within the source has been significantly reduced, by about 1/3. Cleaned up all header files to ensure that all CA/iASL functions are prototyped (even static functions) and the formatting is consistent. Two new header files have been added, acopcode.h and acnames.h. Removed several obsolete functions that were no longer used. Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/utilities')
-rw-r--r--drivers/acpi/utilities/utalloc.c84
-rw-r--r--drivers/acpi/utilities/utcopy.c126
-rw-r--r--drivers/acpi/utilities/utdebug.c106
-rw-r--r--drivers/acpi/utilities/utdelete.c63
-rw-r--r--drivers/acpi/utilities/uteval.c36
-rw-r--r--drivers/acpi/utilities/utglobal.c133
-rw-r--r--drivers/acpi/utilities/utinit.c36
-rw-r--r--drivers/acpi/utilities/utmath.c2
-rw-r--r--drivers/acpi/utilities/utmisc.c187
-rw-r--r--drivers/acpi/utilities/utobject.c68
-rw-r--r--drivers/acpi/utilities/utxface.c61
11 files changed, 548 insertions, 354 deletions
diff --git a/drivers/acpi/utilities/utalloc.c b/drivers/acpi/utilities/utalloc.c
index 3313439c4bc7..c4e7f989a2bd 100644
--- a/drivers/acpi/utilities/utalloc.c
+++ b/drivers/acpi/utilities/utalloc.c
@@ -47,8 +47,35 @@
47#define _COMPONENT ACPI_UTILITIES 47#define _COMPONENT ACPI_UTILITIES
48 ACPI_MODULE_NAME ("utalloc") 48 ACPI_MODULE_NAME ("utalloc")
49 49
50/* Local prototypes */
50 51
51/****************************************************************************** 52#ifdef ACPI_DBG_TRACK_ALLOCATIONS
53static struct acpi_debug_mem_block *
54acpi_ut_find_allocation (
55 u32 list_id,
56 void *allocation);
57
58static acpi_status
59acpi_ut_track_allocation (
60 u32 list_id,
61 struct acpi_debug_mem_block *address,
62 acpi_size size,
63 u8 alloc_type,
64 u32 component,
65 char *module,
66 u32 line);
67
68static acpi_status
69acpi_ut_remove_allocation (
70 u32 list_id,
71 struct acpi_debug_mem_block *address,
72 u32 component,
73 char *module,
74 u32 line);
75#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
76
77
78/*******************************************************************************
52 * 79 *
53 * FUNCTION: acpi_ut_release_to_cache 80 * FUNCTION: acpi_ut_release_to_cache
54 * 81 *
@@ -98,7 +125,8 @@ acpi_ut_release_to_cache (
98 125
99 /* Put the object at the head of the cache list */ 126 /* Put the object at the head of the cache list */
100 127
101 * (ACPI_CAST_INDIRECT_PTR (char, &(((char *) object)[cache_info->link_offset]))) = cache_info->list_head; 128 * (ACPI_CAST_INDIRECT_PTR (char,
129 &(((char *) object)[cache_info->link_offset]))) = cache_info->list_head;
102 cache_info->list_head = object; 130 cache_info->list_head = object;
103 cache_info->cache_depth++; 131 cache_info->cache_depth++;
104 132
@@ -115,7 +143,7 @@ acpi_ut_release_to_cache (
115} 143}
116 144
117 145
118/****************************************************************************** 146/*******************************************************************************
119 * 147 *
120 * FUNCTION: acpi_ut_acquire_from_cache 148 * FUNCTION: acpi_ut_acquire_from_cache
121 * 149 *
@@ -156,7 +184,8 @@ acpi_ut_acquire_from_cache (
156 /* There is an object available, use it */ 184 /* There is an object available, use it */
157 185
158 object = cache_info->list_head; 186 object = cache_info->list_head;
159 cache_info->list_head = *(ACPI_CAST_INDIRECT_PTR (char, &(((char *) object)[cache_info->link_offset]))); 187 cache_info->list_head = *(ACPI_CAST_INDIRECT_PTR (char,
188 &(((char *) object)[cache_info->link_offset])));
160 189
161 ACPI_MEM_TRACKING (cache_info->cache_hits++); 190 ACPI_MEM_TRACKING (cache_info->cache_hits++);
162 cache_info->cache_depth--; 191 cache_info->cache_depth--;
@@ -201,7 +230,7 @@ acpi_ut_acquire_from_cache (
201 230
202 231
203#ifdef ACPI_ENABLE_OBJECT_CACHE 232#ifdef ACPI_ENABLE_OBJECT_CACHE
204/****************************************************************************** 233/*******************************************************************************
205 * 234 *
206 * FUNCTION: acpi_ut_delete_generic_cache 235 * FUNCTION: acpi_ut_delete_generic_cache
207 * 236 *
@@ -228,7 +257,8 @@ acpi_ut_delete_generic_cache (
228 while (cache_info->list_head) { 257 while (cache_info->list_head) {
229 /* Delete one cached state object */ 258 /* Delete one cached state object */
230 259
231 next = *(ACPI_CAST_INDIRECT_PTR (char, &(((char *) cache_info->list_head)[cache_info->link_offset]))); 260 next = *(ACPI_CAST_INDIRECT_PTR (char,
261 &(((char *) cache_info->list_head)[cache_info->link_offset])));
232 ACPI_MEM_FREE (cache_info->list_head); 262 ACPI_MEM_FREE (cache_info->list_head);
233 263
234 cache_info->list_head = next; 264 cache_info->list_head = next;
@@ -497,8 +527,8 @@ acpi_ut_allocate_and_track (
497 acpi_status status; 527 acpi_status status;
498 528
499 529
500 allocation = acpi_ut_allocate (size + sizeof (struct acpi_debug_mem_header), component, 530 allocation = acpi_ut_allocate (size + sizeof (struct acpi_debug_mem_header),
501 module, line); 531 component, module, line);
502 if (!allocation) { 532 if (!allocation) {
503 return (NULL); 533 return (NULL);
504 } 534 }
@@ -543,8 +573,8 @@ acpi_ut_callocate_and_track (
543 acpi_status status; 573 acpi_status status;
544 574
545 575
546 allocation = acpi_ut_callocate (size + sizeof (struct acpi_debug_mem_header), component, 576 allocation = acpi_ut_callocate (size + sizeof (struct acpi_debug_mem_header),
547 module, line); 577 component, module, line);
548 if (!allocation) { 578 if (!allocation) {
549 /* Report allocation error */ 579 /* Report allocation error */
550 580
@@ -637,7 +667,7 @@ acpi_ut_free_and_track (
637 * 667 *
638 ******************************************************************************/ 668 ******************************************************************************/
639 669
640struct acpi_debug_mem_block * 670static struct acpi_debug_mem_block *
641acpi_ut_find_allocation ( 671acpi_ut_find_allocation (
642 u32 list_id, 672 u32 list_id,
643 void *allocation) 673 void *allocation)
@@ -686,7 +716,7 @@ acpi_ut_find_allocation (
686 * 716 *
687 ******************************************************************************/ 717 ******************************************************************************/
688 718
689acpi_status 719static acpi_status
690acpi_ut_track_allocation ( 720acpi_ut_track_allocation (
691 u32 list_id, 721 u32 list_id,
692 struct acpi_debug_mem_block *allocation, 722 struct acpi_debug_mem_block *allocation,
@@ -721,10 +751,12 @@ acpi_ut_track_allocation (
721 751
722 element = acpi_ut_find_allocation (list_id, allocation); 752 element = acpi_ut_find_allocation (list_id, allocation);
723 if (element) { 753 if (element) {
724 ACPI_REPORT_ERROR (("ut_track_allocation: Allocation already present in list! (%p)\n", 754 ACPI_REPORT_ERROR ((
755 "ut_track_allocation: Allocation already present in list! (%p)\n",
725 allocation)); 756 allocation));
726 757
727 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Element %p Address %p\n", element, allocation)); 758 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Element %p Address %p\n",
759 element, allocation));
728 760
729 goto unlock_and_exit; 761 goto unlock_and_exit;
730 } 762 }
@@ -773,7 +805,7 @@ unlock_and_exit:
773 * 805 *
774 ******************************************************************************/ 806 ******************************************************************************/
775 807
776acpi_status 808static acpi_status
777acpi_ut_remove_allocation ( 809acpi_ut_remove_allocation (
778 u32 list_id, 810 u32 list_id,
779 struct acpi_debug_mem_block *allocation, 811 struct acpi_debug_mem_block *allocation,
@@ -797,7 +829,7 @@ acpi_ut_remove_allocation (
797 /* No allocations! */ 829 /* No allocations! */
798 830
799 _ACPI_REPORT_ERROR (module, line, component, 831 _ACPI_REPORT_ERROR (module, line, component,
800 ("ut_remove_allocation: Empty allocation list, nothing to free!\n")); 832 ("ut_remove_allocation: Empty allocation list, nothing to free!\n"));
801 833
802 return_ACPI_STATUS (AE_OK); 834 return_ACPI_STATUS (AE_OK);
803 } 835 }
@@ -824,7 +856,8 @@ acpi_ut_remove_allocation (
824 856
825 ACPI_MEMSET (&allocation->user_space, 0xEA, allocation->size); 857 ACPI_MEMSET (&allocation->user_space, 0xEA, allocation->size);
826 858
827 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Freeing size 0%X\n", allocation->size)); 859 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Freeing size 0%X\n",
860 allocation->size));
828 861
829 status = acpi_ut_release_mutex (ACPI_MTX_MEMORY); 862 status = acpi_ut_release_mutex (ACPI_MTX_MEMORY);
830 return_ACPI_STATUS (status); 863 return_ACPI_STATUS (status);
@@ -842,6 +875,7 @@ acpi_ut_remove_allocation (
842 * DESCRIPTION: Print some info about the outstanding allocations. 875 * DESCRIPTION: Print some info about the outstanding allocations.
843 * 876 *
844 ******************************************************************************/ 877 ******************************************************************************/
878
845#ifdef ACPI_FUTURE_USAGE 879#ifdef ACPI_FUTURE_USAGE
846void 880void
847acpi_ut_dump_allocation_info ( 881acpi_ut_dump_allocation_info (
@@ -884,7 +918,8 @@ acpi_ut_dump_allocation_info (
884 ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES, 918 ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
885 ("%30s: %4d (%3d Kb)\n", "Max Nodes", 919 ("%30s: %4d (%3d Kb)\n", "Max Nodes",
886 acpi_gbl_max_concurrent_node_count, 920 acpi_gbl_max_concurrent_node_count,
887 ROUND_UP_TO_1K ((acpi_gbl_max_concurrent_node_count * sizeof (struct acpi_namespace_node))))); 921 ROUND_UP_TO_1K ((acpi_gbl_max_concurrent_node_count *
922 sizeof (struct acpi_namespace_node)))));
888*/ 923*/
889 return_VOID; 924 return_VOID;
890} 925}
@@ -933,26 +968,26 @@ acpi_ut_dump_allocations (
933 descriptor = ACPI_CAST_PTR (union acpi_descriptor, &element->user_space); 968 descriptor = ACPI_CAST_PTR (union acpi_descriptor, &element->user_space);
934 if (descriptor->descriptor_id != ACPI_DESC_TYPE_CACHED) { 969 if (descriptor->descriptor_id != ACPI_DESC_TYPE_CACHED) {
935 acpi_os_printf ("%p Len %04X %9.9s-%d [%s] ", 970 acpi_os_printf ("%p Len %04X %9.9s-%d [%s] ",
936 descriptor, element->size, element->module, 971 descriptor, element->size, element->module,
937 element->line, acpi_ut_get_descriptor_name (descriptor)); 972 element->line, acpi_ut_get_descriptor_name (descriptor));
938 973
939 /* Most of the elements will be Operand objects. */ 974 /* Most of the elements will be Operand objects. */
940 975
941 switch (ACPI_GET_DESCRIPTOR_TYPE (descriptor)) { 976 switch (ACPI_GET_DESCRIPTOR_TYPE (descriptor)) {
942 case ACPI_DESC_TYPE_OPERAND: 977 case ACPI_DESC_TYPE_OPERAND:
943 acpi_os_printf ("%12.12s R%hd", 978 acpi_os_printf ("%12.12s R%hd",
944 acpi_ut_get_type_name (descriptor->object.common.type), 979 acpi_ut_get_type_name (descriptor->object.common.type),
945 descriptor->object.common.reference_count); 980 descriptor->object.common.reference_count);
946 break; 981 break;
947 982
948 case ACPI_DESC_TYPE_PARSER: 983 case ACPI_DESC_TYPE_PARSER:
949 acpi_os_printf ("aml_opcode %04hX", 984 acpi_os_printf ("aml_opcode %04hX",
950 descriptor->op.asl.aml_opcode); 985 descriptor->op.asl.aml_opcode);
951 break; 986 break;
952 987
953 case ACPI_DESC_TYPE_NAMED: 988 case ACPI_DESC_TYPE_NAMED:
954 acpi_os_printf ("%4.4s", 989 acpi_os_printf ("%4.4s",
955 acpi_ut_get_node_name (&descriptor->node)); 990 acpi_ut_get_node_name (&descriptor->node));
956 break; 991 break;
957 992
958 default: 993 default:
@@ -983,6 +1018,5 @@ acpi_ut_dump_allocations (
983 return_VOID; 1018 return_VOID;
984} 1019}
985 1020
986
987#endif /* #ifdef ACPI_DBG_TRACK_ALLOCATIONS */ 1021#endif /* #ifdef ACPI_DBG_TRACK_ALLOCATIONS */
988 1022
diff --git a/drivers/acpi/utilities/utcopy.c b/drivers/acpi/utilities/utcopy.c
index 0fcd98bde0d1..11e884957162 100644
--- a/drivers/acpi/utilities/utcopy.c
+++ b/drivers/acpi/utilities/utcopy.c
@@ -49,21 +49,69 @@
49#define _COMPONENT ACPI_UTILITIES 49#define _COMPONENT ACPI_UTILITIES
50 ACPI_MODULE_NAME ("utcopy") 50 ACPI_MODULE_NAME ("utcopy")
51 51
52/* Local prototypes */
53
54static acpi_status
55acpi_ut_copy_isimple_to_esimple (
56 union acpi_operand_object *internal_object,
57 union acpi_object *external_object,
58 u8 *data_space,
59 acpi_size *buffer_space_used);
60
61static acpi_status
62acpi_ut_copy_ielement_to_ielement (
63 u8 object_type,
64 union acpi_operand_object *source_object,
65 union acpi_generic_state *state,
66 void *context);
67
68static acpi_status
69acpi_ut_copy_ipackage_to_epackage (
70 union acpi_operand_object *internal_object,
71 u8 *buffer,
72 acpi_size *space_used);
73
74static acpi_status
75acpi_ut_copy_esimple_to_isimple(
76 union acpi_object *user_obj,
77 union acpi_operand_object **return_obj);
78
79static acpi_status
80acpi_ut_copy_simple_object (
81 union acpi_operand_object *source_desc,
82 union acpi_operand_object *dest_desc);
83
84static acpi_status
85acpi_ut_copy_ielement_to_eelement (
86 u8 object_type,
87 union acpi_operand_object *source_object,
88 union acpi_generic_state *state,
89 void *context);
90
91static acpi_status
92acpi_ut_copy_ipackage_to_ipackage (
93 union acpi_operand_object *source_obj,
94 union acpi_operand_object *dest_obj,
95 struct acpi_walk_state *walk_state);
96
52 97
53/******************************************************************************* 98/*******************************************************************************
54 * 99 *
55 * FUNCTION: acpi_ut_copy_isimple_to_esimple 100 * FUNCTION: acpi_ut_copy_isimple_to_esimple
56 * 101 *
57 * PARAMETERS: *internal_object - Pointer to the object we are examining 102 * PARAMETERS: internal_object - Source object to be copied
58 * *Buffer - Where the object is returned 103 * external_object - Where to return the copied object
59 * *space_used - Where the data length is returned 104 * data_space - Where object data is returned (such as
105 * buffer and string data)
106 * buffer_space_used - Length of data_space that was used
60 * 107 *
61 * RETURN: Status 108 * RETURN: Status
62 * 109 *
63 * DESCRIPTION: This function is called to place a simple object in a user 110 * DESCRIPTION: This function is called to copy a simple internal object to
64 * buffer. 111 * an external object.
65 * 112 *
66 * The buffer is assumed to have sufficient space for the object. 113 * The data_space buffer is assumed to have sufficient space for
114 * the object.
67 * 115 *
68 ******************************************************************************/ 116 ******************************************************************************/
69 117
@@ -107,10 +155,12 @@ acpi_ut_copy_isimple_to_esimple (
107 155
108 external_object->string.pointer = (char *) data_space; 156 external_object->string.pointer = (char *) data_space;
109 external_object->string.length = internal_object->string.length; 157 external_object->string.length = internal_object->string.length;
110 *buffer_space_used = ACPI_ROUND_UP_TO_NATIVE_WORD ((acpi_size) internal_object->string.length + 1); 158 *buffer_space_used = ACPI_ROUND_UP_TO_NATIVE_WORD (
159 (acpi_size) internal_object->string.length + 1);
111 160
112 ACPI_MEMCPY ((void *) data_space, (void *) internal_object->string.pointer, 161 ACPI_MEMCPY ((void *) data_space,
113 (acpi_size) internal_object->string.length + 1); 162 (void *) internal_object->string.pointer,
163 (acpi_size) internal_object->string.length + 1);
114 break; 164 break;
115 165
116 166
@@ -118,10 +168,12 @@ acpi_ut_copy_isimple_to_esimple (
118 168
119 external_object->buffer.pointer = data_space; 169 external_object->buffer.pointer = data_space;
120 external_object->buffer.length = internal_object->buffer.length; 170 external_object->buffer.length = internal_object->buffer.length;
121 *buffer_space_used = ACPI_ROUND_UP_TO_NATIVE_WORD (internal_object->string.length); 171 *buffer_space_used = ACPI_ROUND_UP_TO_NATIVE_WORD (
172 internal_object->string.length);
122 173
123 ACPI_MEMCPY ((void *) data_space, (void *) internal_object->buffer.pointer, 174 ACPI_MEMCPY ((void *) data_space,
124 internal_object->buffer.length); 175 (void *) internal_object->buffer.pointer,
176 internal_object->buffer.length);
125 break; 177 break;
126 178
127 179
@@ -194,7 +246,7 @@ acpi_ut_copy_isimple_to_esimple (
194 * 246 *
195 ******************************************************************************/ 247 ******************************************************************************/
196 248
197acpi_status 249static acpi_status
198acpi_ut_copy_ielement_to_eelement ( 250acpi_ut_copy_ielement_to_eelement (
199 u8 object_type, 251 u8 object_type,
200 union acpi_operand_object *source_object, 252 union acpi_operand_object *source_object,
@@ -213,7 +265,7 @@ acpi_ut_copy_ielement_to_eelement (
213 265
214 this_index = state->pkg.index; 266 this_index = state->pkg.index;
215 target_object = (union acpi_object *) 267 target_object = (union acpi_object *)
216 &((union acpi_object *)(state->pkg.dest_object))->package.elements[this_index]; 268 &((union acpi_object *)(state->pkg.dest_object))->package.elements[this_index];
217 269
218 switch (object_type) { 270 switch (object_type) {
219 case ACPI_COPY_TYPE_SIMPLE: 271 case ACPI_COPY_TYPE_SIMPLE:
@@ -236,7 +288,8 @@ acpi_ut_copy_ielement_to_eelement (
236 */ 288 */
237 target_object->type = ACPI_TYPE_PACKAGE; 289 target_object->type = ACPI_TYPE_PACKAGE;
238 target_object->package.count = source_object->package.count; 290 target_object->package.count = source_object->package.count;
239 target_object->package.elements = ACPI_CAST_PTR (union acpi_object, info->free_space); 291 target_object->package.elements =
292 ACPI_CAST_PTR (union acpi_object, info->free_space);
240 293
241 /* 294 /*
242 * Pass the new package object back to the package walk routine 295 * Pass the new package object back to the package walk routine
@@ -248,7 +301,8 @@ acpi_ut_copy_ielement_to_eelement (
248 * update the buffer length counter 301 * update the buffer length counter
249 */ 302 */
250 object_space = ACPI_ROUND_UP_TO_NATIVE_WORD ( 303 object_space = ACPI_ROUND_UP_TO_NATIVE_WORD (
251 (acpi_size) target_object->package.count * sizeof (union acpi_object)); 304 (acpi_size) target_object->package.count *
305 sizeof (union acpi_object));
252 break; 306 break;
253 307
254 308
@@ -266,9 +320,9 @@ acpi_ut_copy_ielement_to_eelement (
266 * 320 *
267 * FUNCTION: acpi_ut_copy_ipackage_to_epackage 321 * FUNCTION: acpi_ut_copy_ipackage_to_epackage
268 * 322 *
269 * PARAMETERS: *internal_object - Pointer to the object we are returning 323 * PARAMETERS: internal_object - Pointer to the object we are returning
270 * *Buffer - Where the object is returned 324 * Buffer - Where the object is returned
271 * *space_used - Where the object length is returned 325 * space_used - Where the object length is returned
272 * 326 *
273 * RETURN: Status 327 * RETURN: Status
274 * 328 *
@@ -304,13 +358,15 @@ acpi_ut_copy_ipackage_to_epackage (
304 * Free space begins right after the first package 358 * Free space begins right after the first package
305 */ 359 */
306 info.length = ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (union acpi_object)); 360 info.length = ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (union acpi_object));
307 info.free_space = buffer + ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (union acpi_object)); 361 info.free_space = buffer + ACPI_ROUND_UP_TO_NATIVE_WORD (
362 sizeof (union acpi_object));
308 info.object_space = 0; 363 info.object_space = 0;
309 info.num_packages = 1; 364 info.num_packages = 1;
310 365
311 external_object->type = ACPI_GET_OBJECT_TYPE (internal_object); 366 external_object->type = ACPI_GET_OBJECT_TYPE (internal_object);
312 external_object->package.count = internal_object->package.count; 367 external_object->package.count = internal_object->package.count;
313 external_object->package.elements = ACPI_CAST_PTR (union acpi_object, info.free_space); 368 external_object->package.elements = ACPI_CAST_PTR (union acpi_object,
369 info.free_space);
314 370
315 /* 371 /*
316 * Leave room for an array of ACPI_OBJECTS in the buffer 372 * Leave room for an array of ACPI_OBJECTS in the buffer
@@ -333,8 +389,8 @@ acpi_ut_copy_ipackage_to_epackage (
333 * 389 *
334 * FUNCTION: acpi_ut_copy_iobject_to_eobject 390 * FUNCTION: acpi_ut_copy_iobject_to_eobject
335 * 391 *
336 * PARAMETERS: *internal_object - The internal object to be converted 392 * PARAMETERS: internal_object - The internal object to be converted
337 * *buffer_ptr - Where the object is returned 393 * buffer_ptr - Where the object is returned
338 * 394 *
339 * RETURN: Status 395 * RETURN: Status
340 * 396 *
@@ -367,10 +423,10 @@ acpi_ut_copy_iobject_to_eobject (
367 * Build a simple object (no nested objects) 423 * Build a simple object (no nested objects)
368 */ 424 */
369 status = acpi_ut_copy_isimple_to_esimple (internal_object, 425 status = acpi_ut_copy_isimple_to_esimple (internal_object,
370 (union acpi_object *) ret_buffer->pointer, 426 (union acpi_object *) ret_buffer->pointer,
371 ((u8 *) ret_buffer->pointer + 427 ((u8 *) ret_buffer->pointer +
372 ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (union acpi_object))), 428 ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (union acpi_object))),
373 &ret_buffer->length); 429 &ret_buffer->length);
374 /* 430 /*
375 * build simple does not include the object size in the length 431 * build simple does not include the object size in the length
376 * so we add it in here 432 * so we add it in here
@@ -386,8 +442,8 @@ acpi_ut_copy_iobject_to_eobject (
386 * 442 *
387 * FUNCTION: acpi_ut_copy_esimple_to_isimple 443 * FUNCTION: acpi_ut_copy_esimple_to_isimple
388 * 444 *
389 * PARAMETERS: *external_object - The external object to be converted 445 * PARAMETERS: external_object - The external object to be converted
390 * *internal_object - Where the internal object is returned 446 * ret_internal_object - Where the internal object is returned
391 * 447 *
392 * RETURN: Status 448 * RETURN: Status
393 * 449 *
@@ -398,7 +454,7 @@ acpi_ut_copy_iobject_to_eobject (
398 * 454 *
399 ******************************************************************************/ 455 ******************************************************************************/
400 456
401acpi_status 457static acpi_status
402acpi_ut_copy_esimple_to_isimple ( 458acpi_ut_copy_esimple_to_isimple (
403 union acpi_object *external_object, 459 union acpi_object *external_object,
404 union acpi_operand_object **ret_internal_object) 460 union acpi_operand_object **ret_internal_object)
@@ -417,7 +473,8 @@ acpi_ut_copy_esimple_to_isimple (
417 case ACPI_TYPE_BUFFER: 473 case ACPI_TYPE_BUFFER:
418 case ACPI_TYPE_INTEGER: 474 case ACPI_TYPE_INTEGER:
419 475
420 internal_object = acpi_ut_create_internal_object ((u8) external_object->type); 476 internal_object = acpi_ut_create_internal_object (
477 (u8) external_object->type);
421 if (!internal_object) { 478 if (!internal_object) {
422 return_ACPI_STATUS (AE_NO_MEMORY); 479 return_ACPI_STATUS (AE_NO_MEMORY);
423 } 480 }
@@ -486,7 +543,6 @@ error_exit:
486 543
487 544
488#ifdef ACPI_FUTURE_IMPLEMENTATION 545#ifdef ACPI_FUTURE_IMPLEMENTATION
489
490/* Code to convert packages that are parameters to control methods */ 546/* Code to convert packages that are parameters to control methods */
491 547
492/******************************************************************************* 548/*******************************************************************************
@@ -614,7 +670,7 @@ acpi_ut_copy_eobject_to_iobject (
614 * 670 *
615 ******************************************************************************/ 671 ******************************************************************************/
616 672
617acpi_status 673static acpi_status
618acpi_ut_copy_simple_object ( 674acpi_ut_copy_simple_object (
619 union acpi_operand_object *source_desc, 675 union acpi_operand_object *source_desc,
620 union acpi_operand_object *dest_desc) 676 union acpi_operand_object *dest_desc)
@@ -724,7 +780,7 @@ acpi_ut_copy_simple_object (
724 * 780 *
725 ******************************************************************************/ 781 ******************************************************************************/
726 782
727acpi_status 783static acpi_status
728acpi_ut_copy_ielement_to_ielement ( 784acpi_ut_copy_ielement_to_ielement (
729 u8 object_type, 785 u8 object_type,
730 union acpi_operand_object *source_object, 786 union acpi_operand_object *source_object,
@@ -837,7 +893,7 @@ error_exit:
837 * 893 *
838 ******************************************************************************/ 894 ******************************************************************************/
839 895
840acpi_status 896static acpi_status
841acpi_ut_copy_ipackage_to_ipackage ( 897acpi_ut_copy_ipackage_to_ipackage (
842 union acpi_operand_object *source_obj, 898 union acpi_operand_object *source_obj,
843 union acpi_operand_object *dest_obj, 899 union acpi_operand_object *dest_obj,
diff --git a/drivers/acpi/utilities/utdebug.c b/drivers/acpi/utilities/utdebug.c
index 985c5d045b78..794c7df3f2ad 100644
--- a/drivers/acpi/utilities/utdebug.c
+++ b/drivers/acpi/utilities/utdebug.c
@@ -56,7 +56,7 @@ static char *acpi_gbl_fn_entry_str = "----Entry";
56static char *acpi_gbl_fn_exit_str = "----Exit-"; 56static char *acpi_gbl_fn_exit_str = "----Exit-";
57 57
58 58
59/***************************************************************************** 59/*******************************************************************************
60 * 60 *
61 * FUNCTION: acpi_ut_init_stack_ptr_trace 61 * FUNCTION: acpi_ut_init_stack_ptr_trace
62 * 62 *
@@ -64,9 +64,9 @@ static char *acpi_gbl_fn_exit_str = "----Exit-";
64 * 64 *
65 * RETURN: None 65 * RETURN: None
66 * 66 *
67 * DESCRIPTION: Save the current stack pointer 67 * DESCRIPTION: Save the current CPU stack pointer at subsystem startup
68 * 68 *
69 ****************************************************************************/ 69 ******************************************************************************/
70 70
71void 71void
72acpi_ut_init_stack_ptr_trace ( 72acpi_ut_init_stack_ptr_trace (
@@ -79,7 +79,7 @@ acpi_ut_init_stack_ptr_trace (
79} 79}
80 80
81 81
82/***************************************************************************** 82/*******************************************************************************
83 * 83 *
84 * FUNCTION: acpi_ut_track_stack_ptr 84 * FUNCTION: acpi_ut_track_stack_ptr
85 * 85 *
@@ -87,9 +87,9 @@ acpi_ut_init_stack_ptr_trace (
87 * 87 *
88 * RETURN: None 88 * RETURN: None
89 * 89 *
90 * DESCRIPTION: Save the current stack pointer 90 * DESCRIPTION: Save the current CPU stack pointer
91 * 91 *
92 ****************************************************************************/ 92 ******************************************************************************/
93 93
94void 94void
95acpi_ut_track_stack_ptr ( 95acpi_ut_track_stack_ptr (
@@ -110,16 +110,16 @@ acpi_ut_track_stack_ptr (
110} 110}
111 111
112 112
113/***************************************************************************** 113/*******************************************************************************
114 * 114 *
115 * FUNCTION: acpi_ut_debug_print 115 * FUNCTION: acpi_ut_debug_print
116 * 116 *
117 * PARAMETERS: debug_level - Requested debug print level 117 * PARAMETERS: requested_debug_level - Requested debug print level
118 * proc_name - Caller's procedure name
119 * module_name - Caller's module name (for error output)
120 * line_number - Caller's line number (for error output) 118 * line_number - Caller's line number (for error output)
121 * component_id - Caller's component ID (for error output) 119 * dbg_info - Contains:
122 * 120 * proc_name - Caller's procedure name
121 * module_name - Caller's module name
122 * component_id - Caller's component ID
123 * Format - Printf format field 123 * Format - Printf format field
124 * ... - Optional printf arguments 124 * ... - Optional printf arguments
125 * 125 *
@@ -128,7 +128,7 @@ acpi_ut_track_stack_ptr (
128 * DESCRIPTION: Print error message with prefix consisting of the module name, 128 * DESCRIPTION: Print error message with prefix consisting of the module name,
129 * line number, and component ID. 129 * line number, and component ID.
130 * 130 *
131 ****************************************************************************/ 131 ******************************************************************************/
132 132
133void ACPI_INTERNAL_VAR_XFACE 133void ACPI_INTERNAL_VAR_XFACE
134acpi_ut_debug_print ( 134acpi_ut_debug_print (
@@ -157,7 +157,8 @@ acpi_ut_debug_print (
157 157
158 if (thread_id != acpi_gbl_prev_thread_id) { 158 if (thread_id != acpi_gbl_prev_thread_id) {
159 if (ACPI_LV_THREADS & acpi_dbg_level) { 159 if (ACPI_LV_THREADS & acpi_dbg_level) {
160 acpi_os_printf ("\n**** Context Switch from TID %X to TID %X ****\n\n", 160 acpi_os_printf (
161 "\n**** Context Switch from TID %X to TID %X ****\n\n",
161 acpi_gbl_prev_thread_id, thread_id); 162 acpi_gbl_prev_thread_id, thread_id);
162 } 163 }
163 164
@@ -174,15 +175,16 @@ acpi_ut_debug_print (
174 acpi_os_printf ("[%04lX] ", thread_id); 175 acpi_os_printf ("[%04lX] ", thread_id);
175 } 176 }
176 177
177 acpi_os_printf ("[%02ld] %-22.22s: ", acpi_gbl_nesting_level, dbg_info->proc_name); 178 acpi_os_printf ("[%02ld] %-22.22s: ",
179 acpi_gbl_nesting_level, dbg_info->proc_name);
178 180
179 va_start (args, format); 181 va_start (args, format);
180 acpi_os_vprintf (format, args); 182 acpi_os_vprintf (format, args);
181} 183}
182EXPORT_SYMBOL(acpi_ut_debug_print);
183 184
185EXPORT_SYMBOL(acpi_ut_debug_print);
184 186
185/***************************************************************************** 187/*******************************************************************************
186 * 188 *
187 * FUNCTION: acpi_ut_debug_print_raw 189 * FUNCTION: acpi_ut_debug_print_raw
188 * 190 *
@@ -200,7 +202,7 @@ EXPORT_SYMBOL(acpi_ut_debug_print);
200 * DESCRIPTION: Print message with no headers. Has same interface as 202 * DESCRIPTION: Print message with no headers. Has same interface as
201 * debug_print so that the same macros can be used. 203 * debug_print so that the same macros can be used.
202 * 204 *
203 ****************************************************************************/ 205 ******************************************************************************/
204 206
205void ACPI_INTERNAL_VAR_XFACE 207void ACPI_INTERNAL_VAR_XFACE
206acpi_ut_debug_print_raw ( 208acpi_ut_debug_print_raw (
@@ -224,7 +226,7 @@ acpi_ut_debug_print_raw (
224EXPORT_SYMBOL(acpi_ut_debug_print_raw); 226EXPORT_SYMBOL(acpi_ut_debug_print_raw);
225 227
226 228
227/***************************************************************************** 229/*******************************************************************************
228 * 230 *
229 * FUNCTION: acpi_ut_trace 231 * FUNCTION: acpi_ut_trace
230 * 232 *
@@ -239,7 +241,7 @@ EXPORT_SYMBOL(acpi_ut_debug_print_raw);
239 * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is 241 * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is
240 * set in debug_level 242 * set in debug_level
241 * 243 *
242 ****************************************************************************/ 244 ******************************************************************************/
243 245
244void 246void
245acpi_ut_trace ( 247acpi_ut_trace (
@@ -256,7 +258,7 @@ acpi_ut_trace (
256EXPORT_SYMBOL(acpi_ut_trace); 258EXPORT_SYMBOL(acpi_ut_trace);
257 259
258 260
259/***************************************************************************** 261/*******************************************************************************
260 * 262 *
261 * FUNCTION: acpi_ut_trace_ptr 263 * FUNCTION: acpi_ut_trace_ptr
262 * 264 *
@@ -272,7 +274,7 @@ EXPORT_SYMBOL(acpi_ut_trace);
272 * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is 274 * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is
273 * set in debug_level 275 * set in debug_level
274 * 276 *
275 ****************************************************************************/ 277 ******************************************************************************/
276 278
277void 279void
278acpi_ut_trace_ptr ( 280acpi_ut_trace_ptr (
@@ -288,7 +290,7 @@ acpi_ut_trace_ptr (
288} 290}
289 291
290 292
291/***************************************************************************** 293/*******************************************************************************
292 * 294 *
293 * FUNCTION: acpi_ut_trace_str 295 * FUNCTION: acpi_ut_trace_str
294 * 296 *
@@ -304,7 +306,7 @@ acpi_ut_trace_ptr (
304 * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is 306 * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is
305 * set in debug_level 307 * set in debug_level
306 * 308 *
307 ****************************************************************************/ 309 ******************************************************************************/
308 310
309void 311void
310acpi_ut_trace_str ( 312acpi_ut_trace_str (
@@ -321,7 +323,7 @@ acpi_ut_trace_str (
321} 323}
322 324
323 325
324/***************************************************************************** 326/*******************************************************************************
325 * 327 *
326 * FUNCTION: acpi_ut_trace_u32 328 * FUNCTION: acpi_ut_trace_u32
327 * 329 *
@@ -337,7 +339,7 @@ acpi_ut_trace_str (
337 * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is 339 * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is
338 * set in debug_level 340 * set in debug_level
339 * 341 *
340 ****************************************************************************/ 342 ******************************************************************************/
341 343
342void 344void
343acpi_ut_trace_u32 ( 345acpi_ut_trace_u32 (
@@ -354,7 +356,7 @@ acpi_ut_trace_u32 (
354} 356}
355 357
356 358
357/***************************************************************************** 359/*******************************************************************************
358 * 360 *
359 * FUNCTION: acpi_ut_exit 361 * FUNCTION: acpi_ut_exit
360 * 362 *
@@ -369,7 +371,7 @@ acpi_ut_trace_u32 (
369 * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is 371 * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
370 * set in debug_level 372 * set in debug_level
371 * 373 *
372 ****************************************************************************/ 374 ******************************************************************************/
373 375
374void 376void
375acpi_ut_exit ( 377acpi_ut_exit (
@@ -385,7 +387,7 @@ acpi_ut_exit (
385EXPORT_SYMBOL(acpi_ut_exit); 387EXPORT_SYMBOL(acpi_ut_exit);
386 388
387 389
388/***************************************************************************** 390/*******************************************************************************
389 * 391 *
390 * FUNCTION: acpi_ut_status_exit 392 * FUNCTION: acpi_ut_status_exit
391 * 393 *
@@ -401,7 +403,7 @@ EXPORT_SYMBOL(acpi_ut_exit);
401 * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is 403 * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
402 * set in debug_level. Prints exit status also. 404 * set in debug_level. Prints exit status also.
403 * 405 *
404 ****************************************************************************/ 406 ******************************************************************************/
405 407
406void 408void
407acpi_ut_status_exit ( 409acpi_ut_status_exit (
@@ -426,7 +428,7 @@ acpi_ut_status_exit (
426EXPORT_SYMBOL(acpi_ut_status_exit); 428EXPORT_SYMBOL(acpi_ut_status_exit);
427 429
428 430
429/***************************************************************************** 431/*******************************************************************************
430 * 432 *
431 * FUNCTION: acpi_ut_value_exit 433 * FUNCTION: acpi_ut_value_exit
432 * 434 *
@@ -442,7 +444,7 @@ EXPORT_SYMBOL(acpi_ut_status_exit);
442 * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is 444 * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
443 * set in debug_level. Prints exit value also. 445 * set in debug_level. Prints exit value also.
444 * 446 *
445 ****************************************************************************/ 447 ******************************************************************************/
446 448
447void 449void
448acpi_ut_value_exit ( 450acpi_ut_value_exit (
@@ -460,7 +462,7 @@ acpi_ut_value_exit (
460EXPORT_SYMBOL(acpi_ut_value_exit); 462EXPORT_SYMBOL(acpi_ut_value_exit);
461 463
462 464
463/***************************************************************************** 465/*******************************************************************************
464 * 466 *
465 * FUNCTION: acpi_ut_ptr_exit 467 * FUNCTION: acpi_ut_ptr_exit
466 * 468 *
@@ -469,14 +471,14 @@ EXPORT_SYMBOL(acpi_ut_value_exit);
469 * proc_name - Caller's procedure name 471 * proc_name - Caller's procedure name
470 * module_name - Caller's module name 472 * module_name - Caller's module name
471 * component_id - Caller's component ID 473 * component_id - Caller's component ID
472 * Value - Value to be printed with exit msg 474 * Ptr - Pointer to display
473 * 475 *
474 * RETURN: None 476 * RETURN: None
475 * 477 *
476 * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is 478 * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
477 * set in debug_level. Prints exit value also. 479 * set in debug_level. Prints exit value also.
478 * 480 *
479 ****************************************************************************/ 481 ******************************************************************************/
480 482
481void 483void
482acpi_ut_ptr_exit ( 484acpi_ut_ptr_exit (
@@ -494,7 +496,7 @@ acpi_ut_ptr_exit (
494#endif 496#endif
495 497
496 498
497/***************************************************************************** 499/*******************************************************************************
498 * 500 *
499 * FUNCTION: acpi_ut_dump_buffer 501 * FUNCTION: acpi_ut_dump_buffer
500 * 502 *
@@ -507,7 +509,7 @@ acpi_ut_ptr_exit (
507 * 509 *
508 * DESCRIPTION: Generic dump buffer in both hex and ascii. 510 * DESCRIPTION: Generic dump buffer in both hex and ascii.
509 * 511 *
510 ****************************************************************************/ 512 ******************************************************************************/
511 513
512void 514void
513acpi_ut_dump_buffer ( 515acpi_ut_dump_buffer (
@@ -533,34 +535,28 @@ acpi_ut_dump_buffer (
533 display = DB_BYTE_DISPLAY; 535 display = DB_BYTE_DISPLAY;
534 } 536 }
535 537
536 acpi_os_printf ("\nOffset Value\n"); 538 /* Nasty little dump buffer routine! */
537 539
538 /*
539 * Nasty little dump buffer routine!
540 */
541 while (i < count) { 540 while (i < count) {
542 /* Print current offset */ 541 /* Print current offset */
543 542
544 acpi_os_printf ("%05X ", (u32) i); 543 acpi_os_printf ("%6.4X: ", (u32) i);
545 544
546 /* Print 16 hex chars */ 545 /* Print 16 hex chars */
547 546
548 for (j = 0; j < 16;) { 547 for (j = 0; j < 16;) {
549 if (i + j >= count) { 548 if (i + j >= count) {
550 acpi_os_printf ("\n"); 549 /* Dump fill spaces */
551 return;
552 }
553 550
554 /* Make sure that the s8 doesn't get sign-extended! */ 551 acpi_os_printf ("%*s", ((display * 2) + 1), " ");
552 j += display;
553 continue;
554 }
555 555
556 switch (display) { 556 switch (display) {
557 /* Default is BYTE display */ 557 default: /* Default is BYTE display */
558 558
559 default: 559 acpi_os_printf ("%02X ", buffer[i + j]);
560
561 acpi_os_printf ("%02X ",
562 *((u8 *) &buffer[i + j]));
563 j += 1;
564 break; 560 break;
565 561
566 562
@@ -568,7 +564,6 @@ acpi_ut_dump_buffer (
568 564
569 ACPI_MOVE_16_TO_32 (&temp32, &buffer[i + j]); 565 ACPI_MOVE_16_TO_32 (&temp32, &buffer[i + j]);
570 acpi_os_printf ("%04X ", temp32); 566 acpi_os_printf ("%04X ", temp32);
571 j += 2;
572 break; 567 break;
573 568
574 569
@@ -576,7 +571,6 @@ acpi_ut_dump_buffer (
576 571
577 ACPI_MOVE_32_TO_32 (&temp32, &buffer[i + j]); 572 ACPI_MOVE_32_TO_32 (&temp32, &buffer[i + j]);
578 acpi_os_printf ("%08X ", temp32); 573 acpi_os_printf ("%08X ", temp32);
579 j += 4;
580 break; 574 break;
581 575
582 576
@@ -587,15 +581,17 @@ acpi_ut_dump_buffer (
587 581
588 ACPI_MOVE_32_TO_32 (&temp32, &buffer[i + j + 4]); 582 ACPI_MOVE_32_TO_32 (&temp32, &buffer[i + j + 4]);
589 acpi_os_printf ("%08X ", temp32); 583 acpi_os_printf ("%08X ", temp32);
590 j += 8;
591 break; 584 break;
592 } 585 }
586
587 j += display;
593 } 588 }
594 589
595 /* 590 /*
596 * Print the ASCII equivalent characters 591 * Print the ASCII equivalent characters
597 * But watch out for the bad unprintable ones... 592 * But watch out for the bad unprintable ones...
598 */ 593 */
594 acpi_os_printf (" ");
599 for (j = 0; j < 16; j++) { 595 for (j = 0; j < 16; j++) {
600 if (i + j >= count) { 596 if (i + j >= count) {
601 acpi_os_printf ("\n"); 597 acpi_os_printf ("\n");
diff --git a/drivers/acpi/utilities/utdelete.c b/drivers/acpi/utilities/utdelete.c
index 9a52ad52a23a..bc5403022681 100644
--- a/drivers/acpi/utilities/utdelete.c
+++ b/drivers/acpi/utilities/utdelete.c
@@ -51,12 +51,23 @@
51#define _COMPONENT ACPI_UTILITIES 51#define _COMPONENT ACPI_UTILITIES
52 ACPI_MODULE_NAME ("utdelete") 52 ACPI_MODULE_NAME ("utdelete")
53 53
54/* Local prototypes */
55
56static void
57acpi_ut_delete_internal_obj (
58 union acpi_operand_object *object);
59
60static void
61acpi_ut_update_ref_count (
62 union acpi_operand_object *object,
63 u32 action);
64
54 65
55/******************************************************************************* 66/*******************************************************************************
56 * 67 *
57 * FUNCTION: acpi_ut_delete_internal_obj 68 * FUNCTION: acpi_ut_delete_internal_obj
58 * 69 *
59 * PARAMETERS: *Object - Pointer to the list to be deleted 70 * PARAMETERS: Object - Object to be deleted
60 * 71 *
61 * RETURN: None 72 * RETURN: None
62 * 73 *
@@ -65,7 +76,7 @@
65 * 76 *
66 ******************************************************************************/ 77 ******************************************************************************/
67 78
68void 79static void
69acpi_ut_delete_internal_obj ( 80acpi_ut_delete_internal_obj (
70 union acpi_operand_object *object) 81 union acpi_operand_object *object)
71{ 82{
@@ -152,7 +163,8 @@ acpi_ut_delete_internal_obj (
152 163
153 case ACPI_TYPE_MUTEX: 164 case ACPI_TYPE_MUTEX:
154 165
155 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "***** Mutex %p, Semaphore %p\n", 166 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
167 "***** Mutex %p, Semaphore %p\n",
156 object, object->mutex.semaphore)); 168 object, object->mutex.semaphore));
157 169
158 acpi_ex_unlink_mutex (object); 170 acpi_ex_unlink_mutex (object);
@@ -162,7 +174,8 @@ acpi_ut_delete_internal_obj (
162 174
163 case ACPI_TYPE_EVENT: 175 case ACPI_TYPE_EVENT:
164 176
165 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "***** Event %p, Semaphore %p\n", 177 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
178 "***** Event %p, Semaphore %p\n",
166 object, object->event.semaphore)); 179 object, object->event.semaphore));
167 180
168 (void) acpi_os_delete_semaphore (object->event.semaphore); 181 (void) acpi_os_delete_semaphore (object->event.semaphore);
@@ -172,7 +185,8 @@ acpi_ut_delete_internal_obj (
172 185
173 case ACPI_TYPE_METHOD: 186 case ACPI_TYPE_METHOD:
174 187
175 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "***** Method %p\n", object)); 188 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
189 "***** Method %p\n", object));
176 190
177 /* Delete the method semaphore if it exists */ 191 /* Delete the method semaphore if it exists */
178 192
@@ -185,7 +199,8 @@ acpi_ut_delete_internal_obj (
185 199
186 case ACPI_TYPE_REGION: 200 case ACPI_TYPE_REGION:
187 201
188 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "***** Region %p\n", object)); 202 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
203 "***** Region %p\n", object));
189 204
190 second_desc = acpi_ns_get_secondary_object (object); 205 second_desc = acpi_ns_get_secondary_object (object);
191 if (second_desc) { 206 if (second_desc) {
@@ -212,7 +227,8 @@ acpi_ut_delete_internal_obj (
212 227
213 case ACPI_TYPE_BUFFER_FIELD: 228 case ACPI_TYPE_BUFFER_FIELD:
214 229
215 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "***** Buffer Field %p\n", object)); 230 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
231 "***** Buffer Field %p\n", object));
216 232
217 second_desc = acpi_ns_get_secondary_object (object); 233 second_desc = acpi_ns_get_secondary_object (object);
218 if (second_desc) { 234 if (second_desc) {
@@ -247,7 +263,7 @@ acpi_ut_delete_internal_obj (
247 * 263 *
248 * FUNCTION: acpi_ut_delete_internal_object_list 264 * FUNCTION: acpi_ut_delete_internal_object_list
249 * 265 *
250 * PARAMETERS: *obj_list - Pointer to the list to be deleted 266 * PARAMETERS: obj_list - Pointer to the list to be deleted
251 * 267 *
252 * RETURN: None 268 * RETURN: None
253 * 269 *
@@ -283,7 +299,7 @@ acpi_ut_delete_internal_object_list (
283 * 299 *
284 * FUNCTION: acpi_ut_update_ref_count 300 * FUNCTION: acpi_ut_update_ref_count
285 * 301 *
286 * PARAMETERS: *Object - Object whose ref count is to be updated 302 * PARAMETERS: Object - Object whose ref count is to be updated
287 * Action - What to do 303 * Action - What to do
288 * 304 *
289 * RETURN: New ref count 305 * RETURN: New ref count
@@ -312,7 +328,8 @@ acpi_ut_update_ref_count (
312 new_count = count; 328 new_count = count;
313 329
314 /* 330 /*
315 * Perform the reference count action (increment, decrement, or force delete) 331 * Perform the reference count action
332 * (increment, decrement, or force delete)
316 */ 333 */
317 switch (action) { 334 switch (action) {
318 335
@@ -321,7 +338,8 @@ acpi_ut_update_ref_count (
321 new_count++; 338 new_count++;
322 object->common.reference_count = new_count; 339 object->common.reference_count = new_count;
323 340
324 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Obj %p Refs=%X, [Incremented]\n", 341 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
342 "Obj %p Refs=%X, [Incremented]\n",
325 object, new_count)); 343 object, new_count));
326 break; 344 break;
327 345
@@ -329,7 +347,8 @@ acpi_ut_update_ref_count (
329 case REF_DECREMENT: 347 case REF_DECREMENT:
330 348
331 if (count < 1) { 349 if (count < 1) {
332 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Obj %p Refs=%X, can't decrement! (Set to 0)\n", 350 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
351 "Obj %p Refs=%X, can't decrement! (Set to 0)\n",
333 object, new_count)); 352 object, new_count));
334 353
335 new_count = 0; 354 new_count = 0;
@@ -337,12 +356,14 @@ acpi_ut_update_ref_count (
337 else { 356 else {
338 new_count--; 357 new_count--;
339 358
340 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Obj %p Refs=%X, [Decremented]\n", 359 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
360 "Obj %p Refs=%X, [Decremented]\n",
341 object, new_count)); 361 object, new_count));
342 } 362 }
343 363
344 if (ACPI_GET_OBJECT_TYPE (object) == ACPI_TYPE_METHOD) { 364 if (ACPI_GET_OBJECT_TYPE (object) == ACPI_TYPE_METHOD) {
345 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Method Obj %p Refs=%X, [Decremented]\n", 365 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
366 "Method Obj %p Refs=%X, [Decremented]\n",
346 object, new_count)); 367 object, new_count));
347 } 368 }
348 369
@@ -356,7 +377,8 @@ acpi_ut_update_ref_count (
356 377
357 case REF_FORCE_DELETE: 378 case REF_FORCE_DELETE:
358 379
359 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Obj %p Refs=%X, Force delete! (Set to 0)\n", 380 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
381 "Obj %p Refs=%X, Force delete! (Set to 0)\n",
360 object, count)); 382 object, count));
361 383
362 new_count = 0; 384 new_count = 0;
@@ -390,7 +412,7 @@ acpi_ut_update_ref_count (
390 * 412 *
391 * FUNCTION: acpi_ut_update_object_reference 413 * FUNCTION: acpi_ut_update_object_reference
392 * 414 *
393 * PARAMETERS: *Object - Increment ref count for this object 415 * PARAMETERS: Object - Increment ref count for this object
394 * and all sub-objects 416 * and all sub-objects
395 * Action - Either REF_INCREMENT or REF_DECREMENT or 417 * Action - Either REF_INCREMENT or REF_DECREMENT or
396 * REF_FORCE_DELETE 418 * REF_FORCE_DELETE
@@ -431,7 +453,8 @@ acpi_ut_update_object_reference (
431 /* Make sure that this isn't a namespace handle */ 453 /* Make sure that this isn't a namespace handle */
432 454
433 if (ACPI_GET_DESCRIPTOR_TYPE (object) == ACPI_DESC_TYPE_NAMED) { 455 if (ACPI_GET_DESCRIPTOR_TYPE (object) == ACPI_DESC_TYPE_NAMED) {
434 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Object %p is NS handle\n", object)); 456 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
457 "Object %p is NS handle\n", object));
435 return_ACPI_STATUS (AE_OK); 458 return_ACPI_STATUS (AE_OK);
436 } 459 }
437 460
@@ -614,8 +637,8 @@ error_exit:
614 * 637 *
615 * FUNCTION: acpi_ut_add_reference 638 * FUNCTION: acpi_ut_add_reference
616 * 639 *
617 * PARAMETERS: *Object - Object whose reference count is to be 640 * PARAMETERS: Object - Object whose reference count is to be
618 * incremented 641 * incremented
619 * 642 *
620 * RETURN: None 643 * RETURN: None
621 * 644 *
@@ -652,7 +675,7 @@ acpi_ut_add_reference (
652 * 675 *
653 * FUNCTION: acpi_ut_remove_reference 676 * FUNCTION: acpi_ut_remove_reference
654 * 677 *
655 * PARAMETERS: *Object - Object whose ref count will be decremented 678 * PARAMETERS: Object - Object whose ref count will be decremented
656 * 679 *
657 * RETURN: None 680 * RETURN: None
658 * 681 *
diff --git a/drivers/acpi/utilities/uteval.c b/drivers/acpi/utilities/uteval.c
index ead27d2c4d18..00046dd5d925 100644
--- a/drivers/acpi/utilities/uteval.c
+++ b/drivers/acpi/utilities/uteval.c
@@ -50,6 +50,19 @@
50#define _COMPONENT ACPI_UTILITIES 50#define _COMPONENT ACPI_UTILITIES
51 ACPI_MODULE_NAME ("uteval") 51 ACPI_MODULE_NAME ("uteval")
52 52
53/* Local prototypes */
54
55static void
56acpi_ut_copy_id_string (
57 char *destination,
58 char *source,
59 acpi_size max_length);
60
61static acpi_status
62acpi_ut_translate_one_cid (
63 union acpi_operand_object *obj_desc,
64 struct acpi_compatible_id *one_cid);
65
53 66
54/******************************************************************************* 67/*******************************************************************************
55 * 68 *
@@ -237,9 +250,9 @@ acpi_ut_evaluate_object (
237 * 250 *
238 * FUNCTION: acpi_ut_evaluate_numeric_object 251 * FUNCTION: acpi_ut_evaluate_numeric_object
239 * 252 *
240 * PARAMETERS: *object_name - Object name to be evaluated 253 * PARAMETERS: object_name - Object name to be evaluated
241 * device_node - Node for the device 254 * device_node - Node for the device
242 * *Address - Where the value is returned 255 * Address - Where the value is returned
243 * 256 *
244 * RETURN: Status 257 * RETURN: Status
245 * 258 *
@@ -303,7 +316,6 @@ acpi_ut_copy_id_string (
303 acpi_size max_length) 316 acpi_size max_length)
304{ 317{
305 318
306
307 /* 319 /*
308 * Workaround for ID strings that have a leading asterisk. This construct 320 * Workaround for ID strings that have a leading asterisk. This construct
309 * is not allowed by the ACPI specification (ID strings must be 321 * is not allowed by the ACPI specification (ID strings must be
@@ -325,7 +337,7 @@ acpi_ut_copy_id_string (
325 * FUNCTION: acpi_ut_execute_HID 337 * FUNCTION: acpi_ut_execute_HID
326 * 338 *
327 * PARAMETERS: device_node - Node for the device 339 * PARAMETERS: device_node - Node for the device
328 * *Hid - Where the HID is returned 340 * Hid - Where the HID is returned
329 * 341 *
330 * RETURN: Status 342 * RETURN: Status
331 * 343 *
@@ -429,7 +441,7 @@ acpi_ut_translate_one_cid (
429 * FUNCTION: acpi_ut_execute_CID 441 * FUNCTION: acpi_ut_execute_CID
430 * 442 *
431 * PARAMETERS: device_node - Node for the device 443 * PARAMETERS: device_node - Node for the device
432 * *Cid - Where the CID is returned 444 * return_cid_list - Where the CID list is returned
433 * 445 *
434 * RETURN: Status 446 * RETURN: Status
435 * 447 *
@@ -488,10 +500,10 @@ acpi_ut_execute_CID (
488 cid_list->size = size; 500 cid_list->size = size;
489 501
490 /* 502 /*
491 * A _CID can return either a single compatible ID or a package of compatible 503 * A _CID can return either a single compatible ID or a package of
492 * IDs. Each compatible ID can be one of the following: 504 * compatible IDs. Each compatible ID can be one of the following:
493 * -- Number (32 bit compressed EISA ID) or 505 * 1) Integer (32 bit compressed EISA ID) or
494 * -- String (PCI ID format, e.g. "PCI\VEN_vvvv&DEV_dddd&SUBSYS_ssssssss"). 506 * 2) String (PCI ID format, e.g. "PCI\VEN_vvvv&DEV_dddd&SUBSYS_ssssssss")
495 */ 507 */
496 508
497 /* The _CID object can be either a single CID or a package (list) of CIDs */ 509 /* The _CID object can be either a single CID or a package (list) of CIDs */
@@ -534,7 +546,7 @@ acpi_ut_execute_CID (
534 * FUNCTION: acpi_ut_execute_UID 546 * FUNCTION: acpi_ut_execute_UID
535 * 547 *
536 * PARAMETERS: device_node - Node for the device 548 * PARAMETERS: device_node - Node for the device
537 * *Uid - Where the UID is returned 549 * Uid - Where the UID is returned
538 * 550 *
539 * RETURN: Status 551 * RETURN: Status
540 * 552 *
@@ -587,7 +599,7 @@ acpi_ut_execute_UID (
587 * FUNCTION: acpi_ut_execute_STA 599 * FUNCTION: acpi_ut_execute_STA
588 * 600 *
589 * PARAMETERS: device_node - Node for the device 601 * PARAMETERS: device_node - Node for the device
590 * *Flags - Where the status flags are returned 602 * Flags - Where the status flags are returned
591 * 603 *
592 * RETURN: Status 604 * RETURN: Status
593 * 605 *
@@ -641,7 +653,7 @@ acpi_ut_execute_STA (
641 * FUNCTION: acpi_ut_execute_Sxds 653 * FUNCTION: acpi_ut_execute_Sxds
642 * 654 *
643 * PARAMETERS: device_node - Node for the device 655 * PARAMETERS: device_node - Node for the device
644 * *Flags - Where the status flags are returned 656 * Flags - Where the status flags are returned
645 * 657 *
646 * RETURN: Status 658 * RETURN: Status
647 * 659 *
diff --git a/drivers/acpi/utilities/utglobal.c b/drivers/acpi/utilities/utglobal.c
index 25b0f8ae1bc6..4146019b543f 100644
--- a/drivers/acpi/utilities/utglobal.c
+++ b/drivers/acpi/utilities/utglobal.c
@@ -44,7 +44,6 @@
44#define DEFINE_ACPI_GLOBALS 44#define DEFINE_ACPI_GLOBALS
45 45
46#include <linux/module.h> 46#include <linux/module.h>
47
48#include <acpi/acpi.h> 47#include <acpi/acpi.h>
49#include <acpi/acnamesp.h> 48#include <acpi/acnamesp.h>
50 49
@@ -52,13 +51,14 @@
52 ACPI_MODULE_NAME ("utglobal") 51 ACPI_MODULE_NAME ("utglobal")
53 52
54 53
55/****************************************************************************** 54/*******************************************************************************
56 * 55 *
57 * FUNCTION: acpi_format_exception 56 * FUNCTION: acpi_format_exception
58 * 57 *
59 * PARAMETERS: Status - The acpi_status code to be formatted 58 * PARAMETERS: Status - The acpi_status code to be formatted
60 * 59 *
61 * RETURN: A string containing the exception text 60 * RETURN: A string containing the exception text. A valid pointer is
61 * always returned.
62 * 62 *
63 * DESCRIPTION: This function translates an ACPI exception into an ASCII string. 63 * DESCRIPTION: This function translates an ACPI exception into an ASCII string.
64 * 64 *
@@ -68,8 +68,8 @@ const char *
68acpi_format_exception ( 68acpi_format_exception (
69 acpi_status status) 69 acpi_status status)
70{ 70{
71 const char *exception = "UNKNOWN_STATUS_CODE";
72 acpi_status sub_status; 71 acpi_status sub_status;
72 const char *exception = NULL;
73 73
74 74
75 ACPI_FUNCTION_NAME ("format_exception"); 75 ACPI_FUNCTION_NAME ("format_exception");
@@ -82,57 +82,55 @@ acpi_format_exception (
82 82
83 if (sub_status <= AE_CODE_ENV_MAX) { 83 if (sub_status <= AE_CODE_ENV_MAX) {
84 exception = acpi_gbl_exception_names_env [sub_status]; 84 exception = acpi_gbl_exception_names_env [sub_status];
85 break;
86 } 85 }
87 goto unknown; 86 break;
88 87
89 case AE_CODE_PROGRAMMER: 88 case AE_CODE_PROGRAMMER:
90 89
91 if (sub_status <= AE_CODE_PGM_MAX) { 90 if (sub_status <= AE_CODE_PGM_MAX) {
92 exception = acpi_gbl_exception_names_pgm [sub_status -1]; 91 exception = acpi_gbl_exception_names_pgm [sub_status -1];
93 break;
94 } 92 }
95 goto unknown; 93 break;
96 94
97 case AE_CODE_ACPI_TABLES: 95 case AE_CODE_ACPI_TABLES:
98 96
99 if (sub_status <= AE_CODE_TBL_MAX) { 97 if (sub_status <= AE_CODE_TBL_MAX) {
100 exception = acpi_gbl_exception_names_tbl [sub_status -1]; 98 exception = acpi_gbl_exception_names_tbl [sub_status -1];
101 break;
102 } 99 }
103 goto unknown; 100 break;
104 101
105 case AE_CODE_AML: 102 case AE_CODE_AML:
106 103
107 if (sub_status <= AE_CODE_AML_MAX) { 104 if (sub_status <= AE_CODE_AML_MAX) {
108 exception = acpi_gbl_exception_names_aml [sub_status -1]; 105 exception = acpi_gbl_exception_names_aml [sub_status -1];
109 break;
110 } 106 }
111 goto unknown; 107 break;
112 108
113 case AE_CODE_CONTROL: 109 case AE_CODE_CONTROL:
114 110
115 if (sub_status <= AE_CODE_CTRL_MAX) { 111 if (sub_status <= AE_CODE_CTRL_MAX) {
116 exception = acpi_gbl_exception_names_ctrl [sub_status -1]; 112 exception = acpi_gbl_exception_names_ctrl [sub_status -1];
117 break;
118 } 113 }
119 goto unknown; 114 break;
120 115
121 default: 116 default:
122 goto unknown; 117 break;
123 } 118 }
124 119
120 if (!exception) {
121 /* Exception code was not recognized */
125 122
126 return ((const char *) exception); 123 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
124 "Unknown exception code: 0x%8.8X\n", status));
127 125
128unknown: 126 return ((const char *) "UNKNOWN_STATUS_CODE");
127 }
129 128
130 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown exception code: 0x%8.8X\n", status));
131 return ((const char *) exception); 129 return ((const char *) exception);
132} 130}
133 131
134 132
135/****************************************************************************** 133/*******************************************************************************
136 * 134 *
137 * Static global variable initialization. 135 * Static global variable initialization.
138 * 136 *
@@ -212,13 +210,12 @@ const char *acpi_gbl_valid_osi_strings[ACPI_NUM_OSI_STR
212}; 210};
213 211
214 212
215/****************************************************************************** 213/*******************************************************************************
216 * 214 *
217 * Namespace globals 215 * Namespace globals
218 * 216 *
219 ******************************************************************************/ 217 ******************************************************************************/
220 218
221
222/* 219/*
223 * Predefined ACPI Names (Built-in to the Interpreter) 220 * Predefined ACPI Names (Built-in to the Interpreter)
224 * 221 *
@@ -241,9 +238,11 @@ const struct acpi_predefined_names acpi_gbl_pre_defined_names[] =
241#if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY) 238#if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
242 {"_OSI", ACPI_TYPE_METHOD, (char *) 1}, 239 {"_OSI", ACPI_TYPE_METHOD, (char *) 1},
243#endif 240#endif
244 {NULL, ACPI_TYPE_ANY, NULL} /* Table terminator */
245};
246 241
242 /* Table terminator */
243
244 {NULL, ACPI_TYPE_ANY, NULL}
245};
247 246
248/* 247/*
249 * Properties of the ACPI Object Types, both internal and external. 248 * Properties of the ACPI Object Types, both internal and external.
@@ -288,22 +287,25 @@ const u8 acpi_gbl_ns_properties[] =
288/* Hex to ASCII conversion table */ 287/* Hex to ASCII conversion table */
289 288
290static const char acpi_gbl_hex_to_ascii[] = 289static const char acpi_gbl_hex_to_ascii[] =
291 {'0','1','2','3','4','5','6','7', 290{
292 '8','9','A','B','C','D','E','F'}; 291 '0','1','2','3','4','5','6','7',
292 '8','9','A','B','C','D','E','F'
293};
294
293 295
294/***************************************************************************** 296/*******************************************************************************
295 * 297 *
296 * FUNCTION: acpi_ut_hex_to_ascii_char 298 * FUNCTION: acpi_ut_hex_to_ascii_char
297 * 299 *
298 * PARAMETERS: Integer - Contains the hex digit 300 * PARAMETERS: Integer - Contains the hex digit
299 * Position - bit position of the digit within the 301 * Position - bit position of the digit within the
300 * integer 302 * integer (multiple of 4)
301 * 303 *
302 * RETURN: Ascii character 304 * RETURN: The converted Ascii character
303 * 305 *
304 * DESCRIPTION: Convert a hex digit to an ascii character 306 * DESCRIPTION: Convert a hex digit to an Ascii character
305 * 307 *
306 ****************************************************************************/ 308 ******************************************************************************/
307 309
308char 310char
309acpi_ut_hex_to_ascii_char ( 311acpi_ut_hex_to_ascii_char (
@@ -315,7 +317,7 @@ acpi_ut_hex_to_ascii_char (
315} 317}
316 318
317 319
318/****************************************************************************** 320/*******************************************************************************
319 * 321 *
320 * Table name globals 322 * Table name globals
321 * 323 *
@@ -324,7 +326,7 @@ acpi_ut_hex_to_ascii_char (
324 * that are not used by the subsystem are simply ignored. 326 * that are not used by the subsystem are simply ignored.
325 * 327 *
326 * Do NOT add any table to this list that is not consumed directly by this 328 * Do NOT add any table to this list that is not consumed directly by this
327 * subsystem. 329 * subsystem (No MADT, ECDT, SBST, etc.)
328 * 330 *
329 ******************************************************************************/ 331 ******************************************************************************/
330 332
@@ -391,7 +393,7 @@ struct acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVE
391 /* ACPI_EVENT_RTC */ {ACPI_BITREG_RT_CLOCK_STATUS, ACPI_BITREG_RT_CLOCK_ENABLE, ACPI_BITMASK_RT_CLOCK_STATUS, ACPI_BITMASK_RT_CLOCK_ENABLE}, 393 /* ACPI_EVENT_RTC */ {ACPI_BITREG_RT_CLOCK_STATUS, ACPI_BITREG_RT_CLOCK_ENABLE, ACPI_BITMASK_RT_CLOCK_STATUS, ACPI_BITMASK_RT_CLOCK_ENABLE},
392}; 394};
393 395
394/***************************************************************************** 396/*******************************************************************************
395 * 397 *
396 * FUNCTION: acpi_ut_get_region_name 398 * FUNCTION: acpi_ut_get_region_name
397 * 399 *
@@ -401,7 +403,7 @@ struct acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVE
401 * 403 *
402 * DESCRIPTION: Translate a Space ID into a name string (Debug only) 404 * DESCRIPTION: Translate a Space ID into a name string (Debug only)
403 * 405 *
404 ****************************************************************************/ 406 ******************************************************************************/
405 407
406/* Region type decoding */ 408/* Region type decoding */
407 409
@@ -429,7 +431,6 @@ acpi_ut_get_region_name (
429 { 431 {
430 return ("user_defined_region"); 432 return ("user_defined_region");
431 } 433 }
432
433 else if (space_id >= ACPI_NUM_PREDEFINED_REGIONS) 434 else if (space_id >= ACPI_NUM_PREDEFINED_REGIONS)
434 { 435 {
435 return ("invalid_space_id"); 436 return ("invalid_space_id");
@@ -439,7 +440,7 @@ acpi_ut_get_region_name (
439} 440}
440 441
441 442
442/***************************************************************************** 443/*******************************************************************************
443 * 444 *
444 * FUNCTION: acpi_ut_get_event_name 445 * FUNCTION: acpi_ut_get_event_name
445 * 446 *
@@ -449,7 +450,7 @@ acpi_ut_get_region_name (
449 * 450 *
450 * DESCRIPTION: Translate a Event ID into a name string (Debug only) 451 * DESCRIPTION: Translate a Event ID into a name string (Debug only)
451 * 452 *
452 ****************************************************************************/ 453 ******************************************************************************/
453 454
454/* Event type decoding */ 455/* Event type decoding */
455 456
@@ -477,7 +478,7 @@ acpi_ut_get_event_name (
477} 478}
478 479
479 480
480/***************************************************************************** 481/*******************************************************************************
481 * 482 *
482 * FUNCTION: acpi_ut_get_type_name 483 * FUNCTION: acpi_ut_get_type_name
483 * 484 *
@@ -487,20 +488,21 @@ acpi_ut_get_event_name (
487 * 488 *
488 * DESCRIPTION: Translate a Type ID into a name string (Debug only) 489 * DESCRIPTION: Translate a Type ID into a name string (Debug only)
489 * 490 *
490 ****************************************************************************/ 491 ******************************************************************************/
491 492
492/* 493/*
493 * Elements of acpi_gbl_ns_type_names below must match 494 * Elements of acpi_gbl_ns_type_names below must match
494 * one-to-one with values of acpi_object_type 495 * one-to-one with values of acpi_object_type
495 * 496 *
496 * The type ACPI_TYPE_ANY (Untyped) is used as a "don't care" when searching; when 497 * The type ACPI_TYPE_ANY (Untyped) is used as a "don't care" when searching;
497 * stored in a table it really means that we have thus far seen no evidence to 498 * when stored in a table it really means that we have thus far seen no
498 * indicate what type is actually going to be stored for this entry. 499 * evidence to indicate what type is actually going to be stored for this entry.
499 */ 500 */
500static const char acpi_gbl_bad_type[] = "UNDEFINED"; 501static const char acpi_gbl_bad_type[] = "UNDEFINED";
501#define TYPE_NAME_LENGTH 12 /* Maximum length of each string */
502 502
503static const char *acpi_gbl_ns_type_names[] = /* printable names of ACPI types */ 503/* Printable names of the ACPI object types */
504
505static const char *acpi_gbl_ns_type_names[] =
504{ 506{
505 /* 00 */ "Untyped", 507 /* 00 */ "Untyped",
506 /* 01 */ "Integer", 508 /* 01 */ "Integer",
@@ -564,7 +566,7 @@ acpi_ut_get_object_type_name (
564} 566}
565 567
566 568
567/***************************************************************************** 569/*******************************************************************************
568 * 570 *
569 * FUNCTION: acpi_ut_get_node_name 571 * FUNCTION: acpi_ut_get_node_name
570 * 572 *
@@ -574,7 +576,7 @@ acpi_ut_get_object_type_name (
574 * 576 *
575 * DESCRIPTION: Validate the node and return the node's ACPI name. 577 * DESCRIPTION: Validate the node and return the node's ACPI name.
576 * 578 *
577 ****************************************************************************/ 579 ******************************************************************************/
578 580
579char * 581char *
580acpi_ut_get_node_name ( 582acpi_ut_get_node_name (
@@ -618,7 +620,7 @@ acpi_ut_get_node_name (
618} 620}
619 621
620 622
621/***************************************************************************** 623/*******************************************************************************
622 * 624 *
623 * FUNCTION: acpi_ut_get_descriptor_name 625 * FUNCTION: acpi_ut_get_descriptor_name
624 * 626 *
@@ -628,9 +630,11 @@ acpi_ut_get_node_name (
628 * 630 *
629 * DESCRIPTION: Validate object and return the descriptor type 631 * DESCRIPTION: Validate object and return the descriptor type
630 * 632 *
631 ****************************************************************************/ 633 ******************************************************************************/
634
635/* Printable names of object descriptor types */
632 636
633static const char *acpi_gbl_desc_type_names[] = /* printable names of descriptor types */ 637static const char *acpi_gbl_desc_type_names[] =
634{ 638{
635 /* 00 */ "Invalid", 639 /* 00 */ "Invalid",
636 /* 01 */ "Cached", 640 /* 01 */ "Cached",
@@ -676,17 +680,18 @@ acpi_ut_get_descriptor_name (
676 * Strings and procedures used for debug only 680 * Strings and procedures used for debug only
677 */ 681 */
678 682
679/***************************************************************************** 683/*******************************************************************************
680 * 684 *
681 * FUNCTION: acpi_ut_get_mutex_name 685 * FUNCTION: acpi_ut_get_mutex_name
682 * 686 *
683 * PARAMETERS: None. 687 * PARAMETERS: mutex_id - The predefined ID for this mutex.
684 * 688 *
685 * RETURN: Status 689 * RETURN: String containing the name of the mutex. Always returns a valid
690 * pointer.
686 * 691 *
687 * DESCRIPTION: Translate a mutex ID into a name string (Debug only) 692 * DESCRIPTION: Translate a mutex ID into a name string (Debug only)
688 * 693 *
689 ****************************************************************************/ 694 ******************************************************************************/
690 695
691char * 696char *
692acpi_ut_get_mutex_name ( 697acpi_ut_get_mutex_name (
@@ -700,21 +705,20 @@ acpi_ut_get_mutex_name (
700 705
701 return (acpi_gbl_mutex_names[mutex_id]); 706 return (acpi_gbl_mutex_names[mutex_id]);
702} 707}
703
704#endif 708#endif
705 709
706 710
707/***************************************************************************** 711/*******************************************************************************
708 * 712 *
709 * FUNCTION: acpi_ut_valid_object_type 713 * FUNCTION: acpi_ut_valid_object_type
710 * 714 *
711 * PARAMETERS: Type - Object type to be validated 715 * PARAMETERS: Type - Object type to be validated
712 * 716 *
713 * RETURN: TRUE if valid object type 717 * RETURN: TRUE if valid object type, FALSE otherwise
714 * 718 *
715 * DESCRIPTION: Validate an object type 719 * DESCRIPTION: Validate an object type
716 * 720 *
717 ****************************************************************************/ 721 ******************************************************************************/
718 722
719u8 723u8
720acpi_ut_valid_object_type ( 724acpi_ut_valid_object_type (
@@ -732,7 +736,7 @@ acpi_ut_valid_object_type (
732} 736}
733 737
734 738
735/**************************************************************************** 739/*******************************************************************************
736 * 740 *
737 * FUNCTION: acpi_ut_allocate_owner_id 741 * FUNCTION: acpi_ut_allocate_owner_id
738 * 742 *
@@ -740,7 +744,10 @@ acpi_ut_valid_object_type (
740 * 744 *
741 * DESCRIPTION: Allocate a table or method owner id 745 * DESCRIPTION: Allocate a table or method owner id
742 * 746 *
743 ***************************************************************************/ 747 * NOTE: this algorithm has a wraparound problem at 64_k method invocations, and
748 * should be revisited (TBD)
749 *
750 ******************************************************************************/
744 751
745acpi_owner_id 752acpi_owner_id
746acpi_ut_allocate_owner_id ( 753acpi_ut_allocate_owner_id (
@@ -796,16 +803,18 @@ acpi_ut_allocate_owner_id (
796} 803}
797 804
798 805
799/**************************************************************************** 806/*******************************************************************************
800 * 807 *
801 * FUNCTION: acpi_ut_init_globals 808 * FUNCTION: acpi_ut_init_globals
802 * 809 *
803 * PARAMETERS: none 810 * PARAMETERS: None
811 *
812 * RETURN: None
804 * 813 *
805 * DESCRIPTION: Init library globals. All globals that require specific 814 * DESCRIPTION: Init library globals. All globals that require specific
806 * initialization should be initialized here! 815 * initialization should be initialized here!
807 * 816 *
808 ***************************************************************************/ 817 ******************************************************************************/
809 818
810void 819void
811acpi_ut_init_globals ( 820acpi_ut_init_globals (
diff --git a/drivers/acpi/utilities/utinit.c b/drivers/acpi/utilities/utinit.c
index bdbadaf48d29..7f3713889ff0 100644
--- a/drivers/acpi/utilities/utinit.c
+++ b/drivers/acpi/utilities/utinit.c
@@ -49,19 +49,29 @@
49#define _COMPONENT ACPI_UTILITIES 49#define _COMPONENT ACPI_UTILITIES
50 ACPI_MODULE_NAME ("utinit") 50 ACPI_MODULE_NAME ("utinit")
51 51
52/* Local prototypes */
53
54static void
55acpi_ut_fadt_register_error (
56 char *register_name,
57 u32 value,
58 acpi_size offset);
59
60static void acpi_ut_terminate (
61 void);
62
52 63
53/******************************************************************************* 64/*******************************************************************************
54 * 65 *
55 * FUNCTION: acpi_ut_fadt_register_error 66 * FUNCTION: acpi_ut_fadt_register_error
56 * 67 *
57 * PARAMETERS: *register_name - Pointer to string identifying register 68 * PARAMETERS: register_name - Pointer to string identifying register
58 * Value - Actual register contents value 69 * Value - Actual register contents value
59 * acpi_test_spec_section - TDS section containing assertion 70 * Offset - Byte offset in the FADT
60 * acpi_assertion - Assertion number being tested
61 * 71 *
62 * RETURN: AE_BAD_VALUE 72 * RETURN: AE_BAD_VALUE
63 * 73 *
64 * DESCRIPTION: Display failure message and link failure to TDS assertion 74 * DESCRIPTION: Display failure message
65 * 75 *
66 ******************************************************************************/ 76 ******************************************************************************/
67 77
@@ -166,12 +176,13 @@ acpi_ut_validate_fadt (
166 * 176 *
167 * RETURN: none 177 * RETURN: none
168 * 178 *
169 * DESCRIPTION: free global memory 179 * DESCRIPTION: Free global memory
170 * 180 *
171 ******************************************************************************/ 181 ******************************************************************************/
172 182
173void 183static void
174acpi_ut_terminate (void) 184acpi_ut_terminate (
185 void)
175{ 186{
176 struct acpi_gpe_block_info *gpe_block; 187 struct acpi_gpe_block_info *gpe_block;
177 struct acpi_gpe_block_info *next_gpe_block; 188 struct acpi_gpe_block_info *next_gpe_block;
@@ -183,8 +194,6 @@ acpi_ut_terminate (void)
183 194
184 195
185 /* Free global tables, etc. */ 196 /* Free global tables, etc. */
186
187
188 /* Free global GPE blocks and related info structures */ 197 /* Free global GPE blocks and related info structures */
189 198
190 gpe_xrupt_info = acpi_gbl_gpe_xrupt_list_head; 199 gpe_xrupt_info = acpi_gbl_gpe_xrupt_list_head;
@@ -221,7 +230,8 @@ acpi_ut_terminate (void)
221 ******************************************************************************/ 230 ******************************************************************************/
222 231
223void 232void
224acpi_ut_subsystem_shutdown (void) 233acpi_ut_subsystem_shutdown (
234 void)
225{ 235{
226 236
227 ACPI_FUNCTION_TRACE ("ut_subsystem_shutdown"); 237 ACPI_FUNCTION_TRACE ("ut_subsystem_shutdown");
@@ -229,14 +239,16 @@ acpi_ut_subsystem_shutdown (void)
229 /* Just exit if subsystem is already shutdown */ 239 /* Just exit if subsystem is already shutdown */
230 240
231 if (acpi_gbl_shutdown) { 241 if (acpi_gbl_shutdown) {
232 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "ACPI Subsystem is already terminated\n")); 242 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
243 "ACPI Subsystem is already terminated\n"));
233 return_VOID; 244 return_VOID;
234 } 245 }
235 246
236 /* Subsystem appears active, go ahead and shut it down */ 247 /* Subsystem appears active, go ahead and shut it down */
237 248
238 acpi_gbl_shutdown = TRUE; 249 acpi_gbl_shutdown = TRUE;
239 ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Shutting down ACPI Subsystem...\n")); 250 ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
251 "Shutting down ACPI Subsystem...\n"));
240 252
241 /* Close the acpi_event Handling */ 253 /* Close the acpi_event Handling */
242 254
diff --git a/drivers/acpi/utilities/utmath.c b/drivers/acpi/utilities/utmath.c
index 2525c1a93547..0d527c91543c 100644
--- a/drivers/acpi/utilities/utmath.c
+++ b/drivers/acpi/utilities/utmath.c
@@ -259,6 +259,8 @@ acpi_ut_divide (
259 * 259 *
260 * FUNCTION: acpi_ut_short_divide, acpi_ut_divide 260 * FUNCTION: acpi_ut_short_divide, acpi_ut_divide
261 * 261 *
262 * PARAMETERS: See function headers above
263 *
262 * DESCRIPTION: Native versions of the ut_divide functions. Use these if either 264 * DESCRIPTION: Native versions of the ut_divide functions. Use these if either
263 * 1) The target is a 64-bit platform and therefore 64-bit 265 * 1) The target is a 64-bit platform and therefore 64-bit
264 * integer math is supported directly by the machine. 266 * integer math is supported directly by the machine.
diff --git a/drivers/acpi/utilities/utmisc.c b/drivers/acpi/utilities/utmisc.c
index f6598547389b..f6de4ed3d527 100644
--- a/drivers/acpi/utilities/utmisc.c
+++ b/drivers/acpi/utilities/utmisc.c
@@ -49,12 +49,57 @@
49#define _COMPONENT ACPI_UTILITIES 49#define _COMPONENT ACPI_UTILITIES
50 ACPI_MODULE_NAME ("utmisc") 50 ACPI_MODULE_NAME ("utmisc")
51 51
52/* Local prototypes */
53
54static acpi_status
55acpi_ut_create_mutex (
56 acpi_mutex_handle mutex_id);
57
58static acpi_status
59acpi_ut_delete_mutex (
60 acpi_mutex_handle mutex_id);
61
62
63/*******************************************************************************
64 *
65 * FUNCTION: acpi_ut_strupr (strupr)
66 *
67 * PARAMETERS: src_string - The source string to convert
68 *
69 * RETURN: Converted src_string (same as input pointer)
70 *
71 * DESCRIPTION: Convert string to uppercase
72 *
73 * NOTE: This is not a POSIX function, so it appears here, not in utclib.c
74 *
75 ******************************************************************************/
76
77char *
78acpi_ut_strupr (
79 char *src_string)
80{
81 char *string;
82
83
84 ACPI_FUNCTION_ENTRY ();
85
86
87 /* Walk entire string, uppercasing the letters */
88
89 for (string = src_string; *string; string++) {
90 *string = (char) ACPI_TOUPPER (*string);
91 }
92
93 return (src_string);
94}
95
52 96
53/******************************************************************************* 97/*******************************************************************************
54 * 98 *
55 * FUNCTION: acpi_ut_print_string 99 * FUNCTION: acpi_ut_print_string
56 * 100 *
57 * PARAMETERS: String - Null terminated ASCII string 101 * PARAMETERS: String - Null terminated ASCII string
102 * max_length - Maximum output length
58 * 103 *
59 * RETURN: None 104 * RETURN: None
60 * 105 *
@@ -148,6 +193,8 @@ acpi_ut_print_string (
148 * 193 *
149 * PARAMETERS: Value - Value to be converted 194 * PARAMETERS: Value - Value to be converted
150 * 195 *
196 * RETURN: u32 integer with bytes swapped
197 *
151 * DESCRIPTION: Convert a 32-bit value to big-endian (swap the bytes) 198 * DESCRIPTION: Convert a 32-bit value to big-endian (swap the bytes)
152 * 199 *
153 ******************************************************************************/ 200 ******************************************************************************/
@@ -160,7 +207,6 @@ acpi_ut_dword_byte_swap (
160 u32 value; 207 u32 value;
161 u8 bytes[4]; 208 u8 bytes[4];
162 } out; 209 } out;
163
164 union { 210 union {
165 u32 value; 211 u32 value;
166 u8 bytes[4]; 212 u8 bytes[4];
@@ -219,7 +265,8 @@ acpi_ut_set_integer_width (
219 * 265 *
220 * FUNCTION: acpi_ut_display_init_pathname 266 * FUNCTION: acpi_ut_display_init_pathname
221 * 267 *
222 * PARAMETERS: obj_handle - Handle whose pathname will be displayed 268 * PARAMETERS: Type - Object type of the node
269 * obj_handle - Handle whose pathname will be displayed
223 * Path - Additional path string to be appended. 270 * Path - Additional path string to be appended.
224 * (NULL if no extra path) 271 * (NULL if no extra path)
225 * 272 *
@@ -270,7 +317,8 @@ acpi_ut_display_init_pathname (
270 317
271 /* Print the object type and pathname */ 318 /* Print the object type and pathname */
272 319
273 acpi_os_printf ("%-12s %s", acpi_ut_get_type_name (type), (char *) buffer.pointer); 320 acpi_os_printf ("%-12s %s",
321 acpi_ut_get_type_name (type), (char *) buffer.pointer);
274 322
275 /* Extra path is used to append names like _STA, _INI, etc. */ 323 /* Extra path is used to append names like _STA, _INI, etc. */
276 324
@@ -288,9 +336,9 @@ acpi_ut_display_init_pathname (
288 * 336 *
289 * FUNCTION: acpi_ut_valid_acpi_name 337 * FUNCTION: acpi_ut_valid_acpi_name
290 * 338 *
291 * PARAMETERS: Character - The character to be examined 339 * PARAMETERS: Name - The name to be examined
292 * 340 *
293 * RETURN: 1 if Character may appear in a name, else 0 341 * RETURN: TRUE if the name is valid, FALSE otherwise
294 * 342 *
295 * DESCRIPTION: Check for a valid ACPI name. Each character must be one of: 343 * DESCRIPTION: Check for a valid ACPI name. Each character must be one of:
296 * 1) Upper case alpha 344 * 1) Upper case alpha
@@ -495,40 +543,6 @@ error_exit:
495 543
496/******************************************************************************* 544/*******************************************************************************
497 * 545 *
498 * FUNCTION: acpi_ut_strupr
499 *
500 * PARAMETERS: src_string - The source string to convert to
501 *
502 * RETURN: src_string
503 *
504 * DESCRIPTION: Convert string to uppercase
505 *
506 ******************************************************************************/
507#ifdef ACPI_FUTURE_USAGE
508char *
509acpi_ut_strupr (
510 char *src_string)
511{
512 char *string;
513
514
515 ACPI_FUNCTION_ENTRY ();
516
517
518 /* Walk entire string, uppercasing the letters */
519
520 for (string = src_string; *string; ) {
521 *string = (char) ACPI_TOUPPER (*string);
522 string++;
523 }
524
525 return (src_string);
526}
527#endif /* ACPI_FUTURE_USAGE */
528
529
530/*******************************************************************************
531 *
532 * FUNCTION: acpi_ut_mutex_initialize 546 * FUNCTION: acpi_ut_mutex_initialize
533 * 547 *
534 * PARAMETERS: None. 548 * PARAMETERS: None.
@@ -611,7 +625,7 @@ acpi_ut_mutex_terminate (
611 * 625 *
612 ******************************************************************************/ 626 ******************************************************************************/
613 627
614acpi_status 628static acpi_status
615acpi_ut_create_mutex ( 629acpi_ut_create_mutex (
616 acpi_mutex_handle mutex_id) 630 acpi_mutex_handle mutex_id)
617{ 631{
@@ -648,7 +662,7 @@ acpi_ut_create_mutex (
648 * 662 *
649 ******************************************************************************/ 663 ******************************************************************************/
650 664
651acpi_status 665static acpi_status
652acpi_ut_delete_mutex ( 666acpi_ut_delete_mutex (
653 acpi_mutex_handle mutex_id) 667 acpi_mutex_handle mutex_id)
654{ 668{
@@ -715,16 +729,16 @@ acpi_ut_acquire_mutex (
715 if (acpi_gbl_mutex_info[i].owner_id == this_thread_id) { 729 if (acpi_gbl_mutex_info[i].owner_id == this_thread_id) {
716 if (i == mutex_id) { 730 if (i == mutex_id) {
717 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, 731 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
718 "Mutex [%s] already acquired by this thread [%X]\n", 732 "Mutex [%s] already acquired by this thread [%X]\n",
719 acpi_ut_get_mutex_name (mutex_id), this_thread_id)); 733 acpi_ut_get_mutex_name (mutex_id), this_thread_id));
720 734
721 return (AE_ALREADY_ACQUIRED); 735 return (AE_ALREADY_ACQUIRED);
722 } 736 }
723 737
724 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, 738 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
725 "Invalid acquire order: Thread %X owns [%s], wants [%s]\n", 739 "Invalid acquire order: Thread %X owns [%s], wants [%s]\n",
726 this_thread_id, acpi_ut_get_mutex_name (i), 740 this_thread_id, acpi_ut_get_mutex_name (i),
727 acpi_ut_get_mutex_name (mutex_id))); 741 acpi_ut_get_mutex_name (mutex_id)));
728 742
729 return (AE_ACQUIRE_DEADLOCK); 743 return (AE_ACQUIRE_DEADLOCK);
730 } 744 }
@@ -733,22 +747,23 @@ acpi_ut_acquire_mutex (
733#endif 747#endif
734 748
735 ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, 749 ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX,
736 "Thread %X attempting to acquire Mutex [%s]\n", 750 "Thread %X attempting to acquire Mutex [%s]\n",
737 this_thread_id, acpi_ut_get_mutex_name (mutex_id))); 751 this_thread_id, acpi_ut_get_mutex_name (mutex_id)));
738 752
739 status = acpi_os_wait_semaphore (acpi_gbl_mutex_info[mutex_id].mutex, 753 status = acpi_os_wait_semaphore (acpi_gbl_mutex_info[mutex_id].mutex,
740 1, ACPI_WAIT_FOREVER); 754 1, ACPI_WAIT_FOREVER);
741 if (ACPI_SUCCESS (status)) { 755 if (ACPI_SUCCESS (status)) {
742 ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %X acquired Mutex [%s]\n", 756 ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %X acquired Mutex [%s]\n",
743 this_thread_id, acpi_ut_get_mutex_name (mutex_id))); 757 this_thread_id, acpi_ut_get_mutex_name (mutex_id)));
744 758
745 acpi_gbl_mutex_info[mutex_id].use_count++; 759 acpi_gbl_mutex_info[mutex_id].use_count++;
746 acpi_gbl_mutex_info[mutex_id].owner_id = this_thread_id; 760 acpi_gbl_mutex_info[mutex_id].owner_id = this_thread_id;
747 } 761 }
748 else { 762 else {
749 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Thread %X could not acquire Mutex [%s] %s\n", 763 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
750 this_thread_id, acpi_ut_get_mutex_name (mutex_id), 764 "Thread %X could not acquire Mutex [%s] %s\n",
751 acpi_format_exception (status))); 765 this_thread_id, acpi_ut_get_mutex_name (mutex_id),
766 acpi_format_exception (status)));
752 } 767 }
753 768
754 return (status); 769 return (status);
@@ -793,8 +808,8 @@ acpi_ut_release_mutex (
793 */ 808 */
794 if (acpi_gbl_mutex_info[mutex_id].owner_id == ACPI_MUTEX_NOT_ACQUIRED) { 809 if (acpi_gbl_mutex_info[mutex_id].owner_id == ACPI_MUTEX_NOT_ACQUIRED) {
795 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, 810 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
796 "Mutex [%s] is not acquired, cannot release\n", 811 "Mutex [%s] is not acquired, cannot release\n",
797 acpi_ut_get_mutex_name (mutex_id))); 812 acpi_ut_get_mutex_name (mutex_id)));
798 813
799 return (AE_NOT_ACQUIRED); 814 return (AE_NOT_ACQUIRED);
800 } 815 }
@@ -812,8 +827,8 @@ acpi_ut_release_mutex (
812 } 827 }
813 828
814 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, 829 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
815 "Invalid release order: owns [%s], releasing [%s]\n", 830 "Invalid release order: owns [%s], releasing [%s]\n",
816 acpi_ut_get_mutex_name (i), acpi_ut_get_mutex_name (mutex_id))); 831 acpi_ut_get_mutex_name (i), acpi_ut_get_mutex_name (mutex_id)));
817 832
818 return (AE_RELEASE_DEADLOCK); 833 return (AE_RELEASE_DEADLOCK);
819 } 834 }
@@ -826,13 +841,14 @@ acpi_ut_release_mutex (
826 status = acpi_os_signal_semaphore (acpi_gbl_mutex_info[mutex_id].mutex, 1); 841 status = acpi_os_signal_semaphore (acpi_gbl_mutex_info[mutex_id].mutex, 1);
827 842
828 if (ACPI_FAILURE (status)) { 843 if (ACPI_FAILURE (status)) {
829 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Thread %X could not release Mutex [%s] %s\n", 844 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
830 this_thread_id, acpi_ut_get_mutex_name (mutex_id), 845 "Thread %X could not release Mutex [%s] %s\n",
831 acpi_format_exception (status))); 846 this_thread_id, acpi_ut_get_mutex_name (mutex_id),
847 acpi_format_exception (status)));
832 } 848 }
833 else { 849 else {
834 ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %X released Mutex [%s]\n", 850 ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %X released Mutex [%s]\n",
835 this_thread_id, acpi_ut_get_mutex_name (mutex_id))); 851 this_thread_id, acpi_ut_get_mutex_name (mutex_id)));
836 } 852 }
837 853
838 return (status); 854 return (status);
@@ -843,11 +859,11 @@ acpi_ut_release_mutex (
843 * 859 *
844 * FUNCTION: acpi_ut_create_update_state_and_push 860 * FUNCTION: acpi_ut_create_update_state_and_push
845 * 861 *
846 * PARAMETERS: *Object - Object to be added to the new state 862 * PARAMETERS: Object - Object to be added to the new state
847 * Action - Increment/Decrement 863 * Action - Increment/Decrement
848 * state_list - List the state will be added to 864 * state_list - List the state will be added to
849 * 865 *
850 * RETURN: None 866 * RETURN: Status
851 * 867 *
852 * DESCRIPTION: Create a new state and push it 868 * DESCRIPTION: Create a new state and push it
853 * 869 *
@@ -885,15 +901,16 @@ acpi_ut_create_update_state_and_push (
885 * 901 *
886 * FUNCTION: acpi_ut_create_pkg_state_and_push 902 * FUNCTION: acpi_ut_create_pkg_state_and_push
887 * 903 *
888 * PARAMETERS: *Object - Object to be added to the new state 904 * PARAMETERS: Object - Object to be added to the new state
889 * Action - Increment/Decrement 905 * Action - Increment/Decrement
890 * state_list - List the state will be added to 906 * state_list - List the state will be added to
891 * 907 *
892 * RETURN: None 908 * RETURN: Status
893 * 909 *
894 * DESCRIPTION: Create a new state and push it 910 * DESCRIPTION: Create a new state and push it
895 * 911 *
896 ******************************************************************************/ 912 ******************************************************************************/
913
897#ifdef ACPI_FUTURE_USAGE 914#ifdef ACPI_FUTURE_USAGE
898acpi_status 915acpi_status
899acpi_ut_create_pkg_state_and_push ( 916acpi_ut_create_pkg_state_and_push (
@@ -925,7 +942,7 @@ acpi_ut_create_pkg_state_and_push (
925 * PARAMETERS: list_head - Head of the state stack 942 * PARAMETERS: list_head - Head of the state stack
926 * State - State object to push 943 * State - State object to push
927 * 944 *
928 * RETURN: Status 945 * RETURN: None
929 * 946 *
930 * DESCRIPTION: Push a state object onto a state stack 947 * DESCRIPTION: Push a state object onto a state stack
931 * 948 *
@@ -954,7 +971,7 @@ acpi_ut_push_generic_state (
954 * 971 *
955 * PARAMETERS: list_head - Head of the state stack 972 * PARAMETERS: list_head - Head of the state stack
956 * 973 *
957 * RETURN: Status 974 * RETURN: The popped state object
958 * 975 *
959 * DESCRIPTION: Pop a state object from a state stack 976 * DESCRIPTION: Pop a state object from a state stack
960 * 977 *
@@ -989,7 +1006,7 @@ acpi_ut_pop_generic_state (
989 * 1006 *
990 * PARAMETERS: None 1007 * PARAMETERS: None
991 * 1008 *
992 * RETURN: Status 1009 * RETURN: The new state object. NULL on failure.
993 * 1010 *
994 * DESCRIPTION: Create a generic state object. Attempt to obtain one from 1011 * DESCRIPTION: Create a generic state object. Attempt to obtain one from
995 * the global state cache; If none available, create a new one. 1012 * the global state cache; If none available, create a new one.
@@ -997,7 +1014,8 @@ acpi_ut_pop_generic_state (
997 ******************************************************************************/ 1014 ******************************************************************************/
998 1015
999union acpi_generic_state * 1016union acpi_generic_state *
1000acpi_ut_create_generic_state (void) 1017acpi_ut_create_generic_state (
1018 void)
1001{ 1019{
1002 union acpi_generic_state *state; 1020 union acpi_generic_state *state;
1003 1021
@@ -1023,7 +1041,7 @@ acpi_ut_create_generic_state (void)
1023 * 1041 *
1024 * PARAMETERS: None 1042 * PARAMETERS: None
1025 * 1043 *
1026 * RETURN: Thread State 1044 * RETURN: New Thread State. NULL on failure
1027 * 1045 *
1028 * DESCRIPTION: Create a "Thread State" - a flavor of the generic state used 1046 * DESCRIPTION: Create a "Thread State" - a flavor of the generic state used
1029 * to track per-thread info during method execution 1047 * to track per-thread info during method execution
@@ -1060,11 +1078,10 @@ acpi_ut_create_thread_state (
1060 * 1078 *
1061 * FUNCTION: acpi_ut_create_update_state 1079 * FUNCTION: acpi_ut_create_update_state
1062 * 1080 *
1063 * PARAMETERS: Object - Initial Object to be installed in the 1081 * PARAMETERS: Object - Initial Object to be installed in the state
1064 * state 1082 * Action - Update action to be performed
1065 * Action - Update action to be performed
1066 * 1083 *
1067 * RETURN: Status 1084 * RETURN: New state object, null on failure
1068 * 1085 *
1069 * DESCRIPTION: Create an "Update State" - a flavor of the generic state used 1086 * DESCRIPTION: Create an "Update State" - a flavor of the generic state used
1070 * to update reference counts and delete complex objects such 1087 * to update reference counts and delete complex objects such
@@ -1104,11 +1121,10 @@ acpi_ut_create_update_state (
1104 * 1121 *
1105 * FUNCTION: acpi_ut_create_pkg_state 1122 * FUNCTION: acpi_ut_create_pkg_state
1106 * 1123 *
1107 * PARAMETERS: Object - Initial Object to be installed in the 1124 * PARAMETERS: Object - Initial Object to be installed in the state
1108 * state 1125 * Action - Update action to be performed
1109 * Action - Update action to be performed
1110 * 1126 *
1111 * RETURN: Status 1127 * RETURN: New state object, null on failure
1112 * 1128 *
1113 * DESCRIPTION: Create a "Package State" 1129 * DESCRIPTION: Create a "Package State"
1114 * 1130 *
@@ -1151,7 +1167,7 @@ acpi_ut_create_pkg_state (
1151 * 1167 *
1152 * PARAMETERS: None 1168 * PARAMETERS: None
1153 * 1169 *
1154 * RETURN: Status 1170 * RETURN: New state object, null on failure
1155 * 1171 *
1156 * DESCRIPTION: Create a "Control State" - a flavor of the generic state used 1172 * DESCRIPTION: Create a "Control State" - a flavor of the generic state used
1157 * to support nested IF/WHILE constructs in the AML. 1173 * to support nested IF/WHILE constructs in the AML.
@@ -1190,7 +1206,7 @@ acpi_ut_create_control_state (
1190 * 1206 *
1191 * PARAMETERS: State - The state object to be deleted 1207 * PARAMETERS: State - The state object to be deleted
1192 * 1208 *
1193 * RETURN: Status 1209 * RETURN: None
1194 * 1210 *
1195 * DESCRIPTION: Put a state object back into the global state cache. The object 1211 * DESCRIPTION: Put a state object back into the global state cache. The object
1196 * is not actually freed at this time. 1212 * is not actually freed at this time.
@@ -1216,7 +1232,7 @@ acpi_ut_delete_generic_state (
1216 * 1232 *
1217 * PARAMETERS: None 1233 * PARAMETERS: None
1218 * 1234 *
1219 * RETURN: Status 1235 * RETURN: None
1220 * 1236 *
1221 * DESCRIPTION: Purge the global state object cache. Used during subsystem 1237 * DESCRIPTION: Purge the global state object cache. Used during subsystem
1222 * termination. 1238 * termination.
@@ -1240,7 +1256,10 @@ acpi_ut_delete_generic_state_cache (
1240 * 1256 *
1241 * FUNCTION: acpi_ut_walk_package_tree 1257 * FUNCTION: acpi_ut_walk_package_tree
1242 * 1258 *
1243 * PARAMETERS: obj_desc - The Package object on which to resolve refs 1259 * PARAMETERS: source_object - The package to walk
1260 * target_object - Target object (if package is being copied)
1261 * walk_callback - Called once for each package element
1262 * Context - Passed to the callback function
1244 * 1263 *
1245 * RETURN: Status 1264 * RETURN: Status
1246 * 1265 *
@@ -1359,7 +1378,7 @@ acpi_ut_walk_package_tree (
1359 * PARAMETERS: Buffer - Buffer to be scanned 1378 * PARAMETERS: Buffer - Buffer to be scanned
1360 * Length - number of bytes to examine 1379 * Length - number of bytes to examine
1361 * 1380 *
1362 * RETURN: checksum 1381 * RETURN: The generated checksum
1363 * 1382 *
1364 * DESCRIPTION: Generate a checksum on a raw buffer 1383 * DESCRIPTION: Generate a checksum on a raw buffer
1365 * 1384 *
@@ -1442,7 +1461,6 @@ acpi_ut_get_resource_end_tag (
1442 * PARAMETERS: module_name - Caller's module name (for error output) 1461 * PARAMETERS: module_name - Caller's module name (for error output)
1443 * line_number - Caller's line number (for error output) 1462 * line_number - Caller's line number (for error output)
1444 * component_id - Caller's component ID (for error output) 1463 * component_id - Caller's component ID (for error output)
1445 * Message - Error message to use on failure
1446 * 1464 *
1447 * RETURN: None 1465 * RETURN: None
1448 * 1466 *
@@ -1457,7 +1475,6 @@ acpi_ut_report_error (
1457 u32 component_id) 1475 u32 component_id)
1458{ 1476{
1459 1477
1460
1461 acpi_os_printf ("%8s-%04d: *** Error: ", module_name, line_number); 1478 acpi_os_printf ("%8s-%04d: *** Error: ", module_name, line_number);
1462} 1479}
1463 1480
@@ -1469,7 +1486,6 @@ acpi_ut_report_error (
1469 * PARAMETERS: module_name - Caller's module name (for error output) 1486 * PARAMETERS: module_name - Caller's module name (for error output)
1470 * line_number - Caller's line number (for error output) 1487 * line_number - Caller's line number (for error output)
1471 * component_id - Caller's component ID (for error output) 1488 * component_id - Caller's component ID (for error output)
1472 * Message - Error message to use on failure
1473 * 1489 *
1474 * RETURN: None 1490 * RETURN: None
1475 * 1491 *
@@ -1495,7 +1511,6 @@ acpi_ut_report_warning (
1495 * PARAMETERS: module_name - Caller's module name (for error output) 1511 * PARAMETERS: module_name - Caller's module name (for error output)
1496 * line_number - Caller's line number (for error output) 1512 * line_number - Caller's line number (for error output)
1497 * component_id - Caller's component ID (for error output) 1513 * component_id - Caller's component ID (for error output)
1498 * Message - Error message to use on failure
1499 * 1514 *
1500 * RETURN: None 1515 * RETURN: None
1501 * 1516 *
diff --git a/drivers/acpi/utilities/utobject.c b/drivers/acpi/utilities/utobject.c
index 9ee40a484e07..cd3899b9cc5a 100644
--- a/drivers/acpi/utilities/utobject.c
+++ b/drivers/acpi/utilities/utobject.c
@@ -50,6 +50,25 @@
50#define _COMPONENT ACPI_UTILITIES 50#define _COMPONENT ACPI_UTILITIES
51 ACPI_MODULE_NAME ("utobject") 51 ACPI_MODULE_NAME ("utobject")
52 52
53/* Local prototypes */
54
55static acpi_status
56acpi_ut_get_simple_object_size (
57 union acpi_operand_object *obj,
58 acpi_size *obj_length);
59
60static acpi_status
61acpi_ut_get_package_object_size (
62 union acpi_operand_object *obj,
63 acpi_size *obj_length);
64
65static acpi_status
66acpi_ut_get_element_length (
67 u8 object_type,
68 union acpi_operand_object *source_object,
69 union acpi_generic_state *state,
70 void *context);
71
53 72
54/******************************************************************************* 73/*******************************************************************************
55 * 74 *
@@ -60,7 +79,7 @@
60 * component_id - Component type of caller 79 * component_id - Component type of caller
61 * Type - ACPI Type of the new object 80 * Type - ACPI Type of the new object
62 * 81 *
63 * RETURN: Object - The new object. Null on failure 82 * RETURN: A new internal object, null on failure
64 * 83 *
65 * DESCRIPTION: Create and initialize a new internal object. 84 * DESCRIPTION: Create and initialize a new internal object.
66 * 85 *
@@ -83,7 +102,8 @@ acpi_ut_create_internal_object_dbg (
83 union acpi_operand_object *second_object; 102 union acpi_operand_object *second_object;
84 103
85 104
86 ACPI_FUNCTION_TRACE_STR ("ut_create_internal_object_dbg", acpi_ut_get_type_name (type)); 105 ACPI_FUNCTION_TRACE_STR ("ut_create_internal_object_dbg",
106 acpi_ut_get_type_name (type));
87 107
88 108
89 /* Allocate the raw object descriptor */ 109 /* Allocate the raw object descriptor */
@@ -99,7 +119,8 @@ acpi_ut_create_internal_object_dbg (
99 119
100 /* These types require a secondary object */ 120 /* These types require a secondary object */
101 121
102 second_object = acpi_ut_allocate_object_desc_dbg (module_name, line_number, component_id); 122 second_object = acpi_ut_allocate_object_desc_dbg (module_name,
123 line_number, component_id);
103 if (!second_object) { 124 if (!second_object) {
104 acpi_ut_delete_object_desc (object); 125 acpi_ut_delete_object_desc (object);
105 return_PTR (NULL); 126 return_PTR (NULL);
@@ -138,7 +159,7 @@ acpi_ut_create_internal_object_dbg (
138 * 159 *
139 * PARAMETERS: buffer_size - Size of buffer to be created 160 * PARAMETERS: buffer_size - Size of buffer to be created
140 * 161 *
141 * RETURN: Pointer to a new Buffer object 162 * RETURN: Pointer to a new Buffer object, null on failure
142 * 163 *
143 * DESCRIPTION: Create a fully initialized buffer object 164 * DESCRIPTION: Create a fully initialized buffer object
144 * 165 *
@@ -192,9 +213,9 @@ acpi_ut_create_buffer_object (
192 * 213 *
193 * FUNCTION: acpi_ut_create_string_object 214 * FUNCTION: acpi_ut_create_string_object
194 * 215 *
195 * PARAMETERS: string_size - Size of string to be created. Does not 216 * PARAMETERS: string_size - Size of string to be created. Does not
196 * include NULL terminator, this is added 217 * include NULL terminator, this is added
197 * automatically. 218 * automatically.
198 * 219 *
199 * RETURN: Pointer to a new String object 220 * RETURN: Pointer to a new String object
200 * 221 *
@@ -249,7 +270,9 @@ acpi_ut_create_string_object (
249 * 270 *
250 * PARAMETERS: Object - Object to be validated 271 * PARAMETERS: Object - Object to be validated
251 * 272 *
252 * RETURN: Validate a pointer to be an union acpi_operand_object 273 * RETURN: TRUE if object is valid, FALSE otherwise
274 *
275 * DESCRIPTION: Validate a pointer to be an union acpi_operand_object
253 * 276 *
254 ******************************************************************************/ 277 ******************************************************************************/
255 278
@@ -399,8 +422,8 @@ acpi_ut_delete_object_cache (
399 * 422 *
400 * FUNCTION: acpi_ut_get_simple_object_size 423 * FUNCTION: acpi_ut_get_simple_object_size
401 * 424 *
402 * PARAMETERS: *internal_object - Pointer to the object we are examining 425 * PARAMETERS: internal_object - An ACPI operand object
403 * *obj_length - Where the length is returned 426 * obj_length - Where the length is returned
404 * 427 *
405 * RETURN: Status 428 * RETURN: Status
406 * 429 *
@@ -412,7 +435,7 @@ acpi_ut_delete_object_cache (
412 * 435 *
413 ******************************************************************************/ 436 ******************************************************************************/
414 437
415acpi_status 438static acpi_status
416acpi_ut_get_simple_object_size ( 439acpi_ut_get_simple_object_size (
417 union acpi_operand_object *internal_object, 440 union acpi_operand_object *internal_object,
418 acpi_size *obj_length) 441 acpi_size *obj_length)
@@ -424,8 +447,10 @@ acpi_ut_get_simple_object_size (
424 ACPI_FUNCTION_TRACE_PTR ("ut_get_simple_object_size", internal_object); 447 ACPI_FUNCTION_TRACE_PTR ("ut_get_simple_object_size", internal_object);
425 448
426 449
427 /* Handle a null object (Could be a uninitialized package element -- which is legal) */ 450 /*
428 451 * Handle a null object (Could be a uninitialized package
452 * element -- which is legal)
453 */
429 if (!internal_object) { 454 if (!internal_object) {
430 *obj_length = 0; 455 *obj_length = 0;
431 return_ACPI_STATUS (AE_OK); 456 return_ACPI_STATUS (AE_OK);
@@ -480,7 +505,8 @@ acpi_ut_get_simple_object_size (
480 * Get the actual length of the full pathname to this object. 505 * Get the actual length of the full pathname to this object.
481 * The reference will be converted to the pathname to the object 506 * The reference will be converted to the pathname to the object
482 */ 507 */
483 length += ACPI_ROUND_UP_TO_NATIVE_WORD (acpi_ns_get_pathname_length (internal_object->reference.node)); 508 length += ACPI_ROUND_UP_TO_NATIVE_WORD (
509 acpi_ns_get_pathname_length (internal_object->reference.node));
484 break; 510 break;
485 511
486 default: 512 default:
@@ -530,7 +556,7 @@ acpi_ut_get_simple_object_size (
530 * 556 *
531 ******************************************************************************/ 557 ******************************************************************************/
532 558
533acpi_status 559static acpi_status
534acpi_ut_get_element_length ( 560acpi_ut_get_element_length (
535 u8 object_type, 561 u8 object_type,
536 union acpi_operand_object *source_object, 562 union acpi_operand_object *source_object,
@@ -582,8 +608,8 @@ acpi_ut_get_element_length (
582 * 608 *
583 * FUNCTION: acpi_ut_get_package_object_size 609 * FUNCTION: acpi_ut_get_package_object_size
584 * 610 *
585 * PARAMETERS: *internal_object - Pointer to the object we are examining 611 * PARAMETERS: internal_object - An ACPI internal object
586 * *obj_length - Where the length is returned 612 * obj_length - Where the length is returned
587 * 613 *
588 * RETURN: Status 614 * RETURN: Status
589 * 615 *
@@ -595,7 +621,7 @@ acpi_ut_get_element_length (
595 * 621 *
596 ******************************************************************************/ 622 ******************************************************************************/
597 623
598acpi_status 624static acpi_status
599acpi_ut_get_package_object_size ( 625acpi_ut_get_package_object_size (
600 union acpi_operand_object *internal_object, 626 union acpi_operand_object *internal_object,
601 acpi_size *obj_length) 627 acpi_size *obj_length)
@@ -636,8 +662,8 @@ acpi_ut_get_package_object_size (
636 * 662 *
637 * FUNCTION: acpi_ut_get_object_size 663 * FUNCTION: acpi_ut_get_object_size
638 * 664 *
639 * PARAMETERS: *internal_object - Pointer to the object we are examining 665 * PARAMETERS: internal_object - An ACPI internal object
640 * *obj_length - Where the length will be returned 666 * obj_length - Where the length will be returned
641 * 667 *
642 * RETURN: Status 668 * RETURN: Status
643 * 669 *
@@ -647,7 +673,7 @@ acpi_ut_get_package_object_size (
647 ******************************************************************************/ 673 ******************************************************************************/
648 674
649acpi_status 675acpi_status
650acpi_ut_get_object_size( 676acpi_ut_get_object_size (
651 union acpi_operand_object *internal_object, 677 union acpi_operand_object *internal_object,
652 acpi_size *obj_length) 678 acpi_size *obj_length)
653{ 679{
diff --git a/drivers/acpi/utilities/utxface.c b/drivers/acpi/utilities/utxface.c
index 97a91f3f06f0..e8803d810656 100644
--- a/drivers/acpi/utilities/utxface.c
+++ b/drivers/acpi/utilities/utxface.c
@@ -73,6 +73,7 @@ acpi_initialize_subsystem (
73{ 73{
74 acpi_status status; 74 acpi_status status;
75 75
76
76 ACPI_FUNCTION_TRACE ("acpi_initialize_subsystem"); 77 ACPI_FUNCTION_TRACE ("acpi_initialize_subsystem");
77 78
78 79
@@ -105,7 +106,6 @@ acpi_initialize_subsystem (
105 * Initialize the namespace manager and 106 * Initialize the namespace manager and
106 * the root of the namespace tree 107 * the root of the namespace tree
107 */ 108 */
108
109 status = acpi_ns_root_initialize (); 109 status = acpi_ns_root_initialize ();
110 if (ACPI_FAILURE (status)) { 110 if (ACPI_FAILURE (status)) {
111 ACPI_REPORT_ERROR (("Namespace initialization failure, %s\n", 111 ACPI_REPORT_ERROR (("Namespace initialization failure, %s\n",
@@ -113,7 +113,6 @@ acpi_initialize_subsystem (
113 return_ACPI_STATUS (status); 113 return_ACPI_STATUS (status);
114 } 114 }
115 115
116
117 /* If configured, initialize the AML debugger */ 116 /* If configured, initialize the AML debugger */
118 117
119 ACPI_DEBUGGER_EXEC (status = acpi_db_initialize ()); 118 ACPI_DEBUGGER_EXEC (status = acpi_db_initialize ());
@@ -150,7 +149,8 @@ acpi_enable_subsystem (
150 * The values from the FADT are validated here. 149 * The values from the FADT are validated here.
151 */ 150 */
152 if (!(flags & ACPI_NO_HARDWARE_INIT)) { 151 if (!(flags & ACPI_NO_HARDWARE_INIT)) {
153 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Initializing ACPI hardware\n")); 152 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
153 "[Init] Initializing ACPI hardware\n"));
154 154
155 status = acpi_hw_initialize (); 155 status = acpi_hw_initialize ();
156 if (ACPI_FAILURE (status)) { 156 if (ACPI_FAILURE (status)) {
@@ -178,7 +178,8 @@ acpi_enable_subsystem (
178 * install_address_space_handler interface. 178 * install_address_space_handler interface.
179 */ 179 */
180 if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) { 180 if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) {
181 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Installing default address space handlers\n")); 181 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
182 "[Init] Installing default address space handlers\n"));
182 183
183 status = acpi_ev_install_region_handlers (); 184 status = acpi_ev_install_region_handlers ();
184 if (ACPI_FAILURE (status)) { 185 if (ACPI_FAILURE (status)) {
@@ -189,12 +190,14 @@ acpi_enable_subsystem (
189 /* 190 /*
190 * Initialize ACPI Event handling (Fixed and General Purpose) 191 * Initialize ACPI Event handling (Fixed and General Purpose)
191 * 192 *
192 * NOTE: We must have the hardware AND events initialized before we can execute 193 * NOTE: We must have the hardware AND events initialized before we can
193 * ANY control methods SAFELY. Any control method can require ACPI hardware 194 * execute ANY control methods SAFELY. Any control method can require
194 * support, so the hardware MUST be initialized before execution! 195 * ACPI hardware support, so the hardware MUST be initialized before
196 * execution!
195 */ 197 */
196 if (!(flags & ACPI_NO_EVENT_INIT)) { 198 if (!(flags & ACPI_NO_EVENT_INIT)) {
197 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Initializing ACPI events\n")); 199 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
200 "[Init] Initializing ACPI events\n"));
198 201
199 status = acpi_ev_initialize_events (); 202 status = acpi_ev_initialize_events ();
200 if (ACPI_FAILURE (status)) { 203 if (ACPI_FAILURE (status)) {
@@ -205,7 +208,8 @@ acpi_enable_subsystem (
205 /* Install the SCI handler and Global Lock handler */ 208 /* Install the SCI handler and Global Lock handler */
206 209
207 if (!(flags & ACPI_NO_HANDLER_INIT)) { 210 if (!(flags & ACPI_NO_HANDLER_INIT)) {
208 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Installing SCI/GL handlers\n")); 211 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
212 "[Init] Installing SCI/GL handlers\n"));
209 213
210 status = acpi_ev_install_xrupt_handlers (); 214 status = acpi_ev_install_xrupt_handlers ();
211 if (ACPI_FAILURE (status)) { 215 if (ACPI_FAILURE (status)) {
@@ -247,7 +251,8 @@ acpi_initialize_objects (
247 * contain executable AML (see call to acpi_ns_initialize_objects below). 251 * contain executable AML (see call to acpi_ns_initialize_objects below).
248 */ 252 */
249 if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) { 253 if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) {
250 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Executing _REG op_region methods\n")); 254 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
255 "[Init] Executing _REG op_region methods\n"));
251 256
252 status = acpi_ev_initialize_op_regions (); 257 status = acpi_ev_initialize_op_regions ();
253 if (ACPI_FAILURE (status)) { 258 if (ACPI_FAILURE (status)) {
@@ -261,7 +266,8 @@ acpi_initialize_objects (
261 * objects: operation_regions, buffer_fields, Buffers, and Packages. 266 * objects: operation_regions, buffer_fields, Buffers, and Packages.
262 */ 267 */
263 if (!(flags & ACPI_NO_OBJECT_INIT)) { 268 if (!(flags & ACPI_NO_OBJECT_INIT)) {
264 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Completing Initialization of ACPI Objects\n")); 269 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
270 "[Init] Completing Initialization of ACPI Objects\n"));
265 271
266 status = acpi_ns_initialize_objects (); 272 status = acpi_ns_initialize_objects ();
267 if (ACPI_FAILURE (status)) { 273 if (ACPI_FAILURE (status)) {
@@ -274,7 +280,8 @@ acpi_initialize_objects (
274 * This runs the _STA and _INI methods. 280 * This runs the _STA and _INI methods.
275 */ 281 */
276 if (!(flags & ACPI_NO_DEVICE_INIT)) { 282 if (!(flags & ACPI_NO_DEVICE_INIT)) {
277 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Initializing ACPI Devices\n")); 283 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
284 "[Init] Initializing ACPI Devices\n"));
278 285
279 status = acpi_ns_initialize_devices (); 286 status = acpi_ns_initialize_devices ();
280 if (ACPI_FAILURE (status)) { 287 if (ACPI_FAILURE (status)) {
@@ -307,7 +314,8 @@ acpi_initialize_objects (
307 ******************************************************************************/ 314 ******************************************************************************/
308 315
309acpi_status 316acpi_status
310acpi_terminate (void) 317acpi_terminate (
318 void)
311{ 319{
312 acpi_status status; 320 acpi_status status;
313 321
@@ -344,8 +352,7 @@ acpi_terminate (void)
344 352
345 353
346#ifdef ACPI_FUTURE_USAGE 354#ifdef ACPI_FUTURE_USAGE
347 355/*******************************************************************************
348/*****************************************************************************
349 * 356 *
350 * FUNCTION: acpi_subsystem_status 357 * FUNCTION: acpi_subsystem_status
351 * 358 *
@@ -354,14 +361,16 @@ acpi_terminate (void)
354 * RETURN: Status of the ACPI subsystem 361 * RETURN: Status of the ACPI subsystem
355 * 362 *
356 * DESCRIPTION: Other drivers that use the ACPI subsystem should call this 363 * DESCRIPTION: Other drivers that use the ACPI subsystem should call this
357 * before making any other calls, to ensure the subsystem initial- 364 * before making any other calls, to ensure the subsystem
358 * ized successfully. 365 * initialized successfully.
359 * 366 *
360 ****************************************************************************/ 367 ******************************************************************************/
361 368
362acpi_status 369acpi_status
363acpi_subsystem_status (void) 370acpi_subsystem_status (
371 void)
364{ 372{
373
365 if (acpi_gbl_startup_flags & ACPI_INITIALIZED_OK) { 374 if (acpi_gbl_startup_flags & ACPI_INITIALIZED_OK) {
366 return (AE_OK); 375 return (AE_OK);
367 } 376 }
@@ -371,13 +380,12 @@ acpi_subsystem_status (void)
371} 380}
372 381
373 382
374/****************************************************************************** 383/*******************************************************************************
375 * 384 *
376 * FUNCTION: acpi_get_system_info 385 * FUNCTION: acpi_get_system_info
377 * 386 *
378 * PARAMETERS: out_buffer - a pointer to a buffer to receive the 387 * PARAMETERS: out_buffer - A buffer to receive the resources for the
379 * resources for the device 388 * device
380 * buffer_length - the number of bytes available in the buffer
381 * 389 *
382 * RETURN: Status - the status of the call 390 * RETURN: Status - the status of the call
383 * 391 *
@@ -395,8 +403,8 @@ acpi_get_system_info (
395 struct acpi_buffer *out_buffer) 403 struct acpi_buffer *out_buffer)
396{ 404{
397 struct acpi_system_info *info_ptr; 405 struct acpi_system_info *info_ptr;
398 u32 i;
399 acpi_status status; 406 acpi_status status;
407 u32 i;
400 408
401 409
402 ACPI_FUNCTION_TRACE ("acpi_get_system_info"); 410 ACPI_FUNCTION_TRACE ("acpi_get_system_info");
@@ -466,6 +474,7 @@ EXPORT_SYMBOL(acpi_get_system_info);
466 * FUNCTION: acpi_install_initialization_handler 474 * FUNCTION: acpi_install_initialization_handler
467 * 475 *
468 * PARAMETERS: Handler - Callback procedure 476 * PARAMETERS: Handler - Callback procedure
477 * Function - Not (currently) used, see below
469 * 478 *
470 * RETURN: Status 479 * RETURN: Status
471 * 480 *
@@ -495,7 +504,6 @@ acpi_install_initialization_handler (
495 504
496#endif /* ACPI_FUTURE_USAGE */ 505#endif /* ACPI_FUTURE_USAGE */
497 506
498
499/***************************************************************************** 507/*****************************************************************************
500 * 508 *
501 * FUNCTION: acpi_purge_cached_objects 509 * FUNCTION: acpi_purge_cached_objects
@@ -509,7 +517,8 @@ acpi_install_initialization_handler (
509 ****************************************************************************/ 517 ****************************************************************************/
510 518
511acpi_status 519acpi_status
512acpi_purge_cached_objects (void) 520acpi_purge_cached_objects (
521 void)
513{ 522{
514 ACPI_FUNCTION_TRACE ("acpi_purge_cached_objects"); 523 ACPI_FUNCTION_TRACE ("acpi_purge_cached_objects");
515 524