aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/namespace/nsdump.c
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2005-08-05 00:44:28 -0400
committerLen Brown <len.brown@intel.com>2005-08-05 00:45:14 -0400
commit4be44fcd3bf648b782f4460fd06dfae6c42ded4b (patch)
tree5b5b7d296ea58786f53b95e5eac9565ff66890b0 /drivers/acpi/namespace/nsdump.c
parentc65ade4dc8b486e8c8b9b0a6399789a5428e2039 (diff)
[ACPI] Lindent all ACPI files
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/namespace/nsdump.c')
-rw-r--r--drivers/acpi/namespace/nsdump.c429
1 files changed, 207 insertions, 222 deletions
diff --git a/drivers/acpi/namespace/nsdump.c b/drivers/acpi/namespace/nsdump.c
index 5d25add6b031..9faf1d5c86ed 100644
--- a/drivers/acpi/namespace/nsdump.c
+++ b/drivers/acpi/namespace/nsdump.c
@@ -41,31 +41,22 @@
41 * POSSIBILITY OF SUCH DAMAGES. 41 * POSSIBILITY OF SUCH DAMAGES.
42 */ 42 */
43 43
44
45#include <acpi/acpi.h> 44#include <acpi/acpi.h>
46#include <acpi/acnamesp.h> 45#include <acpi/acnamesp.h>
47#include <acpi/acparser.h> 46#include <acpi/acparser.h>
48 47
49
50#define _COMPONENT ACPI_NAMESPACE 48#define _COMPONENT ACPI_NAMESPACE
51 ACPI_MODULE_NAME ("nsdump") 49ACPI_MODULE_NAME("nsdump")
52 50
53/* Local prototypes */ 51/* Local prototypes */
54
55#ifdef ACPI_OBSOLETE_FUNCTIONS 52#ifdef ACPI_OBSOLETE_FUNCTIONS
56void 53void acpi_ns_dump_root_devices(void);
57acpi_ns_dump_root_devices (
58 void);
59 54
60static acpi_status 55static acpi_status
61acpi_ns_dump_one_device ( 56acpi_ns_dump_one_device(acpi_handle obj_handle,
62 acpi_handle obj_handle, 57 u32 level, void *context, void **return_value);
63 u32 level,
64 void *context,
65 void **return_value);
66#endif 58#endif
67 59
68
69#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) 60#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
70/******************************************************************************* 61/*******************************************************************************
71 * 62 *
@@ -80,43 +71,38 @@ acpi_ns_dump_one_device (
80 * 71 *
81 ******************************************************************************/ 72 ******************************************************************************/
82 73
83void 74void acpi_ns_print_pathname(u32 num_segments, char *pathname)
84acpi_ns_print_pathname (
85 u32 num_segments,
86 char *pathname)
87{ 75{
88 acpi_native_uint i; 76 acpi_native_uint i;
89 77
78 ACPI_FUNCTION_NAME("ns_print_pathname");
90 79
91 ACPI_FUNCTION_NAME ("ns_print_pathname"); 80 if (!(acpi_dbg_level & ACPI_LV_NAMES)
92 81 || !(acpi_dbg_layer & ACPI_NAMESPACE)) {
93
94 if (!(acpi_dbg_level & ACPI_LV_NAMES) || !(acpi_dbg_layer & ACPI_NAMESPACE)) {
95 return; 82 return;
96 } 83 }
97 84
98 /* Print the entire name */ 85 /* Print the entire name */
99 86
100 ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "[")); 87 ACPI_DEBUG_PRINT((ACPI_DB_NAMES, "["));
101 88
102 while (num_segments) { 89 while (num_segments) {
103 for (i = 0; i < 4; i++) { 90 for (i = 0; i < 4; i++) {
104 ACPI_IS_PRINT (pathname[i]) ? 91 ACPI_IS_PRINT(pathname[i]) ?
105 acpi_os_printf ("%c", pathname[i]) : 92 acpi_os_printf("%c", pathname[i]) :
106 acpi_os_printf ("?"); 93 acpi_os_printf("?");
107 } 94 }
108 95
109 pathname += ACPI_NAME_SIZE; 96 pathname += ACPI_NAME_SIZE;
110 num_segments--; 97 num_segments--;
111 if (num_segments) { 98 if (num_segments) {
112 acpi_os_printf ("."); 99 acpi_os_printf(".");
113 } 100 }
114 } 101 }
115 102
116 acpi_os_printf ("]\n"); 103 acpi_os_printf("]\n");
117} 104}
118 105
119
120/******************************************************************************* 106/*******************************************************************************
121 * 107 *
122 * FUNCTION: acpi_ns_dump_pathname 108 * FUNCTION: acpi_ns_dump_pathname
@@ -134,15 +120,10 @@ acpi_ns_print_pathname (
134 ******************************************************************************/ 120 ******************************************************************************/
135 121
136void 122void
137acpi_ns_dump_pathname ( 123acpi_ns_dump_pathname(acpi_handle handle, char *msg, u32 level, u32 component)
138 acpi_handle handle,
139 char *msg,
140 u32 level,
141 u32 component)
142{ 124{
143 125
144 ACPI_FUNCTION_TRACE ("ns_dump_pathname"); 126 ACPI_FUNCTION_TRACE("ns_dump_pathname");
145
146 127
147 /* Do this only if the requested debug level and component are enabled */ 128 /* Do this only if the requested debug level and component are enabled */
148 129
@@ -152,12 +133,11 @@ acpi_ns_dump_pathname (
152 133
153 /* Convert handle to a full pathname and print it (with supplied message) */ 134 /* Convert handle to a full pathname and print it (with supplied message) */
154 135
155 acpi_ns_print_node_pathname (handle, msg); 136 acpi_ns_print_node_pathname(handle, msg);
156 acpi_os_printf ("\n"); 137 acpi_os_printf("\n");
157 return_VOID; 138 return_VOID;
158} 139}
159 140
160
161/******************************************************************************* 141/*******************************************************************************
162 * 142 *
163 * FUNCTION: acpi_ns_dump_one_object 143 * FUNCTION: acpi_ns_dump_one_object
@@ -175,24 +155,19 @@ acpi_ns_dump_pathname (
175 ******************************************************************************/ 155 ******************************************************************************/
176 156
177acpi_status 157acpi_status
178acpi_ns_dump_one_object ( 158acpi_ns_dump_one_object(acpi_handle obj_handle,
179 acpi_handle obj_handle, 159 u32 level, void *context, void **return_value)
180 u32 level,
181 void *context,
182 void **return_value)
183{ 160{
184 struct acpi_walk_info *info = (struct acpi_walk_info *) context; 161 struct acpi_walk_info *info = (struct acpi_walk_info *)context;
185 struct acpi_namespace_node *this_node; 162 struct acpi_namespace_node *this_node;
186 union acpi_operand_object *obj_desc = NULL; 163 union acpi_operand_object *obj_desc = NULL;
187 acpi_object_type obj_type; 164 acpi_object_type obj_type;
188 acpi_object_type type; 165 acpi_object_type type;
189 u32 bytes_to_dump; 166 u32 bytes_to_dump;
190 u32 dbg_level; 167 u32 dbg_level;
191 u32 i; 168 u32 i;
192
193
194 ACPI_FUNCTION_NAME ("ns_dump_one_object");
195 169
170 ACPI_FUNCTION_NAME("ns_dump_one_object");
196 171
197 /* Is output enabled? */ 172 /* Is output enabled? */
198 173
@@ -201,48 +176,47 @@ acpi_ns_dump_one_object (
201 } 176 }
202 177
203 if (!obj_handle) { 178 if (!obj_handle) {
204 ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Null object handle\n")); 179 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Null object handle\n"));
205 return (AE_OK); 180 return (AE_OK);
206 } 181 }
207 182
208 this_node = acpi_ns_map_handle_to_node (obj_handle); 183 this_node = acpi_ns_map_handle_to_node(obj_handle);
209 type = this_node->type; 184 type = this_node->type;
210 185
211 /* Check if the owner matches */ 186 /* Check if the owner matches */
212 187
213 if ((info->owner_id != ACPI_OWNER_ID_MAX) && 188 if ((info->owner_id != ACPI_OWNER_ID_MAX) &&
214 (info->owner_id != this_node->owner_id)) { 189 (info->owner_id != this_node->owner_id)) {
215 return (AE_OK); 190 return (AE_OK);
216 } 191 }
217 192
218 if (!(info->display_type & ACPI_DISPLAY_SHORT)) { 193 if (!(info->display_type & ACPI_DISPLAY_SHORT)) {
219 /* Indent the object according to the level */ 194 /* Indent the object according to the level */
220 195
221 acpi_os_printf ("%2d%*s", (u32) level - 1, (int) level * 2, " "); 196 acpi_os_printf("%2d%*s", (u32) level - 1, (int)level * 2, " ");
222 197
223 /* Check the node type and name */ 198 /* Check the node type and name */
224 199
225 if (type > ACPI_TYPE_LOCAL_MAX) { 200 if (type > ACPI_TYPE_LOCAL_MAX) {
226 ACPI_REPORT_WARNING (("Invalid ACPI Type %08X\n", type)); 201 ACPI_REPORT_WARNING(("Invalid ACPI Type %08X\n", type));
227 } 202 }
228 203
229 if (!acpi_ut_valid_acpi_name (this_node->name.integer)) { 204 if (!acpi_ut_valid_acpi_name(this_node->name.integer)) {
230 ACPI_REPORT_WARNING (("Invalid ACPI Name %08X\n", 205 ACPI_REPORT_WARNING(("Invalid ACPI Name %08X\n",
231 this_node->name.integer)); 206 this_node->name.integer));
232 } 207 }
233 208
234 acpi_os_printf ("%4.4s", acpi_ut_get_node_name (this_node)); 209 acpi_os_printf("%4.4s", acpi_ut_get_node_name(this_node));
235 } 210 }
236 211
237 /* 212 /*
238 * Now we can print out the pertinent information 213 * Now we can print out the pertinent information
239 */ 214 */
240 acpi_os_printf (" %-12s %p ", 215 acpi_os_printf(" %-12s %p ", acpi_ut_get_type_name(type), this_node);
241 acpi_ut_get_type_name (type), this_node);
242 216
243 dbg_level = acpi_dbg_level; 217 dbg_level = acpi_dbg_level;
244 acpi_dbg_level = 0; 218 acpi_dbg_level = 0;
245 obj_desc = acpi_ns_get_attached_object (this_node); 219 obj_desc = acpi_ns_get_attached_object(this_node);
246 acpi_dbg_level = dbg_level; 220 acpi_dbg_level = dbg_level;
247 221
248 switch (info->display_type & ACPI_DISPLAY_MASK) { 222 switch (info->display_type & ACPI_DISPLAY_MASK) {
@@ -251,147 +225,166 @@ acpi_ns_dump_one_object (
251 if (!obj_desc) { 225 if (!obj_desc) {
252 /* No attached object, we are done */ 226 /* No attached object, we are done */
253 227
254 acpi_os_printf ("\n"); 228 acpi_os_printf("\n");
255 return (AE_OK); 229 return (AE_OK);
256 } 230 }
257 231
258 switch (type) { 232 switch (type) {
259 case ACPI_TYPE_PROCESSOR: 233 case ACPI_TYPE_PROCESSOR:
260 234
261 acpi_os_printf ("ID %X Len %.4X Addr %p\n", 235 acpi_os_printf("ID %X Len %.4X Addr %p\n",
262 obj_desc->processor.proc_id, obj_desc->processor.length, 236 obj_desc->processor.proc_id,
263 (char *) obj_desc->processor.address); 237 obj_desc->processor.length,
238 (char *)obj_desc->processor.address);
264 break; 239 break;
265 240
266
267 case ACPI_TYPE_DEVICE: 241 case ACPI_TYPE_DEVICE:
268 242
269 acpi_os_printf ("Notify Object: %p\n", obj_desc); 243 acpi_os_printf("Notify Object: %p\n", obj_desc);
270 break; 244 break;
271 245
272
273 case ACPI_TYPE_METHOD: 246 case ACPI_TYPE_METHOD:
274 247
275 acpi_os_printf ("Args %X Len %.4X Aml %p\n", 248 acpi_os_printf("Args %X Len %.4X Aml %p\n",
276 (u32) obj_desc->method.param_count, 249 (u32) obj_desc->method.param_count,
277 obj_desc->method.aml_length, obj_desc->method.aml_start); 250 obj_desc->method.aml_length,
251 obj_desc->method.aml_start);
278 break; 252 break;
279 253
280
281 case ACPI_TYPE_INTEGER: 254 case ACPI_TYPE_INTEGER:
282 255
283 acpi_os_printf ("= %8.8X%8.8X\n", 256 acpi_os_printf("= %8.8X%8.8X\n",
284 ACPI_FORMAT_UINT64 (obj_desc->integer.value)); 257 ACPI_FORMAT_UINT64(obj_desc->integer.
258 value));
285 break; 259 break;
286 260
287
288 case ACPI_TYPE_PACKAGE: 261 case ACPI_TYPE_PACKAGE:
289 262
290 if (obj_desc->common.flags & AOPOBJ_DATA_VALID) { 263 if (obj_desc->common.flags & AOPOBJ_DATA_VALID) {
291 acpi_os_printf ("Elements %.2X\n", 264 acpi_os_printf("Elements %.2X\n",
292 obj_desc->package.count); 265 obj_desc->package.count);
293 } 266 } else {
294 else { 267 acpi_os_printf("[Length not yet evaluated]\n");
295 acpi_os_printf ("[Length not yet evaluated]\n");
296 } 268 }
297 break; 269 break;
298 270
299
300 case ACPI_TYPE_BUFFER: 271 case ACPI_TYPE_BUFFER:
301 272
302 if (obj_desc->common.flags & AOPOBJ_DATA_VALID) { 273 if (obj_desc->common.flags & AOPOBJ_DATA_VALID) {
303 acpi_os_printf ("Len %.2X", 274 acpi_os_printf("Len %.2X",
304 obj_desc->buffer.length); 275 obj_desc->buffer.length);
305 276
306 /* Dump some of the buffer */ 277 /* Dump some of the buffer */
307 278
308 if (obj_desc->buffer.length > 0) { 279 if (obj_desc->buffer.length > 0) {
309 acpi_os_printf (" ="); 280 acpi_os_printf(" =");
310 for (i = 0; (i < obj_desc->buffer.length && i < 12); i++) { 281 for (i = 0;
311 acpi_os_printf (" %.2hX", obj_desc->buffer.pointer[i]); 282 (i < obj_desc->buffer.length
283 && i < 12); i++) {
284 acpi_os_printf(" %.2hX",
285 obj_desc->buffer.
286 pointer[i]);
312 } 287 }
313 } 288 }
314 acpi_os_printf ("\n"); 289 acpi_os_printf("\n");
315 } 290 } else {
316 else { 291 acpi_os_printf("[Length not yet evaluated]\n");
317 acpi_os_printf ("[Length not yet evaluated]\n");
318 } 292 }
319 break; 293 break;
320 294
321
322 case ACPI_TYPE_STRING: 295 case ACPI_TYPE_STRING:
323 296
324 acpi_os_printf ("Len %.2X ", obj_desc->string.length); 297 acpi_os_printf("Len %.2X ", obj_desc->string.length);
325 acpi_ut_print_string (obj_desc->string.pointer, 32); 298 acpi_ut_print_string(obj_desc->string.pointer, 32);
326 acpi_os_printf ("\n"); 299 acpi_os_printf("\n");
327 break; 300 break;
328 301
329
330 case ACPI_TYPE_REGION: 302 case ACPI_TYPE_REGION:
331 303
332 acpi_os_printf ("[%s]", 304 acpi_os_printf("[%s]",
333 acpi_ut_get_region_name (obj_desc->region.space_id)); 305 acpi_ut_get_region_name(obj_desc->region.
306 space_id));
334 if (obj_desc->region.flags & AOPOBJ_DATA_VALID) { 307 if (obj_desc->region.flags & AOPOBJ_DATA_VALID) {
335 acpi_os_printf (" Addr %8.8X%8.8X Len %.4X\n", 308 acpi_os_printf(" Addr %8.8X%8.8X Len %.4X\n",
336 ACPI_FORMAT_UINT64 (obj_desc->region.address), 309 ACPI_FORMAT_UINT64(obj_desc->
337 obj_desc->region.length); 310 region.
338 } 311 address),
339 else { 312 obj_desc->region.length);
340 acpi_os_printf (" [Address/Length not yet evaluated]\n"); 313 } else {
314 acpi_os_printf
315 (" [Address/Length not yet evaluated]\n");
341 } 316 }
342 break; 317 break;
343 318
344
345 case ACPI_TYPE_LOCAL_REFERENCE: 319 case ACPI_TYPE_LOCAL_REFERENCE:
346 320
347 acpi_os_printf ("[%s]\n", 321 acpi_os_printf("[%s]\n",
348 acpi_ps_get_opcode_name (obj_desc->reference.opcode)); 322 acpi_ps_get_opcode_name(obj_desc->
323 reference.
324 opcode));
349 break; 325 break;
350 326
351
352 case ACPI_TYPE_BUFFER_FIELD: 327 case ACPI_TYPE_BUFFER_FIELD:
353 328
354 if (obj_desc->buffer_field.buffer_obj && 329 if (obj_desc->buffer_field.buffer_obj &&
355 obj_desc->buffer_field.buffer_obj->buffer.node) { 330 obj_desc->buffer_field.buffer_obj->buffer.node) {
356 acpi_os_printf ("Buf [%4.4s]", 331 acpi_os_printf("Buf [%4.4s]",
357 acpi_ut_get_node_name (obj_desc->buffer_field.buffer_obj->buffer.node)); 332 acpi_ut_get_node_name(obj_desc->
333 buffer_field.
334 buffer_obj->
335 buffer.
336 node));
358 } 337 }
359 break; 338 break;
360 339
361
362 case ACPI_TYPE_LOCAL_REGION_FIELD: 340 case ACPI_TYPE_LOCAL_REGION_FIELD:
363 341
364 acpi_os_printf ("Rgn [%4.4s]", 342 acpi_os_printf("Rgn [%4.4s]",
365 acpi_ut_get_node_name (obj_desc->common_field.region_obj->region.node)); 343 acpi_ut_get_node_name(obj_desc->
344 common_field.
345 region_obj->region.
346 node));
366 break; 347 break;
367 348
368
369 case ACPI_TYPE_LOCAL_BANK_FIELD: 349 case ACPI_TYPE_LOCAL_BANK_FIELD:
370 350
371 acpi_os_printf ("Rgn [%4.4s] Bnk [%4.4s]", 351 acpi_os_printf("Rgn [%4.4s] Bnk [%4.4s]",
372 acpi_ut_get_node_name (obj_desc->common_field.region_obj->region.node), 352 acpi_ut_get_node_name(obj_desc->
373 acpi_ut_get_node_name (obj_desc->bank_field.bank_obj->common_field.node)); 353 common_field.
354 region_obj->region.
355 node),
356 acpi_ut_get_node_name(obj_desc->
357 bank_field.
358 bank_obj->
359 common_field.
360 node));
374 break; 361 break;
375 362
376
377 case ACPI_TYPE_LOCAL_INDEX_FIELD: 363 case ACPI_TYPE_LOCAL_INDEX_FIELD:
378 364
379 acpi_os_printf ("Idx [%4.4s] Dat [%4.4s]", 365 acpi_os_printf("Idx [%4.4s] Dat [%4.4s]",
380 acpi_ut_get_node_name (obj_desc->index_field.index_obj->common_field.node), 366 acpi_ut_get_node_name(obj_desc->
381 acpi_ut_get_node_name (obj_desc->index_field.data_obj->common_field.node)); 367 index_field.
368 index_obj->
369 common_field.node),
370 acpi_ut_get_node_name(obj_desc->
371 index_field.
372 data_obj->
373 common_field.
374 node));
382 break; 375 break;
383 376
384
385 case ACPI_TYPE_LOCAL_ALIAS: 377 case ACPI_TYPE_LOCAL_ALIAS:
386 case ACPI_TYPE_LOCAL_METHOD_ALIAS: 378 case ACPI_TYPE_LOCAL_METHOD_ALIAS:
387 379
388 acpi_os_printf ("Target %4.4s (%p)\n", 380 acpi_os_printf("Target %4.4s (%p)\n",
389 acpi_ut_get_node_name (obj_desc), obj_desc); 381 acpi_ut_get_node_name(obj_desc),
382 obj_desc);
390 break; 383 break;
391 384
392 default: 385 default:
393 386
394 acpi_os_printf ("Object %p\n", obj_desc); 387 acpi_os_printf("Object %p\n", obj_desc);
395 break; 388 break;
396 } 389 }
397 390
@@ -403,11 +396,15 @@ acpi_ns_dump_one_object (
403 case ACPI_TYPE_LOCAL_BANK_FIELD: 396 case ACPI_TYPE_LOCAL_BANK_FIELD:
404 case ACPI_TYPE_LOCAL_INDEX_FIELD: 397 case ACPI_TYPE_LOCAL_INDEX_FIELD:
405 398
406 acpi_os_printf (" Off %.3X Len %.2X Acc %.2hd\n", 399 acpi_os_printf(" Off %.3X Len %.2X Acc %.2hd\n",
407 (obj_desc->common_field.base_byte_offset * 8) 400 (obj_desc->common_field.
408 + obj_desc->common_field.start_field_bit_offset, 401 base_byte_offset * 8)
409 obj_desc->common_field.bit_length, 402 +
410 obj_desc->common_field.access_byte_width); 403 obj_desc->common_field.
404 start_field_bit_offset,
405 obj_desc->common_field.bit_length,
406 obj_desc->common_field.
407 access_byte_width);
411 break; 408 break;
412 409
413 default: 410 default:
@@ -415,56 +412,55 @@ acpi_ns_dump_one_object (
415 } 412 }
416 break; 413 break;
417 414
418
419 case ACPI_DISPLAY_OBJECTS: 415 case ACPI_DISPLAY_OBJECTS:
420 416
421 acpi_os_printf ("O:%p", obj_desc); 417 acpi_os_printf("O:%p", obj_desc);
422 if (!obj_desc) { 418 if (!obj_desc) {
423 /* No attached object, we are done */ 419 /* No attached object, we are done */
424 420
425 acpi_os_printf ("\n"); 421 acpi_os_printf("\n");
426 return (AE_OK); 422 return (AE_OK);
427 } 423 }
428 424
429 acpi_os_printf ("(R%d)", obj_desc->common.reference_count); 425 acpi_os_printf("(R%d)", obj_desc->common.reference_count);
430 426
431 switch (type) { 427 switch (type) {
432 case ACPI_TYPE_METHOD: 428 case ACPI_TYPE_METHOD:
433 429
434 /* Name is a Method and its AML offset/length are set */ 430 /* Name is a Method and its AML offset/length are set */
435 431
436 acpi_os_printf (" M:%p-%X\n", obj_desc->method.aml_start, 432 acpi_os_printf(" M:%p-%X\n", obj_desc->method.aml_start,
437 obj_desc->method.aml_length); 433 obj_desc->method.aml_length);
438 break; 434 break;
439 435
440 case ACPI_TYPE_INTEGER: 436 case ACPI_TYPE_INTEGER:
441 437
442 acpi_os_printf (" I:%8.8X8.8%X\n", 438 acpi_os_printf(" I:%8.8X8.8%X\n",
443 ACPI_FORMAT_UINT64 (obj_desc->integer.value)); 439 ACPI_FORMAT_UINT64(obj_desc->integer.
440 value));
444 break; 441 break;
445 442
446 case ACPI_TYPE_STRING: 443 case ACPI_TYPE_STRING:
447 444
448 acpi_os_printf (" S:%p-%X\n", obj_desc->string.pointer, 445 acpi_os_printf(" S:%p-%X\n", obj_desc->string.pointer,
449 obj_desc->string.length); 446 obj_desc->string.length);
450 break; 447 break;
451 448
452 case ACPI_TYPE_BUFFER: 449 case ACPI_TYPE_BUFFER:
453 450
454 acpi_os_printf (" B:%p-%X\n", obj_desc->buffer.pointer, 451 acpi_os_printf(" B:%p-%X\n", obj_desc->buffer.pointer,
455 obj_desc->buffer.length); 452 obj_desc->buffer.length);
456 break; 453 break;
457 454
458 default: 455 default:
459 456
460 acpi_os_printf ("\n"); 457 acpi_os_printf("\n");
461 break; 458 break;
462 } 459 }
463 break; 460 break;
464 461
465
466 default: 462 default:
467 acpi_os_printf ("\n"); 463 acpi_os_printf("\n");
468 break; 464 break;
469 } 465 }
470 466
@@ -474,46 +470,47 @@ acpi_ns_dump_one_object (
474 return (AE_OK); 470 return (AE_OK);
475 } 471 }
476 472
477
478 /* If there is an attached object, display it */ 473 /* If there is an attached object, display it */
479 474
480 dbg_level = acpi_dbg_level; 475 dbg_level = acpi_dbg_level;
481 acpi_dbg_level = 0; 476 acpi_dbg_level = 0;
482 obj_desc = acpi_ns_get_attached_object (this_node); 477 obj_desc = acpi_ns_get_attached_object(this_node);
483 acpi_dbg_level = dbg_level; 478 acpi_dbg_level = dbg_level;
484 479
485 /* Dump attached objects */ 480 /* Dump attached objects */
486 481
487 while (obj_desc) { 482 while (obj_desc) {
488 obj_type = ACPI_TYPE_INVALID; 483 obj_type = ACPI_TYPE_INVALID;
489 acpi_os_printf ("Attached Object %p: ", obj_desc); 484 acpi_os_printf("Attached Object %p: ", obj_desc);
490 485
491 /* Decode the type of attached object and dump the contents */ 486 /* Decode the type of attached object and dump the contents */
492 487
493 switch (ACPI_GET_DESCRIPTOR_TYPE (obj_desc)) { 488 switch (ACPI_GET_DESCRIPTOR_TYPE(obj_desc)) {
494 case ACPI_DESC_TYPE_NAMED: 489 case ACPI_DESC_TYPE_NAMED:
495 490
496 acpi_os_printf ("(Ptr to Node)\n"); 491 acpi_os_printf("(Ptr to Node)\n");
497 bytes_to_dump = sizeof (struct acpi_namespace_node); 492 bytes_to_dump = sizeof(struct acpi_namespace_node);
498 ACPI_DUMP_BUFFER (obj_desc, bytes_to_dump); 493 ACPI_DUMP_BUFFER(obj_desc, bytes_to_dump);
499 break; 494 break;
500 495
501 case ACPI_DESC_TYPE_OPERAND: 496 case ACPI_DESC_TYPE_OPERAND:
502 497
503 obj_type = ACPI_GET_OBJECT_TYPE (obj_desc); 498 obj_type = ACPI_GET_OBJECT_TYPE(obj_desc);
504 499
505 if (obj_type > ACPI_TYPE_LOCAL_MAX) { 500 if (obj_type > ACPI_TYPE_LOCAL_MAX) {
506 acpi_os_printf ("(Ptr to ACPI Object type %X [UNKNOWN])\n", 501 acpi_os_printf
507 obj_type); 502 ("(Ptr to ACPI Object type %X [UNKNOWN])\n",
503 obj_type);
508 bytes_to_dump = 32; 504 bytes_to_dump = 32;
509 } 505 } else {
510 else { 506 acpi_os_printf
511 acpi_os_printf ("(Ptr to ACPI Object type %X [%s])\n", 507 ("(Ptr to ACPI Object type %X [%s])\n",
512 obj_type, acpi_ut_get_type_name (obj_type)); 508 obj_type, acpi_ut_get_type_name(obj_type));
513 bytes_to_dump = sizeof (union acpi_operand_object); 509 bytes_to_dump =
510 sizeof(union acpi_operand_object);
514 } 511 }
515 512
516 ACPI_DUMP_BUFFER (obj_desc, bytes_to_dump); 513 ACPI_DUMP_BUFFER(obj_desc, bytes_to_dump);
517 break; 514 break;
518 515
519 default: 516 default:
@@ -523,7 +520,8 @@ acpi_ns_dump_one_object (
523 520
524 /* If value is NOT an internal object, we are done */ 521 /* If value is NOT an internal object, we are done */
525 522
526 if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) != ACPI_DESC_TYPE_OPERAND) { 523 if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) !=
524 ACPI_DESC_TYPE_OPERAND) {
527 goto cleanup; 525 goto cleanup;
528 } 526 }
529 527
@@ -537,49 +535,50 @@ acpi_ns_dump_one_object (
537 * NOTE: takes advantage of common fields between string/buffer 535 * NOTE: takes advantage of common fields between string/buffer
538 */ 536 */
539 bytes_to_dump = obj_desc->string.length; 537 bytes_to_dump = obj_desc->string.length;
540 obj_desc = (void *) obj_desc->string.pointer; 538 obj_desc = (void *)obj_desc->string.pointer;
541 acpi_os_printf ( "(Buffer/String pointer %p length %X)\n", 539 acpi_os_printf("(Buffer/String pointer %p length %X)\n",
542 obj_desc, bytes_to_dump); 540 obj_desc, bytes_to_dump);
543 ACPI_DUMP_BUFFER (obj_desc, bytes_to_dump); 541 ACPI_DUMP_BUFFER(obj_desc, bytes_to_dump);
544 goto cleanup; 542 goto cleanup;
545 543
546 case ACPI_TYPE_BUFFER_FIELD: 544 case ACPI_TYPE_BUFFER_FIELD:
547 obj_desc = (union acpi_operand_object *) obj_desc->buffer_field.buffer_obj; 545 obj_desc =
546 (union acpi_operand_object *)obj_desc->buffer_field.
547 buffer_obj;
548 break; 548 break;
549 549
550 case ACPI_TYPE_PACKAGE: 550 case ACPI_TYPE_PACKAGE:
551 obj_desc = (void *) obj_desc->package.elements; 551 obj_desc = (void *)obj_desc->package.elements;
552 break; 552 break;
553 553
554 case ACPI_TYPE_METHOD: 554 case ACPI_TYPE_METHOD:
555 obj_desc = (void *) obj_desc->method.aml_start; 555 obj_desc = (void *)obj_desc->method.aml_start;
556 break; 556 break;
557 557
558 case ACPI_TYPE_LOCAL_REGION_FIELD: 558 case ACPI_TYPE_LOCAL_REGION_FIELD:
559 obj_desc = (void *) obj_desc->field.region_obj; 559 obj_desc = (void *)obj_desc->field.region_obj;
560 break; 560 break;
561 561
562 case ACPI_TYPE_LOCAL_BANK_FIELD: 562 case ACPI_TYPE_LOCAL_BANK_FIELD:
563 obj_desc = (void *) obj_desc->bank_field.region_obj; 563 obj_desc = (void *)obj_desc->bank_field.region_obj;
564 break; 564 break;
565 565
566 case ACPI_TYPE_LOCAL_INDEX_FIELD: 566 case ACPI_TYPE_LOCAL_INDEX_FIELD:
567 obj_desc = (void *) obj_desc->index_field.index_obj; 567 obj_desc = (void *)obj_desc->index_field.index_obj;
568 break; 568 break;
569 569
570 default: 570 default:
571 goto cleanup; 571 goto cleanup;
572 } 572 }
573 573
574 obj_type = ACPI_TYPE_INVALID; /* Terminate loop after next pass */ 574 obj_type = ACPI_TYPE_INVALID; /* Terminate loop after next pass */
575 } 575 }
576 576
577cleanup: 577 cleanup:
578 acpi_os_printf ("\n"); 578 acpi_os_printf("\n");
579 return (AE_OK); 579 return (AE_OK);
580} 580}
581 581
582
583#ifdef ACPI_FUTURE_USAGE 582#ifdef ACPI_FUTURE_USAGE
584/******************************************************************************* 583/*******************************************************************************
585 * 584 *
@@ -601,29 +600,25 @@ cleanup:
601 ******************************************************************************/ 600 ******************************************************************************/
602 601
603void 602void
604acpi_ns_dump_objects ( 603acpi_ns_dump_objects(acpi_object_type type,
605 acpi_object_type type, 604 u8 display_type,
606 u8 display_type, 605 u32 max_depth,
607 u32 max_depth, 606 acpi_owner_id owner_id, acpi_handle start_handle)
608 acpi_owner_id owner_id,
609 acpi_handle start_handle)
610{ 607{
611 struct acpi_walk_info info; 608 struct acpi_walk_info info;
612
613
614 ACPI_FUNCTION_ENTRY ();
615 609
610 ACPI_FUNCTION_ENTRY();
616 611
617 info.debug_level = ACPI_LV_TABLES; 612 info.debug_level = ACPI_LV_TABLES;
618 info.owner_id = owner_id; 613 info.owner_id = owner_id;
619 info.display_type = display_type; 614 info.display_type = display_type;
620 615
621 (void) acpi_ns_walk_namespace (type, start_handle, max_depth, 616 (void)acpi_ns_walk_namespace(type, start_handle, max_depth,
622 ACPI_NS_WALK_NO_UNLOCK, acpi_ns_dump_one_object, 617 ACPI_NS_WALK_NO_UNLOCK,
623 (void *) &info, NULL); 618 acpi_ns_dump_one_object, (void *)&info,
619 NULL);
624} 620}
625#endif /* ACPI_FUTURE_USAGE */ 621#endif /* ACPI_FUTURE_USAGE */
626
627 622
628/******************************************************************************* 623/*******************************************************************************
629 * 624 *
@@ -638,25 +633,19 @@ acpi_ns_dump_objects (
638 * 633 *
639 ******************************************************************************/ 634 ******************************************************************************/
640 635
641void 636void acpi_ns_dump_entry(acpi_handle handle, u32 debug_level)
642acpi_ns_dump_entry (
643 acpi_handle handle,
644 u32 debug_level)
645{ 637{
646 struct acpi_walk_info info; 638 struct acpi_walk_info info;
647
648
649 ACPI_FUNCTION_ENTRY ();
650 639
640 ACPI_FUNCTION_ENTRY();
651 641
652 info.debug_level = debug_level; 642 info.debug_level = debug_level;
653 info.owner_id = ACPI_OWNER_ID_MAX; 643 info.owner_id = ACPI_OWNER_ID_MAX;
654 info.display_type = ACPI_DISPLAY_SUMMARY; 644 info.display_type = ACPI_DISPLAY_SUMMARY;
655 645
656 (void) acpi_ns_dump_one_object (handle, 1, &info, NULL); 646 (void)acpi_ns_dump_one_object(handle, 1, &info, NULL);
657} 647}
658 648
659
660#ifdef ACPI_ASL_COMPILER 649#ifdef ACPI_ASL_COMPILER
661/******************************************************************************* 650/*******************************************************************************
662 * 651 *
@@ -673,23 +662,19 @@ acpi_ns_dump_entry (
673 * 662 *
674 ******************************************************************************/ 663 ******************************************************************************/
675 664
676void 665void acpi_ns_dump_tables(acpi_handle search_base, u32 max_depth)
677acpi_ns_dump_tables (
678 acpi_handle search_base,
679 u32 max_depth)
680{ 666{
681 acpi_handle search_handle = search_base; 667 acpi_handle search_handle = search_base;
682
683
684 ACPI_FUNCTION_TRACE ("ns_dump_tables");
685 668
669 ACPI_FUNCTION_TRACE("ns_dump_tables");
686 670
687 if (!acpi_gbl_root_node) { 671 if (!acpi_gbl_root_node) {
688 /* 672 /*
689 * If the name space has not been initialized, 673 * If the name space has not been initialized,
690 * there is nothing to dump. 674 * there is nothing to dump.
691 */ 675 */
692 ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "namespace not initialized!\n")); 676 ACPI_DEBUG_PRINT((ACPI_DB_TABLES,
677 "namespace not initialized!\n"));
693 return_VOID; 678 return_VOID;
694 } 679 }
695 680
@@ -697,12 +682,12 @@ acpi_ns_dump_tables (
697 /* Entire namespace */ 682 /* Entire namespace */
698 683
699 search_handle = acpi_gbl_root_node; 684 search_handle = acpi_gbl_root_node;
700 ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "\\\n")); 685 ACPI_DEBUG_PRINT((ACPI_DB_TABLES, "\\\n"));
701 } 686 }
702 687
703 acpi_ns_dump_objects (ACPI_TYPE_ANY, ACPI_DISPLAY_OBJECTS, max_depth, 688 acpi_ns_dump_objects(ACPI_TYPE_ANY, ACPI_DISPLAY_OBJECTS, max_depth,
704 ACPI_OWNER_ID_MAX, search_handle); 689 ACPI_OWNER_ID_MAX, search_handle);
705 return_VOID; 690 return_VOID;
706} 691}
707#endif /* _ACPI_ASL_COMPILER */ 692#endif /* _ACPI_ASL_COMPILER */
708#endif /* defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) */ 693#endif /* defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) */