1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44#include <acpi/acpi.h>
45#include "accommon.h"
46#include "acdebug.h"
47#include "acnamesp.h"
48#include "acpredef.h"
49
50#define _COMPONENT ACPI_CA_DEBUGGER
51ACPI_MODULE_NAME("dbtest")
52
53
54static void acpi_db_test_all_objects(void);
55
56static acpi_status
57acpi_db_test_one_object(acpi_handle obj_handle,
58 u32 nesting_level, void *context, void **return_value);
59
60static acpi_status
61acpi_db_test_integer_type(struct acpi_namespace_node *node, u32 bit_length);
62
63static acpi_status
64acpi_db_test_buffer_type(struct acpi_namespace_node *node, u32 bit_length);
65
66static acpi_status
67acpi_db_test_string_type(struct acpi_namespace_node *node, u32 byte_length);
68
69static acpi_status
70acpi_db_read_from_object(struct acpi_namespace_node *node,
71 acpi_object_type expected_type,
72 union acpi_object **value);
73
74static acpi_status
75acpi_db_write_to_object(struct acpi_namespace_node *node,
76 union acpi_object *value);
77
78static void acpi_db_evaluate_all_predefined_names(char *count_arg);
79
80static acpi_status
81acpi_db_evaluate_one_predefined_name(acpi_handle obj_handle,
82 u32 nesting_level,
83 void *context, void **return_value);
84
85
86
87
88static struct acpi_db_argument_info acpi_db_test_types[] = {
89 {"OBJECTS"},
90 {"PREDEFINED"},
91 {NULL}
92};
93
94#define CMD_TEST_OBJECTS 0
95#define CMD_TEST_PREDEFINED 1
96
97#define BUFFER_FILL_VALUE 0xFF
98
99
100
101
102
103
104
105#define ACPI_DB_READ_METHOD "\\_T98"
106#define ACPI_DB_WRITE_METHOD "\\_T99"
107
108static acpi_handle read_handle = NULL;
109static acpi_handle write_handle = NULL;
110
111
112
113#if 0
114definition_block("ssdt.aml", "SSDT", 2, "Intel", "DEBUG", 0x00000001)
115{
116 method(_T98, 1, not_serialized) {
117 return (de_ref_of(arg0))
118 }
119}
120
121definition_block("ssdt2.aml", "SSDT", 2, "Intel", "DEBUG", 0x00000001)
122{
123 method(_T99, 2, not_serialized) {
124 store(arg1, arg0)
125 }
126}
127#endif
128
129static unsigned char read_method_code[] = {
130 0x53, 0x53, 0x44, 0x54, 0x2E, 0x00, 0x00, 0x00,
131 0x02, 0xC9, 0x49, 0x6E, 0x74, 0x65, 0x6C, 0x00,
132 0x44, 0x45, 0x42, 0x55, 0x47, 0x00, 0x00, 0x00,
133 0x01, 0x00, 0x00, 0x00, 0x49, 0x4E, 0x54, 0x4C,
134 0x18, 0x12, 0x13, 0x20, 0x14, 0x09, 0x5F, 0x54,
135 0x39, 0x38, 0x01, 0xA4, 0x83, 0x68
136};
137
138static unsigned char write_method_code[] = {
139 0x53, 0x53, 0x44, 0x54, 0x2E, 0x00, 0x00, 0x00,
140 0x02, 0x15, 0x49, 0x6E, 0x74, 0x65, 0x6C, 0x00,
141 0x44, 0x45, 0x42, 0x55, 0x47, 0x00, 0x00, 0x00,
142 0x01, 0x00, 0x00, 0x00, 0x49, 0x4E, 0x54, 0x4C,
143 0x18, 0x12, 0x13, 0x20, 0x14, 0x09, 0x5F, 0x54,
144 0x39, 0x39, 0x02, 0x70, 0x69, 0x68
145};
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161void acpi_db_execute_test(char *type_arg)
162{
163 u32 temp;
164
165 acpi_ut_strupr(type_arg);
166 temp = acpi_db_match_argument(type_arg, acpi_db_test_types);
167 if (temp == ACPI_TYPE_NOT_FOUND) {
168 acpi_os_printf("Invalid or unsupported argument\n");
169 return;
170 }
171
172 switch (temp) {
173 case CMD_TEST_OBJECTS:
174
175 acpi_db_test_all_objects();
176 break;
177
178 case CMD_TEST_PREDEFINED:
179
180 acpi_db_evaluate_all_predefined_names(NULL);
181 break;
182
183 default:
184 break;
185 }
186}
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202static void acpi_db_test_all_objects(void)
203{
204 acpi_status status;
205
206
207
208 if (!read_handle) {
209 status = acpi_install_method(read_method_code);
210 if (ACPI_FAILURE(status)) {
211 acpi_os_printf
212 ("%s, Could not install debugger read method\n",
213 acpi_format_exception(status));
214 return;
215 }
216
217 status =
218 acpi_get_handle(NULL, ACPI_DB_READ_METHOD, &read_handle);
219 if (ACPI_FAILURE(status)) {
220 acpi_os_printf
221 ("Could not obtain handle for debug method %s\n",
222 ACPI_DB_READ_METHOD);
223 return;
224 }
225 }
226
227
228
229 if (!write_handle) {
230 status = acpi_install_method(write_method_code);
231 if (ACPI_FAILURE(status)) {
232 acpi_os_printf
233 ("%s, Could not install debugger write method\n",
234 acpi_format_exception(status));
235 return;
236 }
237
238 status =
239 acpi_get_handle(NULL, ACPI_DB_WRITE_METHOD, &write_handle);
240 if (ACPI_FAILURE(status)) {
241 acpi_os_printf
242 ("Could not obtain handle for debug method %s\n",
243 ACPI_DB_WRITE_METHOD);
244 return;
245 }
246 }
247
248
249
250 (void)acpi_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
251 ACPI_UINT32_MAX, acpi_db_test_one_object,
252 NULL, NULL, NULL);
253}
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271static acpi_status
272acpi_db_test_one_object(acpi_handle obj_handle,
273 u32 nesting_level, void *context, void **return_value)
274{
275 struct acpi_namespace_node *node;
276 union acpi_operand_object *obj_desc;
277 union acpi_operand_object *region_obj;
278 acpi_object_type local_type;
279 u32 bit_length = 0;
280 u32 byte_length = 0;
281 acpi_status status = AE_OK;
282
283 node = ACPI_CAST_PTR(struct acpi_namespace_node, obj_handle);
284 obj_desc = node->object;
285
286
287
288
289
290 switch (node->type) {
291 case ACPI_TYPE_INTEGER:
292
293
294
295 local_type = ACPI_TYPE_INTEGER;
296 bit_length = acpi_gbl_integer_bit_width;
297 break;
298
299 case ACPI_TYPE_STRING:
300
301 local_type = ACPI_TYPE_STRING;
302 byte_length = obj_desc->string.length;
303 break;
304
305 case ACPI_TYPE_BUFFER:
306
307 local_type = ACPI_TYPE_BUFFER;
308 byte_length = obj_desc->buffer.length;
309 bit_length = byte_length * 8;
310 break;
311
312 case ACPI_TYPE_FIELD_UNIT:
313 case ACPI_TYPE_BUFFER_FIELD:
314 case ACPI_TYPE_LOCAL_REGION_FIELD:
315 case ACPI_TYPE_LOCAL_INDEX_FIELD:
316 case ACPI_TYPE_LOCAL_BANK_FIELD:
317
318 local_type = ACPI_TYPE_INTEGER;
319 if (obj_desc) {
320
321
322
323
324
325 bit_length = obj_desc->common_field.bit_length;
326 byte_length = ACPI_ROUND_BITS_UP_TO_BYTES(bit_length);
327 if (bit_length > acpi_gbl_integer_bit_width) {
328 local_type = ACPI_TYPE_BUFFER;
329 }
330 }
331 break;
332
333 default:
334
335
336
337 return (AE_OK);
338 }
339
340
341
342 acpi_os_printf("%14s: %4.4s",
343 acpi_ut_get_type_name(node->type), node->name.ascii);
344 if (!obj_desc) {
345 acpi_os_printf(" Ignoring, no attached object\n");
346 return (AE_OK);
347 }
348
349
350
351
352
353 switch (node->type) {
354 case ACPI_TYPE_LOCAL_REGION_FIELD:
355
356 region_obj = obj_desc->field.region_obj;
357 switch (region_obj->region.space_id) {
358 case ACPI_ADR_SPACE_SYSTEM_MEMORY:
359 case ACPI_ADR_SPACE_SYSTEM_IO:
360 case ACPI_ADR_SPACE_PCI_CONFIG:
361 case ACPI_ADR_SPACE_EC:
362
363 break;
364
365 default:
366
367 acpi_os_printf
368 (" %s space is not supported [%4.4s]\n",
369 acpi_ut_get_region_name(region_obj->region.
370 space_id),
371 region_obj->region.node->name.ascii);
372 return (AE_OK);
373 }
374 break;
375
376 default:
377 break;
378 }
379
380
381
382 switch (local_type) {
383 case ACPI_TYPE_INTEGER:
384
385 status = acpi_db_test_integer_type(node, bit_length);
386 break;
387
388 case ACPI_TYPE_STRING:
389
390 status = acpi_db_test_string_type(node, byte_length);
391 break;
392
393 case ACPI_TYPE_BUFFER:
394
395 status = acpi_db_test_buffer_type(node, bit_length);
396 break;
397
398 default:
399
400 acpi_os_printf(" Ignoring, type not implemented (%2.2X)",
401 local_type);
402 break;
403 }
404
405 switch (node->type) {
406 case ACPI_TYPE_LOCAL_REGION_FIELD:
407
408 region_obj = obj_desc->field.region_obj;
409 acpi_os_printf(" (%s)",
410 acpi_ut_get_region_name(region_obj->region.
411 space_id));
412 break;
413
414 default:
415 break;
416 }
417
418 acpi_os_printf("\n");
419 return (status);
420}
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439static acpi_status
440acpi_db_test_integer_type(struct acpi_namespace_node *node, u32 bit_length)
441{
442 union acpi_object *temp1 = NULL;
443 union acpi_object *temp2 = NULL;
444 union acpi_object *temp3 = NULL;
445 union acpi_object write_value;
446 u64 value_to_write;
447 acpi_status status;
448
449 if (bit_length > 64) {
450 acpi_os_printf(" Invalid length for an Integer: %u",
451 bit_length);
452 return (AE_OK);
453 }
454
455
456
457 status = acpi_db_read_from_object(node, ACPI_TYPE_INTEGER, &temp1);
458 if (ACPI_FAILURE(status)) {
459 return (status);
460 }
461
462 acpi_os_printf(" (%4.4X/%3.3X) %8.8X%8.8X",
463 bit_length, ACPI_ROUND_BITS_UP_TO_BYTES(bit_length),
464 ACPI_FORMAT_UINT64(temp1->integer.value));
465
466 value_to_write = ACPI_UINT64_MAX >> (64 - bit_length);
467 if (temp1->integer.value == value_to_write) {
468 value_to_write = 0;
469 }
470
471
472
473 write_value.type = ACPI_TYPE_INTEGER;
474 write_value.integer.value = value_to_write;
475 status = acpi_db_write_to_object(node, &write_value);
476 if (ACPI_FAILURE(status)) {
477 goto exit;
478 }
479
480
481
482 status = acpi_db_read_from_object(node, ACPI_TYPE_INTEGER, &temp2);
483 if (ACPI_FAILURE(status)) {
484 goto exit;
485 }
486
487 if (temp2->integer.value != value_to_write) {
488 acpi_os_printf(" MISMATCH 2: %8.8X%8.8X, expecting %8.8X%8.8X",
489 ACPI_FORMAT_UINT64(temp2->integer.value),
490 ACPI_FORMAT_UINT64(value_to_write));
491 }
492
493
494
495 write_value.integer.value = temp1->integer.value;
496 status = acpi_db_write_to_object(node, &write_value);
497 if (ACPI_FAILURE(status)) {
498 goto exit;
499 }
500
501
502
503 status = acpi_db_read_from_object(node, ACPI_TYPE_INTEGER, &temp3);
504 if (ACPI_FAILURE(status)) {
505 goto exit;
506 }
507
508 if (temp3->integer.value != temp1->integer.value) {
509 acpi_os_printf(" MISMATCH 3: %8.8X%8.8X, expecting %8.8X%8.8X",
510 ACPI_FORMAT_UINT64(temp3->integer.value),
511 ACPI_FORMAT_UINT64(temp1->integer.value));
512 }
513
514exit:
515 if (temp1) {
516 acpi_os_free(temp1);
517 }
518 if (temp2) {
519 acpi_os_free(temp2);
520 }
521 if (temp3) {
522 acpi_os_free(temp3);
523 }
524 return (AE_OK);
525}
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542static acpi_status
543acpi_db_test_buffer_type(struct acpi_namespace_node *node, u32 bit_length)
544{
545 union acpi_object *temp1 = NULL;
546 union acpi_object *temp2 = NULL;
547 union acpi_object *temp3 = NULL;
548 u8 *buffer;
549 union acpi_object write_value;
550 acpi_status status;
551 u32 byte_length;
552 u32 i;
553 u8 extra_bits;
554
555 byte_length = ACPI_ROUND_BITS_UP_TO_BYTES(bit_length);
556 if (byte_length == 0) {
557 acpi_os_printf(" Ignoring zero length buffer");
558 return (AE_OK);
559 }
560
561
562
563 buffer = ACPI_ALLOCATE_ZEROED(byte_length);
564 if (!buffer) {
565 return (AE_NO_MEMORY);
566 }
567
568
569
570 status = acpi_db_read_from_object(node, ACPI_TYPE_BUFFER, &temp1);
571 if (ACPI_FAILURE(status)) {
572 goto exit;
573 }
574
575
576
577 acpi_os_printf(" (%4.4X/%3.3X)", bit_length, temp1->buffer.length);
578 for (i = 0; ((i < 4) && (i < byte_length)); i++) {
579 acpi_os_printf(" %2.2X", temp1->buffer.pointer[i]);
580 }
581 acpi_os_printf("... ");
582
583
584
585
586
587
588
589
590
591 memset(buffer, BUFFER_FILL_VALUE, byte_length);
592 extra_bits = bit_length % 8;
593 if (extra_bits) {
594 buffer[byte_length - 1] = ACPI_MASK_BITS_ABOVE(extra_bits);
595 }
596
597 write_value.type = ACPI_TYPE_BUFFER;
598 write_value.buffer.length = byte_length;
599 write_value.buffer.pointer = buffer;
600
601 status = acpi_db_write_to_object(node, &write_value);
602 if (ACPI_FAILURE(status)) {
603 goto exit;
604 }
605
606
607
608 status = acpi_db_read_from_object(node, ACPI_TYPE_BUFFER, &temp2);
609 if (ACPI_FAILURE(status)) {
610 goto exit;
611 }
612
613 if (memcmp(temp2->buffer.pointer, buffer, byte_length)) {
614 acpi_os_printf(" MISMATCH 2: New buffer value");
615 }
616
617
618
619 write_value.buffer.length = byte_length;
620 write_value.buffer.pointer = temp1->buffer.pointer;
621
622 status = acpi_db_write_to_object(node, &write_value);
623 if (ACPI_FAILURE(status)) {
624 goto exit;
625 }
626
627
628
629 status = acpi_db_read_from_object(node, ACPI_TYPE_BUFFER, &temp3);
630 if (ACPI_FAILURE(status)) {
631 goto exit;
632 }
633
634 if (memcmp(temp1->buffer.pointer, temp3->buffer.pointer, byte_length)) {
635 acpi_os_printf(" MISMATCH 3: While restoring original buffer");
636 }
637
638exit:
639 ACPI_FREE(buffer);
640 if (temp1) {
641 acpi_os_free(temp1);
642 }
643 if (temp2) {
644 acpi_os_free(temp2);
645 }
646 if (temp3) {
647 acpi_os_free(temp3);
648 }
649 return (status);
650}
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667static acpi_status
668acpi_db_test_string_type(struct acpi_namespace_node *node, u32 byte_length)
669{
670 union acpi_object *temp1 = NULL;
671 union acpi_object *temp2 = NULL;
672 union acpi_object *temp3 = NULL;
673 char *value_to_write = "Test String from AML Debugger";
674 union acpi_object write_value;
675 acpi_status status;
676
677
678
679 status = acpi_db_read_from_object(node, ACPI_TYPE_STRING, &temp1);
680 if (ACPI_FAILURE(status)) {
681 return (status);
682 }
683
684 acpi_os_printf(" (%4.4X/%3.3X) \"%s\"", (temp1->string.length * 8),
685 temp1->string.length, temp1->string.pointer);
686
687
688
689 write_value.type = ACPI_TYPE_STRING;
690 write_value.string.length = strlen(value_to_write);
691 write_value.string.pointer = value_to_write;
692
693 status = acpi_db_write_to_object(node, &write_value);
694 if (ACPI_FAILURE(status)) {
695 goto exit;
696 }
697
698
699
700 status = acpi_db_read_from_object(node, ACPI_TYPE_STRING, &temp2);
701 if (ACPI_FAILURE(status)) {
702 goto exit;
703 }
704
705 if (strcmp(temp2->string.pointer, value_to_write)) {
706 acpi_os_printf(" MISMATCH 2: %s, expecting %s",
707 temp2->string.pointer, value_to_write);
708 }
709
710
711
712 write_value.string.length = strlen(temp1->string.pointer);
713 write_value.string.pointer = temp1->string.pointer;
714
715 status = acpi_db_write_to_object(node, &write_value);
716 if (ACPI_FAILURE(status)) {
717 goto exit;
718 }
719
720
721
722 status = acpi_db_read_from_object(node, ACPI_TYPE_STRING, &temp3);
723 if (ACPI_FAILURE(status)) {
724 goto exit;
725 }
726
727 if (strcmp(temp1->string.pointer, temp3->string.pointer)) {
728 acpi_os_printf(" MISMATCH 3: %s, expecting %s",
729 temp3->string.pointer, temp1->string.pointer);
730 }
731
732exit:
733 if (temp1) {
734 acpi_os_free(temp1);
735 }
736 if (temp2) {
737 acpi_os_free(temp2);
738 }
739 if (temp3) {
740 acpi_os_free(temp3);
741 }
742 return (status);
743}
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762static acpi_status
763acpi_db_read_from_object(struct acpi_namespace_node *node,
764 acpi_object_type expected_type,
765 union acpi_object **value)
766{
767 union acpi_object *ret_value;
768 struct acpi_object_list param_objects;
769 union acpi_object params[2];
770 struct acpi_buffer return_obj;
771 acpi_status status;
772
773 params[0].type = ACPI_TYPE_LOCAL_REFERENCE;
774 params[0].reference.actual_type = node->type;
775 params[0].reference.handle = ACPI_CAST_PTR(acpi_handle, node);
776
777 param_objects.count = 1;
778 param_objects.pointer = params;
779
780 return_obj.length = ACPI_ALLOCATE_BUFFER;
781
782 acpi_gbl_method_executing = TRUE;
783 status = acpi_evaluate_object(read_handle, NULL,
784 ¶m_objects, &return_obj);
785 acpi_gbl_method_executing = FALSE;
786
787 if (ACPI_FAILURE(status)) {
788 acpi_os_printf("Could not read from object, %s",
789 acpi_format_exception(status));
790 return (status);
791 }
792
793 ret_value = (union acpi_object *)return_obj.pointer;
794
795 switch (ret_value->type) {
796 case ACPI_TYPE_INTEGER:
797 case ACPI_TYPE_BUFFER:
798 case ACPI_TYPE_STRING:
799
800
801
802
803
804 if (ret_value->type != expected_type) {
805 acpi_os_printf
806 (" Type mismatch: Expected %s, Received %s",
807 acpi_ut_get_type_name(expected_type),
808 acpi_ut_get_type_name(ret_value->type));
809
810 return (AE_TYPE);
811 }
812
813 *value = ret_value;
814 break;
815
816 default:
817
818 acpi_os_printf(" Unsupported return object type, %s",
819 acpi_ut_get_type_name(ret_value->type));
820
821 acpi_os_free(return_obj.pointer);
822 return (AE_TYPE);
823 }
824
825 return (status);
826}
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844static acpi_status
845acpi_db_write_to_object(struct acpi_namespace_node *node,
846 union acpi_object *value)
847{
848 struct acpi_object_list param_objects;
849 union acpi_object params[2];
850 acpi_status status;
851
852 params[0].type = ACPI_TYPE_LOCAL_REFERENCE;
853 params[0].reference.actual_type = node->type;
854 params[0].reference.handle = ACPI_CAST_PTR(acpi_handle, node);
855
856
857
858 memcpy(¶ms[1], value, sizeof(union acpi_object));
859
860 param_objects.count = 2;
861 param_objects.pointer = params;
862
863 acpi_gbl_method_executing = TRUE;
864 status = acpi_evaluate_object(write_handle, NULL, ¶m_objects, NULL);
865 acpi_gbl_method_executing = FALSE;
866
867 if (ACPI_FAILURE(status)) {
868 acpi_os_printf("Could not write to object, %s",
869 acpi_format_exception(status));
870 }
871
872 return (status);
873}
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888static void acpi_db_evaluate_all_predefined_names(char *count_arg)
889{
890 struct acpi_db_execute_walk info;
891
892 info.count = 0;
893 info.max_count = ACPI_UINT32_MAX;
894
895 if (count_arg) {
896 info.max_count = strtoul(count_arg, NULL, 0);
897 }
898
899
900
901 (void)acpi_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
902 ACPI_UINT32_MAX,
903 acpi_db_evaluate_one_predefined_name, NULL,
904 (void *)&info, NULL);
905
906 acpi_os_printf("Evaluated %u predefined names in the namespace\n",
907 info.count);
908}
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923static acpi_status
924acpi_db_evaluate_one_predefined_name(acpi_handle obj_handle,
925 u32 nesting_level,
926 void *context, void **return_value)
927{
928 struct acpi_namespace_node *node =
929 (struct acpi_namespace_node *)obj_handle;
930 struct acpi_db_execute_walk *info =
931 (struct acpi_db_execute_walk *)context;
932 char *pathname;
933 const union acpi_predefined_info *predefined;
934 struct acpi_device_info *obj_info;
935 struct acpi_object_list param_objects;
936 union acpi_object params[ACPI_METHOD_NUM_ARGS];
937 union acpi_object *this_param;
938 struct acpi_buffer return_obj;
939 acpi_status status;
940 u16 arg_type_list;
941 u8 arg_count;
942 u8 arg_type;
943 u32 i;
944
945
946
947 predefined = acpi_ut_match_predefined_method(node->name.ascii);
948 if (!predefined) {
949 return (AE_OK);
950 }
951
952 if (node->type == ACPI_TYPE_LOCAL_SCOPE) {
953 return (AE_OK);
954 }
955
956 pathname = acpi_ns_get_normalized_pathname(node, TRUE);
957 if (!pathname) {
958 return (AE_OK);
959 }
960
961
962
963 status = acpi_get_object_info(obj_handle, &obj_info);
964 if (ACPI_FAILURE(status)) {
965 ACPI_FREE(pathname);
966 return (status);
967 }
968
969 param_objects.count = 0;
970 param_objects.pointer = NULL;
971
972 if (obj_info->type == ACPI_TYPE_METHOD) {
973
974
975
976 arg_type_list = predefined->info.argument_list;
977 arg_count = METHOD_GET_ARG_COUNT(arg_type_list);
978
979
980
981
982
983
984 this_param = params;
985 for (i = 0; i < arg_count; i++) {
986 arg_type = METHOD_GET_NEXT_TYPE(arg_type_list);
987 this_param->type = arg_type;
988
989 switch (arg_type) {
990 case ACPI_TYPE_INTEGER:
991
992 this_param->integer.value = 1;
993 break;
994
995 case ACPI_TYPE_STRING:
996
997 this_param->string.pointer =
998 "This is the default argument string";
999 this_param->string.length =
1000 strlen(this_param->string.pointer);
1001 break;
1002
1003 case ACPI_TYPE_BUFFER:
1004
1005 this_param->buffer.pointer = (u8 *)params;
1006 this_param->buffer.length = 48;
1007 break;
1008
1009 case ACPI_TYPE_PACKAGE:
1010
1011 this_param->package.elements = NULL;
1012 this_param->package.count = 0;
1013 break;
1014
1015 default:
1016
1017 acpi_os_printf
1018 ("%s: Unsupported argument type: %u\n",
1019 pathname, arg_type);
1020 break;
1021 }
1022
1023 this_param++;
1024 }
1025
1026 param_objects.count = arg_count;
1027 param_objects.pointer = params;
1028 }
1029
1030 ACPI_FREE(obj_info);
1031 return_obj.pointer = NULL;
1032 return_obj.length = ACPI_ALLOCATE_BUFFER;
1033
1034
1035
1036 acpi_gbl_method_executing = TRUE;
1037
1038 status = acpi_evaluate_object(node, NULL, ¶m_objects, &return_obj);
1039
1040 acpi_os_printf("%-32s returned %s\n",
1041 pathname, acpi_format_exception(status));
1042 acpi_gbl_method_executing = FALSE;
1043 ACPI_FREE(pathname);
1044
1045
1046
1047 status = AE_OK;
1048
1049
1050
1051 info->count++;
1052 if (info->count >= info->max_count) {
1053 status = AE_CTRL_TERMINATE;
1054 }
1055
1056 return (status);
1057}
1058