aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/executer
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2006-10-03 00:00:00 -0400
committerLen Brown <len.brown@intel.com>2006-04-01 01:26:39 -0500
commit8313524a0d466f451a62709aaedf988d8257b21c (patch)
treed612fc796ae07d8a39542c95eec0f5169c9f64eb /drivers/acpi/executer
parentea936b78f46cbe089a4ac363e1682dee7d427096 (diff)
ACPI: ACPICA 20060310
Tagged all external interfaces to the subsystem with the new ACPI_EXPORT_SYMBOL macro. This macro can be defined as necessary to assist kernel integration. For Linux, the macro resolves to the EXPORT_SYMBOL macro. The default definition is NULL. Added the ACPI_THREAD_ID type for the return value from acpi_os_get_thread_id(). This allows the host to define this as necessary to simplify kernel integration. The default definition is ACPI_NATIVE_UINT. Valery Podrezov fixed two interpreter problems related to error processing, the deletion of objects, and placing invalid pointers onto the internal operator result stack. http://bugzilla.kernel.org/show_bug.cgi?id=6028 http://bugzilla.kernel.org/show_bug.cgi?id=6151 Increased the reference count threshold where a warning is emitted for large reference counts in order to eliminate unnecessary warnings on systems with large namespaces (especially 64-bit.) Increased the value from 0x400 to 0x800. Due to universal disagreement as to the meaning of the 'c' in the calloc() function, the ACPI_MEM_CALLOCATE macro has been renamed to ACPI_ALLOCATE_ZEROED so that the purpose of the interface is 'clear'. ACPI_MEM_ALLOCATE and ACPI_MEM_FREE are renamed to ACPI_ALLOCATE and ACPI_FREE. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/executer')
-rw-r--r--drivers/acpi/executer/exconfig.c4
-rw-r--r--drivers/acpi/executer/exdump.c2
-rw-r--r--drivers/acpi/executer/exfield.c4
-rw-r--r--drivers/acpi/executer/exnames.c4
-rw-r--r--drivers/acpi/executer/exoparg1.c17
-rw-r--r--drivers/acpi/executer/exoparg2.c4
-rw-r--r--drivers/acpi/executer/exoparg3.c9
-rw-r--r--drivers/acpi/executer/exregion.c10
-rw-r--r--drivers/acpi/executer/exstorob.c8
9 files changed, 34 insertions, 28 deletions
diff --git a/drivers/acpi/executer/exconfig.c b/drivers/acpi/executer/exconfig.c
index 864530f754c3..e0deffb56790 100644
--- a/drivers/acpi/executer/exconfig.c
+++ b/drivers/acpi/executer/exconfig.c
@@ -349,7 +349,7 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
349 349
350 /* Allocate a buffer for the entire table */ 350 /* Allocate a buffer for the entire table */
351 351
352 table_ptr = ACPI_MEM_ALLOCATE(table_header.length); 352 table_ptr = ACPI_ALLOCATE(table_header.length);
353 if (!table_ptr) { 353 if (!table_ptr) {
354 return_ACPI_STATUS(AE_NO_MEMORY); 354 return_ACPI_STATUS(AE_NO_MEMORY);
355 } 355 }
@@ -447,7 +447,7 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
447 447
448 cleanup: 448 cleanup:
449 if (ACPI_FAILURE(status)) { 449 if (ACPI_FAILURE(status)) {
450 ACPI_MEM_FREE(table_ptr); 450 ACPI_FREE(table_ptr);
451 } 451 }
452 return_ACPI_STATUS(status); 452 return_ACPI_STATUS(status);
453} 453}
diff --git a/drivers/acpi/executer/exdump.c b/drivers/acpi/executer/exdump.c
index 0a53d31e09de..502293c35afa 100644
--- a/drivers/acpi/executer/exdump.c
+++ b/drivers/acpi/executer/exdump.c
@@ -903,7 +903,7 @@ static void acpi_ex_dump_reference_obj(union acpi_operand_object *obj_desc)
903 acpi_os_printf("Could not convert name to pathname\n"); 903 acpi_os_printf("Could not convert name to pathname\n");
904 } else { 904 } else {
905 acpi_os_printf("%s\n", (char *)ret_buf.pointer); 905 acpi_os_printf("%s\n", (char *)ret_buf.pointer);
906 ACPI_MEM_FREE(ret_buf.pointer); 906 ACPI_FREE(ret_buf.pointer);
907 } 907 }
908 } else if (obj_desc->reference.object) { 908 } else if (obj_desc->reference.object) {
909 acpi_os_printf("\nReferenced Object: %p\n", 909 acpi_os_printf("\nReferenced Object: %p\n",
diff --git a/drivers/acpi/executer/exfield.c b/drivers/acpi/executer/exfield.c
index 215783a33c2c..36c265a00c26 100644
--- a/drivers/acpi/executer/exfield.c
+++ b/drivers/acpi/executer/exfield.c
@@ -333,7 +333,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
333 333
334 /* We need to create a new buffer */ 334 /* We need to create a new buffer */
335 335
336 new_buffer = ACPI_MEM_CALLOCATE(required_length); 336 new_buffer = ACPI_ALLOCATE_ZEROED(required_length);
337 if (!new_buffer) { 337 if (!new_buffer) {
338 return_ACPI_STATUS(AE_NO_MEMORY); 338 return_ACPI_STATUS(AE_NO_MEMORY);
339 } 339 }
@@ -377,7 +377,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
377 /* Free temporary buffer if we used one */ 377 /* Free temporary buffer if we used one */
378 378
379 if (new_buffer) { 379 if (new_buffer) {
380 ACPI_MEM_FREE(new_buffer); 380 ACPI_FREE(new_buffer);
381 } 381 }
382 382
383 return_ACPI_STATUS(status); 383 return_ACPI_STATUS(status);
diff --git a/drivers/acpi/executer/exnames.c b/drivers/acpi/executer/exnames.c
index f9bc81c1b78d..80bbc20756a1 100644
--- a/drivers/acpi/executer/exnames.c
+++ b/drivers/acpi/executer/exnames.c
@@ -98,7 +98,7 @@ static char *acpi_ex_allocate_name_string(u32 prefix_count, u32 num_name_segs)
98 * Allocate a buffer for the name. 98 * Allocate a buffer for the name.
99 * This buffer must be deleted by the caller! 99 * This buffer must be deleted by the caller!
100 */ 100 */
101 name_string = ACPI_MEM_ALLOCATE(size_needed); 101 name_string = ACPI_ALLOCATE(size_needed);
102 if (!name_string) { 102 if (!name_string) {
103 ACPI_ERROR((AE_INFO, 103 ACPI_ERROR((AE_INFO,
104 "Could not allocate size %d", size_needed)); 104 "Could not allocate size %d", size_needed));
@@ -424,7 +424,7 @@ acpi_ex_get_name_string(acpi_object_type data_type,
424 424
425 if (ACPI_FAILURE(status)) { 425 if (ACPI_FAILURE(status)) {
426 if (name_string) { 426 if (name_string) {
427 ACPI_MEM_FREE(name_string); 427 ACPI_FREE(name_string);
428 } 428 }
429 return_ACPI_STATUS(status); 429 return_ACPI_STATUS(status);
430 } 430 }
diff --git a/drivers/acpi/executer/exoparg1.c b/drivers/acpi/executer/exoparg1.c
index 4f3627ee2b2b..d00f766246f3 100644
--- a/drivers/acpi/executer/exoparg1.c
+++ b/drivers/acpi/executer/exoparg1.c
@@ -554,16 +554,18 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
554 554
555 cleanup: 555 cleanup:
556 556
557 if (!walk_state->result_obj) {
558 walk_state->result_obj = return_desc;
559 }
560
561 /* Delete return object on error */ 557 /* Delete return object on error */
562 558
563 if (ACPI_FAILURE(status)) { 559 if (ACPI_FAILURE(status)) {
564 acpi_ut_remove_reference(return_desc); 560 acpi_ut_remove_reference(return_desc);
565 } 561 }
566 562
563 /* Save return object on success */
564
565 else if (!walk_state->result_obj) {
566 walk_state->result_obj = return_desc;
567 }
568
567 return_ACPI_STATUS(status); 569 return_ACPI_STATUS(status);
568} 570}
569 571
@@ -1028,6 +1030,11 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
1028 acpi_ut_remove_reference(return_desc); 1030 acpi_ut_remove_reference(return_desc);
1029 } 1031 }
1030 1032
1031 walk_state->result_obj = return_desc; 1033 /* Save return object on success */
1034
1035 else {
1036 walk_state->result_obj = return_desc;
1037 }
1038
1032 return_ACPI_STATUS(status); 1039 return_ACPI_STATUS(status);
1033} 1040}
diff --git a/drivers/acpi/executer/exoparg2.c b/drivers/acpi/executer/exoparg2.c
index 5e1abb12c748..690e43db0abe 100644
--- a/drivers/acpi/executer/exoparg2.c
+++ b/drivers/acpi/executer/exoparg2.c
@@ -391,7 +391,6 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
391 index = operand[1]->integer.value; 391 index = operand[1]->integer.value;
392 return_desc->reference.offset = (u32) index; 392 return_desc->reference.offset = (u32) index;
393 return_desc->reference.opcode = AML_INDEX_OP; 393 return_desc->reference.opcode = AML_INDEX_OP;
394 return_desc->reference.object = operand[0];
395 394
396 /* 395 /*
397 * At this point, the Source operand is a String, Buffer, or Package. 396 * At this point, the Source operand is a String, Buffer, or Package.
@@ -445,9 +444,10 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
445 } 444 }
446 445
447 /* 446 /*
448 * Add a reference to the target package/buffer/string for the life 447 * Save the target object and add a reference to it for the life
449 * of the index 448 * of the index
450 */ 449 */
450 return_desc->reference.object = operand[0];
451 acpi_ut_add_reference(operand[0]); 451 acpi_ut_add_reference(operand[0]);
452 452
453 /* Store the reference to the Target */ 453 /* Store the reference to the Target */
diff --git a/drivers/acpi/executer/exoparg3.c b/drivers/acpi/executer/exoparg3.c
index 8da794ec35b0..4897e6c3431f 100644
--- a/drivers/acpi/executer/exoparg3.c
+++ b/drivers/acpi/executer/exoparg3.c
@@ -100,8 +100,7 @@ acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state)
100 (u32) operand[1]->integer.value, 100 (u32) operand[1]->integer.value,
101 (u32) operand[2]->integer.value)); 101 (u32) operand[2]->integer.value));
102 102
103 fatal = 103 fatal = ACPI_ALLOCATE(sizeof(struct acpi_signal_fatal_info));
104 ACPI_MEM_ALLOCATE(sizeof(struct acpi_signal_fatal_info));
105 if (fatal) { 104 if (fatal) {
106 fatal->type = (u32) operand[0]->integer.value; 105 fatal->type = (u32) operand[0]->integer.value;
107 fatal->code = (u32) operand[1]->integer.value; 106 fatal->code = (u32) operand[1]->integer.value;
@@ -114,7 +113,7 @@ acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state)
114 113
115 /* Might return while OS is shutting down, just continue */ 114 /* Might return while OS is shutting down, just continue */
116 115
117 ACPI_MEM_FREE(fatal); 116 ACPI_FREE(fatal);
118 break; 117 break;
119 118
120 default: 119 default:
@@ -196,7 +195,7 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state)
196 195
197 /* Always allocate a new buffer for the String */ 196 /* Always allocate a new buffer for the String */
198 197
199 buffer = ACPI_MEM_CALLOCATE((acpi_size) length + 1); 198 buffer = ACPI_ALLOCATE_ZEROED((acpi_size) length + 1);
200 if (!buffer) { 199 if (!buffer) {
201 status = AE_NO_MEMORY; 200 status = AE_NO_MEMORY;
202 goto cleanup; 201 goto cleanup;
@@ -211,7 +210,7 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state)
211 210
212 /* Allocate a new buffer for the Buffer */ 211 /* Allocate a new buffer for the Buffer */
213 212
214 buffer = ACPI_MEM_CALLOCATE(length); 213 buffer = ACPI_ALLOCATE_ZEROED(length);
215 if (!buffer) { 214 if (!buffer) {
216 status = AE_NO_MEMORY; 215 status = AE_NO_MEMORY;
217 goto cleanup; 216 goto cleanup;
diff --git a/drivers/acpi/executer/exregion.c b/drivers/acpi/executer/exregion.c
index 9db68d19253e..fdeda7beae43 100644
--- a/drivers/acpi/executer/exregion.c
+++ b/drivers/acpi/executer/exregion.c
@@ -182,8 +182,8 @@ acpi_ex_system_memory_space_handler(u32 function,
182 (acpi_integer) mem_info->mapped_physical_address); 182 (acpi_integer) mem_info->mapped_physical_address);
183 183
184 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 184 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
185 "system_memory %d (%d width) Address=%8.8X%8.8X\n", 185 "System-Memory (width %d) R/W %d Address=%8.8X%8.8X\n",
186 function, bit_width, ACPI_FORMAT_UINT64(address))); 186 bit_width, function, ACPI_FORMAT_UINT64(address)));
187 187
188 /* 188 /*
189 * Perform the memory read or write 189 * Perform the memory read or write
@@ -287,8 +287,8 @@ acpi_ex_system_io_space_handler(u32 function,
287 ACPI_FUNCTION_TRACE("ex_system_io_space_handler"); 287 ACPI_FUNCTION_TRACE("ex_system_io_space_handler");
288 288
289 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 289 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
290 "system_iO %d (%d width) Address=%8.8X%8.8X\n", 290 "System-IO (width %d) R/W %d Address=%8.8X%8.8X\n",
291 function, bit_width, ACPI_FORMAT_UINT64(address))); 291 bit_width, function, ACPI_FORMAT_UINT64(address)));
292 292
293 /* Decode the function parameter */ 293 /* Decode the function parameter */
294 294
@@ -361,7 +361,7 @@ acpi_ex_pci_config_space_handler(u32 function,
361 pci_register = (u16) (u32) address; 361 pci_register = (u16) (u32) address;
362 362
363 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 363 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
364 "pci_config %d (%d) Seg(%04x) Bus(%04x) Dev(%04x) Func(%04x) Reg(%04x)\n", 364 "Pci-Config %d (%d) Seg(%04x) Bus(%04x) Dev(%04x) Func(%04x) Reg(%04x)\n",
365 function, bit_width, pci_id->segment, pci_id->bus, 365 function, bit_width, pci_id->segment, pci_id->bus,
366 pci_id->device, pci_id->function, pci_register)); 366 pci_id->device, pci_id->function, pci_register));
367 367
diff --git a/drivers/acpi/executer/exstorob.c b/drivers/acpi/executer/exstorob.c
index 41732d382bce..db42461101e0 100644
--- a/drivers/acpi/executer/exstorob.c
+++ b/drivers/acpi/executer/exstorob.c
@@ -80,7 +80,7 @@ acpi_ex_store_buffer_to_buffer(union acpi_operand_object *source_desc,
80 */ 80 */
81 if ((target_desc->buffer.length == 0) || 81 if ((target_desc->buffer.length == 0) ||
82 (target_desc->common.flags & AOPOBJ_STATIC_POINTER)) { 82 (target_desc->common.flags & AOPOBJ_STATIC_POINTER)) {
83 target_desc->buffer.pointer = ACPI_MEM_ALLOCATE(length); 83 target_desc->buffer.pointer = ACPI_ALLOCATE(length);
84 if (!target_desc->buffer.pointer) { 84 if (!target_desc->buffer.pointer) {
85 return_ACPI_STATUS(AE_NO_MEMORY); 85 return_ACPI_STATUS(AE_NO_MEMORY);
86 } 86 }
@@ -188,11 +188,11 @@ acpi_ex_store_string_to_string(union acpi_operand_object *source_desc,
188 188
189 /* Only free if not a pointer into the DSDT */ 189 /* Only free if not a pointer into the DSDT */
190 190
191 ACPI_MEM_FREE(target_desc->string.pointer); 191 ACPI_FREE(target_desc->string.pointer);
192 } 192 }
193 193
194 target_desc->string.pointer = ACPI_MEM_CALLOCATE((acpi_size) 194 target_desc->string.pointer = ACPI_ALLOCATE_ZEROED((acpi_size)
195 length + 1); 195 length + 1);
196 if (!target_desc->string.pointer) { 196 if (!target_desc->string.pointer) {
197 return_ACPI_STATUS(AE_NO_MEMORY); 197 return_ACPI_STATUS(AE_NO_MEMORY);
198 } 198 }