aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/tables/tbinstal.c
diff options
context:
space:
mode:
authorRobert Moore <robert.moore@intel.com>2005-07-08 00:00:00 -0400
committerLen Brown <len.brown@intel.com>2005-07-14 00:42:23 -0400
commitf9f4601f331aa1226d7a798a01950efbb388f07f (patch)
tree62e079a9275749d16a4a0da56a427be201e15d27 /drivers/acpi/tables/tbinstal.c
parent4c3ffbd79529b680b3c3ef2b6f42f0c89c694ec5 (diff)
ACPICA 20050708 from Bob Moore <robert.moore@intel.com>
The use of the CPU stack in the debug version of the subsystem has been considerably reduced. Previously, a debug structure was declared in every function that used the debug macros. This structure has been removed in favor of declaring the individual elements as parameters to the debug functions. This reduces the cumulative stack use during nested execution of ACPI function calls at the cost of a small increase in the code size of the debug version of the subsystem. With assistance from Alexey Starikovskiy and Len Brown. Added the ACPI_GET_FUNCTION_NAME macro to enable the compiler-dependent headers to define a macro that will return the current function name at runtime (such as __FUNCTION__ or _func_, etc.) The function name is used by the debug trace output. If ACPI_GET_FUNCTION_NAME is not defined in the compiler-dependent header, the function name is saved on the CPU stack (one pointer per function.) This mechanism is used because apparently there exists no standard ANSI-C defined macro that that returns the function name. Alexey Starikovskiy redesigned and reimplemented the "Owner ID" mechanism used to track namespace objects created/deleted by ACPI tables and control method execution. A bitmap is now used to allocate and free the IDs, thus solving the wraparound problem present in the previous implementation. The size of the namespace node descriptor was reduced by 2 bytes as a result. Removed the UINT32_BIT and UINT16_BIT types that were used for the bitfield flag definitions within the headers for the predefined ACPI tables. These have been replaced by UINT8_BIT in order to increase the code portability of the subsystem. If the use of UINT8 remains a problem, we may be forced to eliminate bitfields entirely because of a lack of portability. Alexey Starikovksiy enhanced the performance of acpi_ut_update_object_reference. This is a frequently used function and this improvement increases the performance of the entire subsystem. Alexey Starikovskiy fixed several possible memory leaks and the inverse - premature object deletion. Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/tables/tbinstal.c')
-rw-r--r--drivers/acpi/tables/tbinstal.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/acpi/tables/tbinstal.c b/drivers/acpi/tables/tbinstal.c
index 629b64c8193d..2ad72f204551 100644
--- a/drivers/acpi/tables/tbinstal.c
+++ b/drivers/acpi/tables/tbinstal.c
@@ -251,6 +251,7 @@ acpi_tb_init_table_descriptor (
251{ 251{
252 struct acpi_table_list *list_head; 252 struct acpi_table_list *list_head;
253 struct acpi_table_desc *table_desc; 253 struct acpi_table_desc *table_desc;
254 acpi_status status;
254 255
255 256
256 ACPI_FUNCTION_TRACE_U32 ("tb_init_table_descriptor", table_type); 257 ACPI_FUNCTION_TRACE_U32 ("tb_init_table_descriptor", table_type);
@@ -263,6 +264,13 @@ acpi_tb_init_table_descriptor (
263 return_ACPI_STATUS (AE_NO_MEMORY); 264 return_ACPI_STATUS (AE_NO_MEMORY);
264 } 265 }
265 266
267 /* Get a new owner ID for the table */
268
269 status = acpi_ut_allocate_owner_id (&table_desc->owner_id);
270 if (ACPI_FAILURE (status)) {
271 return_ACPI_STATUS (status);
272 }
273
266 /* Install the table into the global data structure */ 274 /* Install the table into the global data structure */
267 275
268 list_head = &acpi_gbl_table_lists[table_type]; 276 list_head = &acpi_gbl_table_lists[table_type];
@@ -325,8 +333,6 @@ acpi_tb_init_table_descriptor (
325 table_desc->aml_start = (u8 *) (table_desc->pointer + 1), 333 table_desc->aml_start = (u8 *) (table_desc->pointer + 1),
326 table_desc->aml_length = (u32) (table_desc->length - 334 table_desc->aml_length = (u32) (table_desc->length -
327 (u32) sizeof (struct acpi_table_header)); 335 (u32) sizeof (struct acpi_table_header));
328 table_desc->table_id = acpi_ut_allocate_owner_id (
329 ACPI_OWNER_TYPE_TABLE);
330 table_desc->loaded_into_namespace = FALSE; 336 table_desc->loaded_into_namespace = FALSE;
331 337
332 /* 338 /*
@@ -339,7 +345,7 @@ acpi_tb_init_table_descriptor (
339 345
340 /* Return Data */ 346 /* Return Data */
341 347
342 table_info->table_id = table_desc->table_id; 348 table_info->owner_id = table_desc->owner_id;
343 table_info->installed_desc = table_desc; 349 table_info->installed_desc = table_desc;
344 350
345 return_ACPI_STATUS (AE_OK); 351 return_ACPI_STATUS (AE_OK);