aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/dispatcher/dsfield.c
diff options
context:
space:
mode:
authorRobert Moore <robert.moore@intel.com>2005-04-18 22:49:35 -0400
committerLen Brown <len.brown@intel.com>2005-07-12 00:08:52 -0400
commit44f6c01242da4e162f28d8e1216a8c7a91174605 (patch)
tree53f724764f1bd9036dfb049a643d198125cc9edc /drivers/acpi/dispatcher/dsfield.c
parentebb6e1a6122fd6b7c96470cfd4ce0f04150e5084 (diff)
ACPICA 20050408 from Bob Moore
Fixed three cases in the interpreter where an "index" argument to an ASL function was still (internally) 32 bits instead of the required 64 bits. This was the Index argument to the Index, Mid, and Match operators. The "strupr" function is now permanently local (acpi_ut_strupr), since this is not a POSIX-defined function and not present in most kernel-level C libraries. References to the C library strupr function have been removed from the headers. Completed the deployment of static functions/prototypes. All prototypes with the static attribute have been moved from the headers to the owning C file. ACPICA 20050329 from Bob Moore An error is now generated if an attempt is made to create a Buffer Field of length zero (A CreateField with a length operand of zero.) The interpreter now issues a warning whenever executable code at the module level is detected during ACPI table load. This will give some idea of the prevalence of this type of code. Implemented support for references to named objects (other than control methods) within package objects. Enhanced package object output for the debug object. Package objects are now completely dumped, showing all elements. Enhanced miscellaneous object output for the debug object. Any object can now be written to the debug object (for example, a device object can be written, and the type of the object will be displayed.) The "static" qualifier has been added to all local functions across the core subsystem. The number of "long" lines (> 80 chars) within the source has been significantly reduced, by about 1/3. Cleaned up all header files to ensure that all CA/iASL functions are prototyped (even static functions) and the formatting is consistent. Two new header files have been added, acopcode.h and acnames.h. Removed several obsolete functions that were no longer used. Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/dispatcher/dsfield.c')
-rw-r--r--drivers/acpi/dispatcher/dsfield.c58
1 files changed, 37 insertions, 21 deletions
diff --git a/drivers/acpi/dispatcher/dsfield.c b/drivers/acpi/dispatcher/dsfield.c
index 2779211be756..84193983d6ba 100644
--- a/drivers/acpi/dispatcher/dsfield.c
+++ b/drivers/acpi/dispatcher/dsfield.c
@@ -53,13 +53,20 @@
53#define _COMPONENT ACPI_DISPATCHER 53#define _COMPONENT ACPI_DISPATCHER
54 ACPI_MODULE_NAME ("dsfield") 54 ACPI_MODULE_NAME ("dsfield")
55 55
56/* Local prototypes */
57
58static acpi_status
59acpi_ds_get_field_names (
60 struct acpi_create_field_info *info,
61 struct acpi_walk_state *walk_state,
62 union acpi_parse_object *arg);
63
56 64
57/******************************************************************************* 65/*******************************************************************************
58 * 66 *
59 * FUNCTION: acpi_ds_create_buffer_field 67 * FUNCTION: acpi_ds_create_buffer_field
60 * 68 *
61 * PARAMETERS: Opcode - The opcode to be executed 69 * PARAMETERS: Op - Current parse op (create_xXField)
62 * Operands - List of operands for the opcode
63 * walk_state - Current state 70 * walk_state - Current state
64 * 71 *
65 * RETURN: Status 72 * RETURN: Status
@@ -70,7 +77,7 @@
70 * create_word_field_op, 77 * create_word_field_op,
71 * create_dword_field_op, 78 * create_dword_field_op,
72 * create_qword_field_op, 79 * create_qword_field_op,
73 * create_field_op (all of which define fields in buffers) 80 * create_field_op (all of which define a field in a buffer)
74 * 81 *
75 ******************************************************************************/ 82 ******************************************************************************/
76 83
@@ -119,7 +126,8 @@ acpi_ds_create_buffer_field (
119 flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE; 126 flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE;
120 } 127 }
121 else { 128 else {
122 flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE | ACPI_NS_ERROR_IF_FOUND; 129 flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE |
130 ACPI_NS_ERROR_IF_FOUND;
123 } 131 }
124 132
125 /* 133 /*
@@ -134,16 +142,16 @@ acpi_ds_create_buffer_field (
134 } 142 }
135 } 143 }
136 144
137 /* We could put the returned object (Node) on the object stack for later, but 145 /* We could put the returned object (Node) on the object stack for later,
138 * for now, we will put it in the "op" object that the parser uses, so we 146 * but for now, we will put it in the "op" object that the parser uses,
139 * can get it again at the end of this scope 147 * so we can get it again at the end of this scope
140 */ 148 */
141 op->common.node = node; 149 op->common.node = node;
142 150
143 /* 151 /*
144 * If there is no object attached to the node, this node was just created and 152 * If there is no object attached to the node, this node was just created
145 * we need to create the field object. Otherwise, this was a lookup of an 153 * and we need to create the field object. Otherwise, this was a lookup
146 * existing node and we don't want to create the field object again. 154 * of an existing node and we don't want to create the field object again.
147 */ 155 */
148 obj_desc = acpi_ns_get_attached_object (node); 156 obj_desc = acpi_ns_get_attached_object (node);
149 if (obj_desc) { 157 if (obj_desc) {
@@ -205,7 +213,7 @@ cleanup:
205 * 213 *
206 ******************************************************************************/ 214 ******************************************************************************/
207 215
208acpi_status 216static acpi_status
209acpi_ds_get_field_names ( 217acpi_ds_get_field_names (
210 struct acpi_create_field_info *info, 218 struct acpi_create_field_info *info,
211 struct acpi_walk_state *walk_state, 219 struct acpi_walk_state *walk_state,
@@ -238,7 +246,8 @@ acpi_ds_get_field_names (
238 + (acpi_integer) arg->common.value.size; 246 + (acpi_integer) arg->common.value.size;
239 247
240 if (position > ACPI_UINT32_MAX) { 248 if (position > ACPI_UINT32_MAX) {
241 ACPI_REPORT_ERROR (("Bit offset within field too large (> 0xFFFFFFFF)\n")); 249 ACPI_REPORT_ERROR ((
250 "Bit offset within field too large (> 0xFFFFFFFF)\n"));
242 return_ACPI_STATUS (AE_SUPPORT); 251 return_ACPI_STATUS (AE_SUPPORT);
243 } 252 }
244 253
@@ -250,12 +259,15 @@ acpi_ds_get_field_names (
250 259
251 /* 260 /*
252 * Get a new access_type and access_attribute -- to be used for all 261 * Get a new access_type and access_attribute -- to be used for all
253 * field units that follow, until field end or another access_as keyword. 262 * field units that follow, until field end or another access_as
263 * keyword.
254 * 264 *
255 * In field_flags, preserve the flag bits other than the ACCESS_TYPE bits 265 * In field_flags, preserve the flag bits other than the
266 * ACCESS_TYPE bits
256 */ 267 */
257 info->field_flags = (u8) ((info->field_flags & ~(AML_FIELD_ACCESS_TYPE_MASK)) | 268 info->field_flags = (u8)
258 ((u8) ((u32) arg->common.value.integer >> 8))); 269 ((info->field_flags & ~(AML_FIELD_ACCESS_TYPE_MASK)) |
270 ((u8) ((u32) arg->common.value.integer >> 8)));
259 271
260 info->attribute = (u8) (arg->common.value.integer); 272 info->attribute = (u8) (arg->common.value.integer);
261 break; 273 break;
@@ -267,7 +279,8 @@ acpi_ds_get_field_names (
267 279
268 status = acpi_ns_lookup (walk_state->scope_info, 280 status = acpi_ns_lookup (walk_state->scope_info,
269 (char *) &arg->named.name, 281 (char *) &arg->named.name,
270 info->field_type, ACPI_IMODE_EXECUTE, ACPI_NS_DONT_OPEN_SCOPE, 282 info->field_type, ACPI_IMODE_EXECUTE,
283 ACPI_NS_DONT_OPEN_SCOPE,
271 walk_state, &info->field_node); 284 walk_state, &info->field_node);
272 if (ACPI_FAILURE (status)) { 285 if (ACPI_FAILURE (status)) {
273 ACPI_REPORT_NSERROR ((char *) &arg->named.name, status); 286 ACPI_REPORT_NSERROR ((char *) &arg->named.name, status);
@@ -295,8 +308,9 @@ acpi_ds_get_field_names (
295 + (acpi_integer) arg->common.value.size; 308 + (acpi_integer) arg->common.value.size;
296 309
297 if (position > ACPI_UINT32_MAX) { 310 if (position > ACPI_UINT32_MAX) {
298 ACPI_REPORT_ERROR (("Field [%4.4s] bit offset too large (> 0xFFFFFFFF)\n", 311 ACPI_REPORT_ERROR ((
299 (char *) &info->field_node->name)); 312 "Field [%4.4s] bit offset too large (> 0xFFFFFFFF)\n",
313 (char *) &info->field_node->name));
300 return_ACPI_STATUS (AE_SUPPORT); 314 return_ACPI_STATUS (AE_SUPPORT);
301 } 315 }
302 316
@@ -306,7 +320,8 @@ acpi_ds_get_field_names (
306 320
307 default: 321 default:
308 322
309 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid opcode in field list: %X\n", 323 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
324 "Invalid opcode in field list: %X\n",
310 arg->common.aml_opcode)); 325 arg->common.aml_opcode));
311 return_ACPI_STATUS (AE_AML_BAD_OPCODE); 326 return_ACPI_STATUS (AE_AML_BAD_OPCODE);
312 } 327 }
@@ -435,7 +450,8 @@ acpi_ds_init_field_objects (
435 status = acpi_ns_lookup (walk_state->scope_info, 450 status = acpi_ns_lookup (walk_state->scope_info,
436 (char *) &arg->named.name, 451 (char *) &arg->named.name,
437 type, ACPI_IMODE_LOAD_PASS1, 452 type, ACPI_IMODE_LOAD_PASS1,
438 ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE | ACPI_NS_ERROR_IF_FOUND, 453 ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE |
454 ACPI_NS_ERROR_IF_FOUND,
439 walk_state, &node); 455 walk_state, &node);
440 if (ACPI_FAILURE (status)) { 456 if (ACPI_FAILURE (status)) {
441 ACPI_REPORT_NSERROR ((char *) &arg->named.name, status); 457 ACPI_REPORT_NSERROR ((char *) &arg->named.name, status);