aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/tables
diff options
context:
space:
mode:
authorRobert Moore <robert.moore@intel.com>2005-06-24 00:00:00 -0400
committerLen Brown <len.brown@intel.com>2005-07-13 23:45:36 -0400
commit73459f73e5d1602c59ebec114fc45185521353c1 (patch)
tree56c2183e345784d2be09c2f5d2530cf36221c55e /drivers/acpi/tables
parent88ac00f5a841dcfc5c682000f4a6add0add8caac (diff)
ACPICA 20050617-0624 from Bob Moore <robert.moore@intel.com>
ACPICA 20050617: Moved the object cache operations into the OS interface layer (OSL) to allow the host OS to handle these operations if desired (for example, the Linux OSL will invoke the slab allocator). This support is optional; the compile time define ACPI_USE_LOCAL_CACHE may be used to utilize the original cache code in the ACPI CA core. The new OSL interfaces are shown below. See utalloc.c for an example implementation, and acpiosxf.h for the exact interface definitions. Thanks to Alexey Starikovskiy. acpi_os_create_cache acpi_os_delete_cache acpi_os_purge_cache acpi_os_acquire_object acpi_os_release_object Modified the interfaces to acpi_os_acquire_lock and acpi_os_release_lock to return and restore a flags parameter. This fits better with many OS lock models. Note: the current execution state (interrupt handler or not) is no longer passed to these interfaces. If necessary, the OSL must determine this state by itself, a simple and fast operation. Thanks to Alexey Starikovskiy. Fixed a problem in the ACPI table handling where a valid XSDT was assumed present if the revision of the RSDP was 2 or greater. According to the ACPI specification, the XSDT is optional in all cases, and the table manager therefore now checks for both an RSDP >=2 and a valid XSDT pointer. Otherwise, the RSDT pointer is used. Some ACPI 2.0 compliant BIOSs contain only the RSDT. Fixed an interpreter problem with the Mid() operator in the case of an input string where the resulting output string is of zero length. It now correctly returns a valid, null terminated string object instead of a string object with a null pointer. Fixed a problem with the control method argument handling to allow a store to an Arg object that already contains an object of type Device. The Device object is now correctly overwritten. Previously, an error was returned. ACPICA 20050624: Modified the new OSL cache interfaces to use ACPI_CACHE_T as the type for the host-defined cache object. This allows the OSL implementation to define and type this object in any manner desired, simplifying the OSL implementation. For example, ACPI_CACHE_T is defined as kmem_cache_t for Linux, and should be defined in the OS-specific header file for other operating systems as required. Changed the interface to AcpiOsAcquireObject to directly return the requested object as the function return (instead of ACPI_STATUS.) This change was made for performance reasons, since this is the purpose of the interface in the first place. acpi_os_acquire_object is now similar to the acpi_os_allocate interface. Thanks to Alexey Starikovskiy. Modified the initialization sequence in acpi_initialize_subsystem to call the OSL interface acpi_osl_initialize first, before any local initialization. This change was required because the global initialization now calls OSL interfaces. Restructured the code base to split some files because of size and/or because the code logically belonged in a separate file. New files are listed below. utilities/utcache.c /* Local cache interfaces */ utilities/utmutex.c /* Local mutex support */ utilities/utstate.c /* State object support */ parser/psloop.c /* Main AML parse loop */ Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/tables')
-rw-r--r--drivers/acpi/tables/tbconvrt.c8
-rw-r--r--drivers/acpi/tables/tbrsdt.c34
-rw-r--r--drivers/acpi/tables/tbxfroot.c8
3 files changed, 29 insertions, 21 deletions
diff --git a/drivers/acpi/tables/tbconvrt.c b/drivers/acpi/tables/tbconvrt.c
index 92e0c31539be..d4ff71f5fe5d 100644
--- a/drivers/acpi/tables/tbconvrt.c
+++ b/drivers/acpi/tables/tbconvrt.c
@@ -97,7 +97,9 @@ acpi_tb_get_table_count (
97 ACPI_FUNCTION_ENTRY (); 97 ACPI_FUNCTION_ENTRY ();
98 98
99 99
100 if (RSDP->revision < 2) { 100 /* RSDT pointers are 32 bits, XSDT pointers are 64 bits */
101
102 if (acpi_gbl_root_table_type == ACPI_TABLE_TYPE_RSDT) {
101 pointer_size = sizeof (u32); 103 pointer_size = sizeof (u32);
102 } 104 }
103 else { 105 else {
@@ -158,7 +160,9 @@ acpi_tb_convert_to_xsdt (
158 /* Copy the table pointers */ 160 /* Copy the table pointers */
159 161
160 for (i = 0; i < acpi_gbl_rsdt_table_count; i++) { 162 for (i = 0; i < acpi_gbl_rsdt_table_count; i++) {
161 if (acpi_gbl_RSDP->revision < 2) { 163 /* RSDT pointers are 32 bits, XSDT pointers are 64 bits */
164
165 if (acpi_gbl_root_table_type == ACPI_TABLE_TYPE_RSDT) {
162 ACPI_STORE_ADDRESS (new_table->table_offset_entry[i], 166 ACPI_STORE_ADDRESS (new_table->table_offset_entry[i],
163 (ACPI_CAST_PTR (struct rsdt_descriptor_rev1, 167 (ACPI_CAST_PTR (struct rsdt_descriptor_rev1,
164 table_info->pointer))->table_offset_entry[i]); 168 table_info->pointer))->table_offset_entry[i]);
diff --git a/drivers/acpi/tables/tbrsdt.c b/drivers/acpi/tables/tbrsdt.c
index b7ffe39c3626..13c6ddb2f546 100644
--- a/drivers/acpi/tables/tbrsdt.c
+++ b/drivers/acpi/tables/tbrsdt.c
@@ -159,8 +159,8 @@ cleanup:
159 * 159 *
160 * RETURN: None, Address 160 * RETURN: None, Address
161 * 161 *
162 * DESCRIPTION: Extract the address of the RSDT or XSDT, depending on the 162 * DESCRIPTION: Extract the address of either the RSDT or XSDT, depending on the
163 * version of the RSDP 163 * version of the RSDP and whether the XSDT pointer is valid
164 * 164 *
165 ******************************************************************************/ 165 ******************************************************************************/
166 166
@@ -174,16 +174,19 @@ acpi_tb_get_rsdt_address (
174 174
175 out_address->pointer_type = acpi_gbl_table_flags | ACPI_LOGICAL_ADDRESSING; 175 out_address->pointer_type = acpi_gbl_table_flags | ACPI_LOGICAL_ADDRESSING;
176 176
177 /* 177 /* Use XSDT if it is present */
178 * For RSDP revision 0 or 1, we use the RSDT. 178
179 * For RSDP revision 2 (and above), we use the XSDT 179 if ((acpi_gbl_RSDP->revision >= 2) &&
180 */ 180 acpi_gbl_RSDP->xsdt_physical_address) {
181 if (acpi_gbl_RSDP->revision < 2) {
182 out_address->pointer.value = acpi_gbl_RSDP->rsdt_physical_address;
183 }
184 else {
185 out_address->pointer.value = 181 out_address->pointer.value =
186 acpi_gbl_RSDP->xsdt_physical_address; 182 acpi_gbl_RSDP->xsdt_physical_address;
183 acpi_gbl_root_table_type = ACPI_TABLE_TYPE_XSDT;
184 }
185 else {
186 /* No XSDT, use the RSDT */
187
188 out_address->pointer.value = acpi_gbl_RSDP->rsdt_physical_address;
189 acpi_gbl_root_table_type = ACPI_TABLE_TYPE_RSDT;
187 } 190 }
188} 191}
189 192
@@ -211,10 +214,9 @@ acpi_tb_validate_rsdt (
211 214
212 215
213 /* 216 /*
214 * For RSDP revision 0 or 1, we use the RSDT. 217 * Search for appropriate signature, RSDT or XSDT
215 * For RSDP revision 2 and above, we use the XSDT
216 */ 218 */
217 if (acpi_gbl_RSDP->revision < 2) { 219 if (acpi_gbl_root_table_type == ACPI_TABLE_TYPE_RSDT) {
218 no_match = ACPI_STRNCMP ((char *) table_ptr, RSDT_SIG, 220 no_match = ACPI_STRNCMP ((char *) table_ptr, RSDT_SIG,
219 sizeof (RSDT_SIG) -1); 221 sizeof (RSDT_SIG) -1);
220 } 222 }
@@ -236,11 +238,11 @@ acpi_tb_validate_rsdt (
236 acpi_gbl_RSDP->rsdt_physical_address, 238 acpi_gbl_RSDP->rsdt_physical_address,
237 (void *) (acpi_native_uint) acpi_gbl_RSDP->rsdt_physical_address)); 239 (void *) (acpi_native_uint) acpi_gbl_RSDP->rsdt_physical_address));
238 240
239 if (acpi_gbl_RSDP->revision < 2) { 241 if (acpi_gbl_root_table_type == ACPI_TABLE_TYPE_RSDT) {
240 ACPI_REPORT_ERROR (("Looking for RSDT (RSDP->Rev < 2)\n")) 242 ACPI_REPORT_ERROR (("Looking for RSDT\n"))
241 } 243 }
242 else { 244 else {
243 ACPI_REPORT_ERROR (("Looking for XSDT (RSDP->Rev >= 2)\n")) 245 ACPI_REPORT_ERROR (("Looking for XSDT\n"))
244 } 246 }
245 247
246 ACPI_DUMP_BUFFER ((char *) table_ptr, 48); 248 ACPI_DUMP_BUFFER ((char *) table_ptr, 48);
diff --git a/drivers/acpi/tables/tbxfroot.c b/drivers/acpi/tables/tbxfroot.c
index 198997aa7fbe..fe9c8317df46 100644
--- a/drivers/acpi/tables/tbxfroot.c
+++ b/drivers/acpi/tables/tbxfroot.c
@@ -287,9 +287,11 @@ acpi_get_firmware_table (
287 * requested table 287 * requested table
288 */ 288 */
289 for (i = 0, j = 0; i < table_count; i++) { 289 for (i = 0, j = 0; i < table_count; i++) {
290 /* Get the next table pointer, handle RSDT vs. XSDT */ 290 /*
291 291 * Get the next table pointer, handle RSDT vs. XSDT
292 if (acpi_gbl_RSDP->revision < 2) { 292 * RSDT pointers are 32 bits, XSDT pointers are 64 bits
293 */
294 if (acpi_gbl_root_table_type == ACPI_TABLE_TYPE_RSDT) {
293 address.pointer.value = (ACPI_CAST_PTR ( 295 address.pointer.value = (ACPI_CAST_PTR (
294 RSDT_DESCRIPTOR, rsdt_info->pointer))->table_offset_entry[i]; 296 RSDT_DESCRIPTOR, rsdt_info->pointer))->table_offset_entry[i];
295 } 297 }