diff options
author | Robert Moore <robert.moore@intel.com> | 2005-04-18 22:49:35 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2005-07-12 00:08:52 -0400 |
commit | 44f6c01242da4e162f28d8e1216a8c7a91174605 (patch) | |
tree | 53f724764f1bd9036dfb049a643d198125cc9edc /drivers/acpi/executer/exfield.c | |
parent | ebb6e1a6122fd6b7c96470cfd4ce0f04150e5084 (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/executer/exfield.c')
-rw-r--r-- | drivers/acpi/executer/exfield.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/drivers/acpi/executer/exfield.c b/drivers/acpi/executer/exfield.c index be7f2124fa02..22c8fa480f60 100644 --- a/drivers/acpi/executer/exfield.c +++ b/drivers/acpi/executer/exfield.c | |||
@@ -120,8 +120,8 @@ acpi_ex_read_data_from_field ( | |||
120 | * Note: Smbus protocol value is passed in upper 16-bits of Function | 120 | * Note: Smbus protocol value is passed in upper 16-bits of Function |
121 | */ | 121 | */ |
122 | status = acpi_ex_access_region (obj_desc, 0, | 122 | status = acpi_ex_access_region (obj_desc, 0, |
123 | ACPI_CAST_PTR (acpi_integer, buffer_desc->buffer.pointer), | 123 | ACPI_CAST_PTR (acpi_integer, buffer_desc->buffer.pointer), |
124 | ACPI_READ | (obj_desc->field.attribute << 16)); | 124 | ACPI_READ | (obj_desc->field.attribute << 16)); |
125 | acpi_ex_release_global_lock (locked); | 125 | acpi_ex_release_global_lock (locked); |
126 | goto exit; | 126 | goto exit; |
127 | } | 127 | } |
@@ -196,6 +196,7 @@ exit: | |||
196 | * | 196 | * |
197 | * PARAMETERS: source_desc - Contains data to write | 197 | * PARAMETERS: source_desc - Contains data to write |
198 | * obj_desc - The named field | 198 | * obj_desc - The named field |
199 | * result_desc - Where the return value is returned, if any | ||
199 | * | 200 | * |
200 | * RETURN: Status | 201 | * RETURN: Status |
201 | * | 202 | * |
@@ -250,12 +251,15 @@ acpi_ex_write_data_to_field ( | |||
250 | if (ACPI_GET_OBJECT_TYPE (source_desc) != ACPI_TYPE_BUFFER) { | 251 | if (ACPI_GET_OBJECT_TYPE (source_desc) != ACPI_TYPE_BUFFER) { |
251 | ACPI_REPORT_ERROR (("SMBus write requires Buffer, found type %s\n", | 252 | ACPI_REPORT_ERROR (("SMBus write requires Buffer, found type %s\n", |
252 | acpi_ut_get_object_type_name (source_desc))); | 253 | acpi_ut_get_object_type_name (source_desc))); |
254 | |||
253 | return_ACPI_STATUS (AE_AML_OPERAND_TYPE); | 255 | return_ACPI_STATUS (AE_AML_OPERAND_TYPE); |
254 | } | 256 | } |
255 | 257 | ||
256 | if (source_desc->buffer.length < ACPI_SMBUS_BUFFER_SIZE) { | 258 | if (source_desc->buffer.length < ACPI_SMBUS_BUFFER_SIZE) { |
257 | ACPI_REPORT_ERROR (("SMBus write requires Buffer of length %X, found length %X\n", | 259 | ACPI_REPORT_ERROR (( |
260 | "SMBus write requires Buffer of length %X, found length %X\n", | ||
258 | ACPI_SMBUS_BUFFER_SIZE, source_desc->buffer.length)); | 261 | ACPI_SMBUS_BUFFER_SIZE, source_desc->buffer.length)); |
262 | |||
259 | return_ACPI_STATUS (AE_AML_BUFFER_LIMIT); | 263 | return_ACPI_STATUS (AE_AML_BUFFER_LIMIT); |
260 | } | 264 | } |
261 | 265 | ||
@@ -265,14 +269,16 @@ acpi_ex_write_data_to_field ( | |||
265 | } | 269 | } |
266 | 270 | ||
267 | buffer = buffer_desc->buffer.pointer; | 271 | buffer = buffer_desc->buffer.pointer; |
268 | ACPI_MEMCPY (buffer, source_desc->buffer.pointer, ACPI_SMBUS_BUFFER_SIZE); | 272 | ACPI_MEMCPY (buffer, source_desc->buffer.pointer, |
273 | ACPI_SMBUS_BUFFER_SIZE); | ||
269 | 274 | ||
270 | /* Lock entire transaction if requested */ | 275 | /* Lock entire transaction if requested */ |
271 | 276 | ||
272 | locked = acpi_ex_acquire_global_lock (obj_desc->common_field.field_flags); | 277 | locked = acpi_ex_acquire_global_lock (obj_desc->common_field.field_flags); |
273 | 278 | ||
274 | /* | 279 | /* |
275 | * Perform the write (returns status and perhaps data in the same buffer) | 280 | * Perform the write (returns status and perhaps data in the |
281 | * same buffer) | ||
276 | * Note: SMBus protocol type is passed in upper 16-bits of Function. | 282 | * Note: SMBus protocol type is passed in upper 16-bits of Function. |
277 | */ | 283 | */ |
278 | status = acpi_ex_access_region (obj_desc, 0, | 284 | status = acpi_ex_access_region (obj_desc, 0, |
@@ -284,9 +290,8 @@ acpi_ex_write_data_to_field ( | |||
284 | return_ACPI_STATUS (status); | 290 | return_ACPI_STATUS (status); |
285 | } | 291 | } |
286 | 292 | ||
287 | /* | 293 | /* Get a pointer to the data to be written */ |
288 | * Get a pointer to the data to be written | 294 | |
289 | */ | ||
290 | switch (ACPI_GET_OBJECT_TYPE (source_desc)) { | 295 | switch (ACPI_GET_OBJECT_TYPE (source_desc)) { |
291 | case ACPI_TYPE_INTEGER: | 296 | case ACPI_TYPE_INTEGER: |
292 | buffer = &source_desc->integer.value; | 297 | buffer = &source_desc->integer.value; |
@@ -314,7 +319,8 @@ acpi_ex_write_data_to_field ( | |||
314 | * the ACPI specification. | 319 | * the ACPI specification. |
315 | */ | 320 | */ |
316 | new_buffer = NULL; | 321 | new_buffer = NULL; |
317 | required_length = ACPI_ROUND_BITS_UP_TO_BYTES (obj_desc->common_field.bit_length); | 322 | required_length = ACPI_ROUND_BITS_UP_TO_BYTES ( |
323 | obj_desc->common_field.bit_length); | ||
318 | 324 | ||
319 | if (length < required_length) { | 325 | if (length < required_length) { |
320 | /* We need to create a new buffer */ | 326 | /* We need to create a new buffer */ |
@@ -338,6 +344,7 @@ acpi_ex_write_data_to_field ( | |||
338 | "field_write [FROM]: Obj %p (%s:%X), Buf %p, byte_len %X\n", | 344 | "field_write [FROM]: Obj %p (%s:%X), Buf %p, byte_len %X\n", |
339 | source_desc, acpi_ut_get_type_name (ACPI_GET_OBJECT_TYPE (source_desc)), | 345 | source_desc, acpi_ut_get_type_name (ACPI_GET_OBJECT_TYPE (source_desc)), |
340 | ACPI_GET_OBJECT_TYPE (source_desc), buffer, length)); | 346 | ACPI_GET_OBJECT_TYPE (source_desc), buffer, length)); |
347 | |||
341 | ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, | 348 | ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, |
342 | "field_write [TO]: Obj %p (%s:%X), bit_len %X, bit_off %X, byte_off %X\n", | 349 | "field_write [TO]: Obj %p (%s:%X), bit_len %X, bit_off %X, byte_off %X\n", |
343 | obj_desc, acpi_ut_get_type_name (ACPI_GET_OBJECT_TYPE (obj_desc)), | 350 | obj_desc, acpi_ut_get_type_name (ACPI_GET_OBJECT_TYPE (obj_desc)), |