1 // SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
2 /*******************************************************************************
4 * Module Name: dbtest - Various debug-related tests
6 ******************************************************************************/
14 #define _COMPONENT ACPI_CA_DEBUGGER
15 ACPI_MODULE_NAME("dbtest")
17 /* Local prototypes */
18 static void acpi_db_test_all_objects(void);
21 acpi_db_test_one_object(acpi_handle obj_handle,
22 u32 nesting_level, void *context, void **return_value);
25 acpi_db_test_integer_type(struct acpi_namespace_node *node, u32 bit_length);
28 acpi_db_test_buffer_type(struct acpi_namespace_node *node, u32 bit_length);
31 acpi_db_test_string_type(struct acpi_namespace_node *node, u32 byte_length);
34 acpi_db_read_from_object(struct acpi_namespace_node *node,
35 acpi_object_type expected_type,
36 union acpi_object **value);
39 acpi_db_write_to_object(struct acpi_namespace_node *node,
40 union acpi_object *value);
42 static void acpi_db_evaluate_all_predefined_names(char *count_arg);
45 acpi_db_evaluate_one_predefined_name(acpi_handle obj_handle,
47 void *context, void **return_value);
52 static struct acpi_db_argument_info acpi_db_test_types[] = {
55 {NULL} /* Must be null terminated */
58 #define CMD_TEST_OBJECTS 0
59 #define CMD_TEST_PREDEFINED 1
61 #define BUFFER_FILL_VALUE 0xFF
64 * Support for the special debugger read/write control methods.
65 * These methods are installed into the current namespace and are
66 * used to read and write the various namespace objects. The point
67 * is to force the AML interpreter do all of the work.
69 #define ACPI_DB_READ_METHOD "\\_T98"
70 #define ACPI_DB_WRITE_METHOD "\\_T99"
72 static acpi_handle read_handle = NULL;
73 static acpi_handle write_handle = NULL;
75 /* ASL Definitions of the debugger read/write control methods */
78 definition_block("ssdt.aml", "SSDT", 2, "Intel", "DEBUG", 0x00000001)
80 method(_T98, 1, not_serialized) { /* Read */
81 return (de_ref_of(arg0))
85 definition_block("ssdt2.aml", "SSDT", 2, "Intel", "DEBUG", 0x00000001)
87 method(_T99, 2, not_serialized) { /* Write */
93 static unsigned char read_method_code[] = {
94 0x53, 0x53, 0x44, 0x54, 0x2E, 0x00, 0x00, 0x00, /* 00000000 "SSDT...." */
95 0x02, 0xC9, 0x49, 0x6E, 0x74, 0x65, 0x6C, 0x00, /* 00000008 "..Intel." */
96 0x44, 0x45, 0x42, 0x55, 0x47, 0x00, 0x00, 0x00, /* 00000010 "DEBUG..." */
97 0x01, 0x00, 0x00, 0x00, 0x49, 0x4E, 0x54, 0x4C, /* 00000018 "....INTL" */
98 0x18, 0x12, 0x13, 0x20, 0x14, 0x09, 0x5F, 0x54, /* 00000020 "... .._T" */
99 0x39, 0x38, 0x01, 0xA4, 0x83, 0x68 /* 00000028 "98...h" */
102 static unsigned char write_method_code[] = {
103 0x53, 0x53, 0x44, 0x54, 0x2E, 0x00, 0x00, 0x00, /* 00000000 "SSDT...." */
104 0x02, 0x15, 0x49, 0x6E, 0x74, 0x65, 0x6C, 0x00, /* 00000008 "..Intel." */
105 0x44, 0x45, 0x42, 0x55, 0x47, 0x00, 0x00, 0x00, /* 00000010 "DEBUG..." */
106 0x01, 0x00, 0x00, 0x00, 0x49, 0x4E, 0x54, 0x4C, /* 00000018 "....INTL" */
107 0x18, 0x12, 0x13, 0x20, 0x14, 0x09, 0x5F, 0x54, /* 00000020 "... .._T" */
108 0x39, 0x39, 0x02, 0x70, 0x69, 0x68 /* 00000028 "99.pih" */
111 /*******************************************************************************
113 * FUNCTION: acpi_db_execute_test
115 * PARAMETERS: type_arg - Subcommand
119 * DESCRIPTION: Execute various debug tests.
121 * Note: Code is prepared for future expansion of the TEST command.
123 ******************************************************************************/
125 void acpi_db_execute_test(char *type_arg)
129 acpi_ut_strupr(type_arg);
130 temp = acpi_db_match_argument(type_arg, acpi_db_test_types);
131 if (temp == ACPI_TYPE_NOT_FOUND) {
132 acpi_os_printf("Invalid or unsupported argument\n");
137 case CMD_TEST_OBJECTS:
139 acpi_db_test_all_objects();
142 case CMD_TEST_PREDEFINED:
144 acpi_db_evaluate_all_predefined_names(NULL);
152 /*******************************************************************************
154 * FUNCTION: acpi_db_test_all_objects
160 * DESCRIPTION: This test implements the OBJECTS subcommand. It exercises the
161 * namespace by reading/writing/comparing all data objects such
162 * as integers, strings, buffers, fields, buffer fields, etc.
164 ******************************************************************************/
166 static void acpi_db_test_all_objects(void)
170 /* Install the debugger read-object control method if necessary */
173 status = acpi_install_method(read_method_code);
174 if (ACPI_FAILURE(status)) {
176 ("%s, Could not install debugger read method\n",
177 acpi_format_exception(status));
182 acpi_get_handle(NULL, ACPI_DB_READ_METHOD, &read_handle);
183 if (ACPI_FAILURE(status)) {
185 ("Could not obtain handle for debug method %s\n",
186 ACPI_DB_READ_METHOD);
191 /* Install the debugger write-object control method if necessary */
194 status = acpi_install_method(write_method_code);
195 if (ACPI_FAILURE(status)) {
197 ("%s, Could not install debugger write method\n",
198 acpi_format_exception(status));
203 acpi_get_handle(NULL, ACPI_DB_WRITE_METHOD, &write_handle);
204 if (ACPI_FAILURE(status)) {
206 ("Could not obtain handle for debug method %s\n",
207 ACPI_DB_WRITE_METHOD);
212 /* Walk the entire namespace, testing each supported named data object */
214 (void)acpi_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
215 ACPI_UINT32_MAX, acpi_db_test_one_object,
219 /*******************************************************************************
221 * FUNCTION: acpi_db_test_one_object
223 * PARAMETERS: acpi_walk_callback
227 * DESCRIPTION: Test one namespace object. Supported types are Integer,
228 * String, Buffer, buffer_field, and field_unit. All other object
229 * types are simply ignored.
231 * Note: Support for Packages is not implemented.
233 ******************************************************************************/
236 acpi_db_test_one_object(acpi_handle obj_handle,
237 u32 nesting_level, void *context, void **return_value)
239 struct acpi_namespace_node *node;
240 union acpi_operand_object *obj_desc;
241 union acpi_operand_object *region_obj;
242 acpi_object_type local_type;
245 acpi_status status = AE_OK;
247 node = ACPI_CAST_PTR(struct acpi_namespace_node, obj_handle);
248 obj_desc = node->object;
251 * For the supported types, get the actual bit length or
252 * byte length. Map the type to one of Integer/String/Buffer.
254 switch (node->type) {
255 case ACPI_TYPE_INTEGER:
257 /* Integer width is either 32 or 64 */
259 local_type = ACPI_TYPE_INTEGER;
260 bit_length = acpi_gbl_integer_bit_width;
263 case ACPI_TYPE_STRING:
265 local_type = ACPI_TYPE_STRING;
266 byte_length = obj_desc->string.length;
269 case ACPI_TYPE_BUFFER:
271 local_type = ACPI_TYPE_BUFFER;
272 byte_length = obj_desc->buffer.length;
273 bit_length = byte_length * 8;
276 case ACPI_TYPE_FIELD_UNIT:
277 case ACPI_TYPE_BUFFER_FIELD:
278 case ACPI_TYPE_LOCAL_REGION_FIELD:
279 case ACPI_TYPE_LOCAL_INDEX_FIELD:
280 case ACPI_TYPE_LOCAL_BANK_FIELD:
282 local_type = ACPI_TYPE_INTEGER;
285 * Returned object will be a Buffer if the field length
286 * is larger than the size of an Integer (32 or 64 bits
287 * depending on the DSDT version).
289 bit_length = obj_desc->common_field.bit_length;
290 byte_length = ACPI_ROUND_BITS_UP_TO_BYTES(bit_length);
291 if (bit_length > acpi_gbl_integer_bit_width) {
292 local_type = ACPI_TYPE_BUFFER;
299 /* Ignore all other types */
304 /* Emit the common prefix: Type:Name */
306 acpi_os_printf("%14s: %4.4s",
307 acpi_ut_get_type_name(node->type), node->name.ascii);
309 acpi_os_printf(" Ignoring, no attached object\n");
314 * Check for unsupported region types. Note: acpi_exec simulates
315 * access to system_memory, system_IO, PCI_Config, and EC.
317 switch (node->type) {
318 case ACPI_TYPE_LOCAL_REGION_FIELD:
320 region_obj = obj_desc->field.region_obj;
321 switch (region_obj->region.space_id) {
322 case ACPI_ADR_SPACE_SYSTEM_MEMORY:
323 case ACPI_ADR_SPACE_SYSTEM_IO:
324 case ACPI_ADR_SPACE_PCI_CONFIG:
325 case ACPI_ADR_SPACE_EC:
332 (" %s space is not supported [%4.4s]\n",
333 acpi_ut_get_region_name(region_obj->region.
335 region_obj->region.node->name.ascii);
344 /* At this point, we have resolved the object to one of the major types */
346 switch (local_type) {
347 case ACPI_TYPE_INTEGER:
349 status = acpi_db_test_integer_type(node, bit_length);
352 case ACPI_TYPE_STRING:
354 status = acpi_db_test_string_type(node, byte_length);
357 case ACPI_TYPE_BUFFER:
359 status = acpi_db_test_buffer_type(node, bit_length);
364 acpi_os_printf(" Ignoring, type not implemented (%2.2X)",
369 switch (node->type) {
370 case ACPI_TYPE_LOCAL_REGION_FIELD:
372 region_obj = obj_desc->field.region_obj;
373 acpi_os_printf(" (%s)",
374 acpi_ut_get_region_name(region_obj->region.
382 acpi_os_printf("\n");
386 /*******************************************************************************
388 * FUNCTION: acpi_db_test_integer_type
390 * PARAMETERS: node - Parent NS node for the object
391 * bit_length - Actual length of the object. Used for
392 * support of arbitrary length field_unit
393 * and buffer_field objects.
397 * DESCRIPTION: Test read/write for an Integer-valued object. Performs a
398 * write/read/compare of an arbitrary new value, then performs
399 * a write/read/compare of the original value.
401 ******************************************************************************/
404 acpi_db_test_integer_type(struct acpi_namespace_node *node, u32 bit_length)
406 union acpi_object *temp1 = NULL;
407 union acpi_object *temp2 = NULL;
408 union acpi_object *temp3 = NULL;
409 union acpi_object write_value;
413 if (bit_length > 64) {
414 acpi_os_printf(" Invalid length for an Integer: %u",
419 /* Read the original value */
421 status = acpi_db_read_from_object(node, ACPI_TYPE_INTEGER, &temp1);
422 if (ACPI_FAILURE(status)) {
426 acpi_os_printf(" (%4.4X/%3.3X) %8.8X%8.8X",
427 bit_length, ACPI_ROUND_BITS_UP_TO_BYTES(bit_length),
428 ACPI_FORMAT_UINT64(temp1->integer.value));
430 value_to_write = ACPI_UINT64_MAX >> (64 - bit_length);
431 if (temp1->integer.value == value_to_write) {
435 /* Write a new value */
437 write_value.type = ACPI_TYPE_INTEGER;
438 write_value.integer.value = value_to_write;
439 status = acpi_db_write_to_object(node, &write_value);
440 if (ACPI_FAILURE(status)) {
444 /* Ensure that we can read back the new value */
446 status = acpi_db_read_from_object(node, ACPI_TYPE_INTEGER, &temp2);
447 if (ACPI_FAILURE(status)) {
451 if (temp2->integer.value != value_to_write) {
452 acpi_os_printf(" MISMATCH 2: %8.8X%8.8X, expecting %8.8X%8.8X",
453 ACPI_FORMAT_UINT64(temp2->integer.value),
454 ACPI_FORMAT_UINT64(value_to_write));
457 /* Write back the original value */
459 write_value.integer.value = temp1->integer.value;
460 status = acpi_db_write_to_object(node, &write_value);
461 if (ACPI_FAILURE(status)) {
465 /* Ensure that we can read back the original value */
467 status = acpi_db_read_from_object(node, ACPI_TYPE_INTEGER, &temp3);
468 if (ACPI_FAILURE(status)) {
472 if (temp3->integer.value != temp1->integer.value) {
473 acpi_os_printf(" MISMATCH 3: %8.8X%8.8X, expecting %8.8X%8.8X",
474 ACPI_FORMAT_UINT64(temp3->integer.value),
475 ACPI_FORMAT_UINT64(temp1->integer.value));
491 /*******************************************************************************
493 * FUNCTION: acpi_db_test_buffer_type
495 * PARAMETERS: node - Parent NS node for the object
496 * bit_length - Actual length of the object.
500 * DESCRIPTION: Test read/write for an Buffer-valued object. Performs a
501 * write/read/compare of an arbitrary new value, then performs
502 * a write/read/compare of the original value.
504 ******************************************************************************/
507 acpi_db_test_buffer_type(struct acpi_namespace_node *node, u32 bit_length)
509 union acpi_object *temp1 = NULL;
510 union acpi_object *temp2 = NULL;
511 union acpi_object *temp3 = NULL;
513 union acpi_object write_value;
519 byte_length = ACPI_ROUND_BITS_UP_TO_BYTES(bit_length);
520 if (byte_length == 0) {
521 acpi_os_printf(" Ignoring zero length buffer");
525 /* Allocate a local buffer */
527 buffer = ACPI_ALLOCATE_ZEROED(byte_length);
529 return (AE_NO_MEMORY);
532 /* Read the original value */
534 status = acpi_db_read_from_object(node, ACPI_TYPE_BUFFER, &temp1);
535 if (ACPI_FAILURE(status)) {
539 /* Emit a few bytes of the buffer */
541 acpi_os_printf(" (%4.4X/%3.3X)", bit_length, temp1->buffer.length);
542 for (i = 0; ((i < 4) && (i < byte_length)); i++) {
543 acpi_os_printf(" %2.2X", temp1->buffer.pointer[i]);
545 acpi_os_printf("... ");
550 * Handle possible extra bits at the end of the buffer. Can
551 * happen for field_units larger than an integer, but the bit
552 * count is not an integral number of bytes. Zero out the
555 memset(buffer, BUFFER_FILL_VALUE, byte_length);
556 extra_bits = bit_length % 8;
558 buffer[byte_length - 1] = ACPI_MASK_BITS_ABOVE(extra_bits);
561 write_value.type = ACPI_TYPE_BUFFER;
562 write_value.buffer.length = byte_length;
563 write_value.buffer.pointer = buffer;
565 status = acpi_db_write_to_object(node, &write_value);
566 if (ACPI_FAILURE(status)) {
570 /* Ensure that we can read back the new value */
572 status = acpi_db_read_from_object(node, ACPI_TYPE_BUFFER, &temp2);
573 if (ACPI_FAILURE(status)) {
577 if (memcmp(temp2->buffer.pointer, buffer, byte_length)) {
578 acpi_os_printf(" MISMATCH 2: New buffer value");
581 /* Write back the original value */
583 write_value.buffer.length = byte_length;
584 write_value.buffer.pointer = temp1->buffer.pointer;
586 status = acpi_db_write_to_object(node, &write_value);
587 if (ACPI_FAILURE(status)) {
591 /* Ensure that we can read back the original value */
593 status = acpi_db_read_from_object(node, ACPI_TYPE_BUFFER, &temp3);
594 if (ACPI_FAILURE(status)) {
598 if (memcmp(temp1->buffer.pointer, temp3->buffer.pointer, byte_length)) {
599 acpi_os_printf(" MISMATCH 3: While restoring original buffer");
616 /*******************************************************************************
618 * FUNCTION: acpi_db_test_string_type
620 * PARAMETERS: node - Parent NS node for the object
621 * byte_length - Actual length of the object.
625 * DESCRIPTION: Test read/write for an String-valued object. Performs a
626 * write/read/compare of an arbitrary new value, then performs
627 * a write/read/compare of the original value.
629 ******************************************************************************/
632 acpi_db_test_string_type(struct acpi_namespace_node *node, u32 byte_length)
634 union acpi_object *temp1 = NULL;
635 union acpi_object *temp2 = NULL;
636 union acpi_object *temp3 = NULL;
637 char *value_to_write = "Test String from AML Debugger";
638 union acpi_object write_value;
641 /* Read the original value */
643 status = acpi_db_read_from_object(node, ACPI_TYPE_STRING, &temp1);
644 if (ACPI_FAILURE(status)) {
648 acpi_os_printf(" (%4.4X/%3.3X) \"%s\"", (temp1->string.length * 8),
649 temp1->string.length, temp1->string.pointer);
651 /* Write a new value */
653 write_value.type = ACPI_TYPE_STRING;
654 write_value.string.length = strlen(value_to_write);
655 write_value.string.pointer = value_to_write;
657 status = acpi_db_write_to_object(node, &write_value);
658 if (ACPI_FAILURE(status)) {
662 /* Ensure that we can read back the new value */
664 status = acpi_db_read_from_object(node, ACPI_TYPE_STRING, &temp2);
665 if (ACPI_FAILURE(status)) {
669 if (strcmp(temp2->string.pointer, value_to_write)) {
670 acpi_os_printf(" MISMATCH 2: %s, expecting %s",
671 temp2->string.pointer, value_to_write);
674 /* Write back the original value */
676 write_value.string.length = strlen(temp1->string.pointer);
677 write_value.string.pointer = temp1->string.pointer;
679 status = acpi_db_write_to_object(node, &write_value);
680 if (ACPI_FAILURE(status)) {
684 /* Ensure that we can read back the original value */
686 status = acpi_db_read_from_object(node, ACPI_TYPE_STRING, &temp3);
687 if (ACPI_FAILURE(status)) {
691 if (strcmp(temp1->string.pointer, temp3->string.pointer)) {
692 acpi_os_printf(" MISMATCH 3: %s, expecting %s",
693 temp3->string.pointer, temp1->string.pointer);
709 /*******************************************************************************
711 * FUNCTION: acpi_db_read_from_object
713 * PARAMETERS: node - Parent NS node for the object
714 * expected_type - Object type expected from the read
715 * value - Where the value read is returned
719 * DESCRIPTION: Performs a read from the specified object by invoking the
720 * special debugger control method that reads the object. Thus,
721 * the AML interpreter is doing all of the work, increasing the
722 * validity of the test.
724 ******************************************************************************/
727 acpi_db_read_from_object(struct acpi_namespace_node *node,
728 acpi_object_type expected_type,
729 union acpi_object **value)
731 union acpi_object *ret_value;
732 struct acpi_object_list param_objects;
733 union acpi_object params[2];
734 struct acpi_buffer return_obj;
737 params[0].type = ACPI_TYPE_LOCAL_REFERENCE;
738 params[0].reference.actual_type = node->type;
739 params[0].reference.handle = ACPI_CAST_PTR(acpi_handle, node);
741 param_objects.count = 1;
742 param_objects.pointer = params;
744 return_obj.length = ACPI_ALLOCATE_BUFFER;
746 acpi_gbl_method_executing = TRUE;
747 status = acpi_evaluate_object(read_handle, NULL,
748 ¶m_objects, &return_obj);
749 acpi_gbl_method_executing = FALSE;
751 if (ACPI_FAILURE(status)) {
752 acpi_os_printf("Could not read from object, %s",
753 acpi_format_exception(status));
757 ret_value = (union acpi_object *)return_obj.pointer;
759 switch (ret_value->type) {
760 case ACPI_TYPE_INTEGER:
761 case ACPI_TYPE_BUFFER:
762 case ACPI_TYPE_STRING:
764 * Did we receive the type we wanted? Most important for the
765 * Integer/Buffer case (when a field is larger than an Integer,
766 * it should return a Buffer).
768 if (ret_value->type != expected_type) {
770 (" Type mismatch: Expected %s, Received %s",
771 acpi_ut_get_type_name(expected_type),
772 acpi_ut_get_type_name(ret_value->type));
782 acpi_os_printf(" Unsupported return object type, %s",
783 acpi_ut_get_type_name(ret_value->type));
785 acpi_os_free(return_obj.pointer);
792 /*******************************************************************************
794 * FUNCTION: acpi_db_write_to_object
796 * PARAMETERS: node - Parent NS node for the object
797 * value - Value to be written
801 * DESCRIPTION: Performs a write to the specified object by invoking the
802 * special debugger control method that writes the object. Thus,
803 * the AML interpreter is doing all of the work, increasing the
804 * validity of the test.
806 ******************************************************************************/
809 acpi_db_write_to_object(struct acpi_namespace_node *node,
810 union acpi_object *value)
812 struct acpi_object_list param_objects;
813 union acpi_object params[2];
816 params[0].type = ACPI_TYPE_LOCAL_REFERENCE;
817 params[0].reference.actual_type = node->type;
818 params[0].reference.handle = ACPI_CAST_PTR(acpi_handle, node);
820 /* Copy the incoming user parameter */
822 memcpy(¶ms[1], value, sizeof(union acpi_object));
824 param_objects.count = 2;
825 param_objects.pointer = params;
827 acpi_gbl_method_executing = TRUE;
828 status = acpi_evaluate_object(write_handle, NULL, ¶m_objects, NULL);
829 acpi_gbl_method_executing = FALSE;
831 if (ACPI_FAILURE(status)) {
832 acpi_os_printf("Could not write to object, %s",
833 acpi_format_exception(status));
839 /*******************************************************************************
841 * FUNCTION: acpi_db_evaluate_all_predefined_names
843 * PARAMETERS: count_arg - Max number of methods to execute
847 * DESCRIPTION: Namespace batch execution. Execute predefined names in the
848 * namespace, up to the max count, if specified.
850 ******************************************************************************/
852 static void acpi_db_evaluate_all_predefined_names(char *count_arg)
854 struct acpi_db_execute_walk info;
857 info.max_count = ACPI_UINT32_MAX;
860 info.max_count = strtoul(count_arg, NULL, 0);
863 /* Search all nodes in namespace */
865 (void)acpi_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
867 acpi_db_evaluate_one_predefined_name, NULL,
868 (void *)&info, NULL);
870 acpi_os_printf("Evaluated %u predefined names in the namespace\n",
874 /*******************************************************************************
876 * FUNCTION: acpi_db_evaluate_one_predefined_name
878 * PARAMETERS: Callback from walk_namespace
882 * DESCRIPTION: Batch execution module. Currently only executes predefined
885 ******************************************************************************/
888 acpi_db_evaluate_one_predefined_name(acpi_handle obj_handle,
890 void *context, void **return_value)
892 struct acpi_namespace_node *node =
893 (struct acpi_namespace_node *)obj_handle;
894 struct acpi_db_execute_walk *info =
895 (struct acpi_db_execute_walk *)context;
897 const union acpi_predefined_info *predefined;
898 struct acpi_device_info *obj_info;
899 struct acpi_object_list param_objects;
900 union acpi_object params[ACPI_METHOD_NUM_ARGS];
901 union acpi_object *this_param;
902 struct acpi_buffer return_obj;
909 /* The name must be a predefined ACPI name */
911 predefined = acpi_ut_match_predefined_method(node->name.ascii);
916 if (node->type == ACPI_TYPE_LOCAL_SCOPE) {
920 pathname = acpi_ns_get_normalized_pathname(node, TRUE);
925 /* Get the object info for number of method parameters */
927 status = acpi_get_object_info(obj_handle, &obj_info);
928 if (ACPI_FAILURE(status)) {
933 param_objects.count = 0;
934 param_objects.pointer = NULL;
936 if (obj_info->type == ACPI_TYPE_METHOD) {
938 /* Setup default parameters (with proper types) */
940 arg_type_list = predefined->info.argument_list;
941 arg_count = METHOD_GET_ARG_COUNT(arg_type_list);
944 * Setup the ACPI-required number of arguments, regardless of what
945 * the actual method defines. If there is a difference, then the
946 * method is wrong and a warning will be issued during execution.
949 for (i = 0; i < arg_count; i++) {
950 arg_type = METHOD_GET_NEXT_TYPE(arg_type_list);
951 this_param->type = arg_type;
954 case ACPI_TYPE_INTEGER:
956 this_param->integer.value = 1;
959 case ACPI_TYPE_STRING:
961 this_param->string.pointer =
962 "This is the default argument string";
963 this_param->string.length =
964 strlen(this_param->string.pointer);
967 case ACPI_TYPE_BUFFER:
969 this_param->buffer.pointer = (u8 *)params; /* just a garbage buffer */
970 this_param->buffer.length = 48;
973 case ACPI_TYPE_PACKAGE:
975 this_param->package.elements = NULL;
976 this_param->package.count = 0;
982 ("%s: Unsupported argument type: %u\n",
990 param_objects.count = arg_count;
991 param_objects.pointer = params;
995 return_obj.pointer = NULL;
996 return_obj.length = ACPI_ALLOCATE_BUFFER;
998 /* Do the actual method execution */
1000 acpi_gbl_method_executing = TRUE;
1002 status = acpi_evaluate_object(node, NULL, ¶m_objects, &return_obj);
1004 acpi_os_printf("%-32s returned %s\n",
1005 pathname, acpi_format_exception(status));
1006 acpi_gbl_method_executing = FALSE;
1007 ACPI_FREE(pathname);
1009 /* Ignore status from method execution */
1013 /* Update count, check if we have executed enough methods */
1016 if (info->count >= info->max_count) {
1017 status = AE_CTRL_TERMINATE;