aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/utilities/utcache.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/utilities/utcache.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/utilities/utcache.c')
-rw-r--r--drivers/acpi/utilities/utcache.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/acpi/utilities/utcache.c b/drivers/acpi/utilities/utcache.c
index 07588812e72d..c0df0585c683 100644
--- a/drivers/acpi/utilities/utcache.c
+++ b/drivers/acpi/utilities/utcache.c
@@ -74,6 +74,9 @@ acpi_os_create_cache (
74 struct acpi_memory_list *cache; 74 struct acpi_memory_list *cache;
75 75
76 76
77 ACPI_FUNCTION_ENTRY ();
78
79
77 if (!cache_name || !return_cache || (object_size < 16)) { 80 if (!cache_name || !return_cache || (object_size < 16)) {
78 return (AE_BAD_PARAMETER); 81 return (AE_BAD_PARAMETER);
79 } 82 }
@@ -161,7 +164,10 @@ acpi_os_delete_cache (
161 acpi_status status; 164 acpi_status status;
162 165
163 166
164 /* Purge all objects in the cache */ 167 ACPI_FUNCTION_ENTRY ();
168
169
170 /* Purge all objects in the cache */
165 171
166 status = acpi_os_purge_cache (cache); 172 status = acpi_os_purge_cache (cache);
167 if (ACPI_FAILURE (status)) { 173 if (ACPI_FAILURE (status)) {
@@ -259,7 +265,7 @@ acpi_os_acquire_object (
259 void *object; 265 void *object;
260 266
261 267
262 ACPI_FUNCTION_NAME ("ut_acquire_from_cache"); 268 ACPI_FUNCTION_NAME ("os_acquire_object");
263 269
264 270
265 if (!cache) { 271 if (!cache) {
@@ -286,7 +292,7 @@ acpi_os_acquire_object (
286 292
287 ACPI_MEM_TRACKING (cache->hits++); 293 ACPI_MEM_TRACKING (cache->hits++);
288 ACPI_MEM_TRACKING (ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, 294 ACPI_MEM_TRACKING (ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
289 "Object %p from %s\n", object, cache->list_name))); 295 "Object %p from %s cache\n", object, cache->list_name)));
290 296
291 status = acpi_ut_release_mutex (ACPI_MTX_CACHES); 297 status = acpi_ut_release_mutex (ACPI_MTX_CACHES);
292 if (ACPI_FAILURE (status)) { 298 if (ACPI_FAILURE (status)) {