mirror of
https://github.com/acpica/acpica/
synced 2024-12-26 20:29:48 +03:00
New: I/O port protection.
Protect certain I/O ports from reads/writes. Provides MS compatibility. New module, hwvalid.c
This commit is contained in:
parent
cabb0010ed
commit
491a1e7ae0
@ -33,6 +33,7 @@ SRCS= aeexec.c aemain.c \
|
||||
../../hardware/hwgpe.c \
|
||||
../../hardware/hwregs.c \
|
||||
../../hardware/hwsleep.c \
|
||||
../../hardware/hwvalid.c \
|
||||
../../hardware/hwxface.c \
|
||||
../../dispatcher/dsfield.c \
|
||||
../../dispatcher/dsinit.c \
|
||||
|
@ -136,6 +136,24 @@ AeLocalGetRootPointer (
|
||||
return 0;
|
||||
}
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiHwReadPort (
|
||||
ACPI_IO_ADDRESS Address,
|
||||
UINT32 *Value,
|
||||
UINT32 Width)
|
||||
{
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiHwWritePort (
|
||||
ACPI_IO_ADDRESS Address,
|
||||
UINT32 Value,
|
||||
UINT32 Width)
|
||||
{
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsMethodError (
|
||||
ACPI_STATUS Status,
|
||||
|
@ -384,14 +384,14 @@ AcpiExSystemIoSpaceHandler (
|
||||
{
|
||||
case ACPI_READ:
|
||||
|
||||
Status = AcpiOsReadPort ((ACPI_IO_ADDRESS) Address,
|
||||
Status = AcpiHwReadPort ((ACPI_IO_ADDRESS) Address,
|
||||
&Value32, BitWidth);
|
||||
*Value = Value32;
|
||||
break;
|
||||
|
||||
case ACPI_WRITE:
|
||||
|
||||
Status = AcpiOsWritePort ((ACPI_IO_ADDRESS) Address,
|
||||
Status = AcpiHwWritePort ((ACPI_IO_ADDRESS) Address,
|
||||
(UINT32) *Value, BitWidth);
|
||||
break;
|
||||
|
||||
|
@ -178,7 +178,7 @@ AcpiHwSetMode (
|
||||
|
||||
/* BIOS should have disabled ALL fixed and GP events */
|
||||
|
||||
Status = AcpiOsWritePort (AcpiGbl_FADT.SmiCommand,
|
||||
Status = AcpiHwWritePort (AcpiGbl_FADT.SmiCommand,
|
||||
(UINT32) AcpiGbl_FADT.AcpiEnable, 8);
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Attempting to enable ACPI mode\n"));
|
||||
break;
|
||||
@ -189,7 +189,7 @@ AcpiHwSetMode (
|
||||
* BIOS should clear all fixed status bits and restore fixed event
|
||||
* enable bits to default
|
||||
*/
|
||||
Status = AcpiOsWritePort (AcpiGbl_FADT.SmiCommand,
|
||||
Status = AcpiHwWritePort (AcpiGbl_FADT.SmiCommand,
|
||||
(UINT32) AcpiGbl_FADT.AcpiDisable, 8);
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
|
||||
"Attempting to enable Legacy (non-ACPI) mode\n"));
|
||||
|
@ -324,7 +324,7 @@ AcpiHwRegisterRead (
|
||||
|
||||
case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */
|
||||
|
||||
Status = AcpiOsReadPort (AcpiGbl_FADT.SmiCommand, &Value, 8);
|
||||
Status = AcpiHwReadPort (AcpiGbl_FADT.SmiCommand, &Value, 8);
|
||||
break;
|
||||
|
||||
|
||||
@ -467,7 +467,7 @@ AcpiHwRegisterWrite (
|
||||
|
||||
/* SMI_CMD is currently always in IO space */
|
||||
|
||||
Status = AcpiOsWritePort (AcpiGbl_FADT.SmiCommand, Value, 8);
|
||||
Status = AcpiHwWritePort (AcpiGbl_FADT.SmiCommand, Value, 8);
|
||||
break;
|
||||
|
||||
|
||||
|
@ -536,7 +536,7 @@ AcpiEnterSleepStateS4bios (
|
||||
|
||||
ACPI_FLUSH_CPU_CACHE ();
|
||||
|
||||
Status = AcpiOsWritePort (AcpiGbl_FADT.SmiCommand,
|
||||
Status = AcpiHwWritePort (AcpiGbl_FADT.SmiCommand,
|
||||
(UINT32) AcpiGbl_FADT.S4BiosRequest, 8);
|
||||
|
||||
do {
|
||||
|
344
source/components/hardware/hwvalid.c
Normal file
344
source/components/hardware/hwvalid.c
Normal file
@ -0,0 +1,344 @@
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: hwvalid - I/O request validation
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __HWVALID_C__
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
|
||||
#define _COMPONENT ACPI_HARDWARE
|
||||
ACPI_MODULE_NAME ("hwvalid")
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiHwValidateIoRequest (
|
||||
ACPI_IO_ADDRESS Address,
|
||||
UINT32 BitWidth);
|
||||
|
||||
|
||||
/*
|
||||
* Protected I/O ports. Some ports are always illegal, and some are
|
||||
* conditionally illegal. This table must remain ordered by port address.
|
||||
*
|
||||
* The table is used to implement the Microsoft port access rules that
|
||||
* first appeared in Windows XP. Some ports are always illegal, and some
|
||||
* ports are only illegal if the BIOS calls _OSI with a WinXP string or
|
||||
* later (meaning that the BIOS itelf is post-XP.)
|
||||
*
|
||||
* This provides ACPICA with the desired port protections and
|
||||
* Microsoft compatibility.
|
||||
*/
|
||||
static const ACPI_PORT_INFO AcpiProtectedPorts[] =
|
||||
{
|
||||
{"DMA1", 0x0000, 0x000F, ACPI_OSI_WIN_XP},
|
||||
{"PIC0", 0x0020, 0x0021, ACPI_ALWAYS_ILLEGAL},
|
||||
{"PIT1", 0x0040, 0x0043, ACPI_OSI_WIN_XP},
|
||||
{"PIT2", 0x0048, 0x004B, ACPI_OSI_WIN_XP},
|
||||
{"RTC", 0x0070, 0x0071, ACPI_OSI_WIN_XP},
|
||||
{"CMOS", 0x0074, 0x0076, ACPI_OSI_WIN_XP},
|
||||
{"DMA1", 0x0081, 0x0083, ACPI_OSI_WIN_XP},
|
||||
{"DMA1", 0x0087, 0x0087, ACPI_OSI_WIN_XP},
|
||||
{"DMA2", 0x0089, 0x0089, ACPI_OSI_WIN_XP},
|
||||
{"DMA2", 0x008A, 0x008B, ACPI_OSI_WIN_XP},
|
||||
{"DMA2", 0x008F, 0x008F, ACPI_OSI_WIN_XP},
|
||||
{"Arb", 0x0090, 0x0091, ACPI_OSI_WIN_XP},
|
||||
{"Setup", 0x0093, 0x0094, ACPI_OSI_WIN_XP},
|
||||
{"POS", 0x0096, 0x0097, ACPI_OSI_WIN_XP},
|
||||
{"PIC1", 0x00A0, 0x00A1, ACPI_ALWAYS_ILLEGAL},
|
||||
{"DMA", 0x00C0, 0x00DF, ACPI_OSI_WIN_XP},
|
||||
{"ELCR", 0x04D0, 0x04D1, ACPI_ALWAYS_ILLEGAL},
|
||||
{"PCI", 0x0CF8, 0x0D00, ACPI_OSI_WIN_XP}
|
||||
};
|
||||
|
||||
#define ACPI_PORT_INFO_ENTRIES ACPI_ARRAY_LENGTH (AcpiProtectedPorts)
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiHwValidateIoRequest
|
||||
*
|
||||
* PARAMETERS: Address Address of I/O port/register
|
||||
* BitWidth Number of bits (8,16,32)
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Validates an I/O request (address/length). Certain ports are
|
||||
* always illegal and some ports are only illegal depending on
|
||||
* the requests the BIOS AML code makes to the predefined
|
||||
* _OSI method.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiHwValidateIoRequest (
|
||||
ACPI_IO_ADDRESS Address,
|
||||
UINT32 BitWidth)
|
||||
{
|
||||
UINT32 i;
|
||||
UINT32 ByteWidth;
|
||||
ACPI_IO_ADDRESS LastAddress;
|
||||
const ACPI_PORT_INFO *PortInfo;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (HwValidateIoRequest);
|
||||
|
||||
|
||||
/* Supported widths are 8/16/32 */
|
||||
|
||||
if ((BitWidth != 8) &&
|
||||
(BitWidth != 16) &&
|
||||
(BitWidth != 32))
|
||||
{
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
PortInfo = AcpiProtectedPorts;
|
||||
ByteWidth = ACPI_DIV_8 (BitWidth);
|
||||
LastAddress = Address + ByteWidth - 1;
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Address %X LastAddress %X Length %X",
|
||||
Address, LastAddress, ByteWidth));
|
||||
|
||||
/* Maximum 16-bit address in I/O space */
|
||||
|
||||
if (LastAddress > ACPI_UINT16_MAX)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Illegal I/O port address/length above 64K: %X/%X",
|
||||
Address, ByteWidth));
|
||||
return_ACPI_STATUS (AE_AML_ILLEGAL_ADDRESS);
|
||||
}
|
||||
|
||||
/* Exit if requested address is not within the protected port table */
|
||||
|
||||
if (Address > AcpiProtectedPorts[ACPI_PORT_INFO_ENTRIES - 1].End)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* Check request against the list of protected I/O ports */
|
||||
|
||||
for (i = 0; i < ACPI_PORT_INFO_ENTRIES; i++, PortInfo++)
|
||||
{
|
||||
/*
|
||||
* Check if the requested address range will write to a reserved
|
||||
* port. Four cases to consider:
|
||||
*
|
||||
* 1) Address range is contained completely in the port address range
|
||||
* 2) Address range overlaps port range at the port range start
|
||||
* 3) Address range overlaps port range at the port range end
|
||||
* 4) Address range completely encompasses the port range
|
||||
*/
|
||||
if ((Address <= PortInfo->End) && (LastAddress >= PortInfo->Start))
|
||||
{
|
||||
/* Port illegality may depend on the _OSI calls made by the BIOS */
|
||||
|
||||
if (AcpiGbl_OsiData >= PortInfo->OsiDependency)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Denied AML access to port 0x%.4X/%X (%s 0x%.4X-0x%.4X)",
|
||||
Address, ByteWidth, PortInfo->Name,
|
||||
PortInfo->Start, PortInfo->End));
|
||||
|
||||
return_ACPI_STATUS (AE_AML_ILLEGAL_ADDRESS);
|
||||
}
|
||||
}
|
||||
|
||||
/* Finished if address range ends before the end of this port */
|
||||
|
||||
if (LastAddress <= PortInfo->End)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiHwReadPort
|
||||
*
|
||||
* PARAMETERS: Address Address of I/O port/register to read
|
||||
* Value Where value is placed
|
||||
* Width Number of bits
|
||||
*
|
||||
* RETURN: Value read from port
|
||||
*
|
||||
* DESCRIPTION: Read data from an I/O port or register. This is a front-end
|
||||
* to AcpiOsReadPort that performs validation on both the port
|
||||
* address and the length.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiHwReadPort (
|
||||
ACPI_IO_ADDRESS Address,
|
||||
UINT32 *Value,
|
||||
UINT32 Width)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
Status = AcpiHwValidateIoRequest (Address, Width);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
Status = AcpiOsReadPort (Address, Value, Width);
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiHwWritePort
|
||||
*
|
||||
* PARAMETERS: Address Address of I/O port/register to write
|
||||
* Value Value to write
|
||||
* Width Number of bits
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Write data to an I/O port or register. This is a front-end
|
||||
* to AcpiOsWritePort that performs validation on both the port
|
||||
* address and the length.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiHwWritePort (
|
||||
ACPI_IO_ADDRESS Address,
|
||||
UINT32 Value,
|
||||
UINT32 Width)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
Status = AcpiHwValidateIoRequest (Address, Width);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
Status = AcpiOsWritePort (Address, Value, Width);
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
@ -236,7 +236,7 @@ AcpiRead (
|
||||
|
||||
case ACPI_ADR_SPACE_SYSTEM_IO:
|
||||
|
||||
Status = AcpiOsReadPort ((ACPI_IO_ADDRESS) Address, Value, Width);
|
||||
Status = AcpiHwReadPort ((ACPI_IO_ADDRESS) Address, Value, Width);
|
||||
break;
|
||||
|
||||
|
||||
@ -323,7 +323,7 @@ AcpiWrite (
|
||||
|
||||
case ACPI_ADR_SPACE_SYSTEM_IO:
|
||||
|
||||
Status = AcpiOsWritePort (
|
||||
Status = AcpiHwWritePort (
|
||||
(ACPI_IO_ADDRESS) Address, Value, Width);
|
||||
break;
|
||||
|
||||
|
@ -142,23 +142,28 @@ AcpiUtTranslateOneCid (
|
||||
* Strings supported by the _OSI predefined (internal) method.
|
||||
*
|
||||
* March 2009: Removed "Linux" as this host no longer wants to respond true
|
||||
* for this string. Basically, the only safe OS strings are windows-related.
|
||||
* for this string. Basically, the only safe OS strings are windows-related
|
||||
* and in many or most cases represent the only test path within the
|
||||
* BIOS-provided ASL code.
|
||||
*
|
||||
* The second element of each entry is used to track the newest version of
|
||||
* Windows that the BIOS has requested.
|
||||
*/
|
||||
static const char *AcpiInterfacesSupported[] =
|
||||
static const ACPI_INTERFACE_INFO AcpiInterfacesSupported[] =
|
||||
{
|
||||
/* Operating System Vendor Strings */
|
||||
|
||||
"Windows 2000", /* Windows 2000 */
|
||||
"Windows 2001", /* Windows XP */
|
||||
"Windows 2001 SP1", /* Windows XP SP1 */
|
||||
"Windows 2001 SP2", /* Windows XP SP2 */
|
||||
"Windows 2001.1", /* Windows Server 2003 */
|
||||
"Windows 2001.1 SP1", /* Windows Server 2003 SP1 - Added 03/2006 */
|
||||
"Windows 2006", /* Windows Vista - Added 03/2006 */
|
||||
{"Windows 2000", ACPI_OSI_WIN_2000}, /* Windows 2000 */
|
||||
{"Windows 2001", ACPI_OSI_WIN_XP}, /* Windows XP */
|
||||
{"Windows 2001 SP1", ACPI_OSI_WIN_XP_SP1}, /* Windows XP SP1 */
|
||||
{"Windows 2001.1", ACPI_OSI_WINSRV_2003}, /* Windows Server 2003 */
|
||||
{"Windows 2001 SP2", ACPI_OSI_WIN_XP_SP2}, /* Windows XP SP2 */
|
||||
{"Windows 2001.1 SP1", ACPI_OSI_WINSRV_2003_SP1}, /* Windows Server 2003 SP1 - Added 03/2006 */
|
||||
{"Windows 2006", ACPI_OSI_WIN_VISTA}, /* Windows Vista - Added 03/2006 */
|
||||
|
||||
/* Feature Group Strings */
|
||||
|
||||
"Extended Address Space Descriptor"
|
||||
{"Extended Address Space Descriptor", 0}
|
||||
|
||||
/*
|
||||
* All "optional" feature group strings (features that are implemented
|
||||
@ -219,9 +224,17 @@ AcpiUtOsiImplementation (
|
||||
for (i = 0; i < ACPI_ARRAY_LENGTH (AcpiInterfacesSupported); i++)
|
||||
{
|
||||
if (!ACPI_STRCMP (StringDesc->String.Pointer,
|
||||
AcpiInterfacesSupported[i]))
|
||||
AcpiInterfacesSupported[i].Name))
|
||||
{
|
||||
/* The interface is supported */
|
||||
/*
|
||||
* The interface is supported.
|
||||
* Update the OsiData if necessary. We keep track of the latest
|
||||
* version of Windows that has been requested by the BIOS.
|
||||
*/
|
||||
if (AcpiInterfacesSupported[i].Value > AcpiGbl_OsiData)
|
||||
{
|
||||
AcpiGbl_OsiData = AcpiInterfacesSupported[i].Value;
|
||||
}
|
||||
|
||||
ReturnValue = ACPI_UINT32_MAX;
|
||||
goto Exit;
|
||||
|
@ -865,7 +865,7 @@ AcpiUtInitGlobals (
|
||||
{
|
||||
AcpiGbl_OwnerIdMask[i] = 0;
|
||||
}
|
||||
|
||||
|
||||
/* Last OwnerID is never valid */
|
||||
|
||||
AcpiGbl_OwnerIdMask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000;
|
||||
@ -919,6 +919,7 @@ AcpiUtInitGlobals (
|
||||
AcpiGbl_TraceDbgLayer = 0;
|
||||
AcpiGbl_DebuggerConfiguration = DEBUGGER_THREADING;
|
||||
AcpiGbl_DbOutputFlags = ACPI_DB_CONSOLE_OUTPUT;
|
||||
AcpiGbl_OsiData = 0;
|
||||
|
||||
/* Hardware oriented */
|
||||
|
||||
|
@ -295,6 +295,7 @@ ACPI_EXTERN BOOLEAN AcpiGbl_StepToNextCall;
|
||||
ACPI_EXTERN BOOLEAN AcpiGbl_AcpiHardwarePresent;
|
||||
ACPI_EXTERN BOOLEAN AcpiGbl_EventsInitialized;
|
||||
ACPI_EXTERN BOOLEAN AcpiGbl_SystemAwakeAndRunning;
|
||||
ACPI_EXTERN UINT8 AcpiGbl_OsiData;
|
||||
|
||||
|
||||
#ifndef DEFINE_ACPI_GLOBALS
|
||||
|
@ -165,6 +165,22 @@ AcpiHwClearAcpiStatus (
|
||||
void);
|
||||
|
||||
|
||||
/*
|
||||
* hwvalid - Port I/O with validation
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiHwReadPort (
|
||||
ACPI_IO_ADDRESS Address,
|
||||
UINT32 *Value,
|
||||
UINT32 Width);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiHwWritePort (
|
||||
ACPI_IO_ADDRESS Address,
|
||||
UINT32 Value,
|
||||
UINT32 Width);
|
||||
|
||||
|
||||
/*
|
||||
* hwgpe - GPE support
|
||||
*/
|
||||
|
@ -1088,6 +1088,35 @@ typedef struct acpi_bit_register_info
|
||||
#define ACPI_BITPOSITION_ARB_DISABLE 0x00
|
||||
|
||||
|
||||
/* Structs and definitions for _OSI support and I/O port validation */
|
||||
|
||||
#define ACPI_OSI_WIN_2000 0x01
|
||||
#define ACPI_OSI_WIN_XP 0x02
|
||||
#define ACPI_OSI_WIN_XP_SP1 0x03
|
||||
#define ACPI_OSI_WINSRV_2003 0x04
|
||||
#define ACPI_OSI_WIN_XP_SP2 0x05
|
||||
#define ACPI_OSI_WINSRV_2003_SP1 0x06
|
||||
#define ACPI_OSI_WIN_VISTA 0x07
|
||||
|
||||
#define ACPI_ALWAYS_ILLEGAL 0x00
|
||||
|
||||
typedef struct acpi_interface_info
|
||||
{
|
||||
char *Name;
|
||||
UINT8 Value;
|
||||
|
||||
} ACPI_INTERFACE_INFO;
|
||||
|
||||
typedef struct acpi_port_info
|
||||
{
|
||||
char *Name;
|
||||
UINT16 Start;
|
||||
UINT16 End;
|
||||
UINT8 OsiDependency;
|
||||
|
||||
} ACPI_PORT_INFO;
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Resource descriptors
|
||||
|
@ -141,7 +141,7 @@ extern BOOLEAN AcpiGbl_IgnoreErrors;
|
||||
/*
|
||||
* Debug Regions
|
||||
*/
|
||||
typedef struct Region
|
||||
typedef struct ae_region
|
||||
{
|
||||
ACPI_PHYSICAL_ADDRESS Address;
|
||||
UINT32 Length;
|
||||
@ -149,36 +149,14 @@ typedef struct Region
|
||||
void *NextRegion;
|
||||
UINT8 SpaceId;
|
||||
|
||||
} REGION;
|
||||
} AE_REGION;
|
||||
|
||||
typedef struct DebugRegions
|
||||
typedef struct ae_debug_regions
|
||||
{
|
||||
UINT32 NumberOfRegions;
|
||||
REGION *RegionList;
|
||||
AE_REGION *RegionList;
|
||||
|
||||
} DEBUG_REGIONS;
|
||||
|
||||
|
||||
/*
|
||||
* Pointer overlay for 16-bit code
|
||||
*/
|
||||
typedef union ptr_ovl
|
||||
{
|
||||
void *ptr;
|
||||
UINT32 dword;
|
||||
struct
|
||||
{
|
||||
UINT16 offset;
|
||||
UINT16 base;
|
||||
} ovl;
|
||||
|
||||
} PTR_OVL;
|
||||
|
||||
|
||||
#define GET_SEGMENT(ptr) ((UINT16)(_segment)(ptr))
|
||||
#define GET_OFFSET(ptr) ((UINT16)(UINT32) (ptr))
|
||||
#define GET_PHYSICAL_ADDRESS(ptr) (((((UINT32)GET_SEGMENT(ptr)) << 4)) + GET_OFFSET(ptr))
|
||||
#define PTR_OVL_BUILD_PTR(p,b,o) {p.ovl.base=b;p.ovl.offset=o;}
|
||||
} AE_DEBUG_REGIONS;
|
||||
|
||||
|
||||
#define TEST_OUTPUT_LEVEL(lvl) if ((lvl) & OutputLevel)
|
||||
|
@ -125,7 +125,7 @@ UINT32 AmlLength;
|
||||
UINT8 *DsdtPtr;
|
||||
UINT32 AcpiDsdtLength;
|
||||
|
||||
DEBUG_REGIONS AeRegions;
|
||||
AE_DEBUG_REGIONS AeRegions;
|
||||
ACPI_TABLE_RSDP LocalRsdp;
|
||||
|
||||
/*
|
||||
@ -395,11 +395,11 @@ AeBuildLocalTables (
|
||||
LocalFADT.Pm1ControlLength = 2;
|
||||
LocalFADT.PmTimerLength = 4;
|
||||
|
||||
LocalFADT.Gpe0Block = 0x12340000;
|
||||
LocalFADT.Gpe1Block = 0x56780000;
|
||||
LocalFADT.Gpe0Block = 0x00001234;
|
||||
LocalFADT.Gpe1Block = 0x00005678;
|
||||
|
||||
LocalFADT.Pm1aEventBlock = 0x1aaa0000;
|
||||
LocalFADT.Pm1bEventBlock = 0x1bbb0000;
|
||||
LocalFADT.Pm1aEventBlock = 0x00001aaa;
|
||||
LocalFADT.Pm1bEventBlock = 0x00001bbb;
|
||||
LocalFADT.PmTimerBlock = 0xA0;
|
||||
LocalFADT.Pm1aControlBlock = 0xB0;
|
||||
|
||||
@ -518,8 +518,9 @@ AeRegionHandler (
|
||||
ACPI_PHYSICAL_ADDRESS BaseAddress;
|
||||
ACPI_SIZE Length;
|
||||
BOOLEAN BufferExists;
|
||||
REGION *RegionElement;
|
||||
AE_REGION *RegionElement;
|
||||
void *BufferValue;
|
||||
ACPI_STATUS Status;
|
||||
UINT32 ByteWidth;
|
||||
UINT32 i;
|
||||
UINT8 SpaceId;
|
||||
@ -564,7 +565,35 @@ AeRegionHandler (
|
||||
AcpiUtGetRegionName (RegionObject->Region.SpaceId),
|
||||
(UINT32) Address));
|
||||
|
||||
if (SpaceId == ACPI_ADR_SPACE_SMBUS)
|
||||
if (SpaceId == ACPI_ADR_SPACE_SYSTEM_IO)
|
||||
{
|
||||
/*
|
||||
* For I/O space, exercise the port validation
|
||||
*/
|
||||
switch (Function & ACPI_IO_MASK)
|
||||
{
|
||||
case ACPI_READ:
|
||||
Status = AcpiHwReadPort (Address, (UINT32 *) Value, BitWidth);
|
||||
break;
|
||||
|
||||
case ACPI_WRITE:
|
||||
Status = AcpiHwWritePort (Address, (UINT32) *Value, BitWidth);
|
||||
break;
|
||||
|
||||
default:
|
||||
Status = AE_BAD_PARAMETER;
|
||||
break;
|
||||
}
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
/* Now go ahead and simulate the hardware */
|
||||
}
|
||||
|
||||
else if (SpaceId == ACPI_ADR_SPACE_SMBUS)
|
||||
{
|
||||
Length = 0;
|
||||
|
||||
@ -664,7 +693,7 @@ AeRegionHandler (
|
||||
/*
|
||||
* Do the memory allocations first
|
||||
*/
|
||||
RegionElement = AcpiOsAllocate (sizeof (REGION));
|
||||
RegionElement = AcpiOsAllocate (sizeof (AE_REGION));
|
||||
if (!RegionElement)
|
||||
{
|
||||
return AE_NO_MEMORY;
|
||||
@ -1443,6 +1472,9 @@ ExecuteOSI (
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
/* Reset the OSI data */
|
||||
|
||||
AcpiGbl_OsiData = 0;
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
@ -308,6 +308,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = {
|
||||
{"ACPI_INTEGER", SRC_TYPE_SIMPLE},
|
||||
{"ACPI_INTEGER_OVERLAY", SRC_TYPE_STRUCT},
|
||||
{"ACPI_INTEGRITY_INFO", SRC_TYPE_STRUCT},
|
||||
{"ACPI_INTERFACE_INFO", SRC_TYPE_STRUCT},
|
||||
{"ACPI_INTERNAL_RSDT", SRC_TYPE_STRUCT},
|
||||
{"ACPI_INTERPRETER_MODE", SRC_TYPE_SIMPLE},
|
||||
{"ACPI_IO_ADDRESS", SRC_TYPE_SIMPLE},
|
||||
@ -384,6 +385,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = {
|
||||
{"ACPI_PKG_STATE", SRC_TYPE_STRUCT},
|
||||
{"ACPI_POINTER", SRC_TYPE_STRUCT},
|
||||
{"ACPI_POINTERS", SRC_TYPE_UNION},
|
||||
{"ACPI_PORT_INFO", SRC_TYPE_STRUCT},
|
||||
{"ACPI_PREDEFINED_INFO", SRC_TYPE_UNION},
|
||||
{"ACPI_PREDEFINED_NAMES", SRC_TYPE_STRUCT},
|
||||
{"ACPI_PSCOPE_STATE", SRC_TYPE_STRUCT},
|
||||
@ -480,6 +482,8 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = {
|
||||
|
||||
{"APIC_HEADER", SRC_TYPE_STRUCT},
|
||||
{"ARGUMENT_INFO", SRC_TYPE_STRUCT},
|
||||
{"AE_DEBUG_REGIONS", SRC_TYPE_STRUCT},
|
||||
{"AE_REGION", SRC_TYPE_STRUCT},
|
||||
{"ASL_ANALYSIS_WALK_INFO", SRC_TYPE_STRUCT},
|
||||
{"ASL_ERROR_MSG", SRC_TYPE_STRUCT},
|
||||
{"ASL_EVENT_INFO", SRC_TYPE_STRUCT},
|
||||
|
Loading…
Reference in New Issue
Block a user