aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLv Zheng <lv.zheng@intel.com>2015-07-23 00:52:24 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-07-23 17:09:06 -0400
commit62eb935b77818a5e4ff3c8d9b97036b59944f649 (patch)
treec8740e201e78916bb24bfe37f34b0398424dbde5
parent950a429cd21638b0c076d135ed279518b21f452b (diff)
ACPICA: Dispatcher: Cleanup union acpi_operand_object's AML address assignments
ACPICA commit afb52611dbe7403551f93504d3798534f5c343f4 This patch cleans up the code of assigning the AML address to the union acpi_operand_object. The idea behind this cleanup is: The AML address of the union acpi_operand_object should always be determined at the point where the object is encountered. It should be started from the first byte of the object. For example, the opcode of the object, the name string of the user_term object, or the first byte of the packaged object (where a pkg_length is prefixed). So it's not cleaner to have it assigned here and there in the entire ACPICA source tree. There are some special cases for the internal opcodes, before cleaning up the internal opcodes, we should also determine the rules for the AML addresses of the internal opcodes: 1. INT_NAMEPATH_OP: the address of the first byte for the name_string. 2. INT_METHODCALL_OP: the address of the first byte for the name_string. 3. INT_BYTELIST_OP: the address of the first byte for the byte_data list. 4. INT_EVAL_SUBTREE_OP: the address of the first byte for the Region/Package/Buffer/bank_field/Field arguments. 5. INT_NAMEDFIELD_OP: the address to the name_seg. 6. INT_RESERVEDFIELD_OP: the address to the 0x00 prefix. 7. INT_ACCESSFIELD_OP: the address to the 0x01 prefix. 8. INT_CONNECTION_OP: the address to the 0x02 prefix. 9: INT_EXTACCESSFIELD_OP: the address to the 0x03 prefix. 10.INT_RETURN_VALUE_OP: the address of the replaced operand. 11.computational_data: the address to the Byte/Word/Dword/Qword/string_prefix. Before cleaning up the internal root scope of the aml_walk, turning it into the term_list, we need to remember the aml_start address as the "Aml" attribute for the union acpi_operand_object created by acpi_ps_create_scope_op(). Finally, we can delete some redundant AML address assignment in psloop.c. Link: https://github.com/acpica/acpica/commit/afb52611 Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/acpi/acpica/acparser.h4
-rw-r--r--drivers/acpi/acpica/dsargs.c4
-rw-r--r--drivers/acpi/acpica/dsmethod.c2
-rw-r--r--drivers/acpi/acpica/dswload.c2
-rw-r--r--drivers/acpi/acpica/dswload2.c2
-rw-r--r--drivers/acpi/acpica/nsparse.c40
-rw-r--r--drivers/acpi/acpica/psargs.c21
-rw-r--r--drivers/acpi/acpica/psloop.c3
-rw-r--r--drivers/acpi/acpica/psobject.c2
-rw-r--r--drivers/acpi/acpica/psparse.c12
-rw-r--r--drivers/acpi/acpica/psutils.c8
-rw-r--r--drivers/acpi/acpica/psxface.c2
12 files changed, 53 insertions, 49 deletions
diff --git a/drivers/acpi/acpica/acparser.h b/drivers/acpi/acpica/acparser.h
index 0cdd2fce493a..6021ccfb0b1c 100644
--- a/drivers/acpi/acpica/acparser.h
+++ b/drivers/acpi/acpica/acparser.h
@@ -225,11 +225,11 @@ void acpi_ps_delete_parse_tree(union acpi_parse_object *root);
225/* 225/*
226 * psutils - parser utilities 226 * psutils - parser utilities
227 */ 227 */
228union acpi_parse_object *acpi_ps_create_scope_op(void); 228union acpi_parse_object *acpi_ps_create_scope_op(u8 *aml);
229 229
230void acpi_ps_init_op(union acpi_parse_object *op, u16 opcode); 230void acpi_ps_init_op(union acpi_parse_object *op, u16 opcode);
231 231
232union acpi_parse_object *acpi_ps_alloc_op(u16 opcode); 232union acpi_parse_object *acpi_ps_alloc_op(u16 opcode, u8 *aml);
233 233
234void acpi_ps_free_op(union acpi_parse_object *op); 234void acpi_ps_free_op(union acpi_parse_object *op);
235 235
diff --git a/drivers/acpi/acpica/dsargs.c b/drivers/acpi/acpica/dsargs.c
index 3e6989738e85..e2ab59e39162 100644
--- a/drivers/acpi/acpica/dsargs.c
+++ b/drivers/acpi/acpica/dsargs.c
@@ -86,7 +86,7 @@ acpi_ds_execute_arguments(struct acpi_namespace_node *node,
86 86
87 /* Allocate a new parser op to be the root of the parsed tree */ 87 /* Allocate a new parser op to be the root of the parsed tree */
88 88
89 op = acpi_ps_alloc_op(AML_INT_EVAL_SUBTREE_OP); 89 op = acpi_ps_alloc_op(AML_INT_EVAL_SUBTREE_OP, aml_start);
90 if (!op) { 90 if (!op) {
91 return_ACPI_STATUS(AE_NO_MEMORY); 91 return_ACPI_STATUS(AE_NO_MEMORY);
92 } 92 }
@@ -129,7 +129,7 @@ acpi_ds_execute_arguments(struct acpi_namespace_node *node,
129 129
130 /* Evaluate the deferred arguments */ 130 /* Evaluate the deferred arguments */
131 131
132 op = acpi_ps_alloc_op(AML_INT_EVAL_SUBTREE_OP); 132 op = acpi_ps_alloc_op(AML_INT_EVAL_SUBTREE_OP, aml_start);
133 if (!op) { 133 if (!op) {
134 return_ACPI_STATUS(AE_NO_MEMORY); 134 return_ACPI_STATUS(AE_NO_MEMORY);
135 } 135 }
diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c
index bf8c16e379fb..4abc2425de4b 100644
--- a/drivers/acpi/acpica/dsmethod.c
+++ b/drivers/acpi/acpica/dsmethod.c
@@ -103,7 +103,7 @@ acpi_ds_auto_serialize_method(struct acpi_namespace_node *node,
103 103
104 /* Create/Init a root op for the method parse tree */ 104 /* Create/Init a root op for the method parse tree */
105 105
106 op = acpi_ps_alloc_op(AML_METHOD_OP); 106 op = acpi_ps_alloc_op(AML_METHOD_OP, obj_desc->method.aml_start);
107 if (!op) { 107 if (!op) {
108 return_ACPI_STATUS(AE_NO_MEMORY); 108 return_ACPI_STATUS(AE_NO_MEMORY);
109 } 109 }
diff --git a/drivers/acpi/acpica/dswload.c b/drivers/acpi/acpica/dswload.c
index 845ff44919c3..097188a6b1c1 100644
--- a/drivers/acpi/acpica/dswload.c
+++ b/drivers/acpi/acpica/dswload.c
@@ -388,7 +388,7 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
388 388
389 /* Create a new op */ 389 /* Create a new op */
390 390
391 op = acpi_ps_alloc_op(walk_state->opcode); 391 op = acpi_ps_alloc_op(walk_state->opcode, walk_state->aml);
392 if (!op) { 392 if (!op) {
393 return_ACPI_STATUS(AE_NO_MEMORY); 393 return_ACPI_STATUS(AE_NO_MEMORY);
394 } 394 }
diff --git a/drivers/acpi/acpica/dswload2.c b/drivers/acpi/acpica/dswload2.c
index fcaa30c611fb..e2c08cd79aca 100644
--- a/drivers/acpi/acpica/dswload2.c
+++ b/drivers/acpi/acpica/dswload2.c
@@ -335,7 +335,7 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
335 335
336 /* Create a new op */ 336 /* Create a new op */
337 337
338 op = acpi_ps_alloc_op(walk_state->opcode); 338 op = acpi_ps_alloc_op(walk_state->opcode, walk_state->aml);
339 if (!op) { 339 if (!op) {
340 return_ACPI_STATUS(AE_NO_MEMORY); 340 return_ACPI_STATUS(AE_NO_MEMORY);
341 } 341 }
diff --git a/drivers/acpi/acpica/nsparse.c b/drivers/acpi/acpica/nsparse.c
index 9926a67ca6d7..3736d43b18b9 100644
--- a/drivers/acpi/acpica/nsparse.c
+++ b/drivers/acpi/acpica/nsparse.c
@@ -78,6 +78,20 @@ acpi_ns_one_complete_parse(u32 pass_number,
78 78
79 ACPI_FUNCTION_TRACE(ns_one_complete_parse); 79 ACPI_FUNCTION_TRACE(ns_one_complete_parse);
80 80
81 status = acpi_get_table_by_index(table_index, &table);
82 if (ACPI_FAILURE(status)) {
83 return_ACPI_STATUS(status);
84 }
85
86 /* Table must consist of at least a complete header */
87
88 if (table->length < sizeof(struct acpi_table_header)) {
89 return_ACPI_STATUS(AE_BAD_HEADER);
90 }
91
92 aml_start = (u8 *)table + sizeof(struct acpi_table_header);
93 aml_length = table->length - sizeof(struct acpi_table_header);
94
81 status = acpi_tb_get_owner_id(table_index, &owner_id); 95 status = acpi_tb_get_owner_id(table_index, &owner_id);
82 if (ACPI_FAILURE(status)) { 96 if (ACPI_FAILURE(status)) {
83 return_ACPI_STATUS(status); 97 return_ACPI_STATUS(status);
@@ -85,7 +99,7 @@ acpi_ns_one_complete_parse(u32 pass_number,
85 99
86 /* Create and init a Root Node */ 100 /* Create and init a Root Node */
87 101
88 parse_root = acpi_ps_create_scope_op(); 102 parse_root = acpi_ps_create_scope_op(aml_start);
89 if (!parse_root) { 103 if (!parse_root) {
90 return_ACPI_STATUS(AE_NO_MEMORY); 104 return_ACPI_STATUS(AE_NO_MEMORY);
91 } 105 }
@@ -98,23 +112,12 @@ acpi_ns_one_complete_parse(u32 pass_number,
98 return_ACPI_STATUS(AE_NO_MEMORY); 112 return_ACPI_STATUS(AE_NO_MEMORY);
99 } 113 }
100 114
101 status = acpi_get_table_by_index(table_index, &table); 115 status = acpi_ds_init_aml_walk(walk_state, parse_root, NULL,
116 aml_start, aml_length, NULL,
117 (u8)pass_number);
102 if (ACPI_FAILURE(status)) { 118 if (ACPI_FAILURE(status)) {
103 acpi_ds_delete_walk_state(walk_state); 119 acpi_ds_delete_walk_state(walk_state);
104 acpi_ps_free_op(parse_root); 120 goto cleanup;
105 return_ACPI_STATUS(status);
106 }
107
108 /* Table must consist of at least a complete header */
109
110 if (table->length < sizeof(struct acpi_table_header)) {
111 status = AE_BAD_HEADER;
112 } else {
113 aml_start = (u8 *)table + sizeof(struct acpi_table_header);
114 aml_length = table->length - sizeof(struct acpi_table_header);
115 status = acpi_ds_init_aml_walk(walk_state, parse_root, NULL,
116 aml_start, aml_length, NULL,
117 (u8)pass_number);
118 } 121 }
119 122
120 /* Found OSDT table, enable the namespace override feature */ 123 /* Found OSDT table, enable the namespace override feature */
@@ -124,11 +127,6 @@ acpi_ns_one_complete_parse(u32 pass_number,
124 walk_state->namespace_override = TRUE; 127 walk_state->namespace_override = TRUE;
125 } 128 }
126 129
127 if (ACPI_FAILURE(status)) {
128 acpi_ds_delete_walk_state(walk_state);
129 goto cleanup;
130 }
131
132 /* start_node is the default location to load the table */ 130 /* start_node is the default location to load the table */
133 131
134 if (start_node && start_node != acpi_gbl_root_node) { 132 if (start_node && start_node != acpi_gbl_root_node) {
diff --git a/drivers/acpi/acpica/psargs.c b/drivers/acpi/acpica/psargs.c
index 0bee9466d149..29d8b7b01dca 100644
--- a/drivers/acpi/acpica/psargs.c
+++ b/drivers/acpi/acpica/psargs.c
@@ -287,7 +287,7 @@ acpi_ps_get_next_namepath(struct acpi_walk_state *walk_state,
287 "Control Method - %p Desc %p Path=%p\n", node, 287 "Control Method - %p Desc %p Path=%p\n", node,
288 method_desc, path)); 288 method_desc, path));
289 289
290 name_op = acpi_ps_alloc_op(AML_INT_NAMEPATH_OP); 290 name_op = acpi_ps_alloc_op(AML_INT_NAMEPATH_OP, start);
291 if (!name_op) { 291 if (!name_op) {
292 return_ACPI_STATUS(AE_NO_MEMORY); 292 return_ACPI_STATUS(AE_NO_MEMORY);
293 } 293 }
@@ -535,13 +535,11 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state
535 535
536 /* Allocate a new field op */ 536 /* Allocate a new field op */
537 537
538 field = acpi_ps_alloc_op(opcode); 538 field = acpi_ps_alloc_op(opcode, aml);
539 if (!field) { 539 if (!field) {
540 return_PTR(NULL); 540 return_PTR(NULL);
541 } 541 }
542 542
543 field->common.aml = aml;
544
545 /* Decode the field type */ 543 /* Decode the field type */
546 544
547 switch (opcode) { 545 switch (opcode) {
@@ -603,6 +601,7 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state
603 * Argument for Connection operator can be either a Buffer 601 * Argument for Connection operator can be either a Buffer
604 * (resource descriptor), or a name_string. 602 * (resource descriptor), or a name_string.
605 */ 603 */
604 aml = parser_state->aml;
606 if (ACPI_GET8(parser_state->aml) == AML_BUFFER_OP) { 605 if (ACPI_GET8(parser_state->aml) == AML_BUFFER_OP) {
607 parser_state->aml++; 606 parser_state->aml++;
608 607
@@ -615,7 +614,8 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state
615 614
616 /* Non-empty list */ 615 /* Non-empty list */
617 616
618 arg = acpi_ps_alloc_op(AML_INT_BYTELIST_OP); 617 arg =
618 acpi_ps_alloc_op(AML_INT_BYTELIST_OP, aml);
619 if (!arg) { 619 if (!arg) {
620 acpi_ps_free_op(field); 620 acpi_ps_free_op(field);
621 return_PTR(NULL); 621 return_PTR(NULL);
@@ -664,7 +664,7 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state
664 664
665 parser_state->aml = pkg_end; 665 parser_state->aml = pkg_end;
666 } else { 666 } else {
667 arg = acpi_ps_alloc_op(AML_INT_NAMEPATH_OP); 667 arg = acpi_ps_alloc_op(AML_INT_NAMEPATH_OP, aml);
668 if (!arg) { 668 if (!arg) {
669 acpi_ps_free_op(field); 669 acpi_ps_free_op(field);
670 return_PTR(NULL); 670 return_PTR(NULL);
@@ -729,7 +729,7 @@ acpi_ps_get_next_arg(struct acpi_walk_state *walk_state,
729 729
730 /* Constants, strings, and namestrings are all the same size */ 730 /* Constants, strings, and namestrings are all the same size */
731 731
732 arg = acpi_ps_alloc_op(AML_BYTE_OP); 732 arg = acpi_ps_alloc_op(AML_BYTE_OP, parser_state->aml);
733 if (!arg) { 733 if (!arg) {
734 return_ACPI_STATUS(AE_NO_MEMORY); 734 return_ACPI_STATUS(AE_NO_MEMORY);
735 } 735 }
@@ -776,7 +776,8 @@ acpi_ps_get_next_arg(struct acpi_walk_state *walk_state,
776 776
777 /* Non-empty list */ 777 /* Non-empty list */
778 778
779 arg = acpi_ps_alloc_op(AML_INT_BYTELIST_OP); 779 arg = acpi_ps_alloc_op(AML_INT_BYTELIST_OP,
780 parser_state->aml);
780 if (!arg) { 781 if (!arg) {
781 return_ACPI_STATUS(AE_NO_MEMORY); 782 return_ACPI_STATUS(AE_NO_MEMORY);
782 } 783 }
@@ -806,7 +807,9 @@ acpi_ps_get_next_arg(struct acpi_walk_state *walk_state,
806 807
807 /* null_name or name_string */ 808 /* null_name or name_string */
808 809
809 arg = acpi_ps_alloc_op(AML_INT_NAMEPATH_OP); 810 arg =
811 acpi_ps_alloc_op(AML_INT_NAMEPATH_OP,
812 parser_state->aml);
810 if (!arg) { 813 if (!arg) {
811 return_ACPI_STATUS(AE_NO_MEMORY); 814 return_ACPI_STATUS(AE_NO_MEMORY);
812 } 815 }
diff --git a/drivers/acpi/acpica/psloop.c b/drivers/acpi/acpica/psloop.c
index d5843830fef8..49c60c2671ef 100644
--- a/drivers/acpi/acpica/psloop.c
+++ b/drivers/acpi/acpica/psloop.c
@@ -137,7 +137,6 @@ acpi_ps_get_arguments(struct acpi_walk_state *walk_state,
137 } 137 }
138 138
139 if (arg) { 139 if (arg) {
140 arg->common.aml = walk_state->aml;
141 acpi_ps_append_arg(op, arg); 140 acpi_ps_append_arg(op, arg);
142 } 141 }
143 142
@@ -491,8 +490,6 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state)
491 continue; 490 continue;
492 } 491 }
493 492
494 op->common.aml = walk_state->aml;
495
496 if (walk_state->op_info) { 493 if (walk_state->op_info) {
497 ACPI_DEBUG_PRINT((ACPI_DB_PARSE, 494 ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
498 "Opcode %4.4X [%s] Op %p Aml %p\n", 495 "Opcode %4.4X [%s] Op %p Aml %p\n",
diff --git a/drivers/acpi/acpica/psobject.c b/drivers/acpi/acpica/psobject.c
index 6ba3bb7402a9..e54bc2aa7a88 100644
--- a/drivers/acpi/acpica/psobject.c
+++ b/drivers/acpi/acpica/psobject.c
@@ -297,7 +297,7 @@ acpi_ps_create_op(struct acpi_walk_state *walk_state,
297 /* Create Op structure and append to parent's argument list */ 297 /* Create Op structure and append to parent's argument list */
298 298
299 walk_state->op_info = acpi_ps_get_opcode_info(walk_state->opcode); 299 walk_state->op_info = acpi_ps_get_opcode_info(walk_state->opcode);
300 op = acpi_ps_alloc_op(walk_state->opcode); 300 op = acpi_ps_alloc_op(walk_state->opcode, aml_op_start);
301 if (!op) { 301 if (!op) {
302 return_ACPI_STATUS(AE_NO_MEMORY); 302 return_ACPI_STATUS(AE_NO_MEMORY);
303 } 303 }
diff --git a/drivers/acpi/acpica/psparse.c b/drivers/acpi/acpica/psparse.c
index a555f7f7b9a2..b857ad58022a 100644
--- a/drivers/acpi/acpica/psparse.c
+++ b/drivers/acpi/acpica/psparse.c
@@ -185,7 +185,8 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state,
185 * op must be replaced by a placeholder return op 185 * op must be replaced by a placeholder return op
186 */ 186 */
187 replacement_op = 187 replacement_op =
188 acpi_ps_alloc_op(AML_INT_RETURN_VALUE_OP); 188 acpi_ps_alloc_op(AML_INT_RETURN_VALUE_OP,
189 op->common.aml);
189 if (!replacement_op) { 190 if (!replacement_op) {
190 status = AE_NO_MEMORY; 191 status = AE_NO_MEMORY;
191 } 192 }
@@ -209,7 +210,8 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state,
209 || (op->common.parent->common.aml_opcode == 210 || (op->common.parent->common.aml_opcode ==
210 AML_VAR_PACKAGE_OP)) { 211 AML_VAR_PACKAGE_OP)) {
211 replacement_op = 212 replacement_op =
212 acpi_ps_alloc_op(AML_INT_RETURN_VALUE_OP); 213 acpi_ps_alloc_op(AML_INT_RETURN_VALUE_OP,
214 op->common.aml);
213 if (!replacement_op) { 215 if (!replacement_op) {
214 status = AE_NO_MEMORY; 216 status = AE_NO_MEMORY;
215 } 217 }
@@ -224,7 +226,8 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state,
224 AML_VAR_PACKAGE_OP)) { 226 AML_VAR_PACKAGE_OP)) {
225 replacement_op = 227 replacement_op =
226 acpi_ps_alloc_op(op->common. 228 acpi_ps_alloc_op(op->common.
227 aml_opcode); 229 aml_opcode,
230 op->common.aml);
228 if (!replacement_op) { 231 if (!replacement_op) {
229 status = AE_NO_MEMORY; 232 status = AE_NO_MEMORY;
230 } else { 233 } else {
@@ -240,7 +243,8 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state,
240 default: 243 default:
241 244
242 replacement_op = 245 replacement_op =
243 acpi_ps_alloc_op(AML_INT_RETURN_VALUE_OP); 246 acpi_ps_alloc_op(AML_INT_RETURN_VALUE_OP,
247 op->common.aml);
244 if (!replacement_op) { 248 if (!replacement_op) {
245 status = AE_NO_MEMORY; 249 status = AE_NO_MEMORY;
246 } 250 }
diff --git a/drivers/acpi/acpica/psutils.c b/drivers/acpi/acpica/psutils.c
index 32440912023a..183cc1efbc51 100644
--- a/drivers/acpi/acpica/psutils.c
+++ b/drivers/acpi/acpica/psutils.c
@@ -60,11 +60,11 @@ ACPI_MODULE_NAME("psutils")
60 * DESCRIPTION: Create a Scope and associated namepath op with the root name 60 * DESCRIPTION: Create a Scope and associated namepath op with the root name
61 * 61 *
62 ******************************************************************************/ 62 ******************************************************************************/
63union acpi_parse_object *acpi_ps_create_scope_op(void) 63union acpi_parse_object *acpi_ps_create_scope_op(u8 *aml)
64{ 64{
65 union acpi_parse_object *scope_op; 65 union acpi_parse_object *scope_op;
66 66
67 scope_op = acpi_ps_alloc_op(AML_SCOPE_OP); 67 scope_op = acpi_ps_alloc_op(AML_SCOPE_OP, aml);
68 if (!scope_op) { 68 if (!scope_op) {
69 return (NULL); 69 return (NULL);
70 } 70 }
@@ -103,6 +103,7 @@ void acpi_ps_init_op(union acpi_parse_object *op, u16 opcode)
103 * FUNCTION: acpi_ps_alloc_op 103 * FUNCTION: acpi_ps_alloc_op
104 * 104 *
105 * PARAMETERS: opcode - Opcode that will be stored in the new Op 105 * PARAMETERS: opcode - Opcode that will be stored in the new Op
106 * aml - Address of the opcode
106 * 107 *
107 * RETURN: Pointer to the new Op, null on failure 108 * RETURN: Pointer to the new Op, null on failure
108 * 109 *
@@ -112,7 +113,7 @@ void acpi_ps_init_op(union acpi_parse_object *op, u16 opcode)
112 * 113 *
113 ******************************************************************************/ 114 ******************************************************************************/
114 115
115union acpi_parse_object *acpi_ps_alloc_op(u16 opcode) 116union acpi_parse_object *acpi_ps_alloc_op(u16 opcode, u8 *aml)
116{ 117{
117 union acpi_parse_object *op; 118 union acpi_parse_object *op;
118 const struct acpi_opcode_info *op_info; 119 const struct acpi_opcode_info *op_info;
@@ -149,6 +150,7 @@ union acpi_parse_object *acpi_ps_alloc_op(u16 opcode)
149 150
150 if (op) { 151 if (op) {
151 acpi_ps_init_op(op, opcode); 152 acpi_ps_init_op(op, opcode);
153 op->common.aml = aml;
152 op->common.flags = flags; 154 op->common.flags = flags;
153 } 155 }
154 156
diff --git a/drivers/acpi/acpica/psxface.c b/drivers/acpi/acpica/psxface.c
index 841a5ea06094..1f3f46d44312 100644
--- a/drivers/acpi/acpica/psxface.c
+++ b/drivers/acpi/acpica/psxface.c
@@ -256,7 +256,7 @@ acpi_status acpi_ps_execute_method(struct acpi_evaluate_info *info)
256 256
257 /* Create and init a Root Node */ 257 /* Create and init a Root Node */
258 258
259 op = acpi_ps_create_scope_op(); 259 op = acpi_ps_create_scope_op(info->obj_desc->method.aml_start);
260 if (!op) { 260 if (!op) {
261 status = AE_NO_MEMORY; 261 status = AE_NO_MEMORY;
262 goto cleanup; 262 goto cleanup;