@@ -30,6 +30,8 @@ acpi_db_test_buffer_type(struct acpi_namespace_node *node, u32 bit_length);
30
30
static acpi_status
31
31
acpi_db_test_string_type (struct acpi_namespace_node * node , u32 byte_length );
32
32
33
+ static acpi_status acpi_db_test_package_type (struct acpi_namespace_node * node );
34
+
33
35
static acpi_status
34
36
acpi_db_read_from_object (struct acpi_namespace_node * node ,
35
37
acpi_object_type expected_type ,
@@ -273,6 +275,11 @@ acpi_db_test_one_object(acpi_handle obj_handle,
273
275
bit_length = byte_length * 8 ;
274
276
break ;
275
277
278
+ case ACPI_TYPE_PACKAGE :
279
+
280
+ local_type = ACPI_TYPE_PACKAGE ;
281
+ break ;
282
+
276
283
case ACPI_TYPE_FIELD_UNIT :
277
284
case ACPI_TYPE_BUFFER_FIELD :
278
285
case ACPI_TYPE_LOCAL_REGION_FIELD :
@@ -305,6 +312,7 @@ acpi_db_test_one_object(acpi_handle obj_handle,
305
312
306
313
acpi_os_printf ("%14s: %4.4s" ,
307
314
acpi_ut_get_type_name (node -> type ), node -> name .ascii );
315
+
308
316
if (!obj_desc ) {
309
317
acpi_os_printf (" Ignoring, no attached object\n" );
310
318
return (AE_OK );
@@ -322,14 +330,13 @@ acpi_db_test_one_object(acpi_handle obj_handle,
322
330
case ACPI_ADR_SPACE_SYSTEM_MEMORY :
323
331
case ACPI_ADR_SPACE_SYSTEM_IO :
324
332
case ACPI_ADR_SPACE_PCI_CONFIG :
325
- case ACPI_ADR_SPACE_EC :
326
333
327
334
break ;
328
335
329
336
default :
330
337
331
338
acpi_os_printf
332
- (" %s space is not supported [%4.4s]\n" ,
339
+ (" %s space is not supported in this command [%4.4s]\n" ,
333
340
acpi_ut_get_region_name (region_obj -> region .
334
341
space_id ),
335
342
region_obj -> region .node -> name .ascii );
@@ -359,26 +366,40 @@ acpi_db_test_one_object(acpi_handle obj_handle,
359
366
status = acpi_db_test_buffer_type (node , bit_length );
360
367
break ;
361
368
369
+ case ACPI_TYPE_PACKAGE :
370
+
371
+ status = acpi_db_test_package_type (node );
372
+ break ;
373
+
362
374
default :
363
375
364
376
acpi_os_printf (" Ignoring, type not implemented (%2.2X)" ,
365
377
local_type );
366
378
break ;
367
379
}
368
380
381
+ /* Exit on error, but don't abort the namespace walk */
382
+
383
+ if (ACPI_FAILURE (status )) {
384
+ status = AE_OK ;
385
+ goto exit ;
386
+ }
387
+
369
388
switch (node -> type ) {
370
389
case ACPI_TYPE_LOCAL_REGION_FIELD :
371
390
372
391
region_obj = obj_desc -> field .region_obj ;
373
392
acpi_os_printf (" (%s)" ,
374
393
acpi_ut_get_region_name (region_obj -> region .
375
394
space_id ));
395
+
376
396
break ;
377
397
378
398
default :
379
399
break ;
380
400
}
381
401
402
+ exit :
382
403
acpi_os_printf ("\n" );
383
404
return (status );
384
405
}
@@ -431,7 +452,6 @@ acpi_db_test_integer_type(struct acpi_namespace_node *node, u32 bit_length)
431
452
if (temp1 -> integer .value == value_to_write ) {
432
453
value_to_write = 0 ;
433
454
}
434
-
435
455
/* Write a new value */
436
456
437
457
write_value .type = ACPI_TYPE_INTEGER ;
@@ -706,6 +726,35 @@ acpi_db_test_string_type(struct acpi_namespace_node *node, u32 byte_length)
706
726
return (status );
707
727
}
708
728
729
+ /*******************************************************************************
730
+ *
731
+ * FUNCTION: acpi_db_test_package_type
732
+ *
733
+ * PARAMETERS: node - Parent NS node for the object
734
+ *
735
+ * RETURN: Status
736
+ *
737
+ * DESCRIPTION: Test read for a Package object.
738
+ *
739
+ ******************************************************************************/
740
+
741
+ static acpi_status acpi_db_test_package_type (struct acpi_namespace_node * node )
742
+ {
743
+ union acpi_object * temp1 = NULL ;
744
+ acpi_status status ;
745
+
746
+ /* Read the original value */
747
+
748
+ status = acpi_db_read_from_object (node , ACPI_TYPE_PACKAGE , & temp1 );
749
+ if (ACPI_FAILURE (status )) {
750
+ return (status );
751
+ }
752
+
753
+ acpi_os_printf (" %8.8X Elements" , temp1 -> package .count );
754
+ acpi_os_free (temp1 );
755
+ return (status );
756
+ }
757
+
709
758
/*******************************************************************************
710
759
*
711
760
* FUNCTION: acpi_db_read_from_object
@@ -746,8 +795,8 @@ acpi_db_read_from_object(struct acpi_namespace_node *node,
746
795
acpi_gbl_method_executing = TRUE;
747
796
status = acpi_evaluate_object (read_handle , NULL ,
748
797
& param_objects , & return_obj );
749
- acpi_gbl_method_executing = FALSE;
750
798
799
+ acpi_gbl_method_executing = FALSE;
751
800
if (ACPI_FAILURE (status )) {
752
801
acpi_os_printf ("Could not read from object, %s" ,
753
802
acpi_format_exception (status ));
@@ -760,6 +809,7 @@ acpi_db_read_from_object(struct acpi_namespace_node *node,
760
809
case ACPI_TYPE_INTEGER :
761
810
case ACPI_TYPE_BUFFER :
762
811
case ACPI_TYPE_STRING :
812
+ case ACPI_TYPE_PACKAGE :
763
813
/*
764
814
* Did we receive the type we wanted? Most important for the
765
815
* Integer/Buffer case (when a field is larger than an Integer,
@@ -771,6 +821,7 @@ acpi_db_read_from_object(struct acpi_namespace_node *node,
771
821
acpi_ut_get_type_name (expected_type ),
772
822
acpi_ut_get_type_name (ret_value -> type ));
773
823
824
+ acpi_os_free (return_obj .pointer );
774
825
return (AE_TYPE );
775
826
}
776
827
0 commit comments