aboutsummaryrefslogtreecommitdiff
path: root/tools/acpiexec
diff options
context:
space:
mode:
Diffstat (limited to 'tools/acpiexec')
-rw-r--r--tools/acpiexec/Makefile5
-rw-r--r--tools/acpiexec/aecommon.h2
-rw-r--r--tools/acpiexec/aeexec.c87
-rw-r--r--tools/acpiexec/aehandlers.c249
-rw-r--r--tools/acpiexec/aemain.c27
-rw-r--r--tools/acpiexec/aetables.c22
-rw-r--r--tools/acpiexec/aetables.h38
7 files changed, 362 insertions, 68 deletions
diff --git a/tools/acpiexec/Makefile b/tools/acpiexec/Makefile
index ba6b5340fb82..8d6c9c1ea49a 100644
--- a/tools/acpiexec/Makefile
+++ b/tools/acpiexec/Makefile
@@ -94,6 +94,7 @@ OBJECTS = \
dmopcode.o \
dmresrc.o \
dmresrcl.o \
+ dmresrcl2.o \
dmresrcs.o \
dmutils.o \
dmwalk.o \
@@ -195,6 +196,7 @@ OBJECTS = \
rsirq.o \
rslist.o \
rsmemory.o \
+ rsserial.o \
rsmisc.o \
rsutils.o \
rsxface.o \
@@ -224,7 +226,8 @@ OBJECTS = \
uttrack.o \
utosi.o \
utxferror.o \
- utxface.o
+ utxface.o \
+ utxfmutex.o
CFLAGS+= \
-D$(HOST) \
diff --git a/tools/acpiexec/aecommon.h b/tools/acpiexec/aecommon.h
index 0baee381232a..3a18ea46853e 100644
--- a/tools/acpiexec/aecommon.h
+++ b/tools/acpiexec/aecommon.h
@@ -66,6 +66,8 @@
extern FILE *AcpiGbl_DebugFile;
extern BOOLEAN AcpiGbl_IgnoreErrors;
extern UINT8 AcpiGbl_RegionFillValue;
+extern UINT8 AcpiGbl_UseHwReducedFadt;
+extern BOOLEAN AcpiGbl_DisplayRegionAccess;
/* Check for unexpected exceptions */
diff --git a/tools/acpiexec/aeexec.c b/tools/acpiexec/aeexec.c
index 02a23f52064d..63f408a0e9d1 100644
--- a/tools/acpiexec/aeexec.c
+++ b/tools/acpiexec/aeexec.c
@@ -77,6 +77,10 @@ ExecuteOSI (
UINT32 ExpectedResult);
static void
+AeMutexInterfaces (
+ void);
+
+static void
AeHardwareInterfaces (
void);
@@ -405,6 +409,52 @@ AeGenericRegisters (
/******************************************************************************
*
+ * FUNCTION: AeMutexInterfaces
+ *
+ * DESCRIPTION: Exercise the AML mutex access interfaces
+ *
+ *****************************************************************************/
+
+static void
+AeMutexInterfaces (
+ void)
+{
+ ACPI_STATUS Status;
+ ACPI_HANDLE MutexHandle;
+
+
+ /* Get a handle to an AML mutex */
+
+ Status = AcpiGetHandle (NULL, "\\MTX1", &MutexHandle);
+ if (Status == AE_NOT_FOUND)
+ {
+ return;
+ }
+
+ AE_CHECK_OK (AcpiGetHandle, Status);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ /* Acquire the mutex */
+
+ Status = AcpiAcquireMutex (NULL, "\\MTX1", 0xFFFF);
+ AE_CHECK_OK (AcpiAcquireMutex, Status);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ /* Release mutex with different parameters */
+
+ Status = AcpiReleaseMutex (MutexHandle, NULL);
+ AE_CHECK_OK (AcpiReleaseMutex, Status);
+}
+
+
+/******************************************************************************
+ *
* FUNCTION: AeHardwareInterfaces
*
* DESCRIPTION: Call various hardware support interfaces
@@ -419,6 +469,13 @@ AeHardwareInterfaces (
UINT32 Value;
+ /* If Hardware Reduced flag is set, we are all done */
+
+ if (AcpiGbl_ReducedHardware)
+ {
+ return;
+ }
+
Status = AcpiWriteBitRegister (ACPI_BITREG_WAKE_STATUS, 1);
AE_CHECK_OK (AcpiWriteBitRegister, Status);
@@ -474,7 +531,7 @@ AeMiscellaneousTests (
AeTestBufferArgument();
AeTestPackageArgument ();
-
+ AeMutexInterfaces ();
Status = AcpiInstallInterface ("");
AE_CHECK_STATUS (AcpiInstallInterface, Status, AE_BAD_PARAMETER);
@@ -511,12 +568,27 @@ AeMiscellaneousTests (
Status = AcpiGetName (AcpiGbl_RootNode, ACPI_FULL_PATHNAME, &ReturnBuf);
AE_CHECK_OK (AcpiGetName, Status);
- Status = AcpiEnableEvent (ACPI_EVENT_GLOBAL, 0);
- AE_CHECK_OK (AcpiEnableEvent, Status);
-
Status = AcpiInstallGlobalEventHandler (AeGlobalEventHandler, NULL);
AE_CHECK_OK (AcpiInstallGlobalEventHandler, Status);
+ /* Get Devices */
+
+ Status = AcpiGetDevices (NULL, AeGetDevices, NULL, NULL);
+ AE_CHECK_OK (AcpiGetDevices, Status);
+
+ Status = AcpiGetStatistics (&Stats);
+ AE_CHECK_OK (AcpiGetStatistics, Status);
+
+ /* If Hardware Reduced flag is set, we are all done */
+
+ if (AcpiGbl_ReducedHardware)
+ {
+ return;
+ }
+
+ Status = AcpiEnableEvent (ACPI_EVENT_GLOBAL, 0);
+ AE_CHECK_OK (AcpiEnableEvent, Status);
+
/*
* GPEs: Handlers, enable/disable, etc.
*/
@@ -629,12 +701,5 @@ AeMiscellaneousTests (
Status = AcpiReleaseGlobalLock (LockHandle2);
AE_CHECK_OK (AcpiReleaseGlobalLock, Status);
- /* Get Devices */
-
- Status = AcpiGetDevices (NULL, AeGetDevices, NULL, NULL);
- AE_CHECK_OK (AcpiGetDevices, Status);
-
- Status = AcpiGetStatistics (&Stats);
- AE_CHECK_OK (AcpiGetStatistics, Status);
}
diff --git a/tools/acpiexec/aehandlers.c b/tools/acpiexec/aehandlers.c
index 701804e78a0b..bbd506d37d88 100644
--- a/tools/acpiexec/aehandlers.c
+++ b/tools/acpiexec/aehandlers.c
@@ -97,6 +97,7 @@ AeEventHandler (
static UINT32 SigintCount = 0;
static AE_DEBUG_REGIONS AeRegions;
+BOOLEAN AcpiGbl_DisplayRegionAccess = FALSE;
/*
@@ -108,27 +109,35 @@ static AE_DEBUG_REGIONS AeRegions;
* declares that they must "always be available". Cannot override the
* DataTable region handler either -- needed for test execution.
*/
-static ACPI_ADR_SPACE_TYPE DefaultSpaceIdList[] = {
+static ACPI_ADR_SPACE_TYPE DefaultSpaceIdList[] =
+{
ACPI_ADR_SPACE_SYSTEM_MEMORY,
ACPI_ADR_SPACE_SYSTEM_IO
};
/*
- * We will install handlers for some of the various address space IDs
+ * We will install handlers for some of the various address space IDs.
* Test one user-defined address space (used by aslts.)
*/
-#define ACPI_ADR_SPACE_USER_DEFINED 0x80
+#define ACPI_ADR_SPACE_USER_DEFINED1 0x80
+#define ACPI_ADR_SPACE_USER_DEFINED2 0xE4
-static ACPI_ADR_SPACE_TYPE SpaceIdList[] = {
+static ACPI_ADR_SPACE_TYPE SpaceIdList[] =
+{
ACPI_ADR_SPACE_EC,
ACPI_ADR_SPACE_SMBUS,
+ ACPI_ADR_SPACE_GSBUS,
+ ACPI_ADR_SPACE_GPIO,
ACPI_ADR_SPACE_PCI_BAR_TARGET,
ACPI_ADR_SPACE_IPMI,
ACPI_ADR_SPACE_FIXED_HARDWARE,
- ACPI_ADR_SPACE_USER_DEFINED
+ ACPI_ADR_SPACE_USER_DEFINED1,
+ ACPI_ADR_SPACE_USER_DEFINED2
};
+static ACPI_CONNECTION_INFO AeMyContext;
+
/******************************************************************************
*
* FUNCTION: AeCtrlCHandler
@@ -581,13 +590,19 @@ AeInstallLateHandlers (
UINT32 i;
- /* Install some fixed event handlers */
+ if (!AcpiGbl_ReducedHardware)
+ {
+ /* Install some fixed event handlers */
+
+ Status = AcpiInstallFixedEventHandler (ACPI_EVENT_GLOBAL, AeEventHandler, NULL);
+ AE_CHECK_OK (AcpiInstallFixedEventHandler, Status);
- Status = AcpiInstallFixedEventHandler (ACPI_EVENT_GLOBAL, AeEventHandler, NULL);
- AE_CHECK_OK (AcpiInstallFixedEventHandler, Status);
+ Status = AcpiInstallFixedEventHandler (ACPI_EVENT_RTC, AeEventHandler, NULL);
+ AE_CHECK_OK (AcpiInstallFixedEventHandler, Status);
+ }
- Status = AcpiInstallFixedEventHandler (ACPI_EVENT_RTC, AeEventHandler, NULL);
- AE_CHECK_OK (AcpiInstallFixedEventHandler, Status);
+ AeMyContext.Connection = NULL;
+ AeMyContext.AccessLength = 0xA5;
/*
* Install handlers for some of the "device driver" address spaces
@@ -598,7 +613,8 @@ AeInstallLateHandlers (
/* Install handler at the root object */
Status = AcpiInstallAddressSpaceHandler (AcpiGbl_RootNode,
- SpaceIdList[i], AeRegionHandler, AeRegionInit, NULL);
+ SpaceIdList[i], AeRegionHandler,
+ AeRegionInit, &AeMyContext);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
@@ -738,7 +754,7 @@ AeInstallEarlyHandlers (
Status = AcpiInstallAddressSpaceHandler (AcpiGbl_RootNode,
DefaultSpaceIdList[i], AeRegionHandler,
- AeRegionInit, NULL);
+ AeRegionInit, &AeMyContext);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
@@ -793,6 +809,10 @@ AeRegionHandler (
UINT32 ByteWidth;
UINT32 i;
UINT8 SpaceId;
+ ACPI_CONNECTION_INFO *MyContext;
+ UINT32 Value1;
+ UINT32 Value2;
+ ACPI_RESOURCE *Resource;
ACPI_FUNCTION_NAME (AeRegionHandler);
@@ -805,6 +825,28 @@ AeRegionHandler (
return (AE_OK);
}
+ /* Check that we actually got back our context parameter */
+
+ if (HandlerContext != &AeMyContext)
+ {
+ printf ("Region handler received incorrect context %p, should be %p\n",
+ HandlerContext, &AeMyContext);
+ }
+
+ MyContext = ACPI_CAST_PTR (ACPI_CONNECTION_INFO, HandlerContext);
+
+ /*
+ * Find the region's address space and length before searching
+ * the linked list.
+ */
+ BaseAddress = RegionObject->Region.Address;
+ Length = (ACPI_SIZE) RegionObject->Region.Length;
+ SpaceId = RegionObject->Region.SpaceId;
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, "Operation Region request on %s at 0x%X\n",
+ AcpiUtGetRegionName (RegionObject->Region.SpaceId),
+ (UINT32) Address));
+
/*
* Region support can be disabled with the -r option.
* We use this to support dynamically loaded tables where we pass a valid
@@ -822,34 +864,52 @@ AeRegionHandler (
goto DoFunction;
}
- /*
- * Find the region's address space and length before searching
- * the linked list.
- */
- BaseAddress = RegionObject->Region.Address;
- Length = (ACPI_SIZE) RegionObject->Region.Length;
- SpaceId = RegionObject->Region.SpaceId;
-
- ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, "Operation Region request on %s at 0x%X\n",
- AcpiUtGetRegionName (RegionObject->Region.SpaceId),
- (UINT32) Address));
-
switch (SpaceId)
{
case ACPI_ADR_SPACE_SYSTEM_IO:
/*
* For I/O space, exercise the port validation
+ * Note: ReadPort currently always returns all ones, length=BitLength
*/
switch (Function & ACPI_IO_MASK)
{
case ACPI_READ:
- Status = AcpiHwReadPort (Address, (UINT32 *) Value, BitWidth);
- AE_CHECK_OK (AcpiHwReadPort, Status);
+
+ if (BitWidth == 64)
+ {
+ /* Split the 64-bit request into two 32-bit requests */
+
+ Status = AcpiHwReadPort (Address, &Value1, 32);
+ AE_CHECK_OK (AcpiHwReadPort, Status);
+ Status = AcpiHwReadPort (Address+4, &Value2, 32);
+ AE_CHECK_OK (AcpiHwReadPort, Status);
+
+ *Value = Value1 | ((UINT64) Value2 << 32);
+ }
+ else
+ {
+ Status = AcpiHwReadPort (Address, &Value1, BitWidth);
+ AE_CHECK_OK (AcpiHwReadPort, Status);
+ *Value = (UINT64) Value1;
+ }
break;
case ACPI_WRITE:
- Status = AcpiHwWritePort (Address, (UINT32) *Value, BitWidth);
- AE_CHECK_OK (AcpiHwWritePort, Status);
+
+ if (BitWidth == 64)
+ {
+ /* Split the 64-bit request into two 32-bit requests */
+
+ Status = AcpiHwWritePort (Address, ACPI_LODWORD (*Value), 32);
+ AE_CHECK_OK (AcpiHwWritePort, Status);
+ Status = AcpiHwWritePort (Address+4, ACPI_HIDWORD (*Value), 32);
+ AE_CHECK_OK (AcpiHwWritePort, Status);
+ }
+ else
+ {
+ Status = AcpiHwWritePort (Address, (UINT32) *Value, BitWidth);
+ AE_CHECK_OK (AcpiHwWritePort, Status);
+ }
break;
default:
@@ -865,8 +925,12 @@ AeRegionHandler (
/* Now go ahead and simulate the hardware */
break;
-
+ /*
+ * SMBus and GenericSerialBus support the various bidirectional
+ * protocols.
+ */
case ACPI_ADR_SPACE_SMBUS:
+ case ACPI_ADR_SPACE_GSBUS: /* ACPI 5.0 */
Length = 0;
@@ -875,22 +939,31 @@ AeRegionHandler (
case ACPI_READ:
switch (Function >> 16)
{
- case AML_FIELD_ATTRIB_SMB_QUICK:
- case AML_FIELD_ATTRIB_SMB_SEND_RCV:
- case AML_FIELD_ATTRIB_SMB_BYTE:
+ case AML_FIELD_ATTRIB_QUICK:
+ case AML_FIELD_ATTRIB_SEND_RCV:
+ case AML_FIELD_ATTRIB_BYTE:
Length = 1;
break;
- case AML_FIELD_ATTRIB_SMB_WORD:
- case AML_FIELD_ATTRIB_SMB_WORD_CALL:
+ case AML_FIELD_ATTRIB_WORD:
+ case AML_FIELD_ATTRIB_WORD_CALL:
Length = 2;
break;
- case AML_FIELD_ATTRIB_SMB_BLOCK:
- case AML_FIELD_ATTRIB_SMB_BLOCK_CALL:
+ case AML_FIELD_ATTRIB_BLOCK:
+ case AML_FIELD_ATTRIB_BLOCK_CALL:
Length = 32;
break;
+
+ case AML_FIELD_ATTRIB_MULTIBYTE:
+ case AML_FIELD_ATTRIB_RAW_BYTES:
+ case AML_FIELD_ATTRIB_RAW_PROCESS:
+
+ /* (-2) for status/length */
+ Length = MyContext->AccessLength - 2;
+ break;
+
default:
break;
}
@@ -899,22 +972,30 @@ AeRegionHandler (
case ACPI_WRITE:
switch (Function >> 16)
{
- case AML_FIELD_ATTRIB_SMB_QUICK:
- case AML_FIELD_ATTRIB_SMB_SEND_RCV:
- case AML_FIELD_ATTRIB_SMB_BYTE:
- case AML_FIELD_ATTRIB_SMB_WORD:
- case AML_FIELD_ATTRIB_SMB_BLOCK:
+ case AML_FIELD_ATTRIB_QUICK:
+ case AML_FIELD_ATTRIB_SEND_RCV:
+ case AML_FIELD_ATTRIB_BYTE:
+ case AML_FIELD_ATTRIB_WORD:
+ case AML_FIELD_ATTRIB_BLOCK:
Length = 0;
break;
- case AML_FIELD_ATTRIB_SMB_WORD_CALL:
+ case AML_FIELD_ATTRIB_WORD_CALL:
Length = 2;
break;
- case AML_FIELD_ATTRIB_SMB_BLOCK_CALL:
+ case AML_FIELD_ATTRIB_BLOCK_CALL:
Length = 32;
break;
+ case AML_FIELD_ATTRIB_MULTIBYTE:
+ case AML_FIELD_ATTRIB_RAW_BYTES:
+ case AML_FIELD_ATTRIB_RAW_PROCESS:
+
+ /* (-2) for status/length */
+ Length = MyContext->AccessLength - 2;
+ break;
+
default:
break;
}
@@ -924,6 +1005,31 @@ AeRegionHandler (
break;
}
+ if (AcpiGbl_DisplayRegionAccess)
+ {
+ AcpiOsPrintf ("AcpiExec: %s "
+ "%s: Attr %X Addr %.4X BaseAddr %.4X Len %.2X Width %X BufLen %X",
+ AcpiUtGetRegionName (SpaceId),
+ (Function & ACPI_IO_MASK) ? "Write" : "Read ",
+ (UINT32) (Function >> 16),
+ (UINT32) Address, (UINT32) BaseAddress,
+ Length, BitWidth, Buffer[1]);
+
+ /* GenericSerialBus has a Connection() parameter */
+
+ if (SpaceId == ACPI_ADR_SPACE_GSBUS)
+ {
+ Status = AcpiBufferToResource (MyContext->Connection,
+ MyContext->Length, &Resource);
+
+ AcpiOsPrintf (" [AccLen %.2X Conn %p]",
+ MyContext->AccessLength, MyContext->Connection);
+ }
+ AcpiOsPrintf ("\n");
+ }
+
+ /* Setup the return buffer. Note: ASLTS depends on these fill values */
+
for (i = 0; i < Length; i++)
{
Buffer[i+2] = (UINT8) (0xA0 + i);
@@ -936,10 +1042,14 @@ AeRegionHandler (
case ACPI_ADR_SPACE_IPMI: /* ACPI 4.0 */
- AcpiOsPrintf ("AcpiExec: Received IPMI request: "
- "Address %X BaseAddress %X Length %X Width %X BufferLength %u\n",
- (UINT32) Address, (UINT32) BaseAddress,
- Length, BitWidth, Buffer[1]);
+ if (AcpiGbl_DisplayRegionAccess)
+ {
+ AcpiOsPrintf ("AcpiExec: IPMI "
+ "%s: Attr %X Addr %.4X BaseAddr %.4X Len %.2X Width %X BufLen %X\n",
+ (Function & ACPI_IO_MASK) ? "Write" : "Read ",
+ (UINT32) (Function >> 16), (UINT32) Address, (UINT32) BaseAddress,
+ Length, BitWidth, Buffer[1]);
+ }
/*
* Regardless of a READ or WRITE, this handler is passed a 66-byte
@@ -950,9 +1060,16 @@ AeRegionHandler (
Buffer[0] = 0; /* Status byte */
Buffer[1] = 64; /* Return buffer data length */
Buffer[2] = 0; /* Completion code */
- Buffer[3] = 0x34; /* Power measurement */
- Buffer[4] = 0x12; /* Power measurement */
- Buffer[65] = 0xEE; /* last buffer byte */
+ Buffer[3] = 0; /* Reserved */
+
+ /*
+ * Fill the 66-byte buffer with the return data.
+ * Note: ASLTS depends on these fill values.
+ */
+ for (i = 4; i < 66; i++)
+ {
+ Buffer[i] = (UINT8) (i);
+ }
return (AE_OK);
default:
@@ -1063,7 +1180,6 @@ AeRegionHandler (
((UINT64) Address - (UINT64) RegionElement->Address));
DoFunction:
-
/*
* Perform a read or write to the buffer space
*/
@@ -1087,6 +1203,37 @@ DoFunction:
return (AE_BAD_PARAMETER);
}
+ if (AcpiGbl_DisplayRegionAccess)
+ {
+ switch (SpaceId)
+ {
+ case ACPI_ADR_SPACE_SYSTEM_MEMORY:
+
+ AcpiOsPrintf ("AcpiExec: SystemMemory "
+ "%s: Val %.8X Addr %.4X Width %X [REGION: BaseAddr %.4X Len %.2X]\n",
+ (Function & ACPI_IO_MASK) ? "Write" : "Read ",
+ (UINT32) *Value, (UINT32) Address, BitWidth, (UINT32) BaseAddress, Length);
+ break;
+
+ case ACPI_ADR_SPACE_GPIO: /* ACPI 5.0 */
+
+ /* This space is required to always be ByteAcc */
+
+ Status = AcpiBufferToResource (MyContext->Connection,
+ MyContext->Length, &Resource);
+
+ AcpiOsPrintf ("AcpiExec: GeneralPurposeIo "
+ "%s: Val %.8X Addr %.4X BaseAddr %.4X Len %.2X Width %X AccLen %.2X Conn %p\n",
+ (Function & ACPI_IO_MASK) ? "Write" : "Read ", (UINT32) *Value,
+ (UINT32) Address, (UINT32) BaseAddress, Length, BitWidth,
+ MyContext->AccessLength, MyContext->Connection);
+ break;
+
+ default:
+ break;
+ }
+ }
+
return (AE_OK);
}
diff --git a/tools/acpiexec/aemain.c b/tools/acpiexec/aemain.c
index 2de367b54bfd..2c2f753cf538 100644
--- a/tools/acpiexec/aemain.c
+++ b/tools/acpiexec/aemain.c
@@ -55,6 +55,7 @@ UINT8 AcpiGbl_RegionFillValue = 0;
BOOLEAN AcpiGbl_IgnoreErrors = FALSE;
BOOLEAN AcpiGbl_DbOpt_NoRegionSupport = FALSE;
BOOLEAN AcpiGbl_DebugTimeout = FALSE;
+UINT8 AcpiGbl_UseHwReducedFadt = FALSE;
static UINT8 AcpiGbl_BatchMode = 0;
static char BatchBuffer[128];
@@ -64,7 +65,7 @@ static AE_TABLE_DESC *AeTableListHead = NULL;
static char *FileList[ASL_MAX_FILES];
-#define AE_SUPPORTED_OPTIONS "?b:d:e:f:gm^ovx:"
+#define AE_SUPPORTED_OPTIONS "?b:d:e:f:gm^orv:x:"
/******************************************************************************
@@ -104,7 +105,9 @@ usage (void)
printf ("\n");
ACPI_OPTION ("-f <Value>", "Operation Region initialization fill value");
- ACPI_OPTION ("-v", "Verbose initialization output");
+ ACPI_OPTION ("-r", "Use hardware-reduced FADT V5");
+ ACPI_OPTION ("-vi", "Verbose initialization output");
+ ACPI_OPTION ("-vr", "Verbose region handler output");
ACPI_OPTION ("-x <DebugLevel>", "Debug output level");
}
@@ -507,8 +510,26 @@ main (
AcpiGbl_DbOpt_stats = TRUE;
break;
+ case 'r':
+ AcpiGbl_UseHwReducedFadt = TRUE;
+ printf ("Using ACPI 5.0 Hardware Reduced Mode and FADT\n");
+ break;
+
case 'v':
- AcpiDbgLevel |= ACPI_LV_INIT_NAMES;
+ switch (AcpiGbl_Optarg[0])
+ {
+ case 'i':
+ AcpiDbgLevel |= ACPI_LV_INIT_NAMES;
+ break;
+
+ case 'r':
+ AcpiGbl_DisplayRegionAccess = TRUE;
+ break;
+
+ default:
+ printf ("Unknown option: -v%s\n", AcpiGbl_Optarg);
+ return (-1);
+ }
break;
case 'x':
diff --git a/tools/acpiexec/aetables.c b/tools/acpiexec/aetables.c
index e846d54a3a30..b4b60f0c24d0 100644
--- a/tools/acpiexec/aetables.c
+++ b/tools/acpiexec/aetables.c
@@ -270,19 +270,37 @@ AeBuildLocalTables (
* as well as the checksum
*/
ExternalFadt->Dsdt = DsdtAddress;
- ExternalFadt->Facs = ACPI_PTR_TO_PHYSADDR (&LocalFACS);
+ if (!AcpiGbl_ReducedHardware)
+ {
+ ExternalFadt->Facs = ACPI_PTR_TO_PHYSADDR (&LocalFACS);
+ }
if (ExternalFadt->Header.Length > ACPI_PTR_DIFF (&ExternalFadt->XDsdt, ExternalFadt))
{
ExternalFadt->XDsdt = DsdtAddress;
- ExternalFadt->XFacs = ACPI_PTR_TO_PHYSADDR (&LocalFACS);
+
+ if (!AcpiGbl_ReducedHardware)
+ {
+ ExternalFadt->XFacs = ACPI_PTR_TO_PHYSADDR (&LocalFACS);
+ }
}
+
/* Complete the FADT with the checksum */
ExternalFadt->Header.Checksum = 0;
ExternalFadt->Header.Checksum = (UINT8) -AcpiTbChecksum (
(void *) ExternalFadt, ExternalFadt->Header.Length);
}
+ else if (AcpiGbl_UseHwReducedFadt)
+ {
+ ACPI_MEMCPY (&LocalFADT, HwReducedFadtCode, sizeof (ACPI_TABLE_FADT));
+ LocalFADT.Dsdt = DsdtAddress;
+ LocalFADT.XDsdt = DsdtAddress;
+
+ LocalFADT.Header.Checksum = 0;
+ LocalFADT.Header.Checksum = (UINT8) -AcpiTbChecksum (
+ (void *) &LocalFADT, LocalFADT.Header.Length);
+ }
else
{
/*
diff --git a/tools/acpiexec/aetables.h b/tools/acpiexec/aetables.h
index 8226a6758537..7bf58e1e951c 100644
--- a/tools/acpiexec/aetables.h
+++ b/tools/acpiexec/aetables.h
@@ -101,6 +101,44 @@ unsigned char Ssdt3Code[] = /* Has method _T97 */
0x39,0x37,0x00,0x70,0x0A,0x04,0x60,0xA4, /* 00000028 "97.p..`." */
};
+/* "Hardware-Reduced" ACPI 5.0 FADT (No FACS, no registers) */
+
+unsigned char HwReducedFadtCode[] =
+{
+ 0x46,0x41,0x43,0x50,0x00,0x01,0x00,0x00, /* 00000000 "FACP...." */
+ 0x05,0x8C,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
+ 0x41,0x43,0x50,0x49,0x35,0x30,0x20,0x20, /* 00000010 "ACPI50 " */
+ 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
+ 0x13,0x04,0x11,0x20,0x00,0x00,0x00,0x00, /* 00000020 "... ...." */
+ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */
+ 0x00,0x00,0x78,0x00,0x01,0x08,0x00,0x01, /* 00000070 "..x....." */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000088 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x20,0x00,0x02, /* 00000090 "..... .." */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */
+ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x10,0x00,0x02, /* 000000A8 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B0 "........" */
+ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x00, /* 000000C0 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C8 "........" */
+ 0x01,0x20,0x00,0x03,0x00,0x00,0x00,0x00, /* 000000D0 ". ......" */
+ 0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x01, /* 000000D8 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E0 "........" */
+ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E8 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x01, /* 000000F0 "........" */
+ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 000000F8 "........" */
+};
+
/* Example OEM table */
static unsigned char Oem1Code[] =