@@ -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 );
@@ -359,26 +367,40 @@ acpi_db_test_one_object(acpi_handle obj_handle,
359
367
status = acpi_db_test_buffer_type (node , bit_length );
360
368
break ;
361
369
370
+ case ACPI_TYPE_PACKAGE :
371
+
372
+ status = acpi_db_test_package_type (node );
373
+ break ;
374
+
362
375
default :
363
376
364
377
acpi_os_printf (" Ignoring, type not implemented (%2.2X)" ,
365
378
local_type );
366
379
break ;
367
380
}
368
381
382
+ /* Exit on error, but don't abort the namespace walk */
383
+
384
+ if (ACPI_FAILURE (status )) {
385
+ status = AE_OK ;
386
+ goto exit ;
387
+ }
388
+
369
389
switch (node -> type ) {
370
390
case ACPI_TYPE_LOCAL_REGION_FIELD :
371
391
372
392
region_obj = obj_desc -> field .region_obj ;
373
393
acpi_os_printf (" (%s)" ,
374
394
acpi_ut_get_region_name (region_obj -> region .
375
395
space_id ));
396
+
376
397
break ;
377
398
378
399
default :
379
400
break ;
380
401
}
381
402
403
+ exit :
382
404
acpi_os_printf ("\n" );
383
405
return (status );
384
406
}
@@ -431,7 +453,6 @@ acpi_db_test_integer_type(struct acpi_namespace_node *node, u32 bit_length)
431
453
if (temp1 -> integer .value == value_to_write ) {
432
454
value_to_write = 0 ;
433
455
}
434
-
435
456
/* Write a new value */
436
457
437
458
write_value .type = ACPI_TYPE_INTEGER ;
@@ -706,6 +727,35 @@ acpi_db_test_string_type(struct acpi_namespace_node *node, u32 byte_length)
706
727
return (status );
707
728
}
708
729
730
+ /*******************************************************************************
731
+ *
732
+ * FUNCTION: acpi_db_test_package_type
733
+ *
734
+ * PARAMETERS: node - Parent NS node for the object
735
+ *
736
+ * RETURN: Status
737
+ *
738
+ * DESCRIPTION: Test read for a Package object.
739
+ *
740
+ ******************************************************************************/
741
+
742
+ static acpi_status acpi_db_test_package_type (struct acpi_namespace_node * node )
743
+ {
744
+ union acpi_object * temp1 = NULL ;
745
+ acpi_status status ;
746
+
747
+ /* Read the original value */
748
+
749
+ status = acpi_db_read_from_object (node , ACPI_TYPE_PACKAGE , & temp1 );
750
+ if (ACPI_FAILURE (status )) {
751
+ return (status );
752
+ }
753
+
754
+ acpi_os_printf (" %8.8X Elements" , temp1 -> package .count );
755
+ acpi_os_free (temp1 );
756
+ return (status );
757
+ }
758
+
709
759
/*******************************************************************************
710
760
*
711
761
* FUNCTION: acpi_db_read_from_object
@@ -746,8 +796,8 @@ acpi_db_read_from_object(struct acpi_namespace_node *node,
746
796
acpi_gbl_method_executing = TRUE;
747
797
status = acpi_evaluate_object (read_handle , NULL ,
748
798
& param_objects , & return_obj );
749
- acpi_gbl_method_executing = FALSE;
750
799
800
+ acpi_gbl_method_executing = FALSE;
751
801
if (ACPI_FAILURE (status )) {
752
802
acpi_os_printf ("Could not read from object, %s" ,
753
803
acpi_format_exception (status ));
@@ -760,6 +810,7 @@ acpi_db_read_from_object(struct acpi_namespace_node *node,
760
810
case ACPI_TYPE_INTEGER :
761
811
case ACPI_TYPE_BUFFER :
762
812
case ACPI_TYPE_STRING :
813
+ case ACPI_TYPE_PACKAGE :
763
814
/*
764
815
* Did we receive the type we wanted? Most important for the
765
816
* Integer/Buffer case (when a field is larger than an Integer,
@@ -771,6 +822,7 @@ acpi_db_read_from_object(struct acpi_namespace_node *node,
771
822
acpi_ut_get_type_name (expected_type ),
772
823
acpi_ut_get_type_name (ret_value -> type ));
773
824
825
+ acpi_os_free (return_obj .pointer );
774
826
return (AE_TYPE );
775
827
}
776
828
0 commit comments