aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/resources/rscreate.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/resources/rscreate.c')
-rw-r--r--drivers/acpi/resources/rscreate.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/drivers/acpi/resources/rscreate.c b/drivers/acpi/resources/rscreate.c
index 8c128dea3252..008058acdd39 100644
--- a/drivers/acpi/resources/rscreate.c
+++ b/drivers/acpi/resources/rscreate.c
@@ -75,10 +75,11 @@ acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer,
75 u8 *aml_start; 75 u8 *aml_start;
76 acpi_size list_size_needed = 0; 76 acpi_size list_size_needed = 0;
77 u32 aml_buffer_length; 77 u32 aml_buffer_length;
78 void *resource;
78 79
79 ACPI_FUNCTION_TRACE("rs_create_resource_list"); 80 ACPI_FUNCTION_TRACE(rs_create_resource_list);
80 81
81 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "aml_buffer = %p\n", aml_buffer)); 82 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "AmlBuffer = %p\n", aml_buffer));
82 83
83 /* Params already validated, so we don't re-validate here */ 84 /* Params already validated, so we don't re-validate here */
84 85
@@ -92,7 +93,7 @@ acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer,
92 status = acpi_rs_get_list_length(aml_start, aml_buffer_length, 93 status = acpi_rs_get_list_length(aml_start, aml_buffer_length,
93 &list_size_needed); 94 &list_size_needed);
94 95
95 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Status=%X list_size_needed=%X\n", 96 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Status=%X ListSizeNeeded=%X\n",
96 status, (u32) list_size_needed)); 97 status, (u32) list_size_needed));
97 if (ACPI_FAILURE(status)) { 98 if (ACPI_FAILURE(status)) {
98 return_ACPI_STATUS(status); 99 return_ACPI_STATUS(status);
@@ -107,13 +108,15 @@ acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer,
107 108
108 /* Do the conversion */ 109 /* Do the conversion */
109 110
110 status = acpi_rs_convert_aml_to_resources(aml_start, aml_buffer_length, 111 resource = output_buffer->pointer;
111 output_buffer->pointer); 112 status = acpi_ut_walk_aml_resources(aml_start, aml_buffer_length,
113 acpi_rs_convert_aml_to_resources,
114 &resource);
112 if (ACPI_FAILURE(status)) { 115 if (ACPI_FAILURE(status)) {
113 return_ACPI_STATUS(status); 116 return_ACPI_STATUS(status);
114 } 117 }
115 118
116 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "output_buffer %p Length %X\n", 119 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "OutputBuffer %p Length %X\n",
117 output_buffer->pointer, (u32) output_buffer->length)); 120 output_buffer->pointer, (u32) output_buffer->length));
118 return_ACPI_STATUS(AE_OK); 121 return_ACPI_STATUS(AE_OK);
119} 122}
@@ -155,7 +158,7 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
155 acpi_status status; 158 acpi_status status;
156 struct acpi_buffer path_buffer; 159 struct acpi_buffer path_buffer;
157 160
158 ACPI_FUNCTION_TRACE("rs_create_pci_routing_table"); 161 ACPI_FUNCTION_TRACE(rs_create_pci_routing_table);
159 162
160 /* Params already validated, so we don't re-validate here */ 163 /* Params already validated, so we don't re-validate here */
161 164
@@ -167,7 +170,7 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
167 return_ACPI_STATUS(status); 170 return_ACPI_STATUS(status);
168 } 171 }
169 172
170 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "buffer_size_needed = %X\n", 173 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "BufferSizeNeeded = %X\n",
171 (u32) buffer_size_needed)); 174 (u32) buffer_size_needed));
172 175
173 /* Validate/Allocate/Clear caller buffer */ 176 /* Validate/Allocate/Clear caller buffer */
@@ -332,7 +335,7 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
332 /* Now align the current length */ 335 /* Now align the current length */
333 336
334 user_prt->length = 337 user_prt->length =
335 (u32) ACPI_ROUND_UP_to_64_bITS(user_prt->length); 338 (u32) ACPI_ROUND_UP_TO_64BIT(user_prt->length);
336 339
337 /* 4) Fourth subobject: Dereference the PRT.source_index */ 340 /* 4) Fourth subobject: Dereference the PRT.source_index */
338 341
@@ -341,7 +344,7 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
341 user_prt->source_index = (u32) obj_desc->integer.value; 344 user_prt->source_index = (u32) obj_desc->integer.value;
342 } else { 345 } else {
343 ACPI_ERROR((AE_INFO, 346 ACPI_ERROR((AE_INFO,
344 "(PRT[%X].source_index) Need Integer, found %s", 347 "(PRT[%X].SourceIndex) Need Integer, found %s",
345 index, 348 index,
346 acpi_ut_get_object_type_name(obj_desc))); 349 acpi_ut_get_object_type_name(obj_desc)));
347 return_ACPI_STATUS(AE_BAD_DATA); 350 return_ACPI_STATUS(AE_BAD_DATA);
@@ -352,7 +355,7 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
352 top_object_list++; 355 top_object_list++;
353 } 356 }
354 357
355 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "output_buffer %p Length %X\n", 358 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "OutputBuffer %p Length %X\n",
356 output_buffer->pointer, (u32) output_buffer->length)); 359 output_buffer->pointer, (u32) output_buffer->length));
357 return_ACPI_STATUS(AE_OK); 360 return_ACPI_STATUS(AE_OK);
358} 361}
@@ -382,9 +385,9 @@ acpi_rs_create_aml_resources(struct acpi_resource *linked_list_buffer,
382 acpi_status status; 385 acpi_status status;
383 acpi_size aml_size_needed = 0; 386 acpi_size aml_size_needed = 0;
384 387
385 ACPI_FUNCTION_TRACE("rs_create_aml_resources"); 388 ACPI_FUNCTION_TRACE(rs_create_aml_resources);
386 389
387 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "linked_list_buffer = %p\n", 390 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "LinkedListBuffer = %p\n",
388 linked_list_buffer)); 391 linked_list_buffer));
389 392
390 /* 393 /*
@@ -395,7 +398,7 @@ acpi_rs_create_aml_resources(struct acpi_resource *linked_list_buffer,
395 */ 398 */
396 status = acpi_rs_get_aml_length(linked_list_buffer, &aml_size_needed); 399 status = acpi_rs_get_aml_length(linked_list_buffer, &aml_size_needed);
397 400
398 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "aml_size_needed=%X, %s\n", 401 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "AmlSizeNeeded=%X, %s\n",
399 (u32) aml_size_needed, 402 (u32) aml_size_needed,
400 acpi_format_exception(status))); 403 acpi_format_exception(status)));
401 if (ACPI_FAILURE(status)) { 404 if (ACPI_FAILURE(status)) {
@@ -419,7 +422,7 @@ acpi_rs_create_aml_resources(struct acpi_resource *linked_list_buffer,
419 return_ACPI_STATUS(status); 422 return_ACPI_STATUS(status);
420 } 423 }
421 424
422 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "output_buffer %p Length %X\n", 425 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "OutputBuffer %p Length %X\n",
423 output_buffer->pointer, (u32) output_buffer->length)); 426 output_buffer->pointer, (u32) output_buffer->length));
424 return_ACPI_STATUS(AE_OK); 427 return_ACPI_STATUS(AE_OK);
425} 428}