aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi/aclocal.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/aclocal.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/aclocal.h')
-rw-r--r--include/acpi/aclocal.h57
1 files changed, 27 insertions, 30 deletions
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h
index 58f9ba1a34e7..4d2635698e10 100644
--- a/include/acpi/aclocal.h
+++ b/include/acpi/aclocal.h
@@ -56,6 +56,13 @@ typedef u32 acpi_mutex_handle;
56#define AML_NUM_OPCODES 0x7F 56#define AML_NUM_OPCODES 0x7F
57 57
58 58
59/* Forward declarations */
60
61struct acpi_walk_state ;
62struct acpi_obj_mutex;
63union acpi_parse_object ;
64
65
59/***************************************************************************** 66/*****************************************************************************
60 * 67 *
61 * Mutex typedefs and structs 68 * Mutex typedefs and structs
@@ -116,19 +123,24 @@ static char *acpi_gbl_mutex_names[] =
116#endif 123#endif
117 124
118 125
126/* Owner IDs are used to track namespace nodes for selective deletion */
127
128typedef u8 acpi_owner_id;
129#define ACPI_OWNER_ID_MAX 0xFF
130
131/* This Thread ID means that the mutex is not in use (unlocked) */
132
133#define ACPI_MUTEX_NOT_ACQUIRED (u32) -1
134
119/* Table for the global mutexes */ 135/* Table for the global mutexes */
120 136
121struct acpi_mutex_info 137struct acpi_mutex_info
122{ 138{
123 acpi_mutex mutex; 139 acpi_mutex mutex;
124 u32 use_count; 140 u32 use_count;
125 u32 owner_id; 141 u32 thread_id;
126}; 142};
127 143
128/* This owner ID means that the mutex is not in use (unlocked) */
129
130#define ACPI_MUTEX_NOT_ACQUIRED (u32) (-1)
131
132 144
133/* Lock flag parameter for various interfaces */ 145/* Lock flag parameter for various interfaces */
134 146
@@ -136,13 +148,6 @@ struct acpi_mutex_info
136#define ACPI_MTX_LOCK 1 148#define ACPI_MTX_LOCK 1
137 149
138 150
139typedef u16 acpi_owner_id;
140#define ACPI_OWNER_TYPE_TABLE 0x0
141#define ACPI_OWNER_TYPE_METHOD 0x1
142#define ACPI_FIRST_METHOD_ID 0x0001
143#define ACPI_FIRST_TABLE_ID 0xF000
144
145
146/* Field access granularities */ 151/* Field access granularities */
147 152
148#define ACPI_FIELD_BYTE_GRANULARITY 1 153#define ACPI_FIELD_BYTE_GRANULARITY 1
@@ -185,13 +190,20 @@ struct acpi_namespace_node
185{ 190{
186 u8 descriptor; /* Used to differentiate object descriptor types */ 191 u8 descriptor; /* Used to differentiate object descriptor types */
187 u8 type; /* Type associated with this name */ 192 u8 type; /* Type associated with this name */
188 u16 owner_id; 193 u16 reference_count; /* Current count of references and children */
189 union acpi_name_union name; /* ACPI Name, always 4 chars per ACPI spec */ 194 union acpi_name_union name; /* ACPI Name, always 4 chars per ACPI spec */
190 union acpi_operand_object *object; /* Pointer to attached ACPI object (optional) */ 195 union acpi_operand_object *object; /* Pointer to attached ACPI object (optional) */
191 struct acpi_namespace_node *child; /* First child */ 196 struct acpi_namespace_node *child; /* First child */
192 struct acpi_namespace_node *peer; /* Next peer*/ 197 struct acpi_namespace_node *peer; /* Next peer*/
193 u16 reference_count; /* Current count of references and children */ 198 u8 owner_id; /* Who created this node */
194 u8 flags; 199 u8 flags;
200
201 /* Fields used by the ASL compiler only */
202
203#ifdef ACPI_ASL_COMPILER
204 u32 value;
205 union acpi_parse_object *op;
206#endif
195}; 207};
196 208
197 209
@@ -222,7 +234,7 @@ struct acpi_table_desc
222 u64 physical_address; 234 u64 physical_address;
223 u32 aml_length; 235 u32 aml_length;
224 acpi_size length; 236 acpi_size length;
225 acpi_owner_id table_id; 237 acpi_owner_id owner_id;
226 u8 type; 238 u8 type;
227 u8 allocation; 239 u8 allocation;
228 u8 loaded_into_namespace; 240 u8 loaded_into_namespace;
@@ -420,13 +432,6 @@ struct acpi_field_info
420#define ACPI_CONTROL_PREDICATE_TRUE 0xC4 432#define ACPI_CONTROL_PREDICATE_TRUE 0xC4
421 433
422 434
423/* Forward declarations */
424
425struct acpi_walk_state ;
426struct acpi_obj_mutex;
427union acpi_parse_object ;
428
429
430#define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\ 435#define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\
431 u8 data_type; /* To differentiate various internal objs */\ 436 u8 data_type; /* To differentiate various internal objs */\
432 u8 flags; \ 437 u8 flags; \
@@ -916,14 +921,6 @@ struct acpi_integrity_info
916 * 921 *
917 ****************************************************************************/ 922 ****************************************************************************/
918 923
919struct acpi_debug_print_info
920{
921 u32 component_id;
922 char *proc_name;
923 char *module_name;
924};
925
926
927/* Entry for a memory allocation (debug only) */ 924/* Entry for a memory allocation (debug only) */
928 925
929#define ACPI_MEM_MALLOC 0 926#define ACPI_MEM_MALLOC 0