2005-04-16 18:20:36 -04:00
|
|
|
/******************************************************************************
|
|
|
|
*
|
|
|
|
* Module Name: tbxfroot - Find the root ACPI table (RSDT)
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
/*
|
2006-01-13 16:22:00 -05:00
|
|
|
* Copyright (C) 2000 - 2006, R. Byron Moore
|
2005-04-16 18:20:36 -04:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions, and the following disclaimer,
|
|
|
|
* without modification.
|
|
|
|
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
|
|
|
|
* substantially similar to the "NO WARRANTY" disclaimer below
|
|
|
|
* ("Disclaimer") and any redistribution must be conditioned upon
|
|
|
|
* including a substantially similar Disclaimer requirement for further
|
|
|
|
* binary redistribution.
|
|
|
|
* 3. Neither the names of the above-listed copyright holders nor the names
|
|
|
|
* of any contributors may be used to endorse or promote products derived
|
|
|
|
* from this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* Alternatively, this software may be distributed under the terms of the
|
|
|
|
* GNU General Public License ("GPL") version 2 as published by the Free
|
|
|
|
* Software Foundation.
|
|
|
|
*
|
|
|
|
* NO WARRANTY
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
|
|
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
|
|
|
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
|
|
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGES.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <acpi/acpi.h>
|
|
|
|
#include <acpi/actables.h>
|
|
|
|
|
|
|
|
#define _COMPONENT ACPI_TABLES
|
2005-08-05 00:44:28 -04:00
|
|
|
ACPI_MODULE_NAME("tbxfroot")
|
2005-04-16 18:20:36 -04:00
|
|
|
|
2005-04-18 22:49:35 -04:00
|
|
|
/* Local prototypes */
|
|
|
|
static acpi_status
|
2005-08-05 00:44:28 -04:00
|
|
|
acpi_tb_find_rsdp(struct acpi_table_desc *table_info, u32 flags);
|
2005-04-18 22:49:35 -04:00
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
static u8 *acpi_tb_scan_memory_for_rsdp(u8 * start_address, u32 length);
|
2005-04-16 18:20:36 -04:00
|
|
|
|
2005-07-08 00:00:00 -04:00
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: acpi_tb_validate_rsdp
|
|
|
|
*
|
|
|
|
* PARAMETERS: Rsdp - Pointer to unvalidated RSDP
|
|
|
|
*
|
|
|
|
* RETURN: Status
|
|
|
|
*
|
|
|
|
* DESCRIPTION: Validate the RSDP (ptr)
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
acpi_status acpi_tb_validate_rsdp(struct rsdp_descriptor *rsdp)
|
2005-07-08 00:00:00 -04:00
|
|
|
{
|
2005-08-05 00:44:28 -04:00
|
|
|
ACPI_FUNCTION_ENTRY();
|
2005-07-08 00:00:00 -04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* The signature and checksum must both be correct
|
|
|
|
*/
|
2005-08-05 00:44:28 -04:00
|
|
|
if (ACPI_STRNCMP((char *)rsdp, RSDP_SIG, sizeof(RSDP_SIG) - 1) != 0) {
|
2006-10-02 00:00:00 -04:00
|
|
|
|
2005-07-08 00:00:00 -04:00
|
|
|
/* Nope, BAD Signature */
|
|
|
|
|
|
|
|
return (AE_BAD_SIGNATURE);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Check the standard checksum */
|
|
|
|
|
ACPI: ACPICA 20060331
Implemented header file support for the following
additional ACPI tables: ASF!, BOOT, CPEP, DBGP, MCFG, SPCR,
SPMI, TCPA, and WDRT. With this support, all current and
known ACPI tables are now defined in the ACPICA headers and
are available for use by device drivers and other software.
Implemented support to allow tables that contain ACPI
names with invalid characters to be loaded. Previously,
this would cause the table load to fail, but since
there are several known cases of such tables on
existing machines, this change was made to enable
ACPI support for them. Also, this matches the
behavior of the Microsoft ACPI implementation.
https://bugzilla.novell.com/show_bug.cgi?id=147621
Fixed a couple regressions introduced during the memory
optimization in the 20060317 release. The namespace
node definition required additional reorganization and
an internal datatype that had been changed to 8-bit was
restored to 32-bit. (Valery Podrezov)
Fixed a problem where a null pointer passed to
acpi_ut_delete_generic_state() could be passed through
to acpi_os_release_object which is unexpected. Such
null pointers are now trapped and ignored, matching
the behavior of the previous implementation before the
deployment of acpi_os_release_object(). (Valery Podrezov,
Fiodor Suietov)
Fixed a memory mapping leak during the deletion of
a SystemMemory operation region where a cached memory
mapping was not deleted. This became a noticeable problem
for operation regions that are defined within frequently
used control methods. (Dana Meyers)
Reorganized the ACPI table header files into two main
files: one for the ACPI tables consumed by the ACPICA core,
and another for the miscellaneous ACPI tables that are
consumed by the drivers and other software. The various
FADT definitions were merged into one common section and
three different tables (ACPI 1.0, 1.0+, and 2.0)
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-03-31 00:00:00 -05:00
|
|
|
if (acpi_tb_sum_table(rsdp, ACPI_RSDP_CHECKSUM_LENGTH) != 0) {
|
2005-07-08 00:00:00 -04:00
|
|
|
return (AE_BAD_CHECKSUM);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Check extended checksum if table version >= 2 */
|
|
|
|
|
|
|
|
if ((rsdp->revision >= 2) &&
|
ACPI: ACPICA 20060331
Implemented header file support for the following
additional ACPI tables: ASF!, BOOT, CPEP, DBGP, MCFG, SPCR,
SPMI, TCPA, and WDRT. With this support, all current and
known ACPI tables are now defined in the ACPICA headers and
are available for use by device drivers and other software.
Implemented support to allow tables that contain ACPI
names with invalid characters to be loaded. Previously,
this would cause the table load to fail, but since
there are several known cases of such tables on
existing machines, this change was made to enable
ACPI support for them. Also, this matches the
behavior of the Microsoft ACPI implementation.
https://bugzilla.novell.com/show_bug.cgi?id=147621
Fixed a couple regressions introduced during the memory
optimization in the 20060317 release. The namespace
node definition required additional reorganization and
an internal datatype that had been changed to 8-bit was
restored to 32-bit. (Valery Podrezov)
Fixed a problem where a null pointer passed to
acpi_ut_delete_generic_state() could be passed through
to acpi_os_release_object which is unexpected. Such
null pointers are now trapped and ignored, matching
the behavior of the previous implementation before the
deployment of acpi_os_release_object(). (Valery Podrezov,
Fiodor Suietov)
Fixed a memory mapping leak during the deletion of
a SystemMemory operation region where a cached memory
mapping was not deleted. This became a noticeable problem
for operation regions that are defined within frequently
used control methods. (Dana Meyers)
Reorganized the ACPI table header files into two main
files: one for the ACPI tables consumed by the ACPICA core,
and another for the miscellaneous ACPI tables that are
consumed by the drivers and other software. The various
FADT definitions were merged into one common section and
three different tables (ACPI 1.0, 1.0+, and 2.0)
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-03-31 00:00:00 -05:00
|
|
|
(acpi_tb_sum_table(rsdp, ACPI_RSDP_XCHECKSUM_LENGTH) != 0)) {
|
2005-07-08 00:00:00 -04:00
|
|
|
return (AE_BAD_CHECKSUM);
|
|
|
|
}
|
|
|
|
|
|
|
|
return (AE_OK);
|
|
|
|
}
|
|
|
|
|
2005-04-16 18:20:36 -04:00
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: acpi_tb_find_table
|
|
|
|
*
|
|
|
|
* PARAMETERS: Signature - String with ACPI table signature
|
|
|
|
* oem_id - String with the table OEM ID
|
2005-04-18 22:49:35 -04:00
|
|
|
* oem_table_id - String with the OEM Table ID
|
|
|
|
* table_ptr - Where the table pointer is returned
|
2005-04-16 18:20:36 -04:00
|
|
|
*
|
|
|
|
* RETURN: Status
|
|
|
|
*
|
|
|
|
* DESCRIPTION: Find an ACPI table (in the RSDT/XSDT) that matches the
|
|
|
|
* Signature, OEM ID and OEM Table ID.
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
acpi_status
|
2005-08-05 00:44:28 -04:00
|
|
|
acpi_tb_find_table(char *signature,
|
|
|
|
char *oem_id,
|
|
|
|
char *oem_table_id, struct acpi_table_header ** table_ptr)
|
2005-04-16 18:20:36 -04:00
|
|
|
{
|
2005-08-05 00:44:28 -04:00
|
|
|
acpi_status status;
|
|
|
|
struct acpi_table_header *table;
|
2005-04-16 18:20:36 -04:00
|
|
|
|
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in
20051216 where the _STA method was not run unless an _INI
was also present for the same device. This optimization
could cause problems because it could allow _INI methods
to be run within a not-present device subtree (If a
not-present device had no _INI, _STA would not be run,
the not-present status would not be discovered, and the
children of the device would be incorrectly traversed.)
Implemented a new _STA optimization where namespace
subtrees that do not contain _INI are identified and
ignored during device initialization. Selectively running
_STA can significantly improve boot time on large machines
(with assistance from Len Brown.)
Implemented support for the device initialization case
where the returned _STA flags indicate a device not-present
but functioning. In this case, _INI is not run, but the
device children are examined for presence, as per the
ACPI specification.
Implemented an additional change to the IndexField support
in order to conform to MS behavior. The value written to
the Index Register is not simply a byte offset, it is a
byte offset in units of the access width of the parent
Index Field. (Fiodor Suietov)
Defined and deployed a new OSL interface,
acpi_os_validate_address(). This interface is called during
the creation of all AML operation regions, and allows
the host OS to exert control over what addresses it will
allow the AML code to access. Operation Regions whose
addresses are disallowed will cause a runtime exception
when they are actually accessed (will not affect or abort
table loading.)
Defined and deployed a new OSL interface,
acpi_os_validate_interface(). This interface allows the host OS
to match the various "optional" interface/behavior strings
for the _OSI predefined control method as appropriate
(with assistance from Bjorn Helgaas.)
Restructured and corrected various problems in the
exception handling code paths within DsCallControlMethod
and DsTerminateControlMethod in dsmethod (with assistance
from Takayoshi Kochi.)
Modified the Linux source converter to ignore quoted string
literals while converting identifiers from mixed to lower
case. This will correct problems with the disassembler
and other areas where such strings must not be modified.
The ACPI_FUNCTION_* macros no longer require quotes around
the function name. This allows the Linux source converter
to convert the names, now that the converter ignores
quoted strings.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-21 17:15:00 -04:00
|
|
|
ACPI_FUNCTION_TRACE(tb_find_table);
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
/* Validate string lengths */
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
if ((ACPI_STRLEN(signature) > ACPI_NAME_SIZE) ||
|
|
|
|
(ACPI_STRLEN(oem_id) > sizeof(table->oem_id)) ||
|
|
|
|
(ACPI_STRLEN(oem_table_id) > sizeof(table->oem_table_id))) {
|
|
|
|
return_ACPI_STATUS(AE_AML_STRING_LIMIT);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
|
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in
20051216 where the _STA method was not run unless an _INI
was also present for the same device. This optimization
could cause problems because it could allow _INI methods
to be run within a not-present device subtree (If a
not-present device had no _INI, _STA would not be run,
the not-present status would not be discovered, and the
children of the device would be incorrectly traversed.)
Implemented a new _STA optimization where namespace
subtrees that do not contain _INI are identified and
ignored during device initialization. Selectively running
_STA can significantly improve boot time on large machines
(with assistance from Len Brown.)
Implemented support for the device initialization case
where the returned _STA flags indicate a device not-present
but functioning. In this case, _INI is not run, but the
device children are examined for presence, as per the
ACPI specification.
Implemented an additional change to the IndexField support
in order to conform to MS behavior. The value written to
the Index Register is not simply a byte offset, it is a
byte offset in units of the access width of the parent
Index Field. (Fiodor Suietov)
Defined and deployed a new OSL interface,
acpi_os_validate_address(). This interface is called during
the creation of all AML operation regions, and allows
the host OS to exert control over what addresses it will
allow the AML code to access. Operation Regions whose
addresses are disallowed will cause a runtime exception
when they are actually accessed (will not affect or abort
table loading.)
Defined and deployed a new OSL interface,
acpi_os_validate_interface(). This interface allows the host OS
to match the various "optional" interface/behavior strings
for the _OSI predefined control method as appropriate
(with assistance from Bjorn Helgaas.)
Restructured and corrected various problems in the
exception handling code paths within DsCallControlMethod
and DsTerminateControlMethod in dsmethod (with assistance
from Takayoshi Kochi.)
Modified the Linux source converter to ignore quoted string
literals while converting identifiers from mixed to lower
case. This will correct problems with the disassembler
and other areas where such strings must not be modified.
The ACPI_FUNCTION_* macros no longer require quotes around
the function name. This allows the Linux source converter
to convert the names, now that the converter ignores
quoted strings.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-21 17:15:00 -04:00
|
|
|
if (ACPI_COMPARE_NAME(signature, DSDT_SIG)) {
|
2005-04-16 18:20:36 -04:00
|
|
|
/*
|
|
|
|
* The DSDT pointer is contained in the FADT, not the RSDT.
|
|
|
|
* This code should suffice, because the only code that would perform
|
|
|
|
* a "find" on the DSDT is the data_table_region() AML opcode -- in
|
|
|
|
* which case, the DSDT is guaranteed to be already loaded.
|
|
|
|
* If this becomes insufficient, the FADT will have to be found first.
|
|
|
|
*/
|
|
|
|
if (!acpi_gbl_DSDT) {
|
2005-08-05 00:44:28 -04:00
|
|
|
return_ACPI_STATUS(AE_NO_ACPI_TABLES);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
table = acpi_gbl_DSDT;
|
2005-08-05 00:44:28 -04:00
|
|
|
} else {
|
2005-04-16 18:20:36 -04:00
|
|
|
/* Find the table */
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
status = acpi_get_firmware_table(signature, 1,
|
|
|
|
ACPI_LOGICAL_ADDRESSING,
|
|
|
|
&table);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
|
|
|
return_ACPI_STATUS(status);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Check oem_id and oem_table_id */
|
|
|
|
|
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in
20051216 where the _STA method was not run unless an _INI
was also present for the same device. This optimization
could cause problems because it could allow _INI methods
to be run within a not-present device subtree (If a
not-present device had no _INI, _STA would not be run,
the not-present status would not be discovered, and the
children of the device would be incorrectly traversed.)
Implemented a new _STA optimization where namespace
subtrees that do not contain _INI are identified and
ignored during device initialization. Selectively running
_STA can significantly improve boot time on large machines
(with assistance from Len Brown.)
Implemented support for the device initialization case
where the returned _STA flags indicate a device not-present
but functioning. In this case, _INI is not run, but the
device children are examined for presence, as per the
ACPI specification.
Implemented an additional change to the IndexField support
in order to conform to MS behavior. The value written to
the Index Register is not simply a byte offset, it is a
byte offset in units of the access width of the parent
Index Field. (Fiodor Suietov)
Defined and deployed a new OSL interface,
acpi_os_validate_address(). This interface is called during
the creation of all AML operation regions, and allows
the host OS to exert control over what addresses it will
allow the AML code to access. Operation Regions whose
addresses are disallowed will cause a runtime exception
when they are actually accessed (will not affect or abort
table loading.)
Defined and deployed a new OSL interface,
acpi_os_validate_interface(). This interface allows the host OS
to match the various "optional" interface/behavior strings
for the _OSI predefined control method as appropriate
(with assistance from Bjorn Helgaas.)
Restructured and corrected various problems in the
exception handling code paths within DsCallControlMethod
and DsTerminateControlMethod in dsmethod (with assistance
from Takayoshi Kochi.)
Modified the Linux source converter to ignore quoted string
literals while converting identifiers from mixed to lower
case. This will correct problems with the disassembler
and other areas where such strings must not be modified.
The ACPI_FUNCTION_* macros no longer require quotes around
the function name. This allows the Linux source converter
to convert the names, now that the converter ignores
quoted strings.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-21 17:15:00 -04:00
|
|
|
if ((oem_id[0] &&
|
|
|
|
ACPI_STRNCMP(oem_id, table->oem_id,
|
|
|
|
sizeof(table->oem_id))) ||
|
|
|
|
(oem_table_id[0] &&
|
|
|
|
ACPI_STRNCMP(oem_table_id, table->oem_table_id,
|
|
|
|
sizeof(table->oem_table_id)))) {
|
2005-08-05 00:44:28 -04:00
|
|
|
return_ACPI_STATUS(AE_AML_NAME_NOT_FOUND);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_TABLES, "Found table [%4.4s]\n",
|
|
|
|
table->signature));
|
2005-04-18 22:49:35 -04:00
|
|
|
|
2005-04-16 18:20:36 -04:00
|
|
|
*table_ptr = table;
|
2005-08-05 00:44:28 -04:00
|
|
|
return_ACPI_STATUS(AE_OK);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: acpi_get_firmware_table
|
|
|
|
*
|
|
|
|
* PARAMETERS: Signature - Any ACPI table signature
|
|
|
|
* Instance - the non zero instance of the table, allows
|
|
|
|
* support for multiple tables of the same type
|
|
|
|
* Flags - Physical/Virtual support
|
|
|
|
* table_pointer - Where a buffer containing the table is
|
|
|
|
* returned
|
|
|
|
*
|
|
|
|
* RETURN: Status
|
|
|
|
*
|
|
|
|
* DESCRIPTION: This function is called to get an ACPI table. A buffer is
|
|
|
|
* allocated for the table and returned in table_pointer.
|
|
|
|
* This table will be a complete table including the header.
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
acpi_status
|
2005-08-05 00:44:28 -04:00
|
|
|
acpi_get_firmware_table(acpi_string signature,
|
|
|
|
u32 instance,
|
|
|
|
u32 flags, struct acpi_table_header **table_pointer)
|
2005-04-16 18:20:36 -04:00
|
|
|
{
|
2005-08-05 00:44:28 -04:00
|
|
|
acpi_status status;
|
|
|
|
struct acpi_pointer address;
|
|
|
|
struct acpi_table_header *header = NULL;
|
|
|
|
struct acpi_table_desc *table_info = NULL;
|
|
|
|
struct acpi_table_desc *rsdt_info;
|
|
|
|
u32 table_count;
|
|
|
|
u32 i;
|
|
|
|
u32 j;
|
2005-04-16 18:20:36 -04:00
|
|
|
|
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in
20051216 where the _STA method was not run unless an _INI
was also present for the same device. This optimization
could cause problems because it could allow _INI methods
to be run within a not-present device subtree (If a
not-present device had no _INI, _STA would not be run,
the not-present status would not be discovered, and the
children of the device would be incorrectly traversed.)
Implemented a new _STA optimization where namespace
subtrees that do not contain _INI are identified and
ignored during device initialization. Selectively running
_STA can significantly improve boot time on large machines
(with assistance from Len Brown.)
Implemented support for the device initialization case
where the returned _STA flags indicate a device not-present
but functioning. In this case, _INI is not run, but the
device children are examined for presence, as per the
ACPI specification.
Implemented an additional change to the IndexField support
in order to conform to MS behavior. The value written to
the Index Register is not simply a byte offset, it is a
byte offset in units of the access width of the parent
Index Field. (Fiodor Suietov)
Defined and deployed a new OSL interface,
acpi_os_validate_address(). This interface is called during
the creation of all AML operation regions, and allows
the host OS to exert control over what addresses it will
allow the AML code to access. Operation Regions whose
addresses are disallowed will cause a runtime exception
when they are actually accessed (will not affect or abort
table loading.)
Defined and deployed a new OSL interface,
acpi_os_validate_interface(). This interface allows the host OS
to match the various "optional" interface/behavior strings
for the _OSI predefined control method as appropriate
(with assistance from Bjorn Helgaas.)
Restructured and corrected various problems in the
exception handling code paths within DsCallControlMethod
and DsTerminateControlMethod in dsmethod (with assistance
from Takayoshi Kochi.)
Modified the Linux source converter to ignore quoted string
literals while converting identifiers from mixed to lower
case. This will correct problems with the disassembler
and other areas where such strings must not be modified.
The ACPI_FUNCTION_* macros no longer require quotes around
the function name. This allows the Linux source converter
to convert the names, now that the converter ignores
quoted strings.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-21 17:15:00 -04:00
|
|
|
ACPI_FUNCTION_TRACE(acpi_get_firmware_table);
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Ensure that at least the table manager is initialized. We don't
|
|
|
|
* require that the entire ACPI subsystem is up for this interface.
|
|
|
|
* If we have a buffer, we must have a length too
|
|
|
|
*/
|
2005-08-05 00:44:28 -04:00
|
|
|
if ((instance == 0) || (!signature) || (!table_pointer)) {
|
|
|
|
return_ACPI_STATUS(AE_BAD_PARAMETER);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Ensure that we have a RSDP */
|
|
|
|
|
|
|
|
if (!acpi_gbl_RSDP) {
|
2006-10-02 00:00:00 -04:00
|
|
|
|
2005-04-16 18:20:36 -04:00
|
|
|
/* Get the RSDP */
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
status = acpi_os_get_root_pointer(flags, &address);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "RSDP not found\n"));
|
|
|
|
return_ACPI_STATUS(AE_NO_ACPI_TABLES);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Map and validate the RSDP */
|
|
|
|
|
|
|
|
if ((flags & ACPI_MEMORY_MODE) == ACPI_LOGICAL_ADDRESSING) {
|
2005-08-05 00:44:28 -04:00
|
|
|
status = acpi_os_map_memory(address.pointer.physical,
|
|
|
|
sizeof(struct
|
|
|
|
rsdp_descriptor),
|
|
|
|
(void *)&acpi_gbl_RSDP);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
|
|
|
return_ACPI_STATUS(status);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
2005-08-05 00:44:28 -04:00
|
|
|
} else {
|
2005-04-16 18:20:36 -04:00
|
|
|
acpi_gbl_RSDP = address.pointer.logical;
|
|
|
|
}
|
|
|
|
|
2005-07-08 00:00:00 -04:00
|
|
|
/* The RDSP signature and checksum must both be correct */
|
2005-04-16 18:20:36 -04:00
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
status = acpi_tb_validate_rsdp(acpi_gbl_RSDP);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
|
|
|
return_ACPI_STATUS(status);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Get the RSDT address via the RSDP */
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
acpi_tb_get_rsdt_address(&address);
|
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 19:03:00 -04:00
|
|
|
"RSDP located at %p, RSDT physical=%8.8X%8.8X\n",
|
2005-08-05 00:44:28 -04:00
|
|
|
acpi_gbl_RSDP,
|
|
|
|
ACPI_FORMAT_UINT64(address.pointer.value)));
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
/* Insert processor_mode flags */
|
|
|
|
|
|
|
|
address.pointer_type |= flags;
|
|
|
|
|
|
|
|
/* Get and validate the RSDT */
|
|
|
|
|
2006-10-03 00:00:00 -04:00
|
|
|
rsdt_info = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_table_desc));
|
2005-04-16 18:20:36 -04:00
|
|
|
if (!rsdt_info) {
|
2005-08-05 00:44:28 -04:00
|
|
|
return_ACPI_STATUS(AE_NO_MEMORY);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
status = acpi_tb_get_table(&address, rsdt_info);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
2005-04-16 18:20:36 -04:00
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
status = acpi_tb_validate_rsdt(rsdt_info->pointer);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
2005-04-16 18:20:36 -04:00
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Allocate a scratch table header and table descriptor */
|
|
|
|
|
2006-10-03 00:00:00 -04:00
|
|
|
header = ACPI_ALLOCATE(sizeof(struct acpi_table_header));
|
2005-04-16 18:20:36 -04:00
|
|
|
if (!header) {
|
|
|
|
status = AE_NO_MEMORY;
|
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
|
2006-10-03 00:00:00 -04:00
|
|
|
table_info = ACPI_ALLOCATE(sizeof(struct acpi_table_desc));
|
2005-04-16 18:20:36 -04:00
|
|
|
if (!table_info) {
|
|
|
|
status = AE_NO_MEMORY;
|
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Get the number of table pointers within the RSDT */
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
table_count =
|
|
|
|
acpi_tb_get_table_count(acpi_gbl_RSDP, rsdt_info->pointer);
|
2005-04-16 18:20:36 -04:00
|
|
|
address.pointer_type = acpi_gbl_table_flags | flags;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Search the RSDT/XSDT for the correct instance of the
|
|
|
|
* requested table
|
|
|
|
*/
|
|
|
|
for (i = 0, j = 0; i < table_count; i++) {
|
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>
2005-06-24 00:00:00 -04:00
|
|
|
/*
|
|
|
|
* Get the next table pointer, handle RSDT vs. XSDT
|
|
|
|
* RSDT pointers are 32 bits, XSDT pointers are 64 bits
|
|
|
|
*/
|
|
|
|
if (acpi_gbl_root_table_type == ACPI_TABLE_TYPE_RSDT) {
|
2005-08-05 00:44:28 -04:00
|
|
|
address.pointer.value =
|
|
|
|
(ACPI_CAST_PTR
|
ACPI: ACPICA 20060331
Implemented header file support for the following
additional ACPI tables: ASF!, BOOT, CPEP, DBGP, MCFG, SPCR,
SPMI, TCPA, and WDRT. With this support, all current and
known ACPI tables are now defined in the ACPICA headers and
are available for use by device drivers and other software.
Implemented support to allow tables that contain ACPI
names with invalid characters to be loaded. Previously,
this would cause the table load to fail, but since
there are several known cases of such tables on
existing machines, this change was made to enable
ACPI support for them. Also, this matches the
behavior of the Microsoft ACPI implementation.
https://bugzilla.novell.com/show_bug.cgi?id=147621
Fixed a couple regressions introduced during the memory
optimization in the 20060317 release. The namespace
node definition required additional reorganization and
an internal datatype that had been changed to 8-bit was
restored to 32-bit. (Valery Podrezov)
Fixed a problem where a null pointer passed to
acpi_ut_delete_generic_state() could be passed through
to acpi_os_release_object which is unexpected. Such
null pointers are now trapped and ignored, matching
the behavior of the previous implementation before the
deployment of acpi_os_release_object(). (Valery Podrezov,
Fiodor Suietov)
Fixed a memory mapping leak during the deletion of
a SystemMemory operation region where a cached memory
mapping was not deleted. This became a noticeable problem
for operation regions that are defined within frequently
used control methods. (Dana Meyers)
Reorganized the ACPI table header files into two main
files: one for the ACPI tables consumed by the ACPICA core,
and another for the miscellaneous ACPI tables that are
consumed by the drivers and other software. The various
FADT definitions were merged into one common section and
three different tables (ACPI 1.0, 1.0+, and 2.0)
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-03-31 00:00:00 -05:00
|
|
|
(struct rsdt_descriptor,
|
2005-08-05 00:44:28 -04:00
|
|
|
rsdt_info->pointer))->table_offset_entry[i];
|
|
|
|
} else {
|
|
|
|
address.pointer.value =
|
|
|
|
(ACPI_CAST_PTR
|
ACPI: ACPICA 20060331
Implemented header file support for the following
additional ACPI tables: ASF!, BOOT, CPEP, DBGP, MCFG, SPCR,
SPMI, TCPA, and WDRT. With this support, all current and
known ACPI tables are now defined in the ACPICA headers and
are available for use by device drivers and other software.
Implemented support to allow tables that contain ACPI
names with invalid characters to be loaded. Previously,
this would cause the table load to fail, but since
there are several known cases of such tables on
existing machines, this change was made to enable
ACPI support for them. Also, this matches the
behavior of the Microsoft ACPI implementation.
https://bugzilla.novell.com/show_bug.cgi?id=147621
Fixed a couple regressions introduced during the memory
optimization in the 20060317 release. The namespace
node definition required additional reorganization and
an internal datatype that had been changed to 8-bit was
restored to 32-bit. (Valery Podrezov)
Fixed a problem where a null pointer passed to
acpi_ut_delete_generic_state() could be passed through
to acpi_os_release_object which is unexpected. Such
null pointers are now trapped and ignored, matching
the behavior of the previous implementation before the
deployment of acpi_os_release_object(). (Valery Podrezov,
Fiodor Suietov)
Fixed a memory mapping leak during the deletion of
a SystemMemory operation region where a cached memory
mapping was not deleted. This became a noticeable problem
for operation regions that are defined within frequently
used control methods. (Dana Meyers)
Reorganized the ACPI table header files into two main
files: one for the ACPI tables consumed by the ACPICA core,
and another for the miscellaneous ACPI tables that are
consumed by the drivers and other software. The various
FADT definitions were merged into one common section and
three different tables (ACPI 1.0, 1.0+, and 2.0)
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-03-31 00:00:00 -05:00
|
|
|
(struct xsdt_descriptor,
|
2005-08-05 00:44:28 -04:00
|
|
|
rsdt_info->pointer))->table_offset_entry[i];
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Get the table header */
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
status = acpi_tb_get_table_header(&address, header);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
2005-04-16 18:20:36 -04:00
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Compare table signatures and table instance */
|
|
|
|
|
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in
20051216 where the _STA method was not run unless an _INI
was also present for the same device. This optimization
could cause problems because it could allow _INI methods
to be run within a not-present device subtree (If a
not-present device had no _INI, _STA would not be run,
the not-present status would not be discovered, and the
children of the device would be incorrectly traversed.)
Implemented a new _STA optimization where namespace
subtrees that do not contain _INI are identified and
ignored during device initialization. Selectively running
_STA can significantly improve boot time on large machines
(with assistance from Len Brown.)
Implemented support for the device initialization case
where the returned _STA flags indicate a device not-present
but functioning. In this case, _INI is not run, but the
device children are examined for presence, as per the
ACPI specification.
Implemented an additional change to the IndexField support
in order to conform to MS behavior. The value written to
the Index Register is not simply a byte offset, it is a
byte offset in units of the access width of the parent
Index Field. (Fiodor Suietov)
Defined and deployed a new OSL interface,
acpi_os_validate_address(). This interface is called during
the creation of all AML operation regions, and allows
the host OS to exert control over what addresses it will
allow the AML code to access. Operation Regions whose
addresses are disallowed will cause a runtime exception
when they are actually accessed (will not affect or abort
table loading.)
Defined and deployed a new OSL interface,
acpi_os_validate_interface(). This interface allows the host OS
to match the various "optional" interface/behavior strings
for the _OSI predefined control method as appropriate
(with assistance from Bjorn Helgaas.)
Restructured and corrected various problems in the
exception handling code paths within DsCallControlMethod
and DsTerminateControlMethod in dsmethod (with assistance
from Takayoshi Kochi.)
Modified the Linux source converter to ignore quoted string
literals while converting identifiers from mixed to lower
case. This will correct problems with the disassembler
and other areas where such strings must not be modified.
The ACPI_FUNCTION_* macros no longer require quotes around
the function name. This allows the Linux source converter
to convert the names, now that the converter ignores
quoted strings.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-21 17:15:00 -04:00
|
|
|
if (ACPI_COMPARE_NAME(header->signature, signature)) {
|
2006-10-02 00:00:00 -04:00
|
|
|
|
2005-04-16 18:20:36 -04:00
|
|
|
/* An instance of the table was found */
|
|
|
|
|
|
|
|
j++;
|
|
|
|
if (j >= instance) {
|
2006-10-02 00:00:00 -04:00
|
|
|
|
2005-04-16 18:20:36 -04:00
|
|
|
/* Found the correct instance, get the entire table */
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
status =
|
|
|
|
acpi_tb_get_table_body(&address, header,
|
|
|
|
table_info);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
2005-04-16 18:20:36 -04:00
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
|
|
|
|
*table_pointer = table_info->pointer;
|
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Did not find the table */
|
|
|
|
|
|
|
|
status = AE_NOT_EXIST;
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
cleanup:
|
2005-05-26 00:00:00 -04:00
|
|
|
if (rsdt_info->pointer) {
|
2005-08-05 00:44:28 -04:00
|
|
|
acpi_os_unmap_memory(rsdt_info->pointer,
|
|
|
|
(acpi_size) rsdt_info->pointer->length);
|
2005-05-26 00:00:00 -04:00
|
|
|
}
|
2006-10-03 00:00:00 -04:00
|
|
|
ACPI_FREE(rsdt_info);
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
if (header) {
|
2006-10-03 00:00:00 -04:00
|
|
|
ACPI_FREE(header);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
if (table_info) {
|
2006-10-03 00:00:00 -04:00
|
|
|
ACPI_FREE(table_info);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
2005-08-05 00:44:28 -04:00
|
|
|
return_ACPI_STATUS(status);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
|
2006-10-03 00:00:00 -04:00
|
|
|
ACPI_EXPORT_SYMBOL(acpi_get_firmware_table)
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
/* TBD: Move to a new file */
|
|
|
|
#if ACPI_MACHINE_WIDTH != 16
|
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: acpi_find_root_pointer
|
|
|
|
*
|
2005-04-18 22:49:35 -04:00
|
|
|
* PARAMETERS: Flags - Logical/Physical addressing
|
|
|
|
* rsdp_address - Where to place the RSDP address
|
2005-04-16 18:20:36 -04:00
|
|
|
*
|
|
|
|
* RETURN: Status, Physical address of the RSDP
|
|
|
|
*
|
|
|
|
* DESCRIPTION: Find the RSDP
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
2005-08-05 00:44:28 -04:00
|
|
|
acpi_status acpi_find_root_pointer(u32 flags, struct acpi_pointer *rsdp_address)
|
2005-04-16 18:20:36 -04:00
|
|
|
{
|
2005-08-05 00:44:28 -04:00
|
|
|
struct acpi_table_desc table_info;
|
|
|
|
acpi_status status;
|
2005-04-16 18:20:36 -04:00
|
|
|
|
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in
20051216 where the _STA method was not run unless an _INI
was also present for the same device. This optimization
could cause problems because it could allow _INI methods
to be run within a not-present device subtree (If a
not-present device had no _INI, _STA would not be run,
the not-present status would not be discovered, and the
children of the device would be incorrectly traversed.)
Implemented a new _STA optimization where namespace
subtrees that do not contain _INI are identified and
ignored during device initialization. Selectively running
_STA can significantly improve boot time on large machines
(with assistance from Len Brown.)
Implemented support for the device initialization case
where the returned _STA flags indicate a device not-present
but functioning. In this case, _INI is not run, but the
device children are examined for presence, as per the
ACPI specification.
Implemented an additional change to the IndexField support
in order to conform to MS behavior. The value written to
the Index Register is not simply a byte offset, it is a
byte offset in units of the access width of the parent
Index Field. (Fiodor Suietov)
Defined and deployed a new OSL interface,
acpi_os_validate_address(). This interface is called during
the creation of all AML operation regions, and allows
the host OS to exert control over what addresses it will
allow the AML code to access. Operation Regions whose
addresses are disallowed will cause a runtime exception
when they are actually accessed (will not affect or abort
table loading.)
Defined and deployed a new OSL interface,
acpi_os_validate_interface(). This interface allows the host OS
to match the various "optional" interface/behavior strings
for the _OSI predefined control method as appropriate
(with assistance from Bjorn Helgaas.)
Restructured and corrected various problems in the
exception handling code paths within DsCallControlMethod
and DsTerminateControlMethod in dsmethod (with assistance
from Takayoshi Kochi.)
Modified the Linux source converter to ignore quoted string
literals while converting identifiers from mixed to lower
case. This will correct problems with the disassembler
and other areas where such strings must not be modified.
The ACPI_FUNCTION_* macros no longer require quotes around
the function name. This allows the Linux source converter
to convert the names, now that the converter ignores
quoted strings.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-21 17:15:00 -04:00
|
|
|
ACPI_FUNCTION_TRACE(acpi_find_root_pointer);
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
/* Get the RSDP */
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
status = acpi_tb_find_rsdp(&table_info, flags);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
2006-01-27 16:43:00 -05:00
|
|
|
ACPI_EXCEPTION((AE_INFO, status,
|
|
|
|
"RSDP structure not found - Flags=%X", flags));
|
2005-04-18 22:49:35 -04:00
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
return_ACPI_STATUS(AE_NO_ACPI_TABLES);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
rsdp_address->pointer_type = ACPI_PHYSICAL_POINTER;
|
|
|
|
rsdp_address->pointer.physical = table_info.physical_address;
|
2005-08-05 00:44:28 -04:00
|
|
|
return_ACPI_STATUS(AE_OK);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
|
2006-10-03 00:00:00 -04:00
|
|
|
ACPI_EXPORT_SYMBOL(acpi_find_root_pointer)
|
|
|
|
|
2005-04-16 18:20:36 -04:00
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: acpi_tb_scan_memory_for_rsdp
|
|
|
|
*
|
|
|
|
* PARAMETERS: start_address - Starting pointer for search
|
|
|
|
* Length - Maximum length to search
|
|
|
|
*
|
|
|
|
* RETURN: Pointer to the RSDP if found, otherwise NULL.
|
|
|
|
*
|
|
|
|
* DESCRIPTION: Search a block of memory for the RSDP signature
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
2005-08-05 00:44:28 -04:00
|
|
|
static u8 *acpi_tb_scan_memory_for_rsdp(u8 * start_address, u32 length)
|
2005-04-16 18:20:36 -04:00
|
|
|
{
|
2005-08-05 00:44:28 -04:00
|
|
|
acpi_status status;
|
|
|
|
u8 *mem_rover;
|
|
|
|
u8 *end_address;
|
2005-04-16 18:20:36 -04:00
|
|
|
|
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in
20051216 where the _STA method was not run unless an _INI
was also present for the same device. This optimization
could cause problems because it could allow _INI methods
to be run within a not-present device subtree (If a
not-present device had no _INI, _STA would not be run,
the not-present status would not be discovered, and the
children of the device would be incorrectly traversed.)
Implemented a new _STA optimization where namespace
subtrees that do not contain _INI are identified and
ignored during device initialization. Selectively running
_STA can significantly improve boot time on large machines
(with assistance from Len Brown.)
Implemented support for the device initialization case
where the returned _STA flags indicate a device not-present
but functioning. In this case, _INI is not run, but the
device children are examined for presence, as per the
ACPI specification.
Implemented an additional change to the IndexField support
in order to conform to MS behavior. The value written to
the Index Register is not simply a byte offset, it is a
byte offset in units of the access width of the parent
Index Field. (Fiodor Suietov)
Defined and deployed a new OSL interface,
acpi_os_validate_address(). This interface is called during
the creation of all AML operation regions, and allows
the host OS to exert control over what addresses it will
allow the AML code to access. Operation Regions whose
addresses are disallowed will cause a runtime exception
when they are actually accessed (will not affect or abort
table loading.)
Defined and deployed a new OSL interface,
acpi_os_validate_interface(). This interface allows the host OS
to match the various "optional" interface/behavior strings
for the _OSI predefined control method as appropriate
(with assistance from Bjorn Helgaas.)
Restructured and corrected various problems in the
exception handling code paths within DsCallControlMethod
and DsTerminateControlMethod in dsmethod (with assistance
from Takayoshi Kochi.)
Modified the Linux source converter to ignore quoted string
literals while converting identifiers from mixed to lower
case. This will correct problems with the disassembler
and other areas where such strings must not be modified.
The ACPI_FUNCTION_* macros no longer require quotes around
the function name. This allows the Linux source converter
to convert the names, now that the converter ignores
quoted strings.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-21 17:15:00 -04:00
|
|
|
ACPI_FUNCTION_TRACE(tb_scan_memory_for_rsdp);
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
end_address = start_address + length;
|
|
|
|
|
|
|
|
/* Search from given start address for the requested length */
|
|
|
|
|
|
|
|
for (mem_rover = start_address; mem_rover < end_address;
|
2005-08-05 00:44:28 -04:00
|
|
|
mem_rover += ACPI_RSDP_SCAN_STEP) {
|
2006-10-02 00:00:00 -04:00
|
|
|
|
2005-07-08 00:00:00 -04:00
|
|
|
/* The RSDP signature and checksum must both be correct */
|
2005-04-16 18:20:36 -04:00
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
status =
|
|
|
|
acpi_tb_validate_rsdp(ACPI_CAST_PTR
|
|
|
|
(struct rsdp_descriptor, mem_rover));
|
|
|
|
if (ACPI_SUCCESS(status)) {
|
2006-10-02 00:00:00 -04:00
|
|
|
|
2005-07-08 00:00:00 -04:00
|
|
|
/* Sig and checksum valid, we have found a real RSDP */
|
2005-04-16 18:20:36 -04:00
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
|
|
|
|
"RSDP located at physical address %p\n",
|
|
|
|
mem_rover));
|
|
|
|
return_PTR(mem_rover);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
|
2005-07-08 00:00:00 -04:00
|
|
|
/* No sig match or bad checksum, keep searching */
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Searched entire block, no RSDP was found */
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
|
|
|
|
"Searched entire block from %p, valid RSDP was not found\n",
|
|
|
|
start_address));
|
|
|
|
return_PTR(NULL);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: acpi_tb_find_rsdp
|
|
|
|
*
|
2005-04-18 22:49:35 -04:00
|
|
|
* PARAMETERS: table_info - Where the table info is returned
|
2005-04-16 18:20:36 -04:00
|
|
|
* Flags - Current memory mode (logical vs.
|
|
|
|
* physical addressing)
|
|
|
|
*
|
|
|
|
* RETURN: Status, RSDP physical address
|
|
|
|
*
|
2006-05-12 17:12:00 -04:00
|
|
|
* DESCRIPTION: Search lower 1_mbyte of memory for the root system descriptor
|
2005-04-16 18:20:36 -04:00
|
|
|
* pointer structure. If it is found, set *RSDP to point to it.
|
|
|
|
*
|
2006-05-12 17:12:00 -04:00
|
|
|
* NOTE1: The RSDP must be either in the first 1_k of the Extended
|
2005-04-16 18:20:36 -04:00
|
|
|
* BIOS Data Area or between E0000 and FFFFF (From ACPI Spec.)
|
|
|
|
* Only a 32-bit physical address is necessary.
|
|
|
|
*
|
|
|
|
* NOTE2: This function is always available, regardless of the
|
|
|
|
* initialization state of the rest of ACPI.
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
2005-04-18 22:49:35 -04:00
|
|
|
static acpi_status
|
2005-08-05 00:44:28 -04:00
|
|
|
acpi_tb_find_rsdp(struct acpi_table_desc *table_info, u32 flags)
|
2005-04-16 18:20:36 -04:00
|
|
|
{
|
2005-08-05 00:44:28 -04:00
|
|
|
u8 *table_ptr;
|
|
|
|
u8 *mem_rover;
|
|
|
|
u32 physical_address;
|
|
|
|
acpi_status status;
|
2005-04-16 18:20:36 -04:00
|
|
|
|
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in
20051216 where the _STA method was not run unless an _INI
was also present for the same device. This optimization
could cause problems because it could allow _INI methods
to be run within a not-present device subtree (If a
not-present device had no _INI, _STA would not be run,
the not-present status would not be discovered, and the
children of the device would be incorrectly traversed.)
Implemented a new _STA optimization where namespace
subtrees that do not contain _INI are identified and
ignored during device initialization. Selectively running
_STA can significantly improve boot time on large machines
(with assistance from Len Brown.)
Implemented support for the device initialization case
where the returned _STA flags indicate a device not-present
but functioning. In this case, _INI is not run, but the
device children are examined for presence, as per the
ACPI specification.
Implemented an additional change to the IndexField support
in order to conform to MS behavior. The value written to
the Index Register is not simply a byte offset, it is a
byte offset in units of the access width of the parent
Index Field. (Fiodor Suietov)
Defined and deployed a new OSL interface,
acpi_os_validate_address(). This interface is called during
the creation of all AML operation regions, and allows
the host OS to exert control over what addresses it will
allow the AML code to access. Operation Regions whose
addresses are disallowed will cause a runtime exception
when they are actually accessed (will not affect or abort
table loading.)
Defined and deployed a new OSL interface,
acpi_os_validate_interface(). This interface allows the host OS
to match the various "optional" interface/behavior strings
for the _OSI predefined control method as appropriate
(with assistance from Bjorn Helgaas.)
Restructured and corrected various problems in the
exception handling code paths within DsCallControlMethod
and DsTerminateControlMethod in dsmethod (with assistance
from Takayoshi Kochi.)
Modified the Linux source converter to ignore quoted string
literals while converting identifiers from mixed to lower
case. This will correct problems with the disassembler
and other areas where such strings must not be modified.
The ACPI_FUNCTION_* macros no longer require quotes around
the function name. This allows the Linux source converter
to convert the names, now that the converter ignores
quoted strings.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-21 17:15:00 -04:00
|
|
|
ACPI_FUNCTION_TRACE(tb_find_rsdp);
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
/*
|
2005-04-18 22:49:35 -04:00
|
|
|
* Scan supports either logical addressing or physical addressing
|
2005-04-16 18:20:36 -04:00
|
|
|
*/
|
|
|
|
if ((flags & ACPI_MEMORY_MODE) == ACPI_LOGICAL_ADDRESSING) {
|
2006-10-02 00:00:00 -04:00
|
|
|
|
2005-04-18 22:49:35 -04:00
|
|
|
/* 1a) Get the location of the Extended BIOS Data Area (EBDA) */
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
status = acpi_os_map_memory((acpi_physical_address)
|
|
|
|
ACPI_EBDA_PTR_LOCATION,
|
|
|
|
ACPI_EBDA_PTR_LENGTH,
|
|
|
|
(void *)&table_ptr);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
2006-01-27 16:43:00 -05:00
|
|
|
ACPI_ERROR((AE_INFO,
|
|
|
|
"Could not map memory at %8.8X for length %X",
|
|
|
|
ACPI_EBDA_PTR_LOCATION,
|
|
|
|
ACPI_EBDA_PTR_LENGTH));
|
2005-08-05 00:44:28 -04:00
|
|
|
|
|
|
|
return_ACPI_STATUS(status);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
ACPI_MOVE_16_TO_32(&physical_address, table_ptr);
|
2005-04-18 22:49:35 -04:00
|
|
|
|
|
|
|
/* Convert segment part to physical address */
|
|
|
|
|
|
|
|
physical_address <<= 4;
|
2005-08-05 00:44:28 -04:00
|
|
|
acpi_os_unmap_memory(table_ptr, ACPI_EBDA_PTR_LENGTH);
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
/* EBDA present? */
|
|
|
|
|
|
|
|
if (physical_address > 0x400) {
|
|
|
|
/*
|
2006-05-12 17:12:00 -04:00
|
|
|
* 1b) Search EBDA paragraphs (EBDA is required to be a
|
2005-04-18 22:49:35 -04:00
|
|
|
* minimum of 1_k length)
|
2005-04-16 18:20:36 -04:00
|
|
|
*/
|
2005-08-05 00:44:28 -04:00
|
|
|
status = acpi_os_map_memory((acpi_physical_address)
|
|
|
|
physical_address,
|
|
|
|
ACPI_EBDA_WINDOW_SIZE,
|
|
|
|
(void *)&table_ptr);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
2006-01-27 16:43:00 -05:00
|
|
|
ACPI_ERROR((AE_INFO,
|
|
|
|
"Could not map memory at %8.8X for length %X",
|
|
|
|
physical_address,
|
|
|
|
ACPI_EBDA_WINDOW_SIZE));
|
2005-08-05 00:44:28 -04:00
|
|
|
|
|
|
|
return_ACPI_STATUS(status);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
mem_rover = acpi_tb_scan_memory_for_rsdp(table_ptr,
|
|
|
|
ACPI_EBDA_WINDOW_SIZE);
|
|
|
|
acpi_os_unmap_memory(table_ptr, ACPI_EBDA_WINDOW_SIZE);
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
if (mem_rover) {
|
2006-10-02 00:00:00 -04:00
|
|
|
|
2005-07-08 00:00:00 -04:00
|
|
|
/* Return the physical address */
|
2005-04-16 18:20:36 -04:00
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
physical_address +=
|
2006-05-12 17:12:00 -04:00
|
|
|
(u32) ACPI_PTR_DIFF(mem_rover, table_ptr);
|
2005-04-16 18:20:36 -04:00
|
|
|
|
2005-04-18 22:49:35 -04:00
|
|
|
table_info->physical_address =
|
2005-08-05 00:44:28 -04:00
|
|
|
(acpi_physical_address) physical_address;
|
|
|
|
return_ACPI_STATUS(AE_OK);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* 2) Search upper memory: 16-byte boundaries in E0000h-FFFFFh
|
|
|
|
*/
|
2005-08-05 00:44:28 -04:00
|
|
|
status = acpi_os_map_memory((acpi_physical_address)
|
|
|
|
ACPI_HI_RSDP_WINDOW_BASE,
|
|
|
|
ACPI_HI_RSDP_WINDOW_SIZE,
|
|
|
|
(void *)&table_ptr);
|
|
|
|
|
|
|
|
if (ACPI_FAILURE(status)) {
|
2006-01-27 16:43:00 -05:00
|
|
|
ACPI_ERROR((AE_INFO,
|
|
|
|
"Could not map memory at %8.8X for length %X",
|
|
|
|
ACPI_HI_RSDP_WINDOW_BASE,
|
|
|
|
ACPI_HI_RSDP_WINDOW_SIZE));
|
2005-08-05 00:44:28 -04:00
|
|
|
|
|
|
|
return_ACPI_STATUS(status);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
mem_rover =
|
|
|
|
acpi_tb_scan_memory_for_rsdp(table_ptr,
|
|
|
|
ACPI_HI_RSDP_WINDOW_SIZE);
|
|
|
|
acpi_os_unmap_memory(table_ptr, ACPI_HI_RSDP_WINDOW_SIZE);
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
if (mem_rover) {
|
2006-10-02 00:00:00 -04:00
|
|
|
|
2005-07-08 00:00:00 -04:00
|
|
|
/* Return the physical address */
|
2005-04-16 18:20:36 -04:00
|
|
|
|
2006-05-12 17:12:00 -04:00
|
|
|
physical_address = (u32)
|
|
|
|
(ACPI_HI_RSDP_WINDOW_BASE +
|
|
|
|
ACPI_PTR_DIFF(mem_rover, table_ptr));
|
2005-04-16 18:20:36 -04:00
|
|
|
|
2005-04-18 22:49:35 -04:00
|
|
|
table_info->physical_address =
|
2005-08-05 00:44:28 -04:00
|
|
|
(acpi_physical_address) physical_address;
|
|
|
|
return_ACPI_STATUS(AE_OK);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Physical addressing
|
|
|
|
*/
|
|
|
|
else {
|
2005-04-18 22:49:35 -04:00
|
|
|
/* 1a) Get the location of the EBDA */
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
ACPI_MOVE_16_TO_32(&physical_address, ACPI_EBDA_PTR_LOCATION);
|
|
|
|
physical_address <<= 4; /* Convert segment to physical address */
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
/* EBDA present? */
|
|
|
|
|
|
|
|
if (physical_address > 0x400) {
|
|
|
|
/*
|
2006-05-12 17:12:00 -04:00
|
|
|
* 1b) Search EBDA paragraphs (EBDA is required to be a minimum of
|
2005-04-18 22:49:35 -04:00
|
|
|
* 1_k length)
|
2005-04-16 18:20:36 -04:00
|
|
|
*/
|
2005-08-05 00:44:28 -04:00
|
|
|
mem_rover =
|
|
|
|
acpi_tb_scan_memory_for_rsdp(ACPI_PHYSADDR_TO_PTR
|
|
|
|
(physical_address),
|
|
|
|
ACPI_EBDA_WINDOW_SIZE);
|
2005-04-16 18:20:36 -04:00
|
|
|
if (mem_rover) {
|
2006-10-02 00:00:00 -04:00
|
|
|
|
2005-07-08 00:00:00 -04:00
|
|
|
/* Return the physical address */
|
2005-04-16 18:20:36 -04:00
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
table_info->physical_address =
|
|
|
|
ACPI_TO_INTEGER(mem_rover);
|
|
|
|
return_ACPI_STATUS(AE_OK);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-04-18 22:49:35 -04:00
|
|
|
/* 2) Search upper memory: 16-byte boundaries in E0000h-FFFFFh */
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
mem_rover =
|
|
|
|
acpi_tb_scan_memory_for_rsdp(ACPI_PHYSADDR_TO_PTR
|
|
|
|
(ACPI_HI_RSDP_WINDOW_BASE),
|
|
|
|
ACPI_HI_RSDP_WINDOW_SIZE);
|
2005-04-16 18:20:36 -04:00
|
|
|
if (mem_rover) {
|
2006-10-02 00:00:00 -04:00
|
|
|
|
2005-04-16 18:20:36 -04:00
|
|
|
/* Found it, return the physical address */
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
table_info->physical_address =
|
|
|
|
ACPI_TO_INTEGER(mem_rover);
|
|
|
|
return_ACPI_STATUS(AE_OK);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-07-08 00:00:00 -04:00
|
|
|
/* A valid RSDP was not found */
|
2005-04-16 18:20:36 -04:00
|
|
|
|
2006-01-27 16:43:00 -05:00
|
|
|
ACPI_ERROR((AE_INFO, "No valid RSDP was found"));
|
2005-08-05 00:44:28 -04:00
|
|
|
return_ACPI_STATUS(AE_NOT_FOUND);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|