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/tables/tbget.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/tables/tbget.c')
-rw-r--r-- | drivers/acpi/tables/tbget.c | 63 |
1 files changed, 39 insertions, 24 deletions
diff --git a/drivers/acpi/tables/tbget.c b/drivers/acpi/tables/tbget.c index 896f3ddda62e..4ab2aadc6133 100644 --- a/drivers/acpi/tables/tbget.c +++ b/drivers/acpi/tables/tbget.c | |||
@@ -49,6 +49,19 @@ | |||
49 | #define _COMPONENT ACPI_TABLES | 49 | #define _COMPONENT ACPI_TABLES |
50 | ACPI_MODULE_NAME ("tbget") | 50 | ACPI_MODULE_NAME ("tbget") |
51 | 51 | ||
52 | /* Local prototypes */ | ||
53 | |||
54 | static acpi_status | ||
55 | acpi_tb_get_this_table ( | ||
56 | struct acpi_pointer *address, | ||
57 | struct acpi_table_header *header, | ||
58 | struct acpi_table_desc *table_info); | ||
59 | |||
60 | static acpi_status | ||
61 | acpi_tb_table_override ( | ||
62 | struct acpi_table_header *header, | ||
63 | struct acpi_table_desc *table_info); | ||
64 | |||
52 | 65 | ||
53 | /******************************************************************************* | 66 | /******************************************************************************* |
54 | * | 67 | * |
@@ -76,9 +89,8 @@ acpi_tb_get_table ( | |||
76 | ACPI_FUNCTION_TRACE ("tb_get_table"); | 89 | ACPI_FUNCTION_TRACE ("tb_get_table"); |
77 | 90 | ||
78 | 91 | ||
79 | /* | 92 | /* Get the header in order to get signature and table size */ |
80 | * Get the header in order to get signature and table size | 93 | |
81 | */ | ||
82 | status = acpi_tb_get_table_header (address, &header); | 94 | status = acpi_tb_get_table_header (address, &header); |
83 | if (ACPI_FAILURE (status)) { | 95 | if (ACPI_FAILURE (status)) { |
84 | return_ACPI_STATUS (status); | 96 | return_ACPI_STATUS (status); |
@@ -127,8 +139,8 @@ acpi_tb_get_table_header ( | |||
127 | 139 | ||
128 | 140 | ||
129 | /* | 141 | /* |
130 | * Flags contains the current processor mode (Virtual or Physical addressing) | 142 | * Flags contains the current processor mode (Virtual or Physical |
131 | * The pointer_type is either Logical or Physical | 143 | * addressing) The pointer_type is either Logical or Physical |
132 | */ | 144 | */ |
133 | switch (address->pointer_type) { | 145 | switch (address->pointer_type) { |
134 | case ACPI_PHYSMODE_PHYSPTR: | 146 | case ACPI_PHYSMODE_PHYSPTR: |
@@ -136,7 +148,8 @@ acpi_tb_get_table_header ( | |||
136 | 148 | ||
137 | /* Pointer matches processor mode, copy the header */ | 149 | /* Pointer matches processor mode, copy the header */ |
138 | 150 | ||
139 | ACPI_MEMCPY (return_header, address->pointer.logical, sizeof (struct acpi_table_header)); | 151 | ACPI_MEMCPY (return_header, address->pointer.logical, |
152 | sizeof (struct acpi_table_header)); | ||
140 | break; | 153 | break; |
141 | 154 | ||
142 | 155 | ||
@@ -144,10 +157,11 @@ acpi_tb_get_table_header ( | |||
144 | 157 | ||
145 | /* Create a logical address for the physical pointer*/ | 158 | /* Create a logical address for the physical pointer*/ |
146 | 159 | ||
147 | status = acpi_os_map_memory (address->pointer.physical, sizeof (struct acpi_table_header), | 160 | status = acpi_os_map_memory (address->pointer.physical, |
148 | (void *) &header); | 161 | sizeof (struct acpi_table_header), (void *) &header); |
149 | if (ACPI_FAILURE (status)) { | 162 | if (ACPI_FAILURE (status)) { |
150 | ACPI_REPORT_ERROR (("Could not map memory at %8.8X%8.8X for length %X\n", | 163 | ACPI_REPORT_ERROR (( |
164 | "Could not map memory at %8.8X%8.8X for length %X\n", | ||
151 | ACPI_FORMAT_UINT64 (address->pointer.physical), | 165 | ACPI_FORMAT_UINT64 (address->pointer.physical), |
152 | sizeof (struct acpi_table_header))); | 166 | sizeof (struct acpi_table_header))); |
153 | return_ACPI_STATUS (status); | 167 | return_ACPI_STATUS (status); |
@@ -210,9 +224,8 @@ acpi_tb_get_table_body ( | |||
210 | return_ACPI_STATUS (AE_BAD_PARAMETER); | 224 | return_ACPI_STATUS (AE_BAD_PARAMETER); |
211 | } | 225 | } |
212 | 226 | ||
213 | /* | 227 | /* Attempt table override. */ |
214 | * Attempt table override. | 228 | |
215 | */ | ||
216 | status = acpi_tb_table_override (header, table_info); | 229 | status = acpi_tb_table_override (header, table_info); |
217 | if (ACPI_SUCCESS (status)) { | 230 | if (ACPI_SUCCESS (status)) { |
218 | /* Table was overridden by the host OS */ | 231 | /* Table was overridden by the host OS */ |
@@ -241,7 +254,7 @@ acpi_tb_get_table_body ( | |||
241 | * | 254 | * |
242 | ******************************************************************************/ | 255 | ******************************************************************************/ |
243 | 256 | ||
244 | acpi_status | 257 | static acpi_status |
245 | acpi_tb_table_override ( | 258 | acpi_tb_table_override ( |
246 | struct acpi_table_header *header, | 259 | struct acpi_table_header *header, |
247 | struct acpi_table_desc *table_info) | 260 | struct acpi_table_desc *table_info) |
@@ -315,7 +328,7 @@ acpi_tb_table_override ( | |||
315 | * | 328 | * |
316 | ******************************************************************************/ | 329 | ******************************************************************************/ |
317 | 330 | ||
318 | acpi_status | 331 | static acpi_status |
319 | acpi_tb_get_this_table ( | 332 | acpi_tb_get_this_table ( |
320 | struct acpi_pointer *address, | 333 | struct acpi_pointer *address, |
321 | struct acpi_table_header *header, | 334 | struct acpi_table_header *header, |
@@ -330,8 +343,8 @@ acpi_tb_get_this_table ( | |||
330 | 343 | ||
331 | 344 | ||
332 | /* | 345 | /* |
333 | * Flags contains the current processor mode (Virtual or Physical addressing) | 346 | * Flags contains the current processor mode (Virtual or Physical |
334 | * The pointer_type is either Logical or Physical | 347 | * addressing) The pointer_type is either Logical or Physical |
335 | */ | 348 | */ |
336 | switch (address->pointer_type) { | 349 | switch (address->pointer_type) { |
337 | case ACPI_PHYSMODE_PHYSPTR: | 350 | case ACPI_PHYSMODE_PHYSPTR: |
@@ -341,7 +354,8 @@ acpi_tb_get_this_table ( | |||
341 | 354 | ||
342 | full_table = ACPI_MEM_ALLOCATE (header->length); | 355 | full_table = ACPI_MEM_ALLOCATE (header->length); |
343 | if (!full_table) { | 356 | if (!full_table) { |
344 | ACPI_REPORT_ERROR (("Could not allocate table memory for [%4.4s] length %X\n", | 357 | ACPI_REPORT_ERROR (( |
358 | "Could not allocate table memory for [%4.4s] length %X\n", | ||
345 | header->signature, header->length)); | 359 | header->signature, header->length)); |
346 | return_ACPI_STATUS (AE_NO_MEMORY); | 360 | return_ACPI_STATUS (AE_NO_MEMORY); |
347 | } | 361 | } |
@@ -362,12 +376,14 @@ acpi_tb_get_this_table ( | |||
362 | * Just map the table's physical memory | 376 | * Just map the table's physical memory |
363 | * into our address space. | 377 | * into our address space. |
364 | */ | 378 | */ |
365 | status = acpi_os_map_memory (address->pointer.physical, (acpi_size) header->length, | 379 | status = acpi_os_map_memory (address->pointer.physical, |
366 | (void *) &full_table); | 380 | (acpi_size) header->length, (void *) &full_table); |
367 | if (ACPI_FAILURE (status)) { | 381 | if (ACPI_FAILURE (status)) { |
368 | ACPI_REPORT_ERROR (("Could not map memory for table [%4.4s] at %8.8X%8.8X for length %X\n", | 382 | ACPI_REPORT_ERROR (( |
383 | "Could not map memory for table [%4.4s] at %8.8X%8.8X for length %X\n", | ||
369 | header->signature, | 384 | header->signature, |
370 | ACPI_FORMAT_UINT64 (address->pointer.physical), header->length)); | 385 | ACPI_FORMAT_UINT64 (address->pointer.physical), |
386 | header->length)); | ||
371 | return (status); | 387 | return (status); |
372 | } | 388 | } |
373 | 389 | ||
@@ -465,9 +481,8 @@ acpi_tb_get_table_ptr ( | |||
465 | return_ACPI_STATUS (AE_OK); | 481 | return_ACPI_STATUS (AE_OK); |
466 | } | 482 | } |
467 | 483 | ||
468 | /* | 484 | /* Check for instance out of range */ |
469 | * Check for instance out of range | 485 | |
470 | */ | ||
471 | if (instance > acpi_gbl_table_lists[table_type].count) { | 486 | if (instance > acpi_gbl_table_lists[table_type].count) { |
472 | return_ACPI_STATUS (AE_NOT_EXIST); | 487 | return_ACPI_STATUS (AE_NOT_EXIST); |
473 | } | 488 | } |