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/resources/rslist.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/resources/rslist.c')
-rw-r--r-- | drivers/acpi/resources/rslist.c | 68 |
1 files changed, 28 insertions, 40 deletions
diff --git a/drivers/acpi/resources/rslist.c b/drivers/acpi/resources/rslist.c index e49c1e030f99..db7bcb4e60e3 100644 --- a/drivers/acpi/resources/rslist.c +++ b/drivers/acpi/resources/rslist.c | |||
@@ -55,7 +55,7 @@ | |||
55 | * | 55 | * |
56 | * PARAMETERS: resource_start_byte - Byte 0 of a resource descriptor | 56 | * PARAMETERS: resource_start_byte - Byte 0 of a resource descriptor |
57 | * | 57 | * |
58 | * RETURN: The Resource Type (Name) with no extraneous bits | 58 | * RETURN: The Resource Type with no extraneous bits |
59 | * | 59 | * |
60 | * DESCRIPTION: Extract the Resource Type/Name from the first byte of | 60 | * DESCRIPTION: Extract the Resource Type/Name from the first byte of |
61 | * a resource descriptor. | 61 | * a resource descriptor. |
@@ -70,28 +70,25 @@ acpi_rs_get_resource_type ( | |||
70 | ACPI_FUNCTION_ENTRY (); | 70 | ACPI_FUNCTION_ENTRY (); |
71 | 71 | ||
72 | 72 | ||
73 | /* | 73 | /* Determine if this is a small or large resource */ |
74 | * Determine if this is a small or large resource | 74 | |
75 | */ | ||
76 | switch (resource_start_byte & ACPI_RDESC_TYPE_MASK) { | 75 | switch (resource_start_byte & ACPI_RDESC_TYPE_MASK) { |
77 | case ACPI_RDESC_TYPE_SMALL: | 76 | case ACPI_RDESC_TYPE_SMALL: |
78 | 77 | ||
79 | /* | 78 | /* Small Resource Type -- Only bits 6:3 are valid */ |
80 | * Small Resource Type -- Only bits 6:3 are valid | 79 | |
81 | */ | ||
82 | return ((u8) (resource_start_byte & ACPI_RDESC_SMALL_MASK)); | 80 | return ((u8) (resource_start_byte & ACPI_RDESC_SMALL_MASK)); |
83 | 81 | ||
84 | 82 | ||
85 | case ACPI_RDESC_TYPE_LARGE: | 83 | case ACPI_RDESC_TYPE_LARGE: |
86 | 84 | ||
87 | /* | 85 | /* Large Resource Type -- All bits are valid */ |
88 | * Large Resource Type -- All bits are valid | 86 | |
89 | */ | ||
90 | return (resource_start_byte); | 87 | return (resource_start_byte); |
91 | 88 | ||
92 | 89 | ||
93 | default: | 90 | default: |
94 | /* No other types of resource descriptor */ | 91 | /* Invalid type */ |
95 | break; | 92 | break; |
96 | } | 93 | } |
97 | 94 | ||
@@ -135,9 +132,8 @@ acpi_rs_byte_stream_to_list ( | |||
135 | 132 | ||
136 | while (bytes_parsed < byte_stream_buffer_length && | 133 | while (bytes_parsed < byte_stream_buffer_length && |
137 | !end_tag_processed) { | 134 | !end_tag_processed) { |
138 | /* | 135 | /* The next byte in the stream is the resource type */ |
139 | * The next byte in the stream is the resource type | 136 | |
140 | */ | ||
141 | resource_type = acpi_rs_get_resource_type (*byte_stream_buffer); | 137 | resource_type = acpi_rs_get_resource_type (*byte_stream_buffer); |
142 | 138 | ||
143 | switch (resource_type) { | 139 | switch (resource_type) { |
@@ -299,28 +295,23 @@ acpi_rs_byte_stream_to_list ( | |||
299 | return_ACPI_STATUS (status); | 295 | return_ACPI_STATUS (status); |
300 | } | 296 | } |
301 | 297 | ||
302 | /* | 298 | /* Update the return value and counter */ |
303 | * Update the return value and counter | 299 | |
304 | */ | ||
305 | bytes_parsed += bytes_consumed; | 300 | bytes_parsed += bytes_consumed; |
306 | 301 | ||
307 | /* | 302 | /* Set the byte stream to point to the next resource */ |
308 | * Set the byte stream to point to the next resource | 303 | |
309 | */ | ||
310 | byte_stream_buffer += bytes_consumed; | 304 | byte_stream_buffer += bytes_consumed; |
311 | 305 | ||
312 | /* | 306 | /* Set the Buffer to the next structure */ |
313 | * Set the Buffer to the next structure | 307 | |
314 | */ | ||
315 | resource = ACPI_CAST_PTR (struct acpi_resource, buffer); | 308 | resource = ACPI_CAST_PTR (struct acpi_resource, buffer); |
316 | resource->length = (u32) ACPI_ALIGN_RESOURCE_SIZE (resource->length); | 309 | resource->length = (u32) ACPI_ALIGN_RESOURCE_SIZE (resource->length); |
317 | buffer += ACPI_ALIGN_RESOURCE_SIZE (structure_size); | 310 | buffer += ACPI_ALIGN_RESOURCE_SIZE (structure_size); |
311 | } | ||
318 | 312 | ||
319 | } /* end while */ | 313 | /* Check the reason for exiting the while loop */ |
320 | 314 | ||
321 | /* | ||
322 | * Check the reason for exiting the while loop | ||
323 | */ | ||
324 | if (!end_tag_processed) { | 315 | if (!end_tag_processed) { |
325 | return_ACPI_STATUS (AE_AML_NO_RESOURCE_END_TAG); | 316 | return_ACPI_STATUS (AE_AML_NO_RESOURCE_END_TAG); |
326 | } | 317 | } |
@@ -424,9 +415,8 @@ acpi_rs_list_to_byte_stream ( | |||
424 | */ | 415 | */ |
425 | status = acpi_rs_end_tag_stream (linked_list, &buffer, &bytes_consumed); | 416 | status = acpi_rs_end_tag_stream (linked_list, &buffer, &bytes_consumed); |
426 | 417 | ||
427 | /* | 418 | /* An End Tag indicates the end of the Resource Template */ |
428 | * An End Tag indicates the end of the Resource Template | 419 | |
429 | */ | ||
430 | done = TRUE; | 420 | done = TRUE; |
431 | break; | 421 | break; |
432 | 422 | ||
@@ -488,27 +478,25 @@ acpi_rs_list_to_byte_stream ( | |||
488 | default: | 478 | default: |
489 | /* | 479 | /* |
490 | * If we get here, everything is out of sync, | 480 | * If we get here, everything is out of sync, |
491 | * so exit with an error | 481 | * so exit with an error |
492 | */ | 482 | */ |
493 | ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid descriptor type (%X) in resource list\n", | 483 | ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, |
484 | "Invalid descriptor type (%X) in resource list\n", | ||
494 | linked_list->id)); | 485 | linked_list->id)); |
495 | status = AE_BAD_DATA; | 486 | status = AE_BAD_DATA; |
496 | break; | 487 | break; |
497 | 488 | } | |
498 | } /* switch (linked_list->Id) */ | ||
499 | 489 | ||
500 | if (ACPI_FAILURE (status)) { | 490 | if (ACPI_FAILURE (status)) { |
501 | return_ACPI_STATUS (status); | 491 | return_ACPI_STATUS (status); |
502 | } | 492 | } |
503 | 493 | ||
504 | /* | 494 | /* Set the Buffer to point to the open byte */ |
505 | * Set the Buffer to point to the open byte | 495 | |
506 | */ | ||
507 | buffer += bytes_consumed; | 496 | buffer += bytes_consumed; |
508 | 497 | ||
509 | /* | 498 | /* Point to the next object */ |
510 | * Point to the next object | 499 | |
511 | */ | ||
512 | linked_list = ACPI_PTR_ADD (struct acpi_resource, | 500 | linked_list = ACPI_PTR_ADD (struct acpi_resource, |
513 | linked_list, linked_list->length); | 501 | linked_list, linked_list->length); |
514 | } | 502 | } |