aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi/acutils.h
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 /include/acpi/acutils.h
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 'include/acpi/acutils.h')
-rw-r--r--include/acpi/acutils.h56
1 files changed, 40 insertions, 16 deletions
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h
index e9c1584dd785..9c05c10e379a 100644
--- a/include/acpi/acutils.h
+++ b/include/acpi/acutils.h
@@ -120,10 +120,6 @@ u8
120acpi_ut_valid_object_type ( 120acpi_ut_valid_object_type (
121 acpi_object_type type); 121 acpi_object_type type);
122 122
123acpi_owner_id
124acpi_ut_allocate_owner_id (
125 u32 id_type);
126
127 123
128/* 124/*
129 * utinit - miscellaneous initialization and shutdown 125 * utinit - miscellaneous initialization and shutdown
@@ -306,47 +302,63 @@ acpi_ut_track_stack_ptr (
306void 302void
307acpi_ut_trace ( 303acpi_ut_trace (
308 u32 line_number, 304 u32 line_number,
309 struct acpi_debug_print_info *dbg_info); 305 char *function_name,
306 char *module_name,
307 u32 component_id);
310 308
311void 309void
312acpi_ut_trace_ptr ( 310acpi_ut_trace_ptr (
313 u32 line_number, 311 u32 line_number,
314 struct acpi_debug_print_info *dbg_info, 312 char *function_name,
313 char *module_name,
314 u32 component_id,
315 void *pointer); 315 void *pointer);
316 316
317void 317void
318acpi_ut_trace_u32 ( 318acpi_ut_trace_u32 (
319 u32 line_number, 319 u32 line_number,
320 struct acpi_debug_print_info *dbg_info, 320 char *function_name,
321 char *module_name,
322 u32 component_id,
321 u32 integer); 323 u32 integer);
322 324
323void 325void
324acpi_ut_trace_str ( 326acpi_ut_trace_str (
325 u32 line_number, 327 u32 line_number,
326 struct acpi_debug_print_info *dbg_info, 328 char *function_name,
329 char *module_name,
330 u32 component_id,
327 char *string); 331 char *string);
328 332
329void 333void
330acpi_ut_exit ( 334acpi_ut_exit (
331 u32 line_number, 335 u32 line_number,
332 struct acpi_debug_print_info *dbg_info); 336 char *function_name,
337 char *module_name,
338 u32 component_id);
333 339
334void 340void
335acpi_ut_status_exit ( 341acpi_ut_status_exit (
336 u32 line_number, 342 u32 line_number,
337 struct acpi_debug_print_info *dbg_info, 343 char *function_name,
344 char *module_name,
345 u32 component_id,
338 acpi_status status); 346 acpi_status status);
339 347
340void 348void
341acpi_ut_value_exit ( 349acpi_ut_value_exit (
342 u32 line_number, 350 u32 line_number,
343 struct acpi_debug_print_info *dbg_info, 351 char *function_name,
352 char *module_name,
353 u32 component_id,
344 acpi_integer value); 354 acpi_integer value);
345 355
346void 356void
347acpi_ut_ptr_exit ( 357acpi_ut_ptr_exit (
348 u32 line_number, 358 u32 line_number,
349 struct acpi_debug_print_info *dbg_info, 359 char *function_name,
360 char *module_name,
361 u32 component_id,
350 u8 *ptr); 362 u8 *ptr);
351 363
352void 364void
@@ -378,7 +390,9 @@ void ACPI_INTERNAL_VAR_XFACE
378acpi_ut_debug_print ( 390acpi_ut_debug_print (
379 u32 requested_debug_level, 391 u32 requested_debug_level,
380 u32 line_number, 392 u32 line_number,
381 struct acpi_debug_print_info *dbg_info, 393 char *function_name,
394 char *module_name,
395 u32 component_id,
382 char *format, 396 char *format,
383 ...) ACPI_PRINTF_LIKE_FUNC; 397 ...) ACPI_PRINTF_LIKE_FUNC;
384 398
@@ -386,7 +400,9 @@ void ACPI_INTERNAL_VAR_XFACE
386acpi_ut_debug_print_raw ( 400acpi_ut_debug_print_raw (
387 u32 requested_debug_level, 401 u32 requested_debug_level,
388 u32 line_number, 402 u32 line_number,
389 struct acpi_debug_print_info *dbg_info, 403 char *function_name,
404 char *module_name,
405 u32 component_id,
390 char *format, 406 char *format,
391 ...) ACPI_PRINTF_LIKE_FUNC; 407 ...) ACPI_PRINTF_LIKE_FUNC;
392 408
@@ -477,8 +493,8 @@ acpi_ut_allocate_object_desc_dbg (
477 u32 line_number, 493 u32 line_number,
478 u32 component_id); 494 u32 component_id);
479 495
480#define acpi_ut_create_internal_object(t) acpi_ut_create_internal_object_dbg (_THIS_MODULE,__LINE__,_COMPONENT,t) 496#define acpi_ut_create_internal_object(t) acpi_ut_create_internal_object_dbg (_acpi_module_name,__LINE__,_COMPONENT,t)
481#define acpi_ut_allocate_object_desc() acpi_ut_allocate_object_desc_dbg (_THIS_MODULE,__LINE__,_COMPONENT) 497#define acpi_ut_allocate_object_desc() acpi_ut_allocate_object_desc_dbg (_acpi_module_name,__LINE__,_COMPONENT)
482 498
483void 499void
484acpi_ut_delete_object_desc ( 500acpi_ut_delete_object_desc (
@@ -579,6 +595,14 @@ acpi_ut_short_divide (
579 * utmisc 595 * utmisc
580 */ 596 */
581acpi_status 597acpi_status
598acpi_ut_allocate_owner_id (
599 acpi_owner_id *owner_id);
600
601acpi_status
602acpi_ut_release_owner_id (
603 acpi_owner_id owner_id);
604
605acpi_status
582acpi_ut_walk_package_tree ( 606acpi_ut_walk_package_tree (
583 union acpi_operand_object *source_object, 607 union acpi_operand_object *source_object,
584 void *target_object, 608 void *target_object,