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/rscreate.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/rscreate.c')
-rw-r--r-- | drivers/acpi/resources/rscreate.c | 45 |
1 files changed, 21 insertions, 24 deletions
diff --git a/drivers/acpi/resources/rscreate.c b/drivers/acpi/resources/rscreate.c index a3a0cbfda68d..8e0eae0d50bb 100644 --- a/drivers/acpi/resources/rscreate.c +++ b/drivers/acpi/resources/rscreate.c | |||
@@ -87,9 +87,8 @@ acpi_rs_create_resource_list ( | |||
87 | ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "byte_stream_buffer = %p\n", | 87 | ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "byte_stream_buffer = %p\n", |
88 | byte_stream_buffer)); | 88 | byte_stream_buffer)); |
89 | 89 | ||
90 | /* | 90 | /* Params already validated, so we don't re-validate here */ |
91 | * Params already validated, so we don't re-validate here | 91 | |
92 | */ | ||
93 | byte_stream_buffer_length = byte_stream_buffer->buffer.length; | 92 | byte_stream_buffer_length = byte_stream_buffer->buffer.length; |
94 | byte_stream_start = byte_stream_buffer->buffer.pointer; | 93 | byte_stream_start = byte_stream_buffer->buffer.pointer; |
95 | 94 | ||
@@ -171,9 +170,8 @@ acpi_rs_create_pci_routing_table ( | |||
171 | 170 | ||
172 | /* Params already validated, so we don't re-validate here */ | 171 | /* Params already validated, so we don't re-validate here */ |
173 | 172 | ||
174 | /* | 173 | /* Get the required buffer length */ |
175 | * Get the required buffer length | 174 | |
176 | */ | ||
177 | status = acpi_rs_get_pci_routing_table_length (package_object, | 175 | status = acpi_rs_get_pci_routing_table_length (package_object, |
178 | &buffer_size_needed); | 176 | &buffer_size_needed); |
179 | if (ACPI_FAILURE (status)) { | 177 | if (ACPI_FAILURE (status)) { |
@@ -217,9 +215,8 @@ acpi_rs_create_pci_routing_table ( | |||
217 | */ | 215 | */ |
218 | user_prt->length = (sizeof (struct acpi_pci_routing_table) - 4); | 216 | user_prt->length = (sizeof (struct acpi_pci_routing_table) - 4); |
219 | 217 | ||
220 | /* | 218 | /* Each element of the top-level package must also be a package */ |
221 | * Each element of the top-level package must also be a package | 219 | |
222 | */ | ||
223 | if (ACPI_GET_OBJECT_TYPE (*top_object_list) != ACPI_TYPE_PACKAGE) { | 220 | if (ACPI_GET_OBJECT_TYPE (*top_object_list) != ACPI_TYPE_PACKAGE) { |
224 | ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, | 221 | ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, |
225 | "(PRT[%X]) Need sub-package, found %s\n", | 222 | "(PRT[%X]) Need sub-package, found %s\n", |
@@ -243,9 +240,8 @@ acpi_rs_create_pci_routing_table ( | |||
243 | */ | 240 | */ |
244 | sub_object_list = (*top_object_list)->package.elements; | 241 | sub_object_list = (*top_object_list)->package.elements; |
245 | 242 | ||
246 | /* | 243 | /* 1) First subobject: Dereference the PRT.Address */ |
247 | * 1) First subobject: Dereference the PRT.Address | 244 | |
248 | */ | ||
249 | obj_desc = sub_object_list[0]; | 245 | obj_desc = sub_object_list[0]; |
250 | if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_INTEGER) { | 246 | if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_INTEGER) { |
251 | user_prt->address = obj_desc->integer.value; | 247 | user_prt->address = obj_desc->integer.value; |
@@ -257,9 +253,8 @@ acpi_rs_create_pci_routing_table ( | |||
257 | return_ACPI_STATUS (AE_BAD_DATA); | 253 | return_ACPI_STATUS (AE_BAD_DATA); |
258 | } | 254 | } |
259 | 255 | ||
260 | /* | 256 | /* 2) Second subobject: Dereference the PRT.Pin */ |
261 | * 2) Second subobject: Dereference the PRT.Pin | 257 | |
262 | */ | ||
263 | obj_desc = sub_object_list[1]; | 258 | obj_desc = sub_object_list[1]; |
264 | if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_INTEGER) { | 259 | if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_INTEGER) { |
265 | user_prt->pin = (u32) obj_desc->integer.value; | 260 | user_prt->pin = (u32) obj_desc->integer.value; |
@@ -271,9 +266,8 @@ acpi_rs_create_pci_routing_table ( | |||
271 | return_ACPI_STATUS (AE_BAD_DATA); | 266 | return_ACPI_STATUS (AE_BAD_DATA); |
272 | } | 267 | } |
273 | 268 | ||
274 | /* | 269 | /* 3) Third subobject: Dereference the PRT.source_name */ |
275 | * 3) Third subobject: Dereference the PRT.source_name | 270 | |
276 | */ | ||
277 | obj_desc = sub_object_list[2]; | 271 | obj_desc = sub_object_list[2]; |
278 | switch (ACPI_GET_OBJECT_TYPE (obj_desc)) { | 272 | switch (ACPI_GET_OBJECT_TYPE (obj_desc)) { |
279 | case ACPI_TYPE_LOCAL_REFERENCE: | 273 | case ACPI_TYPE_LOCAL_REFERENCE: |
@@ -296,7 +290,9 @@ acpi_rs_create_pci_routing_table ( | |||
296 | 290 | ||
297 | status = acpi_ns_handle_to_pathname ((acpi_handle) node, &path_buffer); | 291 | status = acpi_ns_handle_to_pathname ((acpi_handle) node, &path_buffer); |
298 | 292 | ||
299 | user_prt->length += (u32) ACPI_STRLEN (user_prt->source) + 1; /* include null terminator */ | 293 | /* +1 to include null terminator */ |
294 | |||
295 | user_prt->length += (u32) ACPI_STRLEN (user_prt->source) + 1; | ||
300 | break; | 296 | break; |
301 | 297 | ||
302 | 298 | ||
@@ -304,8 +300,10 @@ acpi_rs_create_pci_routing_table ( | |||
304 | 300 | ||
305 | ACPI_STRCPY (user_prt->source, obj_desc->string.pointer); | 301 | ACPI_STRCPY (user_prt->source, obj_desc->string.pointer); |
306 | 302 | ||
307 | /* Add to the Length field the length of the string (add 1 for terminator) */ | 303 | /* |
308 | 304 | * Add to the Length field the length of the string | |
305 | * (add 1 for terminator) | ||
306 | */ | ||
309 | user_prt->length += obj_desc->string.length + 1; | 307 | user_prt->length += obj_desc->string.length + 1; |
310 | break; | 308 | break; |
311 | 309 | ||
@@ -333,9 +331,8 @@ acpi_rs_create_pci_routing_table ( | |||
333 | 331 | ||
334 | user_prt->length = (u32) ACPI_ROUND_UP_to_64_bITS (user_prt->length); | 332 | user_prt->length = (u32) ACPI_ROUND_UP_to_64_bITS (user_prt->length); |
335 | 333 | ||
336 | /* | 334 | /* 4) Fourth subobject: Dereference the PRT.source_index */ |
337 | * 4) Fourth subobject: Dereference the PRT.source_index | 335 | |
338 | */ | ||
339 | obj_desc = sub_object_list[3]; | 336 | obj_desc = sub_object_list[3]; |
340 | if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_INTEGER) { | 337 | if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_INTEGER) { |
341 | user_prt->source_index = (u32) obj_desc->integer.value; | 338 | user_prt->source_index = (u32) obj_desc->integer.value; |