acpica/utilities/utcache.c
acpica/utilities/utclib.c
acpica/utilities/utcopy.c
- acpica/utilities/utdebug.c
+ # acpica/utilities/utdebug.c
acpica/utilities/utdecode.c
acpica/utilities/utdelete.c
acpica/utilities/uterror.c
acpica/utilities/uteval.c
+ # acpica/utilities/utfileio.c
+ acpica/utilities/uthex.c
acpica/utilities/utids.c
acpica/utilities/utinit.c
acpica/utilities/utlock.c
acpica/utilities/utosi.c
acpica/utilities/utownerid.c
acpica/utilities/utpredef.c
+ # acpica/utilities/utprint.c
acpica/utilities/utresrc.c
acpica/utilities/utstate.c
acpica/utilities/utstring.c
+ # acpica/utilities/utuuid.c
acpica/utilities/uttrack.c
acpica/utilities/utxface.c
acpica/utilities/utxferror.c
*
*****************************************************************************/
-#define __DSARGS_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
*
*****************************************************************************/
-#define __DSCONTROL_C__
-
#include "acpi.h"
#include "accommon.h"
#include "amlcode.h"
*
*****************************************************************************/
-#define __DSFIELD_C__
-
#include "acpi.h"
#include "accommon.h"
#include "amlcode.h"
*/
Info->ResourceBuffer = NULL;
Info->ConnectionNode = NULL;
+ Info->PinNumberIndex = 0;
/*
* A Connection() is either an actual resource descriptor (buffer)
}
Info->FieldBitPosition += Info->FieldBitLength;
+ Info->PinNumberIndex++; /* Index relative to previous Connection() */
break;
default:
*
*****************************************************************************/
-#define __DSINIT_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acdispat.h"
*
*****************************************************************************/
-#define __DSMETHOD_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acdispat.h"
*
*****************************************************************************/
-#define __DSMTHDAT_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acdispat.h"
*
*****************************************************************************/
-#define __DSOBJECT_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
*
*****************************************************************************/
-#define __DSOPCODE_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
*
*****************************************************************************/
-#define __DSUTILS_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
*
*****************************************************************************/
-#define __DSWEXEC_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
*
*****************************************************************************/
-#define __DSWLOAD_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
*
*****************************************************************************/
-#define __DSWLOAD2_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
*
*****************************************************************************/
-#define __DSWSCOPE_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acdispat.h"
*
*****************************************************************************/
-
-#define __DSWSTATE_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
#define _COMPONENT ACPI_EVENTS
ACPI_MODULE_NAME ("evglock")
-
+#if ACPI_REDUCED_HARDWARE
+#error
+#endif
#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
/* Local prototypes */
GpeRegisterInfo->EnableForWake))
{
ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
- "Ignore disabled registers for GPE%02X-GPE%02X: "
+ "Ignore disabled registers for GPE %02X-%02X: "
"RunEnable=%02X, WakeEnable=%02X\n",
GpeRegisterInfo->BaseGpeNumber,
GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1),
}
ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
- "Read registers for GPE%02X-GPE%02X: Status=%02X, Enable=%02X, "
+ "Read registers for GPE %02X-%02X: Status=%02X, Enable=%02X, "
"RunEnable=%02X, WakeEnable=%02X\n",
GpeRegisterInfo->BaseGpeNumber,
GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1),
GpeNumber, AcpiGbl_GlobalEventHandlerContext);
}
- /*
- * If edge-triggered, clear the GPE status bit now. Note that
- * level-triggered events are cleared after the GPE is serviced.
- */
- if ((GpeEventInfo->Flags & ACPI_GPE_XRUPT_TYPE_MASK) ==
- ACPI_GPE_EDGE_TRIGGERED)
- {
- Status = AcpiHwClearGpe (GpeEventInfo);
- if (ACPI_FAILURE (Status))
- {
- ACPI_EXCEPTION ((AE_INFO, Status,
- "Unable to clear GPE%02X", GpeNumber));
- return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
- }
- }
-
/*
* Always disable the GPE so that it does not keep firing before
* any asynchronous activity completes (either from the execution
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
- "Unable to disable GPE%02X", GpeNumber));
+ "Unable to disable GPE %02X", GpeNumber));
return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
}
+ /*
+ * If edge-triggered, clear the GPE status bit now. Note that
+ * level-triggered events are cleared after the GPE is serviced.
+ */
+ if ((GpeEventInfo->Flags & ACPI_GPE_XRUPT_TYPE_MASK) ==
+ ACPI_GPE_EDGE_TRIGGERED)
+ {
+ Status = AcpiHwClearGpe (GpeEventInfo);
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_EXCEPTION ((AE_INFO, Status,
+ "Unable to clear GPE %02X", GpeNumber));
+ (void) AcpiHwLowSetGpe (GpeEventInfo,
+ ACPI_GPE_CONDITIONAL_ENABLE);
+ return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
+ }
+ }
+
/*
* Dispatch the GPE to either an installed handler or the control
* method associated with this GPE (_Lxx or _Exx). If a handler
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
- "Unable to queue handler for GPE%02X - event disabled",
+ "Unable to queue handler for GPE %02X - event disabled",
GpeNumber));
}
break;
* a GPE to be enabled if it has no handler or method.
*/
ACPI_ERROR ((AE_INFO,
- "No handler or method for GPE%02X, disabling event",
+ "No handler or method for GPE %02X, disabling event",
GpeNumber));
break;
}
{
/* Init the RegisterInfo for this GPE register (8 GPEs) */
- ThisRegister->BaseGpeNumber = (UINT8) (GpeBlock->BlockBaseNumber +
- (i * ACPI_GPE_REGISTER_WIDTH));
+ ThisRegister->BaseGpeNumber = (UINT16)
+ (GpeBlock->BlockBaseNumber + (i * ACPI_GPE_REGISTER_WIDTH));
ThisRegister->StatusAddress.Address =
- GpeBlock->BlockAddress.Address + i;
+ GpeBlock->Address + i;
ThisRegister->EnableAddress.Address =
- GpeBlock->BlockAddress.Address + i + GpeBlock->RegisterCount;
+ GpeBlock->Address + i + GpeBlock->RegisterCount;
- ThisRegister->StatusAddress.SpaceId = GpeBlock->BlockAddress.SpaceId;
- ThisRegister->EnableAddress.SpaceId = GpeBlock->BlockAddress.SpaceId;
+ ThisRegister->StatusAddress.SpaceId = GpeBlock->SpaceId;
+ ThisRegister->EnableAddress.SpaceId = GpeBlock->SpaceId;
ThisRegister->StatusAddress.BitWidth = ACPI_GPE_REGISTER_WIDTH;
ThisRegister->EnableAddress.BitWidth = ACPI_GPE_REGISTER_WIDTH;
ThisRegister->StatusAddress.BitOffset = 0;
ACPI_STATUS
AcpiEvCreateGpeBlock (
ACPI_NAMESPACE_NODE *GpeDevice,
- ACPI_GENERIC_ADDRESS *GpeBlockAddress,
+ UINT64 Address,
+ UINT8 SpaceId,
UINT32 RegisterCount,
- UINT8 GpeBlockBaseNumber,
+ UINT16 GpeBlockBaseNumber,
UINT32 InterruptNumber,
ACPI_GPE_BLOCK_INFO **ReturnGpeBlock)
{
/* Initialize the new GPE block */
+ GpeBlock->Address = Address;
+ GpeBlock->SpaceId = SpaceId;
GpeBlock->Node = GpeDevice;
GpeBlock->GpeCount = (UINT16) (RegisterCount * ACPI_GPE_REGISTER_WIDTH);
GpeBlock->Initialized = FALSE;
GpeBlock->RegisterCount = RegisterCount;
GpeBlock->BlockBaseNumber = GpeBlockBaseNumber;
- ACPI_MEMCPY (&GpeBlock->BlockAddress, GpeBlockAddress,
- sizeof (ACPI_GENERIC_ADDRESS));
-
/*
* Create the RegisterInfo and EventInfo sub-structures
* Note: disables and clears all GPEs in the block
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
- " Initialized GPE %02X to %02X [%4.4s] %u regs on interrupt 0x%X\n",
+ " Initialized GPE %02X to %02X [%4.4s] %u regs on interrupt 0x%X%s\n",
(UINT32) GpeBlock->BlockBaseNumber,
(UINT32) (GpeBlock->BlockBaseNumber + (GpeBlock->GpeCount - 1)),
- GpeDevice->Name.Ascii, GpeBlock->RegisterCount,
- InterruptNumber));
+ GpeDevice->Name.Ascii, GpeBlock->RegisterCount, InterruptNumber,
+ InterruptNumber == AcpiGbl_FADT.SciInterrupt ? " (SCI)" : ""));
/* Update global count of currently available GPEs */
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "acevents.h"
/* Install GPE Block 0 */
Status = AcpiEvCreateGpeBlock (AcpiGbl_FadtGpeDevice,
- &AcpiGbl_FADT.XGpe0Block, RegisterCount0, 0,
+ AcpiGbl_FADT.XGpe0Block.Address,
+ AcpiGbl_FADT.XGpe0Block.SpaceId,
+ RegisterCount0, 0,
AcpiGbl_FADT.SciInterrupt, &AcpiGbl_GpeFadtBlocks[0]);
if (ACPI_FAILURE (Status))
/* Install GPE Block 1 */
Status = AcpiEvCreateGpeBlock (AcpiGbl_FadtGpeDevice,
- &AcpiGbl_FADT.XGpe1Block, RegisterCount1,
+ AcpiGbl_FADT.XGpe1Block.Address,
+ AcpiGbl_FADT.XGpe1Block.SpaceId,
+ RegisterCount1,
AcpiGbl_FADT.Gpe1Base,
AcpiGbl_FADT.SciInterrupt, &AcpiGbl_GpeFadtBlocks[1]);
return_ACPI_STATUS (AE_OK);
}
+ /* Disable the GPE in case it's been enabled already. */
+
+ (void) AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE);
+
/*
* Add the GPE information from above to the GpeEventInfo block for
* use during dispatch of this GPE.
*
*****************************************************************************/
-
-#define __EVHANDLER_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acevents.h"
*
*****************************************************************************/
-
-#define __EVREGION_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acevents.h"
ACPI_OPERAND_OBJECT *RegionObj2;
void *RegionContext = NULL;
ACPI_CONNECTION_INFO *Context;
+ ACPI_PHYSICAL_ADDRESS Address;
ACPI_FUNCTION_TRACE (EvAddressSpaceDispatch);
/* We have everything we need, we can invoke the address space handler */
Handler = HandlerDesc->AddressSpace.Handler;
-
- ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
- "Handler %p (@%p) Address %8.8X%8.8X [%s]\n",
- &RegionObj->Region.Handler->AddressSpace, Handler,
- ACPI_FORMAT_NATIVE_UINT (RegionObj->Region.Address + RegionOffset),
- AcpiUtGetRegionName (RegionObj->Region.SpaceId)));
+ Address = (RegionObj->Region.Address + RegionOffset);
/*
* Special handling for GenericSerialBus and GeneralPurposeIo:
* There are three extra parameters that must be passed to the
* handler via the context:
- * 1) Connection buffer, a resource template from Connection() op.
- * 2) Length of the above buffer.
- * 3) Actual access length from the AccessAs() op.
+ * 1) Connection buffer, a resource template from Connection() op
+ * 2) Length of the above buffer
+ * 3) Actual access length from the AccessAs() op
+ *
+ * In addition, for GeneralPurposeIo, the Address and BitWidth fields
+ * are defined as follows:
+ * 1) Address is the pin number index of the field (bit offset from
+ * the previous Connection)
+ * 2) BitWidth is the actual bit length of the field (number of pins)
*/
- if (((RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS) ||
- (RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO)) &&
+ if ((RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS) &&
+ Context &&
+ FieldObj)
+ {
+ /* Get the Connection (ResourceTemplate) buffer */
+
+ Context->Connection = FieldObj->Field.ResourceBuffer;
+ Context->Length = FieldObj->Field.ResourceLength;
+ Context->AccessLength = FieldObj->Field.AccessLength;
+ }
+ if ((RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO) &&
Context &&
FieldObj)
{
Context->Connection = FieldObj->Field.ResourceBuffer;
Context->Length = FieldObj->Field.ResourceLength;
Context->AccessLength = FieldObj->Field.AccessLength;
+ Address = FieldObj->Field.PinNumberIndex;
+ BitWidth = FieldObj->Field.BitLength;
}
+ ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
+ "Handler %p (@%p) Address %8.8X%8.8X [%s]\n",
+ &RegionObj->Region.Handler->AddressSpace, Handler,
+ ACPI_FORMAT_NATIVE_UINT (Address),
+ AcpiUtGetRegionName (RegionObj->Region.SpaceId)));
+
if (!(HandlerDesc->AddressSpace.HandlerFlags &
ACPI_ADDR_HANDLER_DEFAULT_INSTALLED))
{
/* Call the handler */
- Status = Handler (Function,
- (RegionObj->Region.Address + RegionOffset), BitWidth, Value,
- Context, RegionObj2->Extra.RegionContext);
+ Status = Handler (Function, Address, BitWidth, Value, Context,
+ RegionObj2->Extra.RegionContext);
if (ACPI_FAILURE (Status))
{
*
*****************************************************************************/
-
-#define __EVRGNINI_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acevents.h"
*
*****************************************************************************/
-
-#define __EVXFACE_C__
#define EXPORT_ACPI_INTERFACES
#include "acpi.h"
* enabled, it should be enabled at this point to restore the
* post-initialization configuration.
*/
- if ((Handler->OriginalFlags & ACPI_GPE_DISPATCH_METHOD) &&
+ if (((Handler->OriginalFlags & ACPI_GPE_DISPATCH_METHOD) ||
+ (Handler->OriginalFlags & ACPI_GPE_DISPATCH_NOTIFY)) &&
Handler->OriginallyEnabled)
{
(void) AcpiEvAddGpeReference (GpeEventInfo);
*
*****************************************************************************/
-
-#define __EVXFEVNT_C__
#define EXPORT_ACPI_INTERFACES
#include "acpi.h"
UINT32 Event,
ACPI_EVENT_STATUS *EventStatus)
{
- ACPI_STATUS Status = AE_OK;
+ ACPI_STATUS Status;
+ ACPI_EVENT_STATUS LocalEventStatus = 0;
+ UINT32 InByte;
ACPI_FUNCTION_TRACE (AcpiGetEventStatus);
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
- /* Get the status of the requested fixed event */
+ /* Fixed event currently can be dispatched? */
+
+ if (AcpiGbl_FixedEventHandlers[Event].Handler)
+ {
+ LocalEventStatus |= ACPI_EVENT_FLAG_HAS_HANDLER;
+ }
+
+ /* Fixed event currently enabled? */
Status = AcpiReadBitRegister (
- AcpiGbl_FixedEventInfo[Event].StatusRegisterId, EventStatus);
+ AcpiGbl_FixedEventInfo[Event].EnableRegisterId, &InByte);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
- return_ACPI_STATUS (Status);
+ if (InByte)
+ {
+ LocalEventStatus |= ACPI_EVENT_FLAG_ENABLED;
+ }
+
+ /* Fixed event currently active? */
+
+ Status = AcpiReadBitRegister (
+ AcpiGbl_FixedEventInfo[Event].StatusRegisterId, &InByte);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ if (InByte)
+ {
+ LocalEventStatus |= ACPI_EVENT_FLAG_SET;
+ }
+
+ (*EventStatus) = LocalEventStatus;
+ return_ACPI_STATUS (AE_OK);
}
ACPI_EXPORT_SYMBOL (AcpiGetEventStatus)
*
*****************************************************************************/
-
-#define __EVXFGPE_C__
#define EXPORT_ACPI_INTERFACES
#include "acpi.h"
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
- /* Ensure that we have a valid GPE number */
-
+ /*
+ * Ensure that we have a valid GPE number and that there is some way
+ * of handling the GPE (handler or a GPE method). In other words, we
+ * won't allow a valid GPE to be enabled if there is no way to handle it.
+ */
GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
if (GpeEventInfo)
{
- Status = AcpiEvAddGpeReference (GpeEventInfo);
+ if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) !=
+ ACPI_GPE_DISPATCH_NONE)
+ {
+ Status = AcpiEvAddGpeReference (GpeEventInfo);
+ }
+ else
+ {
+ Status = AE_NO_HANDLER;
+ }
}
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
ACPI_EXPORT_SYMBOL (AcpiSetGpe)
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiMarkGpeForWake
+ *
+ * PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
+ * GpeNumber - GPE level within the GPE block
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Mark a GPE as having the ability to wake the system. Simply
+ * sets the ACPI_GPE_CAN_WAKE flag.
+ *
+ * Some potential callers of AcpiSetupGpeForWake may know in advance that
+ * there won't be any notify handlers installed for device wake notifications
+ * from the given GPE (one example is a button GPE in Linux). For these cases,
+ * AcpiMarkGpeForWake should be used instead of AcpiSetupGpeForWake.
+ * This will set the ACPI_GPE_CAN_WAKE flag for the GPE without trying to
+ * setup implicit wake notification for it (since there's no handler method).
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiMarkGpeForWake (
+ ACPI_HANDLE GpeDevice,
+ UINT32 GpeNumber)
+{
+ ACPI_GPE_EVENT_INFO *GpeEventInfo;
+ ACPI_STATUS Status = AE_BAD_PARAMETER;
+ ACPI_CPU_FLAGS Flags;
+
+
+ ACPI_FUNCTION_TRACE (AcpiMarkGpeForWake);
+
+
+ Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
+
+ /* Ensure that we have a valid GPE number */
+
+ GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
+ if (GpeEventInfo)
+ {
+ /* Mark the GPE as a possible wake event */
+
+ GpeEventInfo->Flags |= ACPI_GPE_CAN_WAKE;
+ Status = AE_OK;
+ }
+
+ AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
+ return_ACPI_STATUS (Status);
+}
+
+ACPI_EXPORT_SYMBOL (AcpiMarkGpeForWake)
+
+
/*******************************************************************************
*
* FUNCTION: AcpiSetupGpeForWake
* For user-installed GPE Block Devices, the GpeBlockBaseNumber
* is always zero
*/
- Status = AcpiEvCreateGpeBlock (Node, GpeBlockAddress, RegisterCount,
+ Status = AcpiEvCreateGpeBlock (Node, GpeBlockAddress->Address,
+ GpeBlockAddress->SpaceId, RegisterCount,
0, InterruptNumber, &GpeBlock);
if (ACPI_FAILURE (Status))
{
*
*****************************************************************************/
-#define __EVXFREGN_C__
#define EXPORT_ACPI_INTERFACES
#include "acpi.h"
*
*****************************************************************************/
-#define __EXCONFIG_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acinterp.h"
*
*****************************************************************************/
-
-#define __EXCONVRT_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acinterp.h"
*
*****************************************************************************/
-#define __EXCREATE_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acinterp.h"
*
*****************************************************************************/
-#define __EXDEBUG_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acinterp.h"
UINT32 Index)
{
UINT32 i;
+ UINT32 Timer;
ACPI_FUNCTION_TRACE_PTR (ExDoDebugObject, SourceDesc);
return_VOID;
}
+ /*
+ * We will emit the current timer value (in microseconds) with each
+ * debug output. Only need the lower 26 bits. This allows for 67
+ * million microseconds or 67 seconds before rollover.
+ */
+ Timer = ((UINT32) AcpiOsGetTimer () / 10); /* (100 nanoseconds to microseconds) */
+ Timer &= 0x03FFFFFF;
+
/*
* Print line header as long as we are not in the middle of an
* object display
*/
if (!((Level > 0) && Index == 0))
{
- AcpiOsPrintf ("[ACPI Debug] %*s", Level, " ");
+ AcpiOsPrintf ("[ACPI Debug %.8u] %*s", Timer, Level, " ");
}
/* Display the index for package output only */
*
*****************************************************************************/
-#define __EXDUMP_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acinterp.h"
}
}
- AcpiOsPrintf ("\n", Next);
+ AcpiOsPrintf ("\n");
break;
case ACPI_EXD_HDLR_LIST:
}
}
- AcpiOsPrintf ("\n", Next);
+ AcpiOsPrintf ("\n");
break;
case ACPI_EXD_RGN_LIST:
}
}
- AcpiOsPrintf ("\n", Next);
+ AcpiOsPrintf ("\n");
break;
case ACPI_EXD_NODE:
*
*****************************************************************************/
-
-#define __EXFIELD_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acdispat.h"
#include "acinterp.h"
+#include "amlcode.h"
#define _COMPONENT ACPI_EXECUTER
ACPI_MODULE_NAME ("exfield")
+/* Local prototypes */
+
+static UINT32
+AcpiExGetSerialAccessLength (
+ UINT32 AccessorType,
+ UINT32 AccessLength);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiExGetSerialAccessLength
+ *
+ * PARAMETERS: AccessorType - The type of the protocol indicated by region
+ * field access attributes
+ * AccessLength - The access length of the region field
+ *
+ * RETURN: Decoded access length
+ *
+ * DESCRIPTION: This routine returns the length of the GenericSerialBus
+ * protocol bytes
+ *
+ ******************************************************************************/
+
+static UINT32
+AcpiExGetSerialAccessLength (
+ UINT32 AccessorType,
+ UINT32 AccessLength)
+{
+ UINT32 Length;
+
+
+ switch (AccessorType)
+ {
+ case AML_FIELD_ATTRIB_QUICK:
+
+ Length = 0;
+ break;
+
+ case AML_FIELD_ATTRIB_SEND_RCV:
+ case AML_FIELD_ATTRIB_BYTE:
+
+ Length = 1;
+ break;
+
+ case AML_FIELD_ATTRIB_WORD:
+ case AML_FIELD_ATTRIB_WORD_CALL:
+
+ Length = 2;
+ break;
+
+ case AML_FIELD_ATTRIB_MULTIBYTE:
+ case AML_FIELD_ATTRIB_RAW_BYTES:
+ case AML_FIELD_ATTRIB_RAW_PROCESS:
+
+ Length = AccessLength;
+ break;
+
+ case AML_FIELD_ATTRIB_BLOCK:
+ case AML_FIELD_ATTRIB_BLOCK_CALL:
+ default:
+
+ Length = ACPI_GSBUS_BUFFER_SIZE - 2;
+ break;
+ }
+
+ return (Length);
+}
+
/*******************************************************************************
*
ACPI_SIZE Length;
void *Buffer;
UINT32 Function;
+ UINT16 AccessorType;
ACPI_FUNCTION_TRACE_PTR (ExReadDataFromField, ObjDesc);
}
else if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS)
{
- Length = ACPI_GSBUS_BUFFER_SIZE;
- Function = ACPI_READ | (ObjDesc->Field.Attribute << 16);
+ AccessorType = ObjDesc->Field.Attribute;
+ Length = AcpiExGetSerialAccessLength (AccessorType,
+ ObjDesc->Field.AccessLength);
+
+ /*
+ * Add additional 2 bytes for the GenericSerialBus data buffer:
+ *
+ * Status; (Byte 0 of the data buffer)
+ * Length; (Byte 1 of the data buffer)
+ * Data[x-1]; (Bytes 2-x of the arbitrary length data buffer)
+ */
+ Length += 2;
+ Function = ACPI_READ | (AccessorType << 16);
}
else /* IPMI */
{
Buffer = &BufferDesc->Integer.Value;
}
+ if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) &&
+ (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO))
+ {
+ /*
+ * For GPIO (GeneralPurposeIo), the Address will be the bit offset
+ * from the previous Connection() operator, making it effectively a
+ * pin number index. The BitLength is the length of the field, which
+ * is thus the number of pins.
+ */
+ ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
+ "GPIO FieldRead [FROM]: Pin %u Bits %u\n",
+ ObjDesc->Field.PinNumberIndex, ObjDesc->Field.BitLength));
+
+ /* Lock entire transaction if requested */
+
+ AcpiExAcquireGlobalLock (ObjDesc->CommonField.FieldFlags);
+
+ /* Perform the write */
+
+ Status = AcpiExAccessRegion (ObjDesc, 0,
+ (UINT64 *) Buffer, ACPI_READ);
+ AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiUtRemoveReference (BufferDesc);
+ }
+ else
+ {
+ *RetBufferDesc = BufferDesc;
+ }
+ return_ACPI_STATUS (Status);
+ }
+
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"FieldRead [TO]: Obj %p, Type %X, Buf %p, ByteLen %X\n",
ObjDesc, ObjDesc->Common.Type, Buffer, (UINT32) Length));
void *Buffer;
ACPI_OPERAND_OBJECT *BufferDesc;
UINT32 Function;
+ UINT16 AccessorType;
ACPI_FUNCTION_TRACE_PTR (ExWriteDataToField, ObjDesc);
}
else if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS)
{
- Length = ACPI_GSBUS_BUFFER_SIZE;
- Function = ACPI_WRITE | (ObjDesc->Field.Attribute << 16);
+ AccessorType = ObjDesc->Field.Attribute;
+ Length = AcpiExGetSerialAccessLength (AccessorType,
+ ObjDesc->Field.AccessLength);
+
+ /*
+ * Add additional 2 bytes for the GenericSerialBus data buffer:
+ *
+ * Status; (Byte 0 of the data buffer)
+ * Length; (Byte 1 of the data buffer)
+ * Data[x-1]; (Bytes 2-x of the arbitrary length data buffer)
+ */
+ Length += 2;
+ Function = ACPI_WRITE | (AccessorType << 16);
}
else /* IPMI */
{
*ResultDesc = BufferDesc;
return_ACPI_STATUS (Status);
}
+ else if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) &&
+ (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO))
+ {
+ /*
+ * For GPIO (GeneralPurposeIo), we will bypass the entire field
+ * mechanism and handoff the bit address and bit width directly to
+ * the handler. The Address will be the bit offset
+ * from the previous Connection() operator, making it effectively a
+ * pin number index. The BitLength is the length of the field, which
+ * is thus the number of pins.
+ */
+ if (SourceDesc->Common.Type != ACPI_TYPE_INTEGER)
+ {
+ return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
+ }
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
+ "GPIO FieldWrite [FROM]: (%s:%X), Val %.8X [TO]: Pin %u Bits %u\n",
+ AcpiUtGetTypeName (SourceDesc->Common.Type),
+ SourceDesc->Common.Type, (UINT32) SourceDesc->Integer.Value,
+ ObjDesc->Field.PinNumberIndex, ObjDesc->Field.BitLength));
+
+ Buffer = &SourceDesc->Integer.Value;
+
+ /* Lock entire transaction if requested */
+
+ AcpiExAcquireGlobalLock (ObjDesc->CommonField.FieldFlags);
+
+ /* Perform the write */
+
+ Status = AcpiExAccessRegion (ObjDesc, 0,
+ (UINT64 *) Buffer, ACPI_WRITE);
+ AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
+ return_ACPI_STATUS (Status);
+ }
/* Get a pointer to the data to be written */
*
*****************************************************************************/
-
-#define __EXFLDIO_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acinterp.h"
*
*****************************************************************************/
-#define __EXMISC_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acinterp.h"
*
*****************************************************************************/
-#define __EXMUTEX_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acinterp.h"
*
*****************************************************************************/
-#define __EXNAMES_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acinterp.h"
*
*****************************************************************************/
-#define __EXOPARG1_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
*
*****************************************************************************/
-
-#define __EXOPARG2_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
*
*****************************************************************************/
-#define __EXOPARG3_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acinterp.h"
*
*****************************************************************************/
-#define __EXOPARG6_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acinterp.h"
*
*****************************************************************************/
-#define __EXPREP_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acinterp.h"
ObjDesc->Field.ResourceLength = Info->ResourceLength;
}
+ ObjDesc->Field.PinNumberIndex = Info->PinNumberIndex;
+
/* Allow full data read from EC address space */
if ((ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_EC) &&
*
*****************************************************************************/
-
-#define __EXREGION_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acinterp.h"
*
*****************************************************************************/
-#define __EXRESNTE_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acdispat.h"
*
*****************************************************************************/
-#define __EXRESOLV_C__
-
#include "acpi.h"
#include "accommon.h"
#include "amlcode.h"
*
*****************************************************************************/
-#define __EXRESOP_C__
-
#include "acpi.h"
#include "accommon.h"
#include "amlcode.h"
*
*****************************************************************************/
-#define __EXSTORE_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acdispat.h"
*
*****************************************************************************/
-#define __EXSTOREN_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acinterp.h"
*
*****************************************************************************/
-#define __EXSTOROB_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acinterp.h"
*
*****************************************************************************/
-#define __EXSYSTEM_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acinterp.h"
*
*****************************************************************************/
-#define __EXUTILS_C__
-
/*
* DEFINE_AML_GLOBALS is tested in amlcode.h
* to determine whether certain global names should be "defined" or only
*
*****************************************************************************/
-#define __HWACPI_C__
-
#include "acpi.h"
#include "accommon.h"
return (AE_BAD_PARAMETER);
}
+ /* GPE currently handled? */
+
+ if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) !=
+ ACPI_GPE_DISPATCH_NONE)
+ {
+ LocalEventStatus |= ACPI_EVENT_FLAG_HAS_HANDLER;
+ }
+
/* Get the info block for the entire GPE register */
GpeRegisterInfo = GpeEventInfo->RegisterInfo;
*
*****************************************************************************/
-#define __HWPCI_C__
-
#include "acpi.h"
#include "accommon.h"
/* Walk the list, updating the PCI device/function/bus numbers */
Status = AcpiHwProcessPciList (PciId, ListHead);
- }
- /* Always delete the list */
+ /* Delete the list */
+
+ AcpiHwDeletePciList (ListHead);
+ }
- AcpiHwDeletePciList (ListHead);
return_ACPI_STATUS (Status);
}
Status = AcpiGetParent (CurrentDevice, &ParentDevice);
if (ACPI_FAILURE (Status))
{
+ /* Must delete the list before exit */
+
+ AcpiHwDeletePciList (*ReturnListHead);
return (Status);
}
ListElement = ACPI_ALLOCATE (sizeof (ACPI_PCI_DEVICE));
if (!ListElement)
{
+ /* Must delete the list before exit */
+
+ AcpiHwDeletePciList (*ReturnListHead);
return (AE_NO_MEMORY);
}
*
*****************************************************************************/
-#define __HWREGS_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acevents.h"
Status = AcpiHwRegisterWrite (ACPI_REGISTER_PM1_STATUS,
ACPI_BITMASK_ALL_FIXED_STATUS);
+
+ AcpiOsReleaseLock (AcpiGbl_HardwareLock, LockFlags);
+
if (ACPI_FAILURE (Status))
{
- goto UnlockAndExit;
+ goto Exit;
}
/* Clear the GPE Bits in all GPE registers in all GPE blocks */
Status = AcpiEvWalkGpeList (AcpiHwClearGpeBlock, NULL);
-UnlockAndExit:
- AcpiOsReleaseLock (AcpiGbl_HardwareLock, LockFlags);
+Exit:
return_ACPI_STATUS (Status);
}
*
*****************************************************************************/
-#define __HWVALID_C__
-
#include "acpi.h"
#include "accommon.h"
/* Macros for usage messages */
#define ACPI_USAGE_HEADER(Usage) \
- printf ("Usage: %s\nOptions:\n", Usage);
+ AcpiOsPrintf ("Usage: %s\nOptions:\n", Usage);
+
+#define ACPI_USAGE_TEXT(Description) \
+ AcpiOsPrintf (Description);
#define ACPI_OPTION(Name, Description) \
- printf (" %-18s%s\n", Name, Description);
+ AcpiOsPrintf (" %-18s%s\n", Name, Description);
#define FILE_SUFFIX_DISASSEMBLY "dsl"
*/
UINT32
CmGetFileSize (
- FILE *File);
+ ACPI_FILE File);
#ifndef ACPI_DUMP_APP
{
UINT8 Revision;
UINT8 IgnoreColor;
- UINT32 Color;
+ UINT8 Red;
+ UINT8 Green;
+ UINT8 Blue;
UINT16 Width;
UINT16 Height;
UINT8 UserVisible;
#define ACPI_PLD_GET_IGNORE_COLOR(dword) ACPI_GET_BITS (dword, 7, ACPI_1BIT_MASK)
#define ACPI_PLD_SET_IGNORE_COLOR(dword,value) ACPI_SET_BITS (dword, 7, ACPI_1BIT_MASK, value) /* Offset 7, Len 1 */
-#define ACPI_PLD_GET_COLOR(dword) ACPI_GET_BITS (dword, 8, ACPI_24BIT_MASK)
-#define ACPI_PLD_SET_COLOR(dword,value) ACPI_SET_BITS (dword, 8, ACPI_24BIT_MASK, value) /* Offset 8, Len 24 */
+#define ACPI_PLD_GET_RED(dword) ACPI_GET_BITS (dword, 8, ACPI_8BIT_MASK)
+#define ACPI_PLD_SET_RED(dword,value) ACPI_SET_BITS (dword, 8, ACPI_8BIT_MASK, value) /* Offset 8, Len 8 */
+
+#define ACPI_PLD_GET_GREEN(dword) ACPI_GET_BITS (dword, 16, ACPI_8BIT_MASK)
+#define ACPI_PLD_SET_GREEN(dword,value) ACPI_SET_BITS (dword, 16, ACPI_8BIT_MASK, value) /* Offset 16, Len 8 */
+
+#define ACPI_PLD_GET_BLUE(dword) ACPI_GET_BITS (dword, 24, ACPI_8BIT_MASK)
+#define ACPI_PLD_SET_BLUE(dword,value) ACPI_SET_BITS (dword, 24, ACPI_8BIT_MASK, value) /* Offset 24, Len 8 */
/* Second 32-bit dword, bits 33:63 */
#define ACPI_NUM_SxW_METHODS 5
+/******************************************************************************
+ *
+ * Miscellaneous constants
+ *
+ *****************************************************************************/
+
+/* UUID constants */
+
+#define UUID_BUFFER_LENGTH 16 /* Length of UUID in memory */
+#define UUID_STRING_LENGTH 36 /* Total length of a UUID string */
+
+/* Positions for required hyphens (dashes) in UUID strings */
+
+#define UUID_HYPHEN1_OFFSET 8
+#define UUID_HYPHEN2_OFFSET 13
+#define UUID_HYPHEN3_OFFSET 18
+#define UUID_HYPHEN4_OFFSET 23
+
+
/******************************************************************************
*
* ACPI AML Debugger
char *Filename,
ACPI_TABLE_HEADER **Table);
-ACPI_STATUS
-AcpiDbReadTableFromFile (
- char *Filename,
- ACPI_TABLE_HEADER **Table);
-
/*
* dbhistry - debugger HISTORY command
ACPI_DMT_ASF,
ACPI_DMT_DMAR,
+ ACPI_DMT_DMAR_SCOPE,
ACPI_DMT_EINJACT,
ACPI_DMT_EINJINST,
ACPI_DMT_ERSTACT,
ACPI_DMT_ERSTINST,
ACPI_DMT_FADTPM,
+ ACPI_DMT_GTDT,
ACPI_DMT_HEST,
ACPI_DMT_HESTNTFY,
ACPI_DMT_HESTNTYP,
ACPI_DMT_IVRS,
+ ACPI_DMT_LPIT,
ACPI_DMT_MADT,
ACPI_DMT_PCCT,
ACPI_DMT_PMTT,
UINT32 BitOffset;
UINT32 Flags;
ACPI_WALK_STATE *WalkState;
+ ACPI_PARSE_OBJECT *MappingOp;
} ACPI_OP_WALK_INFO;
typedef
void (*ACPI_RESOURCE_HANDLER) (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar2[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar3[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar4[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoEcdt[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoGas[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdtHdr[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt0[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt0a[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHeader[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHestNotify[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHestBank[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHpet[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpitHdr[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpit0[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpit1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt10[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt11[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt12[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt13[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt14[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadtHdr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcctHdr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct0[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp2[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat2[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat3[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoTcpa[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoTpm2[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoUefi[];
AcpiDmDumpFpdt (
ACPI_TABLE_HEADER *Table);
+void
+AcpiDmDumpGtdt (
+ ACPI_TABLE_HEADER *Table);
+
void
AcpiDmDumpHest (
ACPI_TABLE_HEADER *Table);
AcpiDmDumpIvrs (
ACPI_TABLE_HEADER *Table);
+void
+AcpiDmDumpLpit (
+ ACPI_TABLE_HEADER *Table);
+
void
AcpiDmDumpMadt (
ACPI_TABLE_HEADER *Table);
AcpiDmDecompressEisaId (
UINT32 EncodedId);
+BOOLEAN
+AcpiDmIsUuidBuffer (
+ ACPI_PARSE_OBJECT *Op);
+
BOOLEAN
AcpiDmIsUnicodeBuffer (
ACPI_PARSE_OBJECT *Op);
*/
void
AcpiDmWordDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmDwordDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmExtendedDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmQwordDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmMemory24Descriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmMemory32Descriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmFixedMemory32Descriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmGenericRegisterDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmInterruptDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmVendorLargeDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmGpioDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmSerialBusDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
*/
void
AcpiDmIrqDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmDmaDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmFixedDmaDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmIoDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmFixedIoDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmStartDependentDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmEndDependentDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmVendorSmallDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
ACPI_WALK_STATE *WalkState);
+/*
+ * dmcstyle
+ */
+BOOLEAN
+AcpiDmCheckForSymbolicOpcode (
+ ACPI_PARSE_OBJECT *Op,
+ ACPI_OP_WALK_INFO *Info);
+
+void
+AcpiDmCloseOperator (
+ ACPI_PARSE_OBJECT *Op);
+
+
/*
* acdisasm
*/
AdDisassemblerHeader (
char *Filename);
-
#endif /* __ACDISASM_H__ */
*
*****************************************************************************/
-
#ifndef _ACDISPAT_H_
#define _ACDISPAT_H_
ACPI_STATUS
AcpiEvCreateGpeBlock (
ACPI_NAMESPACE_NODE *GpeDevice,
- ACPI_GENERIC_ADDRESS *GpeBlockAddress,
+ UINT64 Address,
+ UINT8 SpaceId,
UINT32 RegisterCount,
- UINT8 GpeBlockBaseNumber,
+ UINT16 GpeBlockBaseNumber,
UINT32 InterruptNumber,
ACPI_GPE_BLOCK_INFO **ReturnGpeBlock);
#define __ACGLOBAL_H__
-/*
- * Ensure that the globals are actually defined and initialized only once.
- *
- * The use of these macros allows a single list of globals (here) in order
- * to simplify maintenance of the code.
- */
-#ifdef DEFINE_ACPI_GLOBALS
-#define ACPI_GLOBAL(type,name) \
- extern type name; \
- type name
-
-#define ACPI_INIT_GLOBAL(type,name,value) \
- type name=value
-
-#else
-#define ACPI_GLOBAL(type,name) \
- extern type name
-
-#define ACPI_INIT_GLOBAL(type,name,value) \
- extern type name
-#endif
-
-
-#ifdef DEFINE_ACPI_GLOBALS
-
-/* Public globals, available from outside ACPICA subsystem */
-
/*****************************************************************************
*
- * Runtime configuration (static defaults that can be overriden at runtime)
+ * Globals related to the ACPI tables
*
****************************************************************************/
-/*
- * Enable "slack" in the AML interpreter? Default is FALSE, and the
- * interpreter strictly follows the ACPI specification. Setting to TRUE
- * allows the interpreter to ignore certain errors and/or bad AML constructs.
- *
- * Currently, these features are enabled by this flag:
- *
- * 1) Allow "implicit return" of last value in a control method
- * 2) Allow access beyond the end of an operation region
- * 3) Allow access to uninitialized locals/args (auto-init to integer 0)
- * 4) Allow ANY object type to be a source operand for the Store() operator
- * 5) Allow unresolved references (invalid target name) in package objects
- * 6) Enable warning messages for behavior that is not ACPI spec compliant
- */
-ACPI_INIT_GLOBAL (UINT8, AcpiGbl_EnableInterpreterSlack, FALSE);
-
-/*
- * Automatically serialize all methods that create named objects? Default
- * is TRUE, meaning that all NonSerialized methods are scanned once at
- * table load time to determine those that create named objects. Methods
- * that create named objects are marked Serialized in order to prevent
- * possible run-time problems if they are entered by more than one thread.
- */
-ACPI_INIT_GLOBAL (UINT8, AcpiGbl_AutoSerializeMethods, TRUE);
-
-/*
- * Create the predefined _OSI method in the namespace? Default is TRUE
- * because ACPICA is fully compatible with other ACPI implementations.
- * Changing this will revert ACPICA (and machine ASL) to pre-OSI behavior.
- */
-ACPI_INIT_GLOBAL (UINT8, AcpiGbl_CreateOsiMethod, TRUE);
-
-/*
- * Optionally use default values for the ACPI register widths. Set this to
- * TRUE to use the defaults, if an FADT contains incorrect widths/lengths.
- */
-ACPI_INIT_GLOBAL (UINT8, AcpiGbl_UseDefaultRegisterWidths, TRUE);
+/* Master list of all ACPI tables that were found in the RSDT/XSDT */
-/*
- * Optionally enable output from the AML Debug Object.
- */
-ACPI_INIT_GLOBAL (UINT8, AcpiGbl_EnableAmlDebugObject, FALSE);
-
-/*
- * Optionally copy the entire DSDT to local memory (instead of simply
- * mapping it.) There are some BIOSs that corrupt or replace the original
- * DSDT, creating the need for this option. Default is FALSE, do not copy
- * the DSDT.
- */
-ACPI_INIT_GLOBAL (UINT8, AcpiGbl_CopyDsdtLocally, FALSE);
-
-/*
- * Optionally ignore an XSDT if present and use the RSDT instead.
- * Although the ACPI specification requires that an XSDT be used instead
- * of the RSDT, the XSDT has been found to be corrupt or ill-formed on
- * some machines. Default behavior is to use the XSDT if present.
- */
-ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DoNotUseXsdt, FALSE);
-
-/*
- * Optionally use 32-bit FADT addresses if and when there is a conflict
- * (address mismatch) between the 32-bit and 64-bit versions of the
- * address. Although ACPICA adheres to the ACPI specification which
- * requires the use of the corresponding 64-bit address if it is non-zero,
- * some machines have been found to have a corrupted non-zero 64-bit
- * address. Default is FALSE, do not favor the 32-bit addresses.
- */
-ACPI_INIT_GLOBAL (UINT8, AcpiGbl_Use32BitFadtAddresses, FALSE);
-
-/*
- * Optionally truncate I/O addresses to 16 bits. Provides compatibility
- * with other ACPI implementations. NOTE: During ACPICA initialization,
- * this value is set to TRUE if any Windows OSI strings have been
- * requested by the BIOS.
- */
-ACPI_INIT_GLOBAL (UINT8, AcpiGbl_TruncateIoAddresses, FALSE);
-
-/*
- * Disable runtime checking and repair of values returned by control methods.
- * Use only if the repair is causing a problem on a particular machine.
- */
-ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DisableAutoRepair, FALSE);
-
-/*
- * Optionally do not install any SSDTs from the RSDT/XSDT during initialization.
- * This can be useful for debugging ACPI problems on some machines.
- */
-ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DisableSsdtTableInstall, FALSE);
-
-/*
- * We keep track of the latest version of Windows that has been requested by
- * the BIOS.
- */
-ACPI_INIT_GLOBAL (UINT8, AcpiGbl_OsiData, 0);
-
-#endif /* DEFINE_ACPI_GLOBALS */
-
-
-/*****************************************************************************
- *
- * ACPI Table globals
- *
- ****************************************************************************/
-
-/*
- * Master list of all ACPI tables that were found in the RSDT/XSDT.
- */
ACPI_GLOBAL (ACPI_TABLE_LIST, AcpiGbl_RootTableList);
/* DSDT information. Used to check for DSDT corruption */
ACPI_GLOBAL (ACPI_INIT_HANDLER, AcpiGbl_InitHandler);
ACPI_GLOBAL (ACPI_TABLE_HANDLER, AcpiGbl_TableHandler);
ACPI_GLOBAL (void *, AcpiGbl_TableHandlerContext);
-ACPI_GLOBAL (ACPI_WALK_STATE *, AcpiGbl_BreakpointWalk);
ACPI_GLOBAL (ACPI_INTERFACE_HANDLER, AcpiGbl_InterfaceHandler);
ACPI_GLOBAL (ACPI_SCI_HANDLER_INFO *, AcpiGbl_SciHandlerList);
/* Misc */
ACPI_GLOBAL (UINT32, AcpiGbl_OriginalMode);
-ACPI_GLOBAL (UINT32, AcpiGbl_RsdpOriginalLocation);
ACPI_GLOBAL (UINT32, AcpiGbl_NsLookupCount);
ACPI_GLOBAL (UINT32, AcpiGbl_PsFindCount);
ACPI_GLOBAL (UINT16, AcpiGbl_Pm1EnableRegisterSave);
*
****************************************************************************/
-ACPI_GLOBAL (UINT8, AcpiGbl_DbOutputFlags);
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DbOutputFlags, ACPI_DB_CONSOLE_OUTPUT);
#ifdef ACPI_DISASSEMBLER
ACPI_INIT_GLOBAL (UINT8, AcpiGbl_NoResourceDisassembly, FALSE);
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_IgnoreNoopOperator, FALSE);
+ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_CstyleDisassembly, TRUE);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_disasm);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_verbose);
ACPI_GLOBAL (UINT32, AcpiGbl_NumNodes);
ACPI_GLOBAL (UINT32, AcpiGbl_NumObjects);
-ACPI_GLOBAL (UINT32, AcpiGbl_SizeOfParseTree);
-ACPI_GLOBAL (UINT32, AcpiGbl_SizeOfMethodTrees);
-ACPI_GLOBAL (UINT32, AcpiGbl_SizeOfNodeEntries);
-ACPI_GLOBAL (UINT32, AcpiGbl_SizeOfAcpiObjects);
-
#endif /* ACPI_DEBUGGER */
#ifdef ACPI_APPLICATION
ACPI_INIT_GLOBAL (ACPI_FILE, AcpiGbl_DebugFile, NULL);
+ACPI_INIT_GLOBAL (ACPI_FILE, AcpiGbl_OutputFile, NULL);
+
+/* Print buffer */
+
+ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_PrintLock); /* For print buffer */
+ACPI_GLOBAL (char, AcpiGbl_PrintBuffer[1024]);
#endif /* ACPI_APPLICATION */
UINT32 FieldBitPosition;
UINT32 FieldBitLength;
UINT16 ResourceLength;
+ UINT16 PinNumberIndex;
UINT8 FieldFlags;
UINT8 Attribute;
UINT8 FieldType;
{
ACPI_GENERIC_ADDRESS StatusAddress; /* Address of status reg */
ACPI_GENERIC_ADDRESS EnableAddress; /* Address of enable reg */
+ UINT16 BaseGpeNumber; /* Base GPE number for this register */
UINT8 EnableForWake; /* GPEs to keep enabled when sleeping */
UINT8 EnableForRun; /* GPEs to keep enabled when running */
- UINT8 BaseGpeNumber; /* Base GPE number for this register */
} ACPI_GPE_REGISTER_INFO;
struct acpi_gpe_xrupt_info *XruptBlock; /* Backpointer to interrupt block */
ACPI_GPE_REGISTER_INFO *RegisterInfo; /* One per GPE register pair */
ACPI_GPE_EVENT_INFO *EventInfo; /* One for each GPE */
- ACPI_GENERIC_ADDRESS BlockAddress; /* Base address of the block */
+ UINT64 Address; /* Base address of the block */
UINT32 RegisterCount; /* Number of register pairs in block */
UINT16 GpeCount; /* Number of individual GPEs in block */
- UINT8 BlockBaseNumber;/* Base GPE number for this block */
+ UINT16 BlockBaseNumber;/* Base GPE number for this block */
+ UINT8 SpaceId;
BOOLEAN Initialized; /* TRUE if this block is initialized */
} ACPI_GPE_BLOCK_INFO;
ACPI_DISASM_ONLY_MEMBERS (\
UINT8 DisasmFlags; /* Used during AML disassembly */\
UINT8 DisasmOpcode; /* Subtype used for disassembly */\
+ char *OperatorSymbol;/* Used for C-style operator name strings */\
char AmlOpName[16]) /* Op name (debug only) */
#define ACPI_DASM_STRING 0x02 /* Buffer is a ASCII string */
#define ACPI_DASM_UNICODE 0x03 /* Buffer is a Unicode string */
#define ACPI_DASM_PLD_METHOD 0x04 /* Buffer is a _PLD method bit-packed buffer */
-#define ACPI_DASM_EISAID 0x05 /* Integer is an EISAID */
-#define ACPI_DASM_MATCHOP 0x06 /* Parent opcode is a Match() operator */
-#define ACPI_DASM_LNOT_PREFIX 0x07 /* Start of a LNotEqual (etc.) pair of opcodes */
-#define ACPI_DASM_LNOT_SUFFIX 0x08 /* End of a LNotEqual (etc.) pair of opcodes */
-#define ACPI_DASM_HID_STRING 0x09 /* String is a _HID or _CID */
-#define ACPI_DASM_IGNORE 0x0A /* Not used at this time */
+#define ACPI_DASM_UUID 0x05 /* Buffer is a UUID/GUID */
+#define ACPI_DASM_EISAID 0x06 /* Integer is an EISAID */
+#define ACPI_DASM_MATCHOP 0x07 /* Parent opcode is a Match() operator */
+#define ACPI_DASM_LNOT_PREFIX 0x08 /* Start of a LNotEqual (etc.) pair of opcodes */
+#define ACPI_DASM_LNOT_SUFFIX 0x09 /* End of a LNotEqual (etc.) pair of opcodes */
+#define ACPI_DASM_HID_STRING 0x0A /* String is a _HID or _CID */
+#define ACPI_DASM_IGNORE 0x0B /* Not used at this time */
/*
* Generic operation (for example: If, While, Store)
#define ACPI_PARSEOP_EMPTY_TERMLIST 0x04
#define ACPI_PARSEOP_PREDEF_CHECKED 0x08
#define ACPI_PARSEOP_SPECIAL 0x10
+#define ACPI_PARSEOP_COMPOUND 0x20
+#define ACPI_PARSEOP_ASSIGNMENT 0x40
/*****************************************************************************
} AH_DEVICE_ID;
+typedef struct ah_uuid
+{
+ char *Description;
+ char *String;
+
+} AH_UUID;
+
#endif /* __ACLOCAL_H__ */
#define METHOD_NAME__CBA "_CBA"
#define METHOD_NAME__CID "_CID"
#define METHOD_NAME__CRS "_CRS"
+#define METHOD_NAME__DDN "_DDN"
#define METHOD_NAME__HID "_HID"
#define METHOD_NAME__INI "_INI"
#define METHOD_NAME__PLD "_PLD"
+#define METHOD_NAME__DSD "_DSD"
#define METHOD_NAME__PRS "_PRS"
#define METHOD_NAME__PRT "_PRT"
#define METHOD_NAME__PRW "_PRW"
+#define METHOD_NAME__PS0 "_PS0"
+#define METHOD_NAME__PS1 "_PS1"
+#define METHOD_NAME__PS2 "_PS2"
+#define METHOD_NAME__PS3 "_PS3"
#define METHOD_NAME__REG "_REG"
#define METHOD_NAME__SB_ "_SB_"
#define METHOD_NAME__SEG "_SEG"
UINT16 ResourceLength;
union acpi_operand_object *RegionObj; /* Containing OpRegion object */
UINT8 *ResourceBuffer; /* ResourceTemplate for serial regions/fields */
+ UINT16 PinNumberIndex; /* Index relative to previous Connection/Template */
} ACPI_OBJECT_REGION_FIELD;
*
*****************************************************************************/
-
#ifndef __ACPARSER_H__
#define __ACPARSER_H__
#include "acrestyp.h" /* Resource Descriptor structs */
#include "acpiosxf.h" /* OSL interfaces (ACPICA-to-OS) */
#include "acpixf.h" /* ACPI core subsystem external interfaces */
-#ifdef ACPI_NATIVE_INTERFACE_HEADER
-#include ACPI_NATIVE_INTERFACE_HEADER
-#endif
+#include "platform/acenvex.h" /* Extra environment-specific items */
#endif /* __ACPI_H__ */
#endif
+/*
+ * File I/O and related support
+ */
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsOpenFile
+ACPI_FILE
+AcpiOsOpenFile (
+ const char *Path,
+ UINT8 Modes);
+#endif
+
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCloseFile
+void
+AcpiOsCloseFile (
+ ACPI_FILE File);
+#endif
+
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadFile
+int
+AcpiOsReadFile (
+ ACPI_FILE File,
+ void *Buffer,
+ ACPI_SIZE Size,
+ ACPI_SIZE Count);
+#endif
+
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWriteFile
+int
+AcpiOsWriteFile (
+ ACPI_FILE File,
+ void *Buffer,
+ ACPI_SIZE Size,
+ ACPI_SIZE Count);
+#endif
+
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetFileOffset
+long
+AcpiOsGetFileOffset (
+ ACPI_FILE File);
+#endif
+
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsSetFileOffset
+ACPI_STATUS
+AcpiOsSetFileOffset (
+ ACPI_FILE File,
+ long Offset,
+ UINT8 From);
+#endif
+
+
#endif /* __ACPIOSXF_H__ */
*
*****************************************************************************/
-
#ifndef __ACXFACE_H__
#define __ACXFACE_H__
/* Current ACPICA subsystem version in YYYYMMDD format */
-#define ACPI_CA_VERSION 0x20140325
+#define ACPI_CA_VERSION 0x20141107
#include "acconfig.h"
#include "actypes.h"
#include "actbl.h"
#include "acbuffer.h"
+
+/*****************************************************************************
+ *
+ * Macros used for ACPICA globals and configuration
+ *
+ ****************************************************************************/
+
+/*
+ * Ensure that global variables are defined and initialized only once.
+ *
+ * The use of these macros allows for a single list of globals (here)
+ * in order to simplify maintenance of the code.
+ */
+#ifdef DEFINE_ACPI_GLOBALS
+#define ACPI_GLOBAL(type,name) \
+ extern type name; \
+ type name
+
+#define ACPI_INIT_GLOBAL(type,name,value) \
+ type name=value
+
+#else
+#ifndef ACPI_GLOBAL
+#define ACPI_GLOBAL(type,name) \
+ extern type name
+#endif
+
+#ifndef ACPI_INIT_GLOBAL
+#define ACPI_INIT_GLOBAL(type,name,value) \
+ extern type name
+#endif
+#endif
+
/*
- * Globals that are publically available
+ * These macros configure the various ACPICA interfaces. They are
+ * useful for generating stub inline functions for features that are
+ * configured out of the current kernel or ACPICA application.
*/
-extern UINT32 AcpiCurrentGpeCount;
-extern ACPI_TABLE_FADT AcpiGbl_FADT;
-extern BOOLEAN AcpiGbl_SystemAwakeAndRunning;
-extern BOOLEAN AcpiGbl_ReducedHardware; /* ACPI 5.0 */
-extern UINT8 AcpiGbl_OsiData;
+#ifndef ACPI_EXTERNAL_RETURN_STATUS
+#define ACPI_EXTERNAL_RETURN_STATUS(Prototype) \
+ Prototype;
+#endif
+
+#ifndef ACPI_EXTERNAL_RETURN_OK
+#define ACPI_EXTERNAL_RETURN_OK(Prototype) \
+ Prototype;
+#endif
+
+#ifndef ACPI_EXTERNAL_RETURN_VOID
+#define ACPI_EXTERNAL_RETURN_VOID(Prototype) \
+ Prototype;
+#endif
+
+#ifndef ACPI_EXTERNAL_RETURN_UINT32
+#define ACPI_EXTERNAL_RETURN_UINT32(Prototype) \
+ Prototype;
+#endif
+
+#ifndef ACPI_EXTERNAL_RETURN_PTR
+#define ACPI_EXTERNAL_RETURN_PTR(Prototype) \
+ Prototype;
+#endif
-/* Runtime configuration of debug print levels */
-extern UINT32 AcpiDbgLevel;
-extern UINT32 AcpiDbgLayer;
+/*****************************************************************************
+ *
+ * Public globals and runtime configuration options
+ *
+ ****************************************************************************/
-/* ACPICA runtime options */
+/*
+ * Enable "slack mode" of the AML interpreter? Default is FALSE, and the
+ * interpreter strictly follows the ACPI specification. Setting to TRUE
+ * allows the interpreter to ignore certain errors and/or bad AML constructs.
+ *
+ * Currently, these features are enabled by this flag:
+ *
+ * 1) Allow "implicit return" of last value in a control method
+ * 2) Allow access beyond the end of an operation region
+ * 3) Allow access to uninitialized locals/args (auto-init to integer 0)
+ * 4) Allow ANY object type to be a source operand for the Store() operator
+ * 5) Allow unresolved references (invalid target name) in package objects
+ * 6) Enable warning messages for behavior that is not ACPI spec compliant
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_EnableInterpreterSlack, FALSE);
-extern UINT8 AcpiGbl_AutoSerializeMethods;
-extern UINT8 AcpiGbl_CopyDsdtLocally;
-extern UINT8 AcpiGbl_CreateOsiMethod;
-extern UINT8 AcpiGbl_DisableAutoRepair;
-extern UINT8 AcpiGbl_DisableSsdtTableInstall;
-extern UINT8 AcpiGbl_DoNotUseXsdt;
-extern UINT8 AcpiGbl_EnableAmlDebugObject;
-extern UINT8 AcpiGbl_EnableInterpreterSlack;
-extern UINT32 AcpiGbl_TraceFlags;
-extern ACPI_NAME AcpiGbl_TraceMethodName;
-extern UINT8 AcpiGbl_TruncateIoAddresses;
-extern UINT8 AcpiGbl_Use32BitFadtAddresses;
-extern UINT8 AcpiGbl_UseDefaultRegisterWidths;
+/*
+ * Automatically serialize all methods that create named objects? Default
+ * is TRUE, meaning that all NonSerialized methods are scanned once at
+ * table load time to determine those that create named objects. Methods
+ * that create named objects are marked Serialized in order to prevent
+ * possible run-time problems if they are entered by more than one thread.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_AutoSerializeMethods, TRUE);
+/*
+ * Create the predefined _OSI method in the namespace? Default is TRUE
+ * because ACPICA is fully compatible with other ACPI implementations.
+ * Changing this will revert ACPICA (and machine ASL) to pre-OSI behavior.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_CreateOsiMethod, TRUE);
/*
- * Hardware-reduced prototypes. All interfaces that use these macros will
- * be configured out of the ACPICA build if the ACPI_REDUCED_HARDWARE flag
+ * Optionally use default values for the ACPI register widths. Set this to
+ * TRUE to use the defaults, if an FADT contains incorrect widths/lengths.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_UseDefaultRegisterWidths, TRUE);
+
+/*
+ * Whether or not to verify the table checksum before installation. Set
+ * this to TRUE to verify the table checksum before install it to the table
+ * manager. Note that enabling this option causes errors to happen in some
+ * OSPMs during early initialization stages. Default behavior is to do such
+ * verification.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_VerifyTableChecksum, TRUE);
+
+/*
+ * Optionally enable output from the AML Debug Object.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_EnableAmlDebugObject, FALSE);
+
+/*
+ * Optionally copy the entire DSDT to local memory (instead of simply
+ * mapping it.) There are some BIOSs that corrupt or replace the original
+ * DSDT, creating the need for this option. Default is FALSE, do not copy
+ * the DSDT.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_CopyDsdtLocally, FALSE);
+
+/*
+ * Optionally ignore an XSDT if present and use the RSDT instead.
+ * Although the ACPI specification requires that an XSDT be used instead
+ * of the RSDT, the XSDT has been found to be corrupt or ill-formed on
+ * some machines. Default behavior is to use the XSDT if present.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DoNotUseXsdt, FALSE);
+
+/*
+ * Optionally use 32-bit FADT addresses if and when there is a conflict
+ * (address mismatch) between the 32-bit and 64-bit versions of the
+ * address. Although ACPICA adheres to the ACPI specification which
+ * requires the use of the corresponding 64-bit address if it is non-zero,
+ * some machines have been found to have a corrupted non-zero 64-bit
+ * address. Default is FALSE, do not favor the 32-bit addresses.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_Use32BitFadtAddresses, FALSE);
+
+/*
+ * Optionally truncate I/O addresses to 16 bits. Provides compatibility
+ * with other ACPI implementations. NOTE: During ACPICA initialization,
+ * this value is set to TRUE if any Windows OSI strings have been
+ * requested by the BIOS.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_TruncateIoAddresses, FALSE);
+
+/*
+ * Disable runtime checking and repair of values returned by control methods.
+ * Use only if the repair is causing a problem on a particular machine.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DisableAutoRepair, FALSE);
+
+/*
+ * Optionally do not install any SSDTs from the RSDT/XSDT during initialization.
+ * This can be useful for debugging ACPI problems on some machines.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DisableSsdtTableInstall, FALSE);
+
+/*
+ * We keep track of the latest version of Windows that has been requested by
+ * the BIOS. ACPI 5.0.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_OsiData, 0);
+
+/*
+ * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning
+ * that the ACPI hardware is no longer required. A flag in the FADT indicates
+ * a reduced HW machine, and that flag is duplicated here for convenience.
+ */
+ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_ReducedHardware, FALSE);
+
+/*
+ * This mechanism is used to trace a specified AML method. The method is
+ * traced each time it is executed.
+ */
+ACPI_INIT_GLOBAL (UINT32, AcpiGbl_TraceFlags, 0);
+ACPI_INIT_GLOBAL (ACPI_NAME, AcpiGbl_TraceMethodName, 0);
+
+/*
+ * Runtime configuration of debug output control masks. We want the debug
+ * switches statically initialized so they are already set when the debugger
+ * is entered.
+ */
+#ifdef ACPI_DEBUG_OUTPUT
+ACPI_INIT_GLOBAL (UINT32, AcpiDbgLevel, ACPI_DEBUG_DEFAULT);
+#else
+ACPI_INIT_GLOBAL (UINT32, AcpiDbgLevel, ACPI_NORMAL_DEFAULT);
+#endif
+ACPI_INIT_GLOBAL (UINT32, AcpiDbgLayer, ACPI_COMPONENT_DEFAULT);
+
+/*
+ * Other miscellaneous globals
+ */
+ACPI_GLOBAL (ACPI_TABLE_FADT, AcpiGbl_FADT);
+ACPI_GLOBAL (UINT32, AcpiCurrentGpeCount);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_SystemAwakeAndRunning);
+
+
+/*****************************************************************************
+ *
+ * ACPICA public interface configuration.
+ *
+ * Interfaces that are configured out of the ACPICA build are replaced
+ * by inlined stubs by default.
+ *
+ ****************************************************************************/
+
+/*
+ * Hardware-reduced prototypes (default: Not hardware reduced).
+ *
+ * All ACPICA hardware-related interfaces that use these macros will be
+ * configured out of the ACPICA build if the ACPI_REDUCED_HARDWARE flag
* is set to TRUE.
+ *
+ * Note: This static build option for reduced hardware is intended to
+ * reduce ACPICA code size if desired or necessary. However, even if this
+ * option is not specified, the runtime behavior of ACPICA is dependent
+ * on the actual FADT reduced hardware flag (HW_REDUCED_ACPI). If set,
+ * the flag will enable similar behavior -- ACPICA will not attempt
+ * to access any ACPI-relate hardware (SCI, GPEs, Fixed Events, etc.)
*/
#if (!ACPI_REDUCED_HARDWARE)
#define ACPI_HW_DEPENDENT_RETURN_STATUS(Prototype) \
- Prototype;
+ ACPI_EXTERNAL_RETURN_STATUS(Prototype)
#define ACPI_HW_DEPENDENT_RETURN_OK(Prototype) \
- Prototype;
+ ACPI_EXTERNAL_RETURN_OK(Prototype)
#define ACPI_HW_DEPENDENT_RETURN_VOID(Prototype) \
- Prototype;
+ ACPI_EXTERNAL_RETURN_VOID(Prototype)
#else
#define ACPI_HW_DEPENDENT_RETURN_STATUS(Prototype) \
#endif /* !ACPI_REDUCED_HARDWARE */
+/*
+ * Error message prototypes (default: error messages enabled).
+ *
+ * All interfaces related to error and warning messages
+ * will be configured out of the ACPICA build if the
+ * ACPI_NO_ERROR_MESSAGE flag is defined.
+ */
+#ifndef ACPI_NO_ERROR_MESSAGES
+#define ACPI_MSG_DEPENDENT_RETURN_VOID(Prototype) \
+ Prototype;
+
+#else
+#define ACPI_MSG_DEPENDENT_RETURN_VOID(Prototype) \
+ static ACPI_INLINE Prototype {return;}
+
+#endif /* ACPI_NO_ERROR_MESSAGES */
+
+
+/*
+ * Debugging output prototypes (default: no debug output).
+ *
+ * All interfaces related to debug output messages
+ * will be configured out of the ACPICA build unless the
+ * ACPI_DEBUG_OUTPUT flag is defined.
+ */
+#ifdef ACPI_DEBUG_OUTPUT
+#define ACPI_DBG_DEPENDENT_RETURN_VOID(Prototype) \
+ Prototype;
+
+#else
+#define ACPI_DBG_DEPENDENT_RETURN_VOID(Prototype) \
+ static ACPI_INLINE Prototype {return;}
+
+#endif /* ACPI_DEBUG_OUTPUT */
+
+
+/*
+ * Application prototypes
+ *
+ * All interfaces used by application will be configured
+ * out of the ACPICA build unless the ACPI_APPLICATION
+ * flag is defined.
+ */
+#ifdef ACPI_APPLICATION
+#define ACPI_APP_DEPENDENT_RETURN_VOID(Prototype) \
+ Prototype;
+
+#else
+#define ACPI_APP_DEPENDENT_RETURN_VOID(Prototype) \
+ static ACPI_INLINE Prototype {return;}
+
+#endif /* ACPI_APPLICATION */
+
+
+/*****************************************************************************
+ *
+ * ACPICA public interface prototypes
+ *
+ ****************************************************************************/
+
/*
* Initialization
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInitializeTables (
ACPI_TABLE_DESC *InitialStorage,
UINT32 InitialTableCount,
- BOOLEAN AllowResize);
+ BOOLEAN AllowResize))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInitializeSubsystem (
- void);
+ void))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiEnableSubsystem (
- UINT32 Flags);
+ UINT32 Flags))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInitializeObjects (
- UINT32 Flags);
+ UINT32 Flags))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiTerminate (
- void);
+ void))
/*
AcpiDisable (
void))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiSubsystemStatus (
- void);
+ void))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetSystemInfo (
- ACPI_BUFFER *RetBuffer);
+ ACPI_BUFFER *RetBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetStatistics (
- ACPI_STATISTICS *Stats);
+ ACPI_STATISTICS *Stats))
+ACPI_EXTERNAL_RETURN_PTR (
const char *
AcpiFormatException (
- ACPI_STATUS Exception);
+ ACPI_STATUS Exception))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiPurgeCachedObjects (
- void);
+ void))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallInterface (
- ACPI_STRING InterfaceName);
+ ACPI_STRING InterfaceName))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiRemoveInterface (
- ACPI_STRING InterfaceName);
+ ACPI_STRING InterfaceName))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiUpdateInterfaces (
- UINT8 Action);
+ UINT8 Action))
+ACPI_EXTERNAL_RETURN_UINT32 (
UINT32
AcpiCheckAddressRange (
ACPI_ADR_SPACE_TYPE SpaceId,
ACPI_PHYSICAL_ADDRESS Address,
ACPI_SIZE Length,
- BOOLEAN Warn);
+ BOOLEAN Warn))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiDecodePldBuffer (
UINT8 *InBuffer,
ACPI_SIZE Length,
- ACPI_PLD_INFO **ReturnBuffer);
+ ACPI_PLD_INFO **ReturnBuffer))
/*
* ACPI table load/unload interfaces
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallTable (
ACPI_PHYSICAL_ADDRESS Address,
- BOOLEAN Physical);
+ BOOLEAN Physical))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiLoadTable (
- ACPI_TABLE_HEADER *Table);
+ ACPI_TABLE_HEADER *Table))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiUnloadParentTable (
- ACPI_HANDLE Object);
+ ACPI_HANDLE Object))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiLoadTables (
- void);
+ void))
/*
* ACPI table manipulation interfaces
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiReallocateRootTable (
- void);
+ void))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiFindRootPointer (
- ACPI_SIZE *RsdpAddress);
+ ACPI_SIZE *RsdpAddress))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetTableHeader (
ACPI_STRING Signature,
UINT32 Instance,
- ACPI_TABLE_HEADER *OutTableHeader);
+ ACPI_TABLE_HEADER *OutTableHeader))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetTable (
ACPI_STRING Signature,
UINT32 Instance,
- ACPI_TABLE_HEADER **OutTable);
+ ACPI_TABLE_HEADER **OutTable))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetTableByIndex (
UINT32 TableIndex,
- ACPI_TABLE_HEADER **OutTable);
+ ACPI_TABLE_HEADER **OutTable))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallTableHandler (
ACPI_TABLE_HANDLER Handler,
- void *Context);
+ void *Context))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiRemoveTableHandler (
- ACPI_TABLE_HANDLER Handler);
+ ACPI_TABLE_HANDLER Handler))
/*
* Namespace and name interfaces
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiWalkNamespace (
ACPI_OBJECT_TYPE Type,
ACPI_WALK_CALLBACK DescendingCallback,
ACPI_WALK_CALLBACK AscendingCallback,
void *Context,
- void **ReturnValue);
+ void **ReturnValue))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetDevices (
char *HID,
ACPI_WALK_CALLBACK UserFunction,
void *Context,
- void **ReturnValue);
+ void **ReturnValue))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetName (
ACPI_HANDLE Object,
UINT32 NameType,
- ACPI_BUFFER *RetPathPtr);
+ ACPI_BUFFER *RetPathPtr))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetHandle (
ACPI_HANDLE Parent,
ACPI_STRING Pathname,
- ACPI_HANDLE *RetHandle);
+ ACPI_HANDLE *RetHandle))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiAttachData (
ACPI_HANDLE Object,
ACPI_OBJECT_HANDLER Handler,
- void *Data);
+ void *Data))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiDetachData (
ACPI_HANDLE Object,
- ACPI_OBJECT_HANDLER Handler);
+ ACPI_OBJECT_HANDLER Handler))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetData (
ACPI_HANDLE Object,
ACPI_OBJECT_HANDLER Handler,
- void **Data);
+ void **Data))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiDebugTrace (
char *Name,
UINT32 DebugLevel,
UINT32 DebugLayer,
- UINT32 Flags);
+ UINT32 Flags))
/*
* Object manipulation and enumeration
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiEvaluateObject (
ACPI_HANDLE Object,
ACPI_STRING Pathname,
ACPI_OBJECT_LIST *ParameterObjects,
- ACPI_BUFFER *ReturnObjectBuffer);
+ ACPI_BUFFER *ReturnObjectBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiEvaluateObjectTyped (
ACPI_HANDLE Object,
ACPI_STRING Pathname,
ACPI_OBJECT_LIST *ExternalParams,
ACPI_BUFFER *ReturnBuffer,
- ACPI_OBJECT_TYPE ReturnType);
+ ACPI_OBJECT_TYPE ReturnType))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetObjectInfo (
ACPI_HANDLE Object,
- ACPI_DEVICE_INFO **ReturnBuffer);
+ ACPI_DEVICE_INFO **ReturnBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallMethod (
- UINT8 *Buffer);
+ UINT8 *Buffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetNextObject (
ACPI_OBJECT_TYPE Type,
ACPI_HANDLE Parent,
ACPI_HANDLE Child,
- ACPI_HANDLE *OutHandle);
+ ACPI_HANDLE *OutHandle))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetType (
ACPI_HANDLE Object,
- ACPI_OBJECT_TYPE *OutType);
+ ACPI_OBJECT_TYPE *OutType))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetParent (
ACPI_HANDLE Object,
- ACPI_HANDLE *OutHandle);
+ ACPI_HANDLE *OutHandle))
/*
* Handler interfaces
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallInitializationHandler (
ACPI_INIT_HANDLER Handler,
- UINT32 Function);
+ UINT32 Function))
ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
UINT32 GpeNumber,
ACPI_GPE_HANDLER Address))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallNotifyHandler (
ACPI_HANDLE Device,
UINT32 HandlerType,
ACPI_NOTIFY_HANDLER Handler,
- void *Context);
+ void *Context))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiRemoveNotifyHandler (
ACPI_HANDLE Device,
UINT32 HandlerType,
- ACPI_NOTIFY_HANDLER Handler);
+ ACPI_NOTIFY_HANDLER Handler))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallAddressSpaceHandler (
ACPI_HANDLE Device,
ACPI_ADR_SPACE_TYPE SpaceId,
ACPI_ADR_SPACE_HANDLER Handler,
ACPI_ADR_SPACE_SETUP Setup,
- void *Context);
+ void *Context))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiRemoveAddressSpaceHandler (
ACPI_HANDLE Device,
ACPI_ADR_SPACE_TYPE SpaceId,
- ACPI_ADR_SPACE_HANDLER Handler);
+ ACPI_ADR_SPACE_HANDLER Handler))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallExceptionHandler (
- ACPI_EXCEPTION_HANDLER Handler);
+ ACPI_EXCEPTION_HANDLER Handler))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallInterfaceHandler (
- ACPI_INTERFACE_HANDLER Handler);
+ ACPI_INTERFACE_HANDLER Handler))
/*
/*
* Interfaces to AML mutex objects
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiAcquireMutex (
ACPI_HANDLE Handle,
ACPI_STRING Pathname,
- UINT16 Timeout);
+ UINT16 Timeout))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiReleaseMutex (
ACPI_HANDLE Handle,
- ACPI_STRING Pathname);
+ ACPI_STRING Pathname))
/*
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber))
+ACPI_HW_DEPENDENT_RETURN_STATUS (
+ACPI_STATUS
+AcpiMarkGpeForWake (
+ ACPI_HANDLE GpeDevice,
+ UINT32 GpeNumber))
+
ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiSetupGpeForWake (
ACPI_RESOURCE *Resource,
void *Context);
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetVendorResource (
ACPI_HANDLE Device,
char *Name,
ACPI_VENDOR_UUID *Uuid,
- ACPI_BUFFER *RetBuffer);
+ ACPI_BUFFER *RetBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetCurrentResources (
ACPI_HANDLE Device,
- ACPI_BUFFER *RetBuffer);
+ ACPI_BUFFER *RetBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetPossibleResources (
ACPI_HANDLE Device,
- ACPI_BUFFER *RetBuffer);
+ ACPI_BUFFER *RetBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetEventResources (
ACPI_HANDLE DeviceHandle,
- ACPI_BUFFER *RetBuffer);
+ ACPI_BUFFER *RetBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiWalkResourceBuffer (
ACPI_BUFFER *Buffer,
ACPI_WALK_RESOURCE_CALLBACK UserFunction,
- void *Context);
+ void *Context))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiWalkResources (
ACPI_HANDLE Device,
char *Name,
ACPI_WALK_RESOURCE_CALLBACK UserFunction,
- void *Context);
+ void *Context))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiSetCurrentResources (
ACPI_HANDLE Device,
- ACPI_BUFFER *InBuffer);
+ ACPI_BUFFER *InBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetIrqRoutingTable (
ACPI_HANDLE Device,
- ACPI_BUFFER *RetBuffer);
+ ACPI_BUFFER *RetBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiResourceToAddress64 (
ACPI_RESOURCE *Resource,
- ACPI_RESOURCE_ADDRESS64 *Out);
+ ACPI_RESOURCE_ADDRESS64 *Out))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiBufferToResource (
UINT8 *AmlBuffer,
UINT16 AmlBufferLength,
- ACPI_RESOURCE **ResourcePtr);
+ ACPI_RESOURCE **ResourcePtr))
/*
* Hardware (ACPI device) interfaces
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiReset (
- void);
+ void))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiRead (
UINT64 *Value,
- ACPI_GENERIC_ADDRESS *Reg);
+ ACPI_GENERIC_ADDRESS *Reg))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiWrite (
UINT64 Value,
- ACPI_GENERIC_ADDRESS *Reg);
+ ACPI_GENERIC_ADDRESS *Reg))
ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
/*
* Sleep/Wake interfaces
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetSleepTypeData (
UINT8 SleepState,
UINT8 *Slp_TypA,
- UINT8 *Slp_TypB);
+ UINT8 *Slp_TypB))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiEnterSleepStatePrep (
- UINT8 SleepState);
+ UINT8 SleepState))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiEnterSleepState (
- UINT8 SleepState);
+ UINT8 SleepState))
ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiEnterSleepStateS4bios (
void))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiLeaveSleepStatePrep (
- UINT8 SleepState);
+ UINT8 SleepState))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiLeaveSleepState (
- UINT8 SleepState);
+ UINT8 SleepState))
ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
/*
* Error/Warning output
*/
+ACPI_MSG_DEPENDENT_RETURN_VOID (
ACPI_PRINTF_LIKE(3)
void ACPI_INTERNAL_VAR_XFACE
AcpiError (
const char *ModuleName,
UINT32 LineNumber,
const char *Format,
- ...);
+ ...))
+ACPI_MSG_DEPENDENT_RETURN_VOID (
ACPI_PRINTF_LIKE(4)
void ACPI_INTERNAL_VAR_XFACE
AcpiException (
UINT32 LineNumber,
ACPI_STATUS Status,
const char *Format,
- ...);
+ ...))
+ACPI_MSG_DEPENDENT_RETURN_VOID (
ACPI_PRINTF_LIKE(3)
void ACPI_INTERNAL_VAR_XFACE
AcpiWarning (
const char *ModuleName,
UINT32 LineNumber,
const char *Format,
- ...);
+ ...))
+ACPI_MSG_DEPENDENT_RETURN_VOID (
ACPI_PRINTF_LIKE(3)
void ACPI_INTERNAL_VAR_XFACE
AcpiInfo (
const char *ModuleName,
UINT32 LineNumber,
const char *Format,
- ...);
+ ...))
+ACPI_MSG_DEPENDENT_RETURN_VOID (
ACPI_PRINTF_LIKE(3)
void ACPI_INTERNAL_VAR_XFACE
AcpiBiosError (
const char *ModuleName,
UINT32 LineNumber,
const char *Format,
- ...);
+ ...))
+ACPI_MSG_DEPENDENT_RETURN_VOID (
ACPI_PRINTF_LIKE(3)
void ACPI_INTERNAL_VAR_XFACE
AcpiBiosWarning (
const char *ModuleName,
UINT32 LineNumber,
const char *Format,
- ...);
+ ...))
/*
* Debug output
*/
-#ifdef ACPI_DEBUG_OUTPUT
-
+ACPI_DBG_DEPENDENT_RETURN_VOID (
ACPI_PRINTF_LIKE(6)
void ACPI_INTERNAL_VAR_XFACE
AcpiDebugPrint (
const char *ModuleName,
UINT32 ComponentId,
const char *Format,
- ...);
+ ...))
+ACPI_DBG_DEPENDENT_RETURN_VOID (
ACPI_PRINTF_LIKE(6)
void ACPI_INTERNAL_VAR_XFACE
AcpiDebugPrintRaw (
const char *ModuleName,
UINT32 ComponentId,
const char *Format,
- ...);
-#endif
+ ...))
+
+ACPI_APP_DEPENDENT_RETURN_VOID (
+ACPI_PRINTF_LIKE(1)
+void ACPI_INTERNAL_VAR_XFACE
+AcpiLogError (
+ const char *Format,
+ ...))
#endif /* __ACXFACE_H__ */
* count = 0 (optional)
* (Used for _DLM)
*
+ * ACPI_PTYPE2_UUID_PAIR: Each subpackage is preceded by a UUID Buffer. The UUID
+ * defines the format of the package. Zero-length parent package is
+ * allowed.
+ * (Used for _DSD)
+ *
*****************************************************************************/
enum AcpiReturnPackageTypes
ACPI_PTYPE2_FIXED = 7,
ACPI_PTYPE2_MIN = 8,
ACPI_PTYPE2_REV_FIXED = 9,
- ACPI_PTYPE2_FIX_VAR = 10
+ ACPI_PTYPE2_FIX_VAR = 10,
+ ACPI_PTYPE2_UUID_PAIR = 11
};
{{"_CBA", METHOD_0ARGS,
METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, /* See PCI firmware spec 3.0 */
+ {{"_CCA", METHOD_0ARGS,
+ METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, /* ACPI 5.1 */
+
{{"_CDM", METHOD_0ARGS,
METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
{{"_DOS", METHOD_1ARGS (ACPI_TYPE_INTEGER),
METHOD_NO_RETURN_VALUE}},
+ {{"_DSD", METHOD_0ARGS,
+ METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Pkgs) each: 1 Buf, 1 Pkg */
+ PACKAGE_INFO (ACPI_PTYPE2_UUID_PAIR, ACPI_RTYPE_BUFFER, 1, ACPI_RTYPE_PACKAGE, 1,0),
+
{{"_DSM", METHOD_4ARGS (ACPI_TYPE_BUFFER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_PACKAGE),
METHOD_RETURNS (ACPI_RTYPE_ALL)}}, /* Must return a value, but it can be of any type */
{{"_LID", METHOD_0ARGS,
METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
+ {{"_LPD", METHOD_0ARGS,
+ METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (1 Int(rev), n Pkg (2 Int) */
+ PACKAGE_INFO (ACPI_PTYPE2_REV_FIXED, ACPI_RTYPE_INTEGER, 2,0,0,0),
+
{{"_MAT", METHOD_0ARGS,
METHOD_RETURNS (ACPI_RTYPE_BUFFER)}},
METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Refs) */
PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0),
- {{"_PRP", METHOD_0ARGS,
- METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Pkgs) each: 1 Str, 1 Int/Str/Pkg */
- PACKAGE_INFO (ACPI_PTYPE2, ACPI_RTYPE_STRING, 1,
- ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING |
- ACPI_RTYPE_PACKAGE | ACPI_RTYPE_REFERENCE, 1,0),
-
{{"_PRS", METHOD_0ARGS,
METHOD_RETURNS (ACPI_RTYPE_BUFFER)}},
/*
* tbxfroot - Root pointer utilities
*/
+UINT32
+AcpiTbGetRsdpLength (
+ ACPI_TABLE_RSDP *Rsdp);
+
ACPI_STATUS
AcpiTbValidateRsdp (
ACPI_TABLE_RSDP *Rsdp);
AcpiTbReleaseTempTable (
ACPI_TABLE_DESC *TableDesc);
+ACPI_STATUS
+AcpiTbValidateTempTable (
+ ACPI_TABLE_DESC *TableDesc);
+
+ACPI_STATUS
+AcpiTbVerifyTempTable (
+ ACPI_TABLE_DESC *TableDesc,
+ char *Signature);
+
BOOLEAN
AcpiTbIsTableLoaded (
UINT32 TableIndex);
AcpiTbInvalidateTable (
ACPI_TABLE_DESC *TableDesc);
-ACPI_STATUS
-AcpiTbVerifyTable (
- ACPI_TABLE_DESC *TableDesc,
- char *Signature);
-
void
AcpiTbOverrideTable (
ACPI_TABLE_DESC *OldTableDesc);
UINT32 Flags; /* Miscellaneous flag bits (see below for individual flags) */
ACPI_GENERIC_ADDRESS ResetRegister; /* 64-bit address of the Reset register */
UINT8 ResetValue; /* Value to write to the ResetRegister port to reset the system */
- UINT8 Reserved4[3]; /* Reserved, must be zero */
+ UINT16 ArmBootFlags; /* ARM-Specific Boot Flags (see below for individual flags) (ACPI 5.1) */
+ UINT8 MinorRevision; /* FADT Minor Revision (ACPI 5.1) */
UINT64 XFacs; /* 64-bit physical address of FACS */
UINT64 XDsdt; /* 64-bit physical address of DSDT */
ACPI_GENERIC_ADDRESS XPm1aEventBlock; /* 64-bit Extended Power Mgt 1a Event Reg Blk address */
} ACPI_TABLE_FADT;
-/* Masks for FADT Boot Architecture Flags (BootFlags) [Vx]=Introduced in this FADT revision */
+/* Masks for FADT IA-PC Boot Architecture Flags (boot_flags) [Vx]=Introduced in this FADT revision */
#define ACPI_FADT_LEGACY_DEVICES (1) /* 00: [V2] System has LPC or ISA bus devices */
#define ACPI_FADT_8042 (1<<1) /* 01: [V3] System has an 8042 controller on port 60/64 */
#define ACPI_FADT_NO_ASPM (1<<4) /* 04: [V4] PCIe ASPM control must not be enabled */
#define ACPI_FADT_NO_CMOS_RTC (1<<5) /* 05: [V5] No CMOS real-time clock present */
+/* Masks for FADT ARM Boot Architecture Flags (arm_boot_flags) ACPI 5.1 */
+
+#define ACPI_FADT_PSCI_COMPLIANT (1) /* 00: [V5+] PSCI 0.2+ is implemented */
+#define ACPI_FADT_PSCI_USE_HVC (1<<1) /* 01: [V5+] HVC must be used instead of SMC as the PSCI conduit */
+
/* Masks for FADT flags */
#define ACPI_FADT_WBINVD (1) /* 00: [V1] The WBINVD instruction works properly */
* FADT V5 size: 0x10C
*/
#define ACPI_FADT_V1_SIZE (UINT32) (ACPI_FADT_OFFSET (Flags) + 4)
-#define ACPI_FADT_V2_SIZE (UINT32) (ACPI_FADT_OFFSET (Reserved4[0]) + 3)
+#define ACPI_FADT_V2_SIZE (UINT32) (ACPI_FADT_OFFSET (MinorRevision) + 1)
#define ACPI_FADT_V3_SIZE (UINT32) (ACPI_FADT_OFFSET (SleepControl))
#define ACPI_FADT_V5_SIZE (UINT32) (sizeof (ACPI_TABLE_FADT))
enum AcpiMadtType
{
- ACPI_MADT_TYPE_LOCAL_APIC = 0,
- ACPI_MADT_TYPE_IO_APIC = 1,
- ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2,
- ACPI_MADT_TYPE_NMI_SOURCE = 3,
- ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4,
- ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5,
- ACPI_MADT_TYPE_IO_SAPIC = 6,
- ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
- ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
- ACPI_MADT_TYPE_LOCAL_X2APIC = 9,
- ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
- ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
- ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
- ACPI_MADT_TYPE_RESERVED = 13 /* 13 and greater are reserved */
+ ACPI_MADT_TYPE_LOCAL_APIC = 0,
+ ACPI_MADT_TYPE_IO_APIC = 1,
+ ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2,
+ ACPI_MADT_TYPE_NMI_SOURCE = 3,
+ ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4,
+ ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5,
+ ACPI_MADT_TYPE_IO_SAPIC = 6,
+ ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
+ ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
+ ACPI_MADT_TYPE_LOCAL_X2APIC = 9,
+ ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
+ ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
+ ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
+ ACPI_MADT_TYPE_GENERIC_MSI_FRAME = 13,
+ ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14,
+ ACPI_MADT_TYPE_RESERVED = 15 /* 15 and greater are reserved */
};
/*
- * MADT Sub-tables, correspond to Type in ACPI_SUBTABLE_HEADER
+ * MADT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
*/
/* 0: Processor Local APIC */
{
ACPI_SUBTABLE_HEADER Header;
UINT16 Reserved; /* Reserved - must be zero */
- UINT32 GicId;
+ UINT32 CpuInterfaceNumber;
UINT32 Uid;
UINT32 Flags;
UINT32 ParkingVersion;
UINT32 PerformanceInterrupt;
UINT64 ParkedAddress;
UINT64 BaseAddress;
+ UINT64 GicvBaseAddress;
+ UINT64 GichBaseAddress;
+ UINT32 VgicInterrupt;
+ UINT64 GicrBaseAddress;
+ UINT64 ArmMpidr;
} ACPI_MADT_GENERIC_INTERRUPT;
+/* Masks for Flags field above */
+
+/* ACPI_MADT_ENABLED (1) Processor is usable if set */
+#define ACPI_MADT_PERFORMANCE_IRQ_MODE (1<<1) /* 01: Performance Interrupt Mode */
+#define ACPI_MADT_VGIC_IRQ_MODE (1<<2) /* 02: VGIC Maintenance Interrupt mode */
+
/* 12: Generic Distributor (ACPI 5.0) */
} ACPI_MADT_GENERIC_DISTRIBUTOR;
+/* 13: Generic MSI Frame (ACPI 5.1) */
+
+typedef struct acpi_madt_generic_msi_frame
+{
+ ACPI_SUBTABLE_HEADER Header;
+ UINT16 Reserved; /* Reserved - must be zero */
+ UINT32 MsiFrameId;
+ UINT64 BaseAddress;
+ UINT32 Flags;
+ UINT16 SpiCount;
+ UINT16 SpiBase;
+
+} ACPI_MADT_GENERIC_MSI_FRAME;
+
+/* Masks for Flags field above */
+
+#define ACPI_MADT_OVERRIDE_SPI_VALUES (1)
+
+
+/* 14: Generic Redistributor (ACPI 5.1) */
+
+typedef struct acpi_madt_generic_redistributor
+{
+ ACPI_SUBTABLE_HEADER Header;
+ UINT16 Reserved; /* reserved - must be zero */
+ UINT64 BaseAddress;
+ UINT32 Length;
+
+} ACPI_MADT_GENERIC_REDISTRIBUTOR;
+
+
/*
* Common flags fields for MADT subtables
*/
-/* MADT Local APIC flags (LapicFlags) and GIC flags */
+/* MADT Local APIC flags */
#define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */
ACPI_SRAT_TYPE_CPU_AFFINITY = 0,
ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1,
ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY = 2,
- ACPI_SRAT_TYPE_RESERVED = 3 /* 3 and greater are reserved */
+ ACPI_SRAT_TYPE_GICC_AFFINITY = 3,
+ ACPI_SRAT_TYPE_RESERVED = 4 /* 4 and greater are reserved */
};
/*
- * SRAT Sub-tables, correspond to Type in ACPI_SUBTABLE_HEADER
+ * SRAT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
*/
/* 0: Processor Local APIC/SAPIC Affinity */
UINT32 Flags;
UINT8 LocalSapicEid;
UINT8 ProximityDomainHi[3];
- UINT32 Reserved; /* Reserved, must be zero */
+ UINT32 ClockDomain;
} ACPI_SRAT_CPU_AFFINITY;
#define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */
+/* 3: GICC Affinity (ACPI 5.1) */
+
+typedef struct acpi_srat_gicc_affinity
+{
+ ACPI_SUBTABLE_HEADER Header;
+ UINT32 ProximityDomain;
+ UINT32 AcpiProcessorUid;
+ UINT32 Flags;
+ UINT32 ClockDomain;
+
+} ACPI_SRAT_GICC_AFFINITY;
+
+/* Flags for ACPI_SRAT_GICC_AFFINITY */
+
+#define ACPI_SRAT_GICC_ENABLED (1) /* 00: Use affinity structure */
+
/* Reset to default packing */
#pragma pack()
#define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table */
#define ACPI_SIG_IBFT "IBFT" /* iSCSI Boot Firmware Table */
#define ACPI_SIG_IVRS "IVRS" /* I/O Virtualization Reporting Structure */
+#define ACPI_SIG_LPIT "LPIT" /* Low Power Idle Table */
#define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */
#define ACPI_SIG_MCHI "MCHI" /* Management Controller Host Interface table */
#define ACPI_SIG_MTMR "MTMR" /* MID Timer table */
* Version 1
*
* Conforms to "Intel Virtualization Technology for Directed I/O",
- * Version 1.2, Sept. 2008
+ * Version 2.2, Sept. 2013
*
******************************************************************************/
{
ACPI_DMAR_TYPE_HARDWARE_UNIT = 0,
ACPI_DMAR_TYPE_RESERVED_MEMORY = 1,
- ACPI_DMAR_TYPE_ATSR = 2,
- ACPI_DMAR_HARDWARE_AFFINITY = 3,
- ACPI_DMAR_TYPE_RESERVED = 4 /* 4 and greater are reserved */
+ ACPI_DMAR_TYPE_ROOT_ATS = 2,
+ ACPI_DMAR_TYPE_HARDWARE_AFFINITY = 3,
+ ACPI_DMAR_TYPE_NAMESPACE = 4,
+ ACPI_DMAR_TYPE_RESERVED = 5 /* 5 and greater are reserved */
};
} ACPI_DMAR_DEVICE_SCOPE;
-/* Values for EntryType in ACPI_DMAR_DEVICE_SCOPE */
+/* Values for EntryType in ACPI_DMAR_DEVICE_SCOPE - device types */
enum AcpiDmarScopeType
{
ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2,
ACPI_DMAR_SCOPE_TYPE_IOAPIC = 3,
ACPI_DMAR_SCOPE_TYPE_HPET = 4,
- ACPI_DMAR_SCOPE_TYPE_RESERVED = 5 /* 5 and greater are reserved */
+ ACPI_DMAR_SCOPE_TYPE_NAMESPACE = 5,
+ ACPI_DMAR_SCOPE_TYPE_RESERVED = 6 /* 6 and greater are reserved */
};
typedef struct acpi_dmar_pci_path
/*
- * DMAR Sub-tables, correspond to Type in ACPI_DMAR_HEADER
+ * DMAR Subtables, correspond to Type in ACPI_DMAR_HEADER
*/
/* 0: Hardware Unit Definition */
} ACPI_DMAR_RHSA;
+/* 4: ACPI Namespace Device Declaration Structure */
+
+typedef struct acpi_dmar_andd
+{
+ ACPI_DMAR_HEADER Header;
+ UINT8 Reserved[3];
+ UINT8 DeviceNumber;
+ char DeviceName[1];
+
+} ACPI_DMAR_ANDD;
+
+
/*******************************************************************************
*
* HPET - High Precision Event Timer table
/*******************************************************************************
*
- * MCFG - PCI Memory Mapped Configuration table and sub-table
+ * LPIT - Low Power Idle Table
+ *
+ * Conforms to "ACPI Low Power Idle Table (LPIT) and _LPD Proposal (DRAFT)"
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_lpit
+{
+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */
+
+} ACPI_TABLE_LPIT;
+
+
+/* LPIT subtable header */
+
+typedef struct acpi_lpit_header
+{
+ UINT32 Type; /* Subtable type */
+ UINT32 Length; /* Subtable length */
+ UINT16 UniqueId;
+ UINT16 Reserved;
+ UINT32 Flags;
+
+} ACPI_LPIT_HEADER;
+
+/* Values for subtable Type above */
+
+enum AcpiLpitType
+{
+ ACPI_LPIT_TYPE_NATIVE_CSTATE = 0x00,
+ ACPI_LPIT_TYPE_SIMPLE_IO = 0x01
+};
+
+/* Masks for Flags field above */
+
+#define ACPI_LPIT_STATE_DISABLED (1)
+#define ACPI_LPIT_NO_COUNTER (1<<1)
+
+/*
+ * LPIT subtables, correspond to Type in ACPI_LPIT_HEADER
+ */
+
+/* 0x00: Native C-state instruction based LPI structure */
+
+typedef struct acpi_lpit_native
+{
+ ACPI_LPIT_HEADER Header;
+ ACPI_GENERIC_ADDRESS EntryTrigger;
+ UINT32 Residency;
+ UINT32 Latency;
+ ACPI_GENERIC_ADDRESS ResidencyCounter;
+ UINT64 CounterFrequency;
+
+} ACPI_LPIT_NATIVE;
+
+
+/* 0x01: Simple I/O based LPI structure */
+
+typedef struct acpi_lpit_io
+{
+ ACPI_LPIT_HEADER Header;
+ ACPI_GENERIC_ADDRESS EntryTrigger;
+ UINT32 TriggerAction;
+ UINT64 TriggerValue;
+ UINT64 TriggerMask;
+ ACPI_GENERIC_ADDRESS MinimumIdleState;
+ UINT32 Residency;
+ UINT32 Latency;
+ ACPI_GENERIC_ADDRESS ResidencyCounter;
+ UINT64 CounterFrequency;
+
+} ACPI_LPIT_IO;
+
+
+/*******************************************************************************
+ *
+ * MCFG - PCI Memory Mapped Configuration table and subtable
* Version 1
*
* Conforms to "PCI Firmware Specification", Revision 3.0, June 20, 2005
/*
- * SLIC Sub-tables, correspond to Type in ACPI_SLIC_HEADER
+ * SLIC Subtables, correspond to Type in ACPI_SLIC_HEADER
*/
/* 0: Public Key Structure */
/*******************************************************************************
*
- * GTDT - Generic Timer Description Table (ACPI 5.0)
- * Version 1
+ * GTDT - Generic Timer Description Table (ACPI 5.1)
+ * Version 2
*
******************************************************************************/
typedef struct acpi_table_gtdt
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
- UINT64 Address;
- UINT32 Flags;
- UINT32 SecurePl1Interrupt;
- UINT32 SecurePl1Flags;
- UINT32 NonSecurePl1Interrupt;
- UINT32 NonSecurePl1Flags;
+ UINT64 CounterBlockAddresss;
+ UINT32 Reserved;
+ UINT32 SecureEl1Interrupt;
+ UINT32 SecureEl1Flags;
+ UINT32 NonSecureEl1Interrupt;
+ UINT32 NonSecureEl1Flags;
UINT32 VirtualTimerInterrupt;
UINT32 VirtualTimerFlags;
- UINT32 NonSecurePl2Interrupt;
- UINT32 NonSecurePl2Flags;
+ UINT32 NonSecureEl2Interrupt;
+ UINT32 NonSecureEl2Flags;
+ UINT64 CounterReadBlockAddress;
+ UINT32 PlatformTimerCount;
+ UINT32 PlatformTimerOffset;
} ACPI_TABLE_GTDT;
-/* Values for Flags field above */
+/* Flag Definitions: Timer Block Physical Timers and Virtual timers */
+
+#define ACPI_GTDT_INTERRUPT_MODE (1)
+#define ACPI_GTDT_INTERRUPT_POLARITY (1<<1)
+#define ACPI_GTDT_ALWAYS_ON (1<<2)
+
+
+/* Common GTDT subtable header */
+
+typedef struct acpi_gtdt_header
+{
+ UINT8 Type;
+ UINT16 Length;
+
+} ACPI_GTDT_HEADER;
+
+/* Values for GTDT subtable type above */
-#define ACPI_GTDT_MAPPED_BLOCK_PRESENT 1
+enum AcpiGtdtType
+{
+ ACPI_GTDT_TYPE_TIMER_BLOCK = 0,
+ ACPI_GTDT_TYPE_WATCHDOG = 1,
+ ACPI_GTDT_TYPE_RESERVED = 2 /* 2 and greater are reserved */
+};
+
+
+/* GTDT Subtables, correspond to Type in acpi_gtdt_header */
+
+/* 0: Generic Timer Block */
+
+typedef struct acpi_gtdt_timer_block
+{
+ ACPI_GTDT_HEADER Header;
+ UINT8 Reserved;
+ UINT64 BlockAddress;
+ UINT32 TimerCount;
+ UINT32 TimerOffset;
+
+} ACPI_GTDT_TIMER_BLOCK;
+
+/* Timer Sub-Structure, one per timer */
+
+typedef struct acpi_gtdt_timer_entry
+{
+ UINT8 FrameNumber;
+ UINT8 Reserved[3];
+ UINT64 BaseAddress;
+ UINT64 El0BaseAddress;
+ UINT32 TimerInterrupt;
+ UINT32 TimerFlags;
+ UINT32 VirtualTimerInterrupt;
+ UINT32 VirtualTimerFlags;
+ UINT32 CommonFlags;
-/* Values for all "TimerFlags" fields above */
+} ACPI_GTDT_TIMER_ENTRY;
-#define ACPI_GTDT_INTERRUPT_MODE 1
-#define ACPI_GTDT_INTERRUPT_POLARITY 2
+/* Flag Definitions: TimerFlags and VirtualTimerFlags above */
+
+#define ACPI_GTDT_GT_IRQ_MODE (1)
+#define ACPI_GTDT_GT_IRQ_POLARITY (1<<1)
+
+/* Flag Definitions: CommonFlags above */
+
+#define ACPI_GTDT_GT_IS_SECURE_TIMER (1)
+#define ACPI_GTDT_GT_ALWAYS_ON (1<<1)
+
+
+/* 1: SBSA Generic Watchdog Structure */
+
+typedef struct acpi_gtdt_watchdog
+{
+ ACPI_GTDT_HEADER Header;
+ UINT8 Reserved;
+ UINT64 RefreshFrameAddress;
+ UINT64 ControlFrameAddress;
+ UINT32 TimerInterrupt;
+ UINT32 TimerFlags;
+
+} ACPI_GTDT_WATCHDOG;
+
+/* Flag Definitions: TimerFlags above */
+
+#define ACPI_GTDT_WATCHDOG_IRQ_MODE (1)
+#define ACPI_GTDT_WATCHDOG_IRQ_POLARITY (1<<1)
+#define ACPI_GTDT_WATCHDOG_SECURE (1<<2)
/*******************************************************************************
enum AcpiPcctType
{
ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0,
- ACPI_PCCT_TYPE_RESERVED = 1 /* 1 and greater are reserved */
+ ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE = 1,
+ ACPI_PCCT_TYPE_RESERVED = 2 /* 2 and greater are reserved */
};
/*
} ACPI_PCCT_SUBSPACE;
+/* 1: HW-reduced Communications Subspace (ACPI 5.1) */
+
+typedef struct acpi_pcct_hw_reduced
+{
+ ACPI_SUBTABLE_HEADER Header;
+ UINT32 DoorbellInterrupt;
+ UINT8 Flags;
+ UINT8 Reserved;
+ UINT64 BaseAddress;
+ UINT64 Length;
+ ACPI_GENERIC_ADDRESS DoorbellRegister;
+ UINT64 PreserveMask;
+ UINT64 WriteMask;
+ UINT32 Latency;
+ UINT32 MaxAccessRate;
+ UINT16 MinTurnaroundTime;
+
+} ACPI_PCCT_HW_REDUCED;
+
+/* Values for doorbell flags above */
+
+#define ACPI_PCCT_INTERRUPT_POLARITY (1)
+#define ACPI_PCCT_INTERRUPT_MODE (1<<1)
+
+
/*
* PCC memory structures (not part of the ACPI table)
*/
#error ACPI_MACHINE_WIDTH not defined
#endif
-/*! [Begin] no source code translation */
-
/*
* Data type ranges
* Note: These macros are designed to be compiler independent as well as
*
******************************************************************************/
-#ifndef __REACTOS__
+#ifndef ACPI_USE_SYSTEM_INTTYPES
+
typedef unsigned char BOOLEAN;
typedef unsigned char UINT8;
typedef unsigned short UINT16;
+typedef short INT16;
typedef COMPILER_DEPENDENT_UINT64 UINT64;
typedef COMPILER_DEPENDENT_INT64 INT64;
-#endif /* __REACTOS__ */
-/*! [End] no source code translation !*/
+#endif /* ACPI_USE_SYSTEM_INTTYPES */
/*
* Value returned by AcpiOsGetThreadId. There is no standard "thread_id"
#if ACPI_MACHINE_WIDTH == 64
-/*! [Begin] no source code translation (keep the typedefs as-is) */
+#ifndef ACPI_USE_SYSTEM_INTTYPES
-#ifndef __REACTOS__
typedef unsigned int UINT32;
typedef int INT32;
-#endif /* __REACTOS__ */
-/*! [End] no source code translation !*/
+#endif /* ACPI_USE_SYSTEM_INTTYPES */
+
typedef INT64 ACPI_NATIVE_INT;
#elif ACPI_MACHINE_WIDTH == 32
-/*! [Begin] no source code translation (keep the typedefs as-is) */
+#ifndef ACPI_USE_SYSTEM_INTTYPES
-#ifndef __REACTOS__
typedef unsigned int UINT32;
typedef int INT32;
-#endif /* __REACTOS__ */
-/*! [End] no source code translation !*/
+#endif /* ACPI_USE_SYSTEM_INTTYPES */
+
typedef INT32 ACPI_NATIVE_INT;
*
******************************************************************************/
+#ifdef ACPI_NO_MEM_ALLOCATIONS
+
+#define ACPI_ALLOCATE(a) NULL
+#define ACPI_ALLOCATE_ZEROED(a) NULL
+#define ACPI_FREE(a)
+#define ACPI_MEM_TRACKING(a)
+
+#else /* ACPI_NO_MEM_ALLOCATIONS */
+
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
/*
* Memory allocation tracking (used by AcpiExec to detect memory leaks)
#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
+#endif /* ACPI_NO_MEM_ALLOCATIONS */
+
/******************************************************************************
*
#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void, (void *) NULL,(ACPI_SIZE) i)
#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p, (void *) NULL)
-#define ACPI_OFFSET(d, f) (ACPI_SIZE) ACPI_PTR_DIFF (&(((d *)0)->f), (void *) NULL)
+#define ACPI_OFFSET(d, f) ACPI_PTR_DIFF (&(((d *) 0)->f), (void *) NULL)
#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i)
#define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i)
#define ACPI_NOTIFY_RESERVED (UINT8) 0x0A
#define ACPI_NOTIFY_LOCALITY_UPDATE (UINT8) 0x0B
#define ACPI_NOTIFY_SHUTDOWN_REQUEST (UINT8) 0x0C
+#define ACPI_NOTIFY_AFFINITY_UPDATE (UINT8) 0x0D
-#define ACPI_NOTIFY_MAX 0x0C
+#define ACPI_NOTIFY_MAX 0x0D
/*
* Types associated with ACPI names and objects. The first group of
* The encoding of ACPI_EVENT_STATUS is illustrated below.
* Note that a set bit (1) indicates the property is TRUE
* (e.g. if bit 0 is set then the event is enabled).
- * +-------------+-+-+-+
- * | Bits 31:3 |2|1|0|
- * +-------------+-+-+-+
- * | | | |
- * | | | +- Enabled?
- * | | +--- Enabled for wake?
- * | +----- Set?
- * +----------- <Reserved>
+ * +-------------+-+-+-+-+
+ * | Bits 31:4 |3|2|1|0|
+ * +-------------+-+-+-+-+
+ * | | | | |
+ * | | | | +- Enabled?
+ * | | | +--- Enabled for wake?
+ * | | +----- Set?
+ * | +------- Has a handler?
+ * +------------- <Reserved>
*/
typedef UINT32 ACPI_EVENT_STATUS;
#define ACPI_EVENT_FLAG_ENABLED (ACPI_EVENT_STATUS) 0x01
#define ACPI_EVENT_FLAG_WAKE_ENABLED (ACPI_EVENT_STATUS) 0x02
#define ACPI_EVENT_FLAG_SET (ACPI_EVENT_STATUS) 0x04
+#define ACPI_EVENT_FLAG_HAS_HANDLER (ACPI_EVENT_STATUS) 0x08
/* Actions for AcpiSetGpe, AcpiGpeWakeup, AcpiHwLowSetGpe */
* Miscellaneous common Data Structures used by the interfaces
*/
#define ACPI_NO_BUFFER 0
+
+#ifdef ACPI_NO_MEM_ALLOCATIONS
+
+#define ACPI_ALLOCATE_BUFFER (ACPI_SIZE) (0)
+#define ACPI_ALLOCATE_LOCAL_BUFFER (ACPI_SIZE) (0)
+
+#else /* ACPI_NO_MEM_ALLOCATIONS */
+
#define ACPI_ALLOCATE_BUFFER (ACPI_SIZE) (-1) /* Let ACPICA allocate buffer */
#define ACPI_ALLOCATE_LOCAL_BUFFER (ACPI_SIZE) (-2) /* For internal use only (enables tracking) */
+#endif /* ACPI_NO_MEM_ALLOCATIONS */
+
typedef struct acpi_buffer
{
ACPI_SIZE Length; /* Length in bytes of the buffer */
#define ACPI_OSI_WIN_8 0x0C
+/* Definitions of file IO */
+
+#define ACPI_FILE_READING 0x01
+#define ACPI_FILE_WRITING 0x02
+#define ACPI_FILE_BINARY 0x04
+
+#define ACPI_FILE_BEGIN 0x01
+#define ACPI_FILE_END 0x02
+
+
+/* Definitions of getopt */
+
+#define ACPI_OPT_END -1
+
+
#endif /* __ACTYPES_H__ */
#ifdef ACPI_ASL_COMPILER
#include <stdio.h>
-extern FILE *AcpiGbl_OutputFile;
#define ACPI_MSG_REDIRECT_BEGIN \
FILE *OutputFile = AcpiGbl_OutputFile; \
UINT64 Integer,
UINT32 Position);
+UINT8
+AcpiUtAsciiCharToHex (
+ int HexChar);
+
BOOLEAN
AcpiUtValidObjectType (
ACPI_OBJECT_TYPE Type);
AcpiUtStrlen (
const char *String);
+char *
+AcpiUtStrchr (
+ const char *String,
+ int ch);
+
char *
AcpiUtStrcpy (
char *DstString,
#define ACPI_IS_XDIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD))
#define ACPI_IS_UPPER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP))
#define ACPI_IS_LOWER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO))
-#define ACPI_IS_PRINT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_SP | _ACPI_PU))
+#define ACPI_IS_PRINT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_XS | _ACPI_PU))
#define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP))
#endif /* !ACPI_USE_SYSTEM_CLIBRARY */
UINT32 Display,
UINT32 Offset);
+#ifdef ACPI_APPLICATION
+void
+AcpiUtDumpBufferToFile (
+ ACPI_FILE File,
+ UINT8 *Buffer,
+ UINT32 Count,
+ UINT32 Display,
+ UINT32 BaseOffset);
+#endif
+
void
AcpiUtReportError (
char *ModuleName,
UINT8 *OutValues);
+/*
+ * utfileio - file operations
+ */
+#ifdef ACPI_APPLICATION
+ACPI_STATUS
+AcpiUtReadTableFromFile (
+ char *Filename,
+ ACPI_TABLE_HEADER **Table);
+#endif
+
+
/*
* utids - device ID support
*/
AcpiAhMatchHardwareId (
char *Hid);
+const char *
+AcpiAhMatchUuid (
+ UINT8 *Data);
+
+/*
+ * utprint - printf/vprintf output functions
+ */
+const char *
+AcpiUtScanNumber (
+ const char *String,
+ UINT64 *NumberPtr);
+
+const char *
+AcpiUtPrintNumber (
+ char *String,
+ UINT64 Number);
+
+int
+AcpiUtVsnprintf (
+ char *String,
+ ACPI_SIZE Size,
+ const char *Format,
+ va_list Args);
+
+int
+AcpiUtSnprintf (
+ char *String,
+ ACPI_SIZE Size,
+ const char *Format,
+ ...);
+
+#ifdef ACPI_APPLICATION
+int
+AcpiUtFileVprintf (
+ ACPI_FILE File,
+ const char *Format,
+ va_list Args);
+
+int
+AcpiUtFilePrintf (
+ ACPI_FILE File,
+ const char *Format,
+ ...);
+#endif
+
+/*
+ * utuuid -- UUID support functions
+ */
+void
+AcpiUtConvertStringToUuid (
+ char *InString,
+ UINT8 *UuidBuffer);
+
#endif /* _ACUTILS_H */
} ASL_RESOURCE_NODE;
+typedef struct asl_resource_info
+{
+ ACPI_PARSE_OBJECT *DescriptorTypeOp; /* Resource descriptor parse node */
+ ACPI_PARSE_OBJECT *MappingOp; /* Used for mapfile support */
+ UINT32 CurrentByteOffset; /* Offset in resource template */
+
+} ASL_RESOURCE_INFO;
+
/* Macros used to generate AML resource length fields */
} AML_RESOURCE;
+
+/* Interfaces used by both the disassembler and compiler */
+
+void
+MpSaveGpioInfo (
+ ACPI_PARSE_OBJECT *Op,
+ AML_RESOURCE *Resource,
+ UINT32 PinCount,
+ UINT16 *PinList,
+ char *DeviceName);
+
+void
+MpSaveSerialInfo (
+ ACPI_PARSE_OBJECT *Op,
+ AML_RESOURCE *Resource,
+ char *DeviceName);
+
+char *
+MpGetHidFromParseTree (
+ ACPI_NAMESPACE_NODE *HidNode);
+
+char *
+MpGetHidViaNamestring (
+ char *DeviceName);
+
+char *
+MpGetConnectionInfo (
+ ACPI_PARSE_OBJECT *Op,
+ UINT32 PinIndex,
+ ACPI_NAMESPACE_NODE **TargetNode,
+ char **TargetName);
+
+char *
+MpGetParentDeviceHid (
+ ACPI_PARSE_OBJECT *Op,
+ ACPI_NAMESPACE_NODE **TargetNode,
+ char **ParentDeviceName);
+
+char *
+MpGetDdnValue (
+ char *DeviceName);
+
+char *
+MpGetHidValue (
+ ACPI_NAMESPACE_NODE *DeviceNode);
+
#endif
/*
- * The vsnprintf function is defined by c99, but cygwin/gcc does not
- * enable this prototype when the -ansi flag is set. Also related to
- * __STRICT_ANSI__. So, we just declare the prototype here.
+ * The vsnprintf/snprintf functions are defined by c99, but cygwin/gcc
+ * does not enable this prototype when the -ansi flag is set. Also related
+ * to __STRICT_ANSI__. So, we just declare the prototype here.
*/
int
vsnprintf (char *s, size_t n, const char *format, va_list ap);
+int
+snprintf (char *s, size_t n, const char *format, ...);
+
#endif /* __ACCYGWIN_H__ */
#ifndef __ACEFI_H__
#define __ACEFI_H__
+#include <stdarg.h>
+#if defined(_GNU_EFI)
+#include <stdint.h>
+#include <unistd.h>
+#endif
#include <efi.h>
#include <efistdarg.h>
#include <efilib.h>
+/* AED EFI definitions */
+
+#if defined(_AED_EFI)
+
/* _int64 works for both IA32 and IA64 */
#define COMPILER_DEPENDENT_INT64 __int64
#pragma warning(disable:4142)
+#endif
+
+
+/* GNU EFI definitions */
+
+#if defined(_GNU_EFI)
+
+/* Using GCC for GNU EFI */
+
+#include "acgcc.h"
+
+#undef ACPI_USE_SYSTEM_CLIBRARY
+#undef ACPI_USE_STANDARD_HEADERS
+#undef ACPI_USE_NATIVE_DIVIDE
+#define ACPI_USE_SYSTEM_INTTYPES
+
+#define ACPI_FILE SIMPLE_TEXT_OUTPUT_INTERFACE *
+#define ACPI_FILE_OUT ST->ConOut
+#define ACPI_FILE_ERR ST->ConOut
+
+/*
+ * Math helpers
+ */
+#define ACPI_DIV_64_BY_32(n_hi, n_lo, d32, q32, r32) \
+ do { \
+ UINT64 __n = ((UINT64) n_hi) << 32 | (n_lo); \
+ (q32) = DivU64x32 ((__n), (d32), &(r32)); \
+ } while (0)
+
+#define ACPI_SHIFT_RIGHT_64(n_hi, n_lo) \
+ do { \
+ (n_lo) >>= 1; \
+ (n_lo) |= (((n_hi) & 1) << 31); \
+ (n_hi) >>= 1; \
+ } while (0)
+
+/*
+ * EFI specific prototypes
+ */
+EFI_STATUS
+efi_main (
+ EFI_HANDLE Image,
+ EFI_SYSTEM_TABLE *SystemTab);
+
+int
+acpi_main (
+ int argc,
+ char *argv[]);
+
+
+#endif
+
#endif /* __ACEFI_H__ */
#define ACPI_DBG_TRACK_ALLOCATIONS
#endif
-/* AcpiNames configuration. Single threaded with debugger output enabled. */
-
-#ifdef ACPI_NAMES_APP
-#define ACPI_DEBUGGER
-#define ACPI_APPLICATION
-#define ACPI_SINGLE_THREADED
-#endif
-
/*
- * AcpiBin/AcpiDump/AcpiSrc/AcpiXtract/Example configuration. All single
- * threaded, with no debug output.
+ * AcpiBin/AcpiDump/AcpiHelp/AcpiNames/AcpiSrc/AcpiXtract/Example configuration.
+ * All single threaded.
*/
#if (defined ACPI_BIN_APP) || \
(defined ACPI_DUMP_APP) || \
+ (defined ACPI_HELP_APP) || \
+ (defined ACPI_NAMES_APP) || \
(defined ACPI_SRC_APP) || \
(defined ACPI_XTRACT_APP) || \
(defined ACPI_EXAMPLE_APP)
#define ACPI_SINGLE_THREADED
#endif
+/* AcpiHelp configuration. Error messages disabled. */
+
#ifdef ACPI_HELP_APP
-#define ACPI_APPLICATION
-#define ACPI_SINGLE_THREADED
#define ACPI_NO_ERROR_MESSAGES
#endif
+/* AcpiNames configuration. Debug output enabled. */
+
+#ifdef ACPI_NAMES_APP
+#define ACPI_DEBUG_OUTPUT
+#endif
+
+/* AcpiExec/AcpiNames/Example configuration. Native RSDP used. */
+
+#if (defined ACPI_EXEC_APP) || \
+ (defined ACPI_EXAMPLE_APP) || \
+ (defined ACPI_NAMES_APP)
+#define ACPI_USE_NATIVE_RSDP_POINTER
+#endif
+
+/* AcpiDump configuration. Native mapping used if provied by OSPMs */
+
+#ifdef ACPI_DUMP_APP
+#define ACPI_USE_NATIVE_MEMORY_MAPPING
+#define USE_NATIVE_ALLOCATE_ZEROED
+#endif
+
+/* AcpiNames/Example configuration. Hardware disabled */
+
+#if (defined ACPI_EXAMPLE_APP) || \
+ (defined ACPI_NAMES_APP)
+#define ACPI_REDUCED_HARDWARE 1
+#endif
+
/* Linkable ACPICA library */
#ifdef ACPI_LIBRARY
#elif defined(_AED_EFI)
#include "acefi.h"
+#elif defined(_GNU_EFI)
+#include "acefi.h"
+
#elif defined(__HAIKU__)
#include "achaiku.h"
#ifdef ACPI_APPLICATION
#include <stdio.h>
#define ACPI_FILE FILE *
+#define ACPI_FILE_OUT stdout
+#define ACPI_FILE_ERR stderr
#else
#define ACPI_FILE void *
+#define ACPI_FILE_OUT NULL
+#define ACPI_FILE_ERR NULL
#endif /* ACPI_APPLICATION */
#endif /* ACPI_FILE */
--- /dev/null
+/******************************************************************************
+ *
+ * Name: acenvex.h - Extra host and compiler configuration
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2014, 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.
+ *
+ *****************************************************************************/
+
+#ifndef __ACENVEX_H__
+#define __ACENVEX_H__
+
+/*! [Begin] no source code translation */
+
+/******************************************************************************
+ *
+ * Extra host configuration files. All ACPICA headers are included before
+ * including these files.
+ *
+ *****************************************************************************/
+
+#if defined(_LINUX) || defined(__linux__)
+#include "aclinuxex.h"
+
+#endif
+
+/*! [End] no source code translation !*/
+
+#endif /* __ACENVEX_H__ */
#define ACPI_USE_NATIVE_DIVIDE
-// #define ACPI_THREAD_ID thread_id
+/* #define ACPI_THREAD_ID thread_id */
+
#define ACPI_SEMAPHORE sem_id
#define ACPI_SPINLOCK spinlock *
#define ACPI_CPU_FLAGS cpu_status
#ifndef __ACLINUX_H__
#define __ACLINUX_H__
+#ifdef __KERNEL__
+
+/* ACPICA external files should not include ACPICA headers directly. */
+
+#if !defined(BUILDING_ACPICA) && !defined(_LINUX_ACPI_H)
+#error "Please don't include <acpi/acpi.h> directly, include <linux/acpi.h> instead."
+#endif
+
+#endif
+
/* Common (in-kernel/user-space) ACPICA configuration */
#define ACPI_USE_SYSTEM_CLIBRARY
#define ACPI_USE_DO_WHILE_0
-#define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE
#ifdef __KERNEL__
+#define ACPI_USE_SYSTEM_INTTYPES
+
+/* Compile for reduced hardware mode only with this kernel config */
+
+#ifdef CONFIG_ACPI_REDUCED_HARDWARE_ONLY
+#define ACPI_REDUCED_HARDWARE 1
+#endif
+
#include <linux/string.h>
#include <linux/kernel.h>
#include <linux/ctype.h>
#ifdef EXPORT_ACPI_INTERFACES
#include <linux/export.h>
#endif
-#include <asm/acpi.h>
+#ifdef CONFIG_ACPI
+#include <asm/acenv.h>
+#endif
+
+#ifndef CONFIG_ACPI
+
+/* External globals for __KERNEL__, stubs is needed */
+
+#define ACPI_GLOBAL(t,a)
+#define ACPI_INIT_GLOBAL(t,a,b)
+
+/* Generating stubs for configurable ACPICA macros */
+
+#define ACPI_NO_MEM_ALLOCATIONS
+
+/* Generating stubs for configurable ACPICA functions */
+
+#define ACPI_NO_ERROR_MESSAGES
+#undef ACPI_DEBUG_OUTPUT
+
+/* External interface for __KERNEL__, stub is needed */
+
+#define ACPI_EXTERNAL_RETURN_STATUS(Prototype) \
+ static ACPI_INLINE Prototype {return(AE_NOT_CONFIGURED);}
+#define ACPI_EXTERNAL_RETURN_OK(Prototype) \
+ static ACPI_INLINE Prototype {return(AE_OK);}
+#define ACPI_EXTERNAL_RETURN_VOID(Prototype) \
+ static ACPI_INLINE Prototype {return;}
+#define ACPI_EXTERNAL_RETURN_UINT32(Prototype) \
+ static ACPI_INLINE Prototype {return(0);}
+#define ACPI_EXTERNAL_RETURN_PTR(Prototype) \
+ static ACPI_INLINE Prototype {return(NULL);}
+
+#endif /* CONFIG_ACPI */
/* Host-dependent types and defines for in-kernel ACPICA */
#define ACPI_SPINLOCK spinlock_t *
#define ACPI_CPU_FLAGS unsigned long
+/* Use native linux version of AcpiOsAllocateZeroed */
+
+#define USE_NATIVE_ALLOCATE_ZEROED
+
+/*
+ * Overrides for in-kernel ACPICA
+ */
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsInitialize
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsTerminate
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAllocate
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAllocateZeroed
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsFree
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAcquireObject
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetThreadId
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateLock
+
+/*
+ * OSL interfaces used by debugger/disassembler
+ */
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadable
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWritable
+
+/*
+ * OSL interfaces used by utilities
+ */
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsRedirectOutput
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetLine
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByName
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByIndex
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByAddress
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsOpenDirectory
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetNextFilename
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCloseDirectory
+
#else /* !__KERNEL__ */
#include <stdarg.h>
#define __init
#endif
-#ifndef __iomem
-#define __iomem
-#endif
-
/* Host-dependent types and defines for user-space ACPICA */
#define ACPI_FLUSH_CPU_CACHE()
#include "acgcc.h"
-
-#ifdef __KERNEL__
-
-/*
- * FIXME: Inclusion of actypes.h
- * Linux kernel need this before defining inline OSL interfaces as
- * actypes.h need to be included to find ACPICA type definitions.
- * Since from ACPICA's perspective, the actypes.h should be included after
- * acenv.h (aclinux.h), this leads to a inclusion mis-ordering issue.
- */
-#include <acpi/actypes.h>
-
-/*
- * Overrides for in-kernel ACPICA
- */
-ACPI_STATUS __init AcpiOsInitialize (
- void);
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsInitialize
-
-ACPI_STATUS AcpiOsTerminate (
- void);
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsTerminate
-
-/*
- * Memory allocation/deallocation
- */
-
-/*
- * The irqs_disabled() check is for resume from RAM.
- * Interrupts are off during resume, just like they are for boot.
- * However, boot has (system_state != SYSTEM_RUNNING)
- * to quiet __might_sleep() in kmalloc() and resume does not.
- */
-static inline void *
-AcpiOsAllocate (
- ACPI_SIZE Size)
-{
- return kmalloc (Size, irqs_disabled () ? GFP_ATOMIC : GFP_KERNEL);
-}
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAllocate
-
-/* Use native linux version of AcpiOsAllocateZeroed */
-
-static inline void *
-AcpiOsAllocateZeroed (
- ACPI_SIZE Size)
-{
- return kzalloc (Size, irqs_disabled () ? GFP_ATOMIC : GFP_KERNEL);
-}
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAllocateZeroed
-#define USE_NATIVE_ALLOCATE_ZEROED
-
-static inline void
-AcpiOsFree (
- void *Memory)
-{
- kfree (Memory);
-}
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsFree
-
-static inline void *
-AcpiOsAcquireObject (
- ACPI_CACHE_T *Cache)
-{
- return kmem_cache_zalloc (Cache,
- irqs_disabled () ? GFP_ATOMIC : GFP_KERNEL);
-}
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAcquireObject
-
-static inline ACPI_THREAD_ID
-AcpiOsGetThreadId (
- void)
-{
- return (ACPI_THREAD_ID) (unsigned long) current;
-}
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetThreadId
-
-#ifndef CONFIG_PREEMPT
-
-/*
- * Used within ACPICA to show where it is safe to preempt execution
- * when CONFIG_PREEMPT=n
- */
-#define ACPI_PREEMPTION_POINT() \
- do { \
- if (!irqs_disabled()) \
- cond_resched(); \
- } while (0)
-
-#endif
-
-/*
- * When lockdep is enabled, the spin_lock_init() macro stringifies it's
- * argument and uses that as a name for the lock in debugging.
- * By executing spin_lock_init() in a macro the key changes from "lock" for
- * all locks to the name of the argument of acpi_os_create_lock(), which
- * prevents lockdep from reporting false positives for ACPICA locks.
- */
-#define AcpiOsCreateLock(__Handle) \
- ({ \
- spinlock_t *Lock = ACPI_ALLOCATE(sizeof(*Lock)); \
- if (Lock) { \
- *(__Handle) = Lock; \
- spin_lock_init(*(__Handle)); \
- } \
- Lock ? AE_OK : AE_NO_MEMORY; \
- })
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateLock
-
-void __iomem *
-AcpiOsMapMemory (
- ACPI_PHYSICAL_ADDRESS Where,
- ACPI_SIZE Length);
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsMapMemory
-
-void
-AcpiOsUnmapMemory (
- void __iomem *LogicalAddress,
- ACPI_SIZE Size);
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsUnmapMemory
-
-/*
- * OSL interfaces used by debugger/disassembler
- */
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadable
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWritable
-
-/*
- * OSL interfaces used by utilities
- */
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsRedirectOutput
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetLine
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByName
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByIndex
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByAddress
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsOpenDirectory
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetNextFilename
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCloseDirectory
-
-/*
- * OSL interfaces added by Linux
- */
-void
-EarlyAcpiOsUnmapMemory (
- void __iomem *Virt,
- ACPI_SIZE Size);
-
-#endif /* __KERNEL__ */
-
#endif /* __ACLINUX_H__ */
--- /dev/null
+/******************************************************************************
+ *
+ * Name: aclinuxex.h - Extra OS specific defines, etc. for Linux
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2014, 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.
+ *
+ *****************************************************************************/
+
+#ifndef __ACLINUXEX_H__
+#define __ACLINUXEX_H__
+
+#ifdef __KERNEL__
+
+#ifndef ACPI_USE_NATIVE_DIVIDE
+
+#ifndef ACPI_DIV_64_BY_32
+#define ACPI_DIV_64_BY_32(n_hi, n_lo, d32, q32, r32) \
+ do { \
+ UINT64 (__n) = ((UINT64) n_hi) << 32 | (n_lo); \
+ (r32) = do_div ((__n), (d32)); \
+ (q32) = (UINT32) (__n); \
+ } while (0)
+#endif
+
+#ifndef ACPI_SHIFT_RIGHT_64
+#define ACPI_SHIFT_RIGHT_64(n_hi, n_lo) \
+ do { \
+ (n_lo) >>= 1; \
+ (n_lo) |= (((n_hi) & 1) << 31); \
+ (n_hi) >>= 1; \
+ } while (0)
+#endif
+
+#endif
+
+/*
+ * Overrides for in-kernel ACPICA
+ */
+ACPI_STATUS __init AcpiOsInitialize (
+ void);
+
+ACPI_STATUS AcpiOsTerminate (
+ void);
+
+/*
+ * The irqs_disabled() check is for resume from RAM.
+ * Interrupts are off during resume, just like they are for boot.
+ * However, boot has (system_state != SYSTEM_RUNNING)
+ * to quiet __might_sleep() in kmalloc() and resume does not.
+ */
+static inline void *
+AcpiOsAllocate (
+ ACPI_SIZE Size)
+{
+ return kmalloc (Size, irqs_disabled () ? GFP_ATOMIC : GFP_KERNEL);
+}
+
+static inline void *
+AcpiOsAllocateZeroed (
+ ACPI_SIZE Size)
+{
+ return kzalloc (Size, irqs_disabled () ? GFP_ATOMIC : GFP_KERNEL);
+}
+
+static inline void
+AcpiOsFree (
+ void *Memory)
+{
+ kfree (Memory);
+}
+
+static inline void *
+AcpiOsAcquireObject (
+ ACPI_CACHE_T *Cache)
+{
+ return kmem_cache_zalloc (Cache,
+ irqs_disabled () ? GFP_ATOMIC : GFP_KERNEL);
+}
+
+static inline ACPI_THREAD_ID
+AcpiOsGetThreadId (
+ void)
+{
+ return (ACPI_THREAD_ID) (unsigned long) current;
+}
+
+/*
+ * When lockdep is enabled, the spin_lock_init() macro stringifies it's
+ * argument and uses that as a name for the lock in debugging.
+ * By executing spin_lock_init() in a macro the key changes from "lock" for
+ * all locks to the name of the argument of acpi_os_create_lock(), which
+ * prevents lockdep from reporting false positives for ACPICA locks.
+ */
+#define AcpiOsCreateLock(__Handle) \
+ ({ \
+ spinlock_t *Lock = ACPI_ALLOCATE(sizeof(*Lock)); \
+ if (Lock) { \
+ *(__Handle) = Lock; \
+ spin_lock_init(*(__Handle)); \
+ } \
+ Lock ? AE_OK : AE_NO_MEMORY; \
+ })
+
+/*
+ * OSL interfaces added by Linux
+ */
+void
+EarlyAcpiOsUnmapMemory (
+ void __iomem *Virt,
+ ACPI_SIZE Size);
+
+#endif /* __KERNEL__ */
+
+#endif /* __ACLINUXEX_H__ */
/* Debug support. Must be last in this file, do not move. */
#ifdef _DEBUG
+#define _CRTDBG_MAP_ALLOC /* Enables specific file/lineno for leaks */
+
+#include <stdlib.h>
+#include <malloc.h>
#include <crtdbg.h>
/*
* This can quickly localize the memory corruption.
*/
#define ACPI_DEBUG_INITIALIZE() \
- _CrtSetDbgFlag (_CRTDBG_CHECK_ALWAYS_DF | \
- _CRTDBG_ALLOC_MEM_DF | _CRTDBG_CHECK_CRT_DF | \
- _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG))
+ _CrtSetDbgFlag (\
+ _CRTDBG_CHECK_ALWAYS_DF | \
+ _CRTDBG_ALLOC_MEM_DF | \
+ _CRTDBG_DELAY_FREE_MEM_DF | \
+ _CRTDBG_LEAK_CHECK_DF | \
+ _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG));
+
+#if 0
+/*
+ * _CrtSetBreakAlloc can be used to set a breakpoint at a particular
+ * memory leak, add to the macro above.
+ */
+Detected memory leaks!
+Dumping objects ->
+..\..\source\os_specific\service_layers\oswinxf.c(701) : {937} normal block at 0x002E9190, 40 bytes long.
+ Data: < > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+_CrtSetBreakAlloc (937);
+#endif
+
#endif
#endif /* __ACMSVC_H__ */
#if !defined(_MSC_VER) && defined(__GNUC__)
#include "acgcc.h"
#endif
+
+#define ACPI_USE_SYSTEM_INTTYPES
#endif /* __REACTOS __ */
/*! [End] no source code translation !*/
*
*****************************************************************************/
-#define __NSACCESS_C__
-
#include "acpi.h"
#include "accommon.h"
#include "amlcode.h"
*
*****************************************************************************/
-
-#define __NSALLOC_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
*
*****************************************************************************/
-#define __NSCONVERT_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
*
*****************************************************************************/
-#define __NSDUMP_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
*
*****************************************************************************/
-#define __NSDUMPDV_C__
-
#include "acpi.h"
*
*****************************************************************************/
-#define __NSEVAL_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
*
*****************************************************************************/
-
-#define __NSXFINIT_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
*
*****************************************************************************/
-#define __NSLOAD_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
*
*****************************************************************************/
-#define __NSNAMES_C__
-
#include "acpi.h"
#include "accommon.h"
#include "amlcode.h"
*
*****************************************************************************/
-
-#define __NSOBJECT_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
{
Node->Object = Node->Object->Common.NextObject;
}
+
+ /*
+ * Detach the object from any data objects (which are still held by
+ * the namespace node)
+ */
+ if (ObjDesc->Common.NextObject &&
+ ((ObjDesc->Common.NextObject)->Common.Type == ACPI_TYPE_LOCAL_DATA))
+ {
+ ObjDesc->Common.NextObject = NULL;
+ }
}
/* Reset the node type to untyped */
*
*****************************************************************************/
-#define __NSPARSE_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
Status = AcpiNsCheckPackageList (Info, Package, Elements, Count);
break;
+ case ACPI_PTYPE2_UUID_PAIR:
+
+ /* The package must contain pairs of (UUID + type) */
+
+ if (Count & 1)
+ {
+ ExpectedCount = Count + 1;
+ goto PackageTooSmall;
+ }
+
+ while (Count > 0)
+ {
+ Status = AcpiNsCheckObjectType(Info, Elements,
+ Package->RetInfo.ObjectType1, 0);
+ if (ACPI_FAILURE(Status))
+ {
+ return (Status);
+ }
+
+ /* Validate length of the UUID buffer */
+
+ if ((*Elements)->Buffer.Length != 16)
+ {
+ ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname,
+ Info->NodeFlags, "Invalid length for UUID Buffer"));
+ return (AE_AML_OPERAND_VALUE);
+ }
+
+ Status = AcpiNsCheckObjectType(Info, Elements + 1,
+ Package->RetInfo.ObjectType2, 0);
+ if (ACPI_FAILURE(Status))
+ {
+ return (Status);
+ }
+
+ Elements += 2;
+ Count -= 2;
+ }
+ break;
+
default:
/* Should not get here if predefined info table is correct */
*
*****************************************************************************/
-#define __NSREPAIR_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
*
*****************************************************************************/
-#define __NSREPAIR2_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
*
*****************************************************************************/
-#define __NSSEARCH_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
*
*****************************************************************************/
-#define __NSUTILS_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
*
*****************************************************************************/
-
-#define __NSWALK_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
*
*****************************************************************************/
-
-#define __NSXFEVAL_C__
#define EXPORT_ACPI_INTERFACES
#include "acpi.h"
*
*****************************************************************************/
-#define __NSXFNAME_C__
#define EXPORT_ACPI_INTERFACES
#include "acpi.h"
*
*****************************************************************************/
-
-#define __NSXFOBJ_C__
#define EXPORT_ACPI_INTERFACES
#include "acpi.h"
*
*****************************************************************************/
-#define __PSARGS_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
*
*****************************************************************************/
-
/*
* Parse the AML and build an operation tree as most interpreters, (such as
* Perl) do. Parsing is done by hand rather than with a YACC generated parser
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "acopcode.h"
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
*
*****************************************************************************/
-
/*
* Parse the AML and build an operation tree as most interpreters,
* like Perl, do. Parsing is done by hand rather than with a YACC
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
*
*****************************************************************************/
-
-#define __PSTREE_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
*
*****************************************************************************/
-#define __PSXFACE_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
*
*****************************************************************************/
-#define __RSADDR_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acresrc.h"
*
*****************************************************************************/
-#define __RSCALC_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acresrc.h"
*
*****************************************************************************/
-#define __RSCREATE_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acresrc.h"
void *Resource;
void *CurrentResourcePtr;
+
+ ACPI_FUNCTION_TRACE (AcpiBufferToResource);
+
+
/*
* Note: we allow AE_AML_NO_RESOURCE_END_TAG, since an end tag
* is not required here.
}
if (ACPI_FAILURE (Status))
{
- return (Status);
+ return_ACPI_STATUS (Status);
}
/* Allocate a buffer for the converted resource */
CurrentResourcePtr = Resource;
if (!Resource)
{
- return (AE_NO_MEMORY);
+ return_ACPI_STATUS (AE_NO_MEMORY);
}
/* Perform the AML-to-Resource conversion */
*ResourcePtr = Resource;
}
- return (Status);
+ return_ACPI_STATUS (Status);
}
+ACPI_EXPORT_SYMBOL (AcpiBufferToResource)
+
/*******************************************************************************
*
*
*****************************************************************************/
-
-#define __RSDUMP_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acresrc.h"
*
*****************************************************************************/
-
-#define __RSDUMPINFO_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acresrc.h"
*
*****************************************************************************/
-#define __RSINFO_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acresrc.h"
*
*****************************************************************************/
-#define __RSIO_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acresrc.h"
*
*****************************************************************************/
-#define __RSIRQ_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acresrc.h"
*
*****************************************************************************/
-#define __RSLIST_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acresrc.h"
*
*****************************************************************************/
-#define __RSMEMORY_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acresrc.h"
*
*****************************************************************************/
-#define __RSMISC_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acresrc.h"
*
*****************************************************************************/
-#define __RSIRQ_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acresrc.h"
*
*****************************************************************************/
-
-#define __RSUTILS_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
*
*****************************************************************************/
-
-#define __RSXFACE_C__
#define EXPORT_ACPI_INTERFACES
#include "acpi.h"
*
*****************************************************************************/
-#define __TBDATA_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
/******************************************************************************
*
- * FUNCTION: AcpiTbVerifyTable
+ * FUNCTION: AcpiTbValidateTempTable
+ *
+ * PARAMETERS: TableDesc - Table descriptor
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: This function is called to validate the table, the returned
+ * table descriptor is in "VALIDATED" state.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+AcpiTbValidateTempTable (
+ ACPI_TABLE_DESC *TableDesc)
+{
+
+ if (!TableDesc->Pointer && !AcpiGbl_VerifyTableChecksum)
+ {
+ /*
+ * Only validates the header of the table.
+ * Note that Length contains the size of the mapping after invoking
+ * this work around, this value is required by
+ * AcpiTbReleaseTempTable().
+ * We can do this because in AcpiInitTableDescriptor(), the Length
+ * field of the installed descriptor is filled with the actual
+ * table length obtaining from the table header.
+ */
+ TableDesc->Length = sizeof (ACPI_TABLE_HEADER);
+ }
+
+ return (AcpiTbValidateTable (TableDesc));
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: AcpiTbVerifyTempTable
*
* PARAMETERS: TableDesc - Table descriptor
* Signature - Table signature to verify
*****************************************************************************/
ACPI_STATUS
-AcpiTbVerifyTable (
+AcpiTbVerifyTempTable (
ACPI_TABLE_DESC *TableDesc,
char *Signature)
{
ACPI_STATUS Status = AE_OK;
- ACPI_FUNCTION_TRACE (TbVerifyTable);
+ ACPI_FUNCTION_TRACE (TbVerifyTempTable);
/* Validate the table */
- Status = AcpiTbValidateTable (TableDesc);
+ Status = AcpiTbValidateTempTable (TableDesc);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (AE_NO_MEMORY);
/* Verify the checksum */
- Status = AcpiTbVerifyChecksum (TableDesc->Pointer, TableDesc->Length);
- if (ACPI_FAILURE (Status))
+ if (AcpiGbl_VerifyTableChecksum)
{
- ACPI_EXCEPTION ((AE_INFO, AE_NO_MEMORY,
- "%4.4s " ACPI_PRINTF_UINT
- " Attempted table install failed",
- AcpiUtValidAcpiName (TableDesc->Signature.Ascii) ?
- TableDesc->Signature.Ascii : "????",
- ACPI_FORMAT_TO_UINT (TableDesc->Address)));
- goto InvalidateAndExit;
+ Status = AcpiTbVerifyChecksum (TableDesc->Pointer, TableDesc->Length);
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_EXCEPTION ((AE_INFO, AE_NO_MEMORY,
+ "%4.4s " ACPI_PRINTF_UINT
+ " Attempted table install failed",
+ AcpiUtValidAcpiName (TableDesc->Signature.Ascii) ?
+ TableDesc->Signature.Ascii : "????",
+ ACPI_FORMAT_TO_UINT (TableDesc->Address)));
+ goto InvalidateAndExit;
+ }
}
return_ACPI_STATUS (AE_OK);
*
*****************************************************************************/
-#define __TBFADT_C__
-
#include "acpi.h"
#include "accommon.h"
#include "actables.h"
UINT8 SpaceId,
UINT8 ByteWidth,
UINT64 Address,
- char *RegisterName);
+ char *RegisterName,
+ UINT8 Flags);
static void
AcpiTbConvertFadt (
UINT16 Address32;
UINT16 Length;
UINT8 DefaultLength;
- UINT8 Type;
+ UINT8 Flags;
} ACPI_FADT_INFO;
#define ACPI_FADT_OPTIONAL 0
#define ACPI_FADT_REQUIRED 1
#define ACPI_FADT_SEPARATE_LENGTH 2
+#define ACPI_FADT_GPE_REGISTER 4
static ACPI_FADT_INFO FadtInfoTable[] =
{
ACPI_FADT_OFFSET (Gpe0Block),
ACPI_FADT_OFFSET (Gpe0BlockLength),
0,
- ACPI_FADT_SEPARATE_LENGTH},
+ ACPI_FADT_SEPARATE_LENGTH | ACPI_FADT_GPE_REGISTER},
{"Gpe1Block",
ACPI_FADT_OFFSET (XGpe1Block),
ACPI_FADT_OFFSET (Gpe1Block),
ACPI_FADT_OFFSET (Gpe1BlockLength),
0,
- ACPI_FADT_SEPARATE_LENGTH}
+ ACPI_FADT_SEPARATE_LENGTH | ACPI_FADT_GPE_REGISTER}
};
#define ACPI_FADT_INFO_ENTRIES \
UINT8 SpaceId,
UINT8 ByteWidth,
UINT64 Address,
- char *RegisterName)
+ char *RegisterName,
+ UINT8 Flags)
{
UINT8 BitWidth;
- /* Bit width field in the GAS is only one byte long, 255 max */
-
+ /*
+ * Bit width field in the GAS is only one byte long, 255 max.
+ * Check for BitWidth overflow in GAS.
+ */
BitWidth = (UINT8) (ByteWidth * 8);
-
- if (ByteWidth > 31) /* (31*8)=248 */
+ if (ByteWidth > 31) /* (31*8)=248, (32*8)=256 */
{
- ACPI_ERROR ((AE_INFO,
- "%s - 32-bit FADT register is too long (%u bytes, %u bits) "
- "to convert to GAS struct - 255 bits max, truncating",
- RegisterName, ByteWidth, (ByteWidth * 8)));
+ /*
+ * No error for GPE blocks, because we do not use the BitWidth
+ * for GPEs, the legacy length (ByteWidth) is used instead to
+ * allow for a large number of GPEs.
+ */
+ if (!(Flags & ACPI_FADT_GPE_REGISTER))
+ {
+ ACPI_ERROR ((AE_INFO,
+ "%s - 32-bit FADT register is too long (%u bytes, %u bits) "
+ "to convert to GAS struct - 255 bits max, truncating",
+ RegisterName, ByteWidth, (ByteWidth * 8)));
+ }
BitWidth = 255;
}
ACPI_GENERIC_ADDRESS *Address64;
UINT32 Address32;
UINT8 Length;
+ UINT8 Flags;
UINT32 i;
&AcpiGbl_FADT, FadtInfoTable[i].Length);
Name = FadtInfoTable[i].Name;
+ Flags = FadtInfoTable[i].Flags;
/*
* Expand the ACPI 1.0 32-bit addresses to the ACPI 2.0 64-bit "X"
ACPI_ADR_SPACE_SYSTEM_IO,
*ACPI_ADD_PTR (UINT8, &AcpiGbl_FADT,
FadtInfoTable[i].Length),
- (UINT64) Address32, Name);
+ (UINT64) Address32, Name, Flags);
}
else if (Address64->Address != (UINT64) Address32)
{
ACPI_ADR_SPACE_SYSTEM_IO,
*ACPI_ADD_PTR (UINT8, &AcpiGbl_FADT,
FadtInfoTable[i].Length),
- (UINT64) Address32, Name);
+ (UINT64) Address32, Name, Flags);
}
}
}
Name, ACPI_MUL_8 (Length), Address64->BitWidth));
}
- if (FadtInfoTable[i].Type & ACPI_FADT_REQUIRED)
+ if (FadtInfoTable[i].Flags & ACPI_FADT_REQUIRED)
{
/*
* Field is required (PM1aEvent, PM1aControl).
Name, ACPI_FORMAT_UINT64 (Address64->Address), Length));
}
}
- else if (FadtInfoTable[i].Type & ACPI_FADT_SEPARATE_LENGTH)
+ else if (FadtInfoTable[i].Flags & ACPI_FADT_SEPARATE_LENGTH)
{
/*
* Field is optional (PM2Control, GPE0, GPE1) AND has its own
Source64->SpaceId, Pm1RegisterByteWidth,
Source64->Address +
(FadtPmInfoTable[i].RegisterNum * Pm1RegisterByteWidth),
- "PmRegisters");
+ "PmRegisters", 0);
}
}
}
*
*****************************************************************************/
-#define __TBFIND_C__
-
#include "acpi.h"
#include "accommon.h"
#include "actables.h"
*
*****************************************************************************/
-#define __TBINSTAL_C__
-
#include "acpi.h"
#include "accommon.h"
#include "actables.h"
/* Validate and verify a table before installation */
- Status = AcpiTbVerifyTable (&NewTableDesc, Signature);
+ Status = AcpiTbVerifyTempTable (&NewTableDesc, Signature);
if (ACPI_FAILURE (Status))
{
goto ReleaseAndExit;
/* Validate and verify a table before installation */
- Status = AcpiTbVerifyTable (&NewTableDesc, NULL);
+ Status = AcpiTbVerifyTempTable (&NewTableDesc, NULL);
if (ACPI_FAILURE (Status))
{
goto ReleaseAndExit;
/* Validate and verify a table before overriding */
- Status = AcpiTbVerifyTable (&NewTableDesc, NULL);
+ Status = AcpiTbVerifyTempTable (&NewTableDesc, NULL);
if (ACPI_FAILURE (Status))
{
return;
*/
AcpiTbInitTableDescriptor (OldTableDesc, NewTableDesc.Address,
NewTableDesc.Flags, NewTableDesc.Pointer);
- AcpiTbValidateTable (OldTableDesc);
+ AcpiTbValidateTempTable (OldTableDesc);
/* Release the temporary table descriptor */
*
*****************************************************************************/
-#define __TBPRINT_C__
-
#include "acpi.h"
#include "accommon.h"
#include "actables.h"
*
*****************************************************************************/
-#define __TBUTILS_C__
-
#include "acpi.h"
#include "accommon.h"
#include "actables.h"
/* Local prototypes */
-static ACPI_STATUS
-AcpiTbValidateXsdt (
- ACPI_PHYSICAL_ADDRESS Address);
-
static ACPI_PHYSICAL_ADDRESS
AcpiTbGetRootTableEntry (
UINT8 *TableEntry,
}
-/*******************************************************************************
- *
- * FUNCTION: AcpiTbValidateXsdt
- *
- * PARAMETERS: Address - Physical address of the XSDT (from RSDP)
- *
- * RETURN: Status. AE_OK if the table appears to be valid.
- *
- * DESCRIPTION: Validate an XSDT to ensure that it is of minimum size and does
- * not contain any NULL entries. A problem that is seen in the
- * field is that the XSDT exists, but is actually useless because
- * of one or more (or all) NULL entries.
- *
- ******************************************************************************/
-
-static ACPI_STATUS
-AcpiTbValidateXsdt (
- ACPI_PHYSICAL_ADDRESS XsdtAddress)
-{
- ACPI_TABLE_HEADER *Table;
- UINT8 *NextEntry;
- ACPI_PHYSICAL_ADDRESS Address;
- UINT32 Length;
- UINT32 EntryCount;
- ACPI_STATUS Status;
- UINT32 i;
-
-
- /* Get the XSDT length */
-
- Table = AcpiOsMapMemory (XsdtAddress, sizeof (ACPI_TABLE_HEADER));
- if (!Table)
- {
- return (AE_NO_MEMORY);
- }
-
- Length = Table->Length;
- AcpiOsUnmapMemory (Table, sizeof (ACPI_TABLE_HEADER));
-
- /*
- * Minimum XSDT length is the size of the standard ACPI header
- * plus one physical address entry
- */
- if (Length < (sizeof (ACPI_TABLE_HEADER) + ACPI_XSDT_ENTRY_SIZE))
- {
- return (AE_INVALID_TABLE_LENGTH);
- }
-
- /* Map the entire XSDT */
-
- Table = AcpiOsMapMemory (XsdtAddress, Length);
- if (!Table)
- {
- return (AE_NO_MEMORY);
- }
-
- /* Get the number of entries and pointer to first entry */
-
- Status = AE_OK;
- NextEntry = ACPI_ADD_PTR (UINT8, Table, sizeof (ACPI_TABLE_HEADER));
- EntryCount = (UINT32) ((Table->Length - sizeof (ACPI_TABLE_HEADER)) /
- ACPI_XSDT_ENTRY_SIZE);
-
- /* Validate each entry (physical address) within the XSDT */
-
- for (i = 0; i < EntryCount; i++)
- {
- Address = AcpiTbGetRootTableEntry (NextEntry, ACPI_XSDT_ENTRY_SIZE);
- if (!Address)
- {
- /* Detected a NULL entry, XSDT is invalid */
-
- Status = AE_NULL_ENTRY;
- break;
- }
-
- NextEntry += ACPI_XSDT_ENTRY_SIZE;
- }
-
- /* Unmap table */
-
- AcpiOsUnmapMemory (Table, Length);
- return (Status);
-}
-
-
/*******************************************************************************
*
* FUNCTION: AcpiTbParseRootTable
*/
AcpiOsUnmapMemory (Rsdp, sizeof (ACPI_TABLE_RSDP));
- /*
- * If it is present and used, validate the XSDT for access/size
- * and ensure that all table entries are at least non-NULL
- */
- if (TableEntrySize == ACPI_XSDT_ENTRY_SIZE)
- {
- Status = AcpiTbValidateXsdt (Address);
- if (ACPI_FAILURE (Status))
- {
- ACPI_BIOS_WARNING ((AE_INFO, "XSDT is invalid (%s), using RSDT",
- AcpiFormatException (Status)));
-
- /* Fall back to the RSDT */
-
- Address = (ACPI_PHYSICAL_ADDRESS) Rsdp->RsdtPhysicalAddress;
- TableEntrySize = ACPI_RSDT_ENTRY_SIZE;
- }
- }
-
/* Map the RSDT/XSDT table header to get the full table length */
Table = AcpiOsMapMemory (Address, sizeof (ACPI_TABLE_HEADER));
{
/* Get the table physical address (32-bit for RSDT, 64-bit for XSDT) */
- Status = AcpiTbInstallStandardTable (
- AcpiTbGetRootTableEntry (TableEntry, TableEntrySize),
+ Address = AcpiTbGetRootTableEntry (TableEntry, TableEntrySize);
+
+ /* Skip NULL entries in RSDT/XSDT */
+
+ if (!Address)
+ {
+ goto NextTable;
+ }
+
+ Status = AcpiTbInstallStandardTable (Address,
ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL, FALSE, TRUE, &TableIndex);
if (ACPI_SUCCESS (Status) &&
AcpiTbParseFadt (TableIndex);
}
+NextTable:
+
TableEntry += TableEntrySize;
}
- /*
- * It is not possible to map more than one entry in some environments,
- * so unmap the root table here before mapping other tables
- */
AcpiOsUnmapMemory (Table, Length);
return_ACPI_STATUS (AE_OK);
*
*****************************************************************************/
-#define __TBXFACE_C__
#define EXPORT_ACPI_INTERFACES
#include "acpi.h"
*
*****************************************************************************/
-#define __TBXFLOAD_C__
#define EXPORT_ACPI_INTERFACES
#include "acpi.h"
*
*****************************************************************************/
-#define __TBXFROOT_C__
-
#include "acpi.h"
#include "accommon.h"
#include "actables.h"
ACPI_MODULE_NAME ("tbxfroot")
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbGetRsdpLength
+ *
+ * PARAMETERS: Rsdp - Pointer to RSDP
+ *
+ * RETURN: Table length
+ *
+ * DESCRIPTION: Get the length of the RSDP
+ *
+ ******************************************************************************/
+
+UINT32
+AcpiTbGetRsdpLength (
+ ACPI_TABLE_RSDP *Rsdp)
+{
+
+ if (!ACPI_VALIDATE_RSDP_SIG (Rsdp->Signature))
+ {
+ /* BAD Signature */
+
+ return (0);
+ }
+
+ /* "Length" field is available if table version >= 2 */
+
+ if (Rsdp->Revision >= 2)
+ {
+ return (Rsdp->Length);
+ }
+ else
+ {
+ return (ACPI_RSDP_CHECKSUM_LENGTH);
+ }
+}
+
+
/*******************************************************************************
*
* FUNCTION: AcpiTbValidateRsdp
*
*****************************************************************************/
-#define __UTADDRESS_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
*
*****************************************************************************/
-#define __UTALLOC_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acdebug.h"
*
*****************************************************************************/
-#define __UTBUFFER_C__
-
#include "acpi.h"
#include "accommon.h"
AcpiUtDumpBuffer (Buffer, Count, Display, 0);
}
+
+
+#ifdef ACPI_APPLICATION
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtDumpBufferToFile
+ *
+ * PARAMETERS: File - File descriptor
+ * Buffer - Buffer to dump
+ * Count - Amount to dump, in bytes
+ * Display - BYTE, WORD, DWORD, or QWORD display:
+ * DB_BYTE_DISPLAY
+ * DB_WORD_DISPLAY
+ * DB_DWORD_DISPLAY
+ * DB_QWORD_DISPLAY
+ * BaseOffset - Beginning buffer offset (display only)
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Generic dump buffer in both hex and ascii to a file.
+ *
+ ******************************************************************************/
+
+void
+AcpiUtDumpBufferToFile (
+ ACPI_FILE File,
+ UINT8 *Buffer,
+ UINT32 Count,
+ UINT32 Display,
+ UINT32 BaseOffset)
+{
+ UINT32 i = 0;
+ UINT32 j;
+ UINT32 Temp32;
+ UINT8 BufChar;
+
+
+ if (!Buffer)
+ {
+ AcpiUtFilePrintf (File, "Null Buffer Pointer in DumpBuffer!\n");
+ return;
+ }
+
+ if ((Count < 4) || (Count & 0x01))
+ {
+ Display = DB_BYTE_DISPLAY;
+ }
+
+ /* Nasty little dump buffer routine! */
+
+ while (i < Count)
+ {
+ /* Print current offset */
+
+ AcpiUtFilePrintf (File, "%6.4X: ", (BaseOffset + i));
+
+ /* Print 16 hex chars */
+
+ for (j = 0; j < 16;)
+ {
+ if (i + j >= Count)
+ {
+ /* Dump fill spaces */
+
+ AcpiUtFilePrintf (File, "%*s", ((Display * 2) + 1), " ");
+ j += Display;
+ continue;
+ }
+
+ switch (Display)
+ {
+ case DB_BYTE_DISPLAY:
+ default: /* Default is BYTE display */
+
+ AcpiUtFilePrintf (File, "%02X ", Buffer[(ACPI_SIZE) i + j]);
+ break;
+
+ case DB_WORD_DISPLAY:
+
+ ACPI_MOVE_16_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]);
+ AcpiUtFilePrintf (File, "%04X ", Temp32);
+ break;
+
+ case DB_DWORD_DISPLAY:
+
+ ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]);
+ AcpiUtFilePrintf (File, "%08X ", Temp32);
+ break;
+
+ case DB_QWORD_DISPLAY:
+
+ ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]);
+ AcpiUtFilePrintf (File, "%08X", Temp32);
+
+ ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j + 4]);
+ AcpiUtFilePrintf (File, "%08X ", Temp32);
+ break;
+ }
+
+ j += Display;
+ }
+
+ /*
+ * Print the ASCII equivalent characters but watch out for the bad
+ * unprintable ones (printable chars are 0x20 through 0x7E)
+ */
+ AcpiUtFilePrintf (File, " ");
+ for (j = 0; j < 16; j++)
+ {
+ if (i + j >= Count)
+ {
+ AcpiUtFilePrintf (File, "\n");
+ return;
+ }
+
+ BufChar = Buffer[(ACPI_SIZE) i + j];
+ if (ACPI_IS_PRINT (BufChar))
+ {
+ AcpiUtFilePrintf (File, "%c", BufChar);
+ }
+ else
+ {
+ AcpiUtFilePrintf (File, ".");
+ }
+ }
+
+ /* Done with that line. */
+
+ AcpiUtFilePrintf (File, "\n");
+ i += 16;
+ }
+
+ return;
+}
+#endif
*
*****************************************************************************/
-#define __UTCACHE_C__
-
#include "acpi.h"
#include "accommon.h"
*
*****************************************************************************/
-
-#define __CMCLIB_C__
-
#include "acpi.h"
#include "accommon.h"
}
-#ifdef ACPI_FUTURE_IMPLEMENTATION
-/* Not used at this time */
/*******************************************************************************
*
* FUNCTION: AcpiUtStrchr (strchr)
return (NULL);
}
-#endif
+
/*******************************************************************************
*
*
*****************************************************************************/
-#define __UTCOPY_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
Status = AcpiUtCopySimpleObject (SourceDesc, *DestDesc);
}
+ /* Delete the allocated object if copy failed */
+
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiUtRemoveReference(*DestDesc);
+ }
+
return_ACPI_STATUS (Status);
}
*
*****************************************************************************/
-#define __UTDEBUG_C__
#define EXPORT_ACPI_INTERFACES
#include "acpi.h"
}
#endif
+
+
+#ifdef ACPI_APPLICATION
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiLogError
+ *
+ * PARAMETERS: Format - Printf format field
+ * ... - Optional printf arguments
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Print error message to the console, used by applications.
+ *
+ ******************************************************************************/
+
+void ACPI_INTERNAL_VAR_XFACE
+AcpiLogError (
+ const char *Format,
+ ...)
+{
+ va_list Args;
+
+ va_start (Args, Format);
+ (void) AcpiUtFileVprintf (ACPI_FILE_ERR, Format, Args);
+ va_end (Args);
+}
+
+ACPI_EXPORT_SYMBOL (AcpiLogError)
+#endif
*
*****************************************************************************/
-#define __UTDECODE_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
};
-/*******************************************************************************
- *
- * FUNCTION: AcpiUtHexToAsciiChar
- *
- * PARAMETERS: Integer - Contains the hex digit
- * Position - bit position of the digit within the
- * integer (multiple of 4)
- *
- * RETURN: The converted Ascii character
- *
- * DESCRIPTION: Convert a hex digit to an Ascii character
- *
- ******************************************************************************/
-
-/* Hex to ASCII conversion table */
-
-static const char AcpiGbl_HexToAscii[] =
-{
- '0','1','2','3','4','5','6','7',
- '8','9','A','B','C','D','E','F'
-};
-
-char
-AcpiUtHexToAsciiChar (
- UINT64 Integer,
- UINT32 Position)
-{
-
- return (AcpiGbl_HexToAscii[(Integer >> Position) & 0xF]);
-}
-
-
/*******************************************************************************
*
* FUNCTION: AcpiUtGetRegionName
/* 09 */ "Device PLD Check",
/* 0A */ "Reserved",
/* 0B */ "System Locality Update",
- /* 0C */ "Shutdown Request"
+ /* 0C */ "Shutdown Request",
+ /* 0D */ "System Resource Affinity Update"
};
static const char *AcpiGbl_DeviceNotify[4] =
ACPI_OBJECT_TYPE Type)
{
- /* 00 - 0C are common to all object types */
+ /* 00 - 0D are common to all object types */
if (NotifyValue <= ACPI_NOTIFY_MAX)
{
*
*****************************************************************************/
-#define __UTDELETE_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acinterp.h"
*
*****************************************************************************/
-#define __UTERROR_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
*
*****************************************************************************/
-#define __UTEVAL_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
*
*****************************************************************************/
-
-#define __UTEXCEP_C__
#define EXPORT_ACPI_INTERFACES
#define ACPI_DEFINE_EXCEPTION_TABLE
--- /dev/null
+/*******************************************************************************
+ *
+ * Module Name: utfileio - simple file I/O routines
+ *
+ ******************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2014, 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.
+ *
+ *****************************************************************************/
+
+#include "acpi.h"
+#include "accommon.h"
+#include "actables.h"
+#include "acapps.h"
+
+#ifdef ACPI_ASL_COMPILER
+#include "aslcompiler.h"
+#endif
+
+
+#define _COMPONENT ACPI_CA_DEBUGGER
+ ACPI_MODULE_NAME ("utfileio")
+
+
+#ifdef ACPI_APPLICATION
+
+/* Local prototypes */
+
+static ACPI_STATUS
+AcpiUtCheckTextModeCorruption (
+ UINT8 *Table,
+ UINT32 TableLength,
+ UINT32 FileLength);
+
+static ACPI_STATUS
+AcpiUtReadTable (
+ FILE *fp,
+ ACPI_TABLE_HEADER **Table,
+ UINT32 *TableLength);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtCheckTextModeCorruption
+ *
+ * PARAMETERS: Table - Table buffer
+ * TableLength - Length of table from the table header
+ * FileLength - Length of the file that contains the table
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Check table for text mode file corruption where all linefeed
+ * characters (LF) have been replaced by carriage return linefeed
+ * pairs (CR/LF).
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiUtCheckTextModeCorruption (
+ UINT8 *Table,
+ UINT32 TableLength,
+ UINT32 FileLength)
+{
+ UINT32 i;
+ UINT32 Pairs = 0;
+
+
+ if (TableLength != FileLength)
+ {
+ ACPI_WARNING ((AE_INFO,
+ "File length (0x%X) is not the same as the table length (0x%X)",
+ FileLength, TableLength));
+ }
+
+ /* Scan entire table to determine if each LF has been prefixed with a CR */
+
+ for (i = 1; i < FileLength; i++)
+ {
+ if (Table[i] == 0x0A)
+ {
+ if (Table[i - 1] != 0x0D)
+ {
+ /* The LF does not have a preceding CR, table not corrupted */
+
+ return (AE_OK);
+ }
+ else
+ {
+ /* Found a CR/LF pair */
+
+ Pairs++;
+ }
+ i++;
+ }
+ }
+
+ if (!Pairs)
+ {
+ return (AE_OK);
+ }
+
+ /*
+ * Entire table scanned, each CR is part of a CR/LF pair --
+ * meaning that the table was treated as a text file somewhere.
+ *
+ * NOTE: We can't "fix" the table, because any existing CR/LF pairs in the
+ * original table are left untouched by the text conversion process --
+ * meaning that we cannot simply replace CR/LF pairs with LFs.
+ */
+ AcpiOsPrintf ("Table has been corrupted by text mode conversion\n");
+ AcpiOsPrintf ("All LFs (%u) were changed to CR/LF pairs\n", Pairs);
+ AcpiOsPrintf ("Table cannot be repaired!\n");
+ return (AE_BAD_VALUE);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtReadTable
+ *
+ * PARAMETERS: fp - File that contains table
+ * Table - Return value, buffer with table
+ * TableLength - Return value, length of table
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Load the DSDT from the file pointer
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiUtReadTable (
+ FILE *fp,
+ ACPI_TABLE_HEADER **Table,
+ UINT32 *TableLength)
+{
+ ACPI_TABLE_HEADER TableHeader;
+ UINT32 Actual;
+ ACPI_STATUS Status;
+ UINT32 FileSize;
+ BOOLEAN StandardHeader = TRUE;
+ INT32 Count;
+
+ /* Get the file size */
+
+ FileSize = CmGetFileSize (fp);
+ if (FileSize == ACPI_UINT32_MAX)
+ {
+ return (AE_ERROR);
+ }
+
+ if (FileSize < 4)
+ {
+ return (AE_BAD_HEADER);
+ }
+
+ /* Read the signature */
+
+ fseek (fp, 0, SEEK_SET);
+
+ Count = fread (&TableHeader, 1, sizeof (ACPI_TABLE_HEADER), fp);
+ if (Count != sizeof (ACPI_TABLE_HEADER))
+ {
+ AcpiOsPrintf ("Could not read the table header\n");
+ return (AE_BAD_HEADER);
+ }
+
+ /* The RSDP table does not have standard ACPI header */
+
+ if (ACPI_VALIDATE_RSDP_SIG (TableHeader.Signature))
+ {
+ *TableLength = FileSize;
+ StandardHeader = FALSE;
+ }
+ else
+ {
+
+#if 0
+ /* Validate the table header/length */
+
+ Status = AcpiTbValidateTableHeader (&TableHeader);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("Table header is invalid!\n");
+ return (Status);
+ }
+#endif
+
+ /* File size must be at least as long as the Header-specified length */
+
+ if (TableHeader.Length > FileSize)
+ {
+ AcpiOsPrintf (
+ "TableHeader length [0x%X] greater than the input file size [0x%X]\n",
+ TableHeader.Length, FileSize);
+
+#ifdef ACPI_ASL_COMPILER
+ Status = FlCheckForAscii (fp, NULL, FALSE);
+ if (ACPI_SUCCESS (Status))
+ {
+ AcpiOsPrintf ("File appears to be ASCII only, must be binary\n");
+ }
+#endif
+ return (AE_BAD_HEADER);
+ }
+
+#ifdef ACPI_OBSOLETE_CODE
+ /* We only support a limited number of table types */
+
+ if (!ACPI_COMPARE_NAME ((char *) TableHeader.Signature, ACPI_SIG_DSDT) &&
+ !ACPI_COMPARE_NAME ((char *) TableHeader.Signature, ACPI_SIG_PSDT) &&
+ !ACPI_COMPARE_NAME ((char *) TableHeader.Signature, ACPI_SIG_SSDT))
+ {
+ AcpiOsPrintf ("Table signature [%4.4s] is invalid or not supported\n",
+ (char *) TableHeader.Signature);
+ ACPI_DUMP_BUFFER (&TableHeader, sizeof (ACPI_TABLE_HEADER));
+ return (AE_ERROR);
+ }
+#endif
+
+ *TableLength = TableHeader.Length;
+ }
+
+ /* Allocate a buffer for the table */
+
+ *Table = AcpiOsAllocate ((size_t) FileSize);
+ if (!*Table)
+ {
+ AcpiOsPrintf (
+ "Could not allocate memory for ACPI table %4.4s (size=0x%X)\n",
+ TableHeader.Signature, *TableLength);
+ return (AE_NO_MEMORY);
+ }
+
+ /* Get the rest of the table */
+
+ fseek (fp, 0, SEEK_SET);
+ Actual = fread (*Table, 1, (size_t) FileSize, fp);
+ if (Actual == FileSize)
+ {
+ if (StandardHeader)
+ {
+ /* Now validate the checksum */
+
+ Status = AcpiTbVerifyChecksum ((void *) *Table,
+ ACPI_CAST_PTR (ACPI_TABLE_HEADER, *Table)->Length);
+
+ if (Status == AE_BAD_CHECKSUM)
+ {
+ Status = AcpiUtCheckTextModeCorruption ((UINT8 *) *Table,
+ FileSize, (*Table)->Length);
+ return (Status);
+ }
+ }
+ return (AE_OK);
+ }
+
+ if (Actual > 0)
+ {
+ AcpiOsPrintf ("Warning - reading table, asked for %X got %X\n",
+ FileSize, Actual);
+ return (AE_OK);
+ }
+
+ AcpiOsPrintf ("Error - could not read the table file\n");
+ AcpiOsFree (*Table);
+ *Table = NULL;
+ *TableLength = 0;
+ return (AE_ERROR);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtReadTableFromFile
+ *
+ * PARAMETERS: Filename - File where table is located
+ * Table - Where a pointer to the table is returned
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Get an ACPI table from a file
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiUtReadTableFromFile (
+ char *Filename,
+ ACPI_TABLE_HEADER **Table)
+{
+ FILE *File;
+ UINT32 FileSize;
+ UINT32 TableLength;
+ ACPI_STATUS Status = AE_ERROR;
+
+
+ /* Open the file, get current size */
+
+ File = fopen (Filename, "rb");
+ if (!File)
+ {
+ perror ("Could not open input file");
+ return (Status);
+ }
+
+ FileSize = CmGetFileSize (File);
+ if (FileSize == ACPI_UINT32_MAX)
+ {
+ goto Exit;
+ }
+
+ /* Get the entire file */
+
+ fprintf (stderr, "Loading Acpi table from file %10s - Length %.8u (%06X)\n",
+ Filename, FileSize, FileSize);
+
+ Status = AcpiUtReadTable (File, Table, &TableLength);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("Could not get table from the file\n");
+ }
+
+Exit:
+ fclose(File);
+ return (Status);
+}
+
+#endif
*
*****************************************************************************/
-#define __UTGLOBAL_C__
#define EXPORT_ACPI_INTERFACES
#define DEFINE_ACPI_GLOBALS
*
******************************************************************************/
-/* Debug output control masks */
-
-#ifdef ACPI_DEBUG_OUTPUT
-UINT32 AcpiDbgLevel = ACPI_DEBUG_DEFAULT;
-#else
-UINT32 AcpiDbgLevel = ACPI_NORMAL_DEFAULT;
-#endif
-
-UINT32 AcpiDbgLayer = ACPI_COMPONENT_DEFAULT;
-
-/* AcpiGbl_FADT is a local copy of the FADT, converted to a common format. */
-
-ACPI_TABLE_FADT AcpiGbl_FADT;
-UINT32 AcpiGbl_TraceFlags;
-ACPI_NAME AcpiGbl_TraceMethodName;
-BOOLEAN AcpiGbl_SystemAwakeAndRunning;
-UINT32 AcpiCurrentGpeCount;
-
-/*
- * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning
- * that the ACPI hardware is no longer required. A flag in the FADT indicates
- * a reduced HW machine, and that flag is duplicated here for convenience.
- */
-BOOLEAN AcpiGbl_ReducedHardware;
-
/* Various state name strings */
const char *AcpiGbl_SleepStateNames[ACPI_S_STATE_COUNT] =
};
#endif /* !ACPI_REDUCED_HARDWARE */
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiUtInitGlobals
- *
- * PARAMETERS: None
- *
- * RETURN: Status
- *
- * DESCRIPTION: Initialize ACPICA globals. All globals that require specific
- * initialization should be initialized here. This allows for
- * a warm restart.
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiUtInitGlobals (
- void)
-{
- ACPI_STATUS Status;
- UINT32 i;
-
-
- ACPI_FUNCTION_TRACE (UtInitGlobals);
-
-
- /* Create all memory caches */
-
- Status = AcpiUtCreateCaches ();
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
-
- /* Address Range lists */
-
- for (i = 0; i < ACPI_ADDRESS_RANGE_MAX; i++)
- {
- AcpiGbl_AddressRangeList[i] = NULL;
- }
-
- /* Mutex locked flags */
-
- for (i = 0; i < ACPI_NUM_MUTEX; i++)
- {
- AcpiGbl_MutexInfo[i].Mutex = NULL;
- AcpiGbl_MutexInfo[i].ThreadId = ACPI_MUTEX_NOT_ACQUIRED;
- AcpiGbl_MutexInfo[i].UseCount = 0;
- }
-
- for (i = 0; i < ACPI_NUM_OWNERID_MASKS; i++)
- {
- AcpiGbl_OwnerIdMask[i] = 0;
- }
-
- /* Last OwnerID is never valid */
-
- AcpiGbl_OwnerIdMask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000;
-
- /* Event counters */
-
- AcpiMethodCount = 0;
- AcpiSciCount = 0;
- AcpiGpeCount = 0;
-
- for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++)
- {
- AcpiFixedEventCount[i] = 0;
- }
-
-#if (!ACPI_REDUCED_HARDWARE)
-
- /* GPE/SCI support */
-
- AcpiGbl_AllGpesInitialized = FALSE;
- AcpiGbl_GpeXruptListHead = NULL;
- AcpiGbl_GpeFadtBlocks[0] = NULL;
- AcpiGbl_GpeFadtBlocks[1] = NULL;
- AcpiCurrentGpeCount = 0;
-
- AcpiGbl_GlobalEventHandler = NULL;
- AcpiGbl_SciHandlerList = NULL;
-
-#endif /* !ACPI_REDUCED_HARDWARE */
-
- /* Global handlers */
-
- AcpiGbl_GlobalNotify[0].Handler = NULL;
- AcpiGbl_GlobalNotify[1].Handler = NULL;
- AcpiGbl_ExceptionHandler = NULL;
- AcpiGbl_InitHandler = NULL;
- AcpiGbl_TableHandler = NULL;
- AcpiGbl_InterfaceHandler = NULL;
-
- /* Global Lock support */
-
- AcpiGbl_GlobalLockSemaphore = NULL;
- AcpiGbl_GlobalLockMutex = NULL;
- AcpiGbl_GlobalLockAcquired = FALSE;
- AcpiGbl_GlobalLockHandle = 0;
- AcpiGbl_GlobalLockPresent = FALSE;
-
- /* Miscellaneous variables */
-
- AcpiGbl_DSDT = NULL;
- AcpiGbl_CmSingleStep = FALSE;
- AcpiGbl_Shutdown = FALSE;
- AcpiGbl_NsLookupCount = 0;
- AcpiGbl_PsFindCount = 0;
- AcpiGbl_AcpiHardwarePresent = TRUE;
- AcpiGbl_LastOwnerIdIndex = 0;
- AcpiGbl_NextOwnerIdOffset = 0;
- AcpiGbl_TraceMethodName = 0;
- AcpiGbl_TraceDbgLevel = 0;
- AcpiGbl_TraceDbgLayer = 0;
- AcpiGbl_DebuggerConfiguration = DEBUGGER_THREADING;
- AcpiGbl_DbOutputFlags = ACPI_DB_CONSOLE_OUTPUT;
- AcpiGbl_OsiMutex = NULL;
- AcpiGbl_RegMethodsExecuted = FALSE;
-
- /* Hardware oriented */
-
- AcpiGbl_EventsInitialized = FALSE;
- AcpiGbl_SystemAwakeAndRunning = TRUE;
-
- /* Namespace */
-
- AcpiGbl_ModuleCodeList = NULL;
- AcpiGbl_RootNode = NULL;
- AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME;
- AcpiGbl_RootNodeStruct.DescriptorType = ACPI_DESC_TYPE_NAMED;
- AcpiGbl_RootNodeStruct.Type = ACPI_TYPE_DEVICE;
- AcpiGbl_RootNodeStruct.Parent = NULL;
- AcpiGbl_RootNodeStruct.Child = NULL;
- AcpiGbl_RootNodeStruct.Peer = NULL;
- AcpiGbl_RootNodeStruct.Object = NULL;
-
-
-#ifdef ACPI_DISASSEMBLER
- AcpiGbl_ExternalList = NULL;
- AcpiGbl_NumExternalMethods = 0;
- AcpiGbl_ResolvedExternalMethods = 0;
-#endif
-
-#ifdef ACPI_DEBUG_OUTPUT
- AcpiGbl_LowestStackPointer = ACPI_CAST_PTR (ACPI_SIZE, ACPI_SIZE_MAX);
-#endif
-
-#ifdef ACPI_DBG_TRACK_ALLOCATIONS
- AcpiGbl_DisplayFinalMemStats = FALSE;
- AcpiGbl_DisableMemTracking = FALSE;
-#endif
-
-#ifdef ACPI_DEBUGGER
- AcpiGbl_DbTerminateThreads = FALSE;
-#endif
-
- return_ACPI_STATUS (AE_OK);
-}
-
/* Public globals */
ACPI_EXPORT_SYMBOL (AcpiGbl_FADT)
--- /dev/null
+/******************************************************************************
+ *
+ * Module Name: uthex -- Hex/ASCII support functions
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2014, 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.
+ *
+ *****************************************************************************/
+
+#include "acpi.h"
+#include "accommon.h"
+
+#define _COMPONENT ACPI_COMPILER
+ ACPI_MODULE_NAME ("uthex")
+
+
+/* Hex to ASCII conversion table */
+
+static char AcpiGbl_HexToAscii[] =
+{
+ '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'
+};
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtHexToAsciiChar
+ *
+ * PARAMETERS: Integer - Contains the hex digit
+ * Position - bit position of the digit within the
+ * integer (multiple of 4)
+ *
+ * RETURN: The converted Ascii character
+ *
+ * DESCRIPTION: Convert a hex digit to an Ascii character
+ *
+ ******************************************************************************/
+
+char
+AcpiUtHexToAsciiChar (
+ UINT64 Integer,
+ UINT32 Position)
+{
+
+ return (AcpiGbl_HexToAscii[(Integer >> Position) & 0xF]);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtHexCharToValue
+ *
+ * PARAMETERS: AsciiChar - Hex character in Ascii
+ *
+ * RETURN: The binary value of the ascii/hex character
+ *
+ * DESCRIPTION: Perform ascii-to-hex translation
+ *
+ ******************************************************************************/
+
+UINT8
+AcpiUtAsciiCharToHex (
+ int HexChar)
+{
+
+ if (HexChar <= 0x39)
+ {
+ return ((UINT8) (HexChar - 0x30));
+ }
+
+ if (HexChar <= 0x46)
+ {
+ return ((UINT8) (HexChar - 0x37));
+ }
+
+ return ((UINT8) (HexChar - 0x57));
+}
*
*****************************************************************************/
-#define __UTIDS_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acinterp.h"
*
*****************************************************************************/
-
-#define __UTINIT_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
#endif /* !ACPI_REDUCED_HARDWARE */
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtInitGlobals
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Initialize ACPICA globals. All globals that require specific
+ * initialization should be initialized here. This allows for
+ * a warm restart.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiUtInitGlobals (
+ void)
+{
+ ACPI_STATUS Status;
+ UINT32 i;
+
+
+ ACPI_FUNCTION_TRACE (UtInitGlobals);
+
+
+ /* Create all memory caches */
+
+ Status = AcpiUtCreateCaches ();
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ /* Address Range lists */
+
+ for (i = 0; i < ACPI_ADDRESS_RANGE_MAX; i++)
+ {
+ AcpiGbl_AddressRangeList[i] = NULL;
+ }
+
+ /* Mutex locked flags */
+
+ for (i = 0; i < ACPI_NUM_MUTEX; i++)
+ {
+ AcpiGbl_MutexInfo[i].Mutex = NULL;
+ AcpiGbl_MutexInfo[i].ThreadId = ACPI_MUTEX_NOT_ACQUIRED;
+ AcpiGbl_MutexInfo[i].UseCount = 0;
+ }
+
+ for (i = 0; i < ACPI_NUM_OWNERID_MASKS; i++)
+ {
+ AcpiGbl_OwnerIdMask[i] = 0;
+ }
+
+ /* Last OwnerID is never valid */
+
+ AcpiGbl_OwnerIdMask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000;
+
+ /* Event counters */
+
+ AcpiMethodCount = 0;
+ AcpiSciCount = 0;
+ AcpiGpeCount = 0;
+
+ for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++)
+ {
+ AcpiFixedEventCount[i] = 0;
+ }
+
+#if (!ACPI_REDUCED_HARDWARE)
+
+ /* GPE/SCI support */
+
+ AcpiGbl_AllGpesInitialized = FALSE;
+ AcpiGbl_GpeXruptListHead = NULL;
+ AcpiGbl_GpeFadtBlocks[0] = NULL;
+ AcpiGbl_GpeFadtBlocks[1] = NULL;
+ AcpiCurrentGpeCount = 0;
+
+ AcpiGbl_GlobalEventHandler = NULL;
+ AcpiGbl_SciHandlerList = NULL;
+
+#endif /* !ACPI_REDUCED_HARDWARE */
+
+ /* Global handlers */
+
+ AcpiGbl_GlobalNotify[0].Handler = NULL;
+ AcpiGbl_GlobalNotify[1].Handler = NULL;
+ AcpiGbl_ExceptionHandler = NULL;
+ AcpiGbl_InitHandler = NULL;
+ AcpiGbl_TableHandler = NULL;
+ AcpiGbl_InterfaceHandler = NULL;
+
+ /* Global Lock support */
+
+ AcpiGbl_GlobalLockSemaphore = NULL;
+ AcpiGbl_GlobalLockMutex = NULL;
+ AcpiGbl_GlobalLockAcquired = FALSE;
+ AcpiGbl_GlobalLockHandle = 0;
+ AcpiGbl_GlobalLockPresent = FALSE;
+
+ /* Miscellaneous variables */
+
+ AcpiGbl_DSDT = NULL;
+ AcpiGbl_CmSingleStep = FALSE;
+ AcpiGbl_Shutdown = FALSE;
+ AcpiGbl_NsLookupCount = 0;
+ AcpiGbl_PsFindCount = 0;
+ AcpiGbl_AcpiHardwarePresent = TRUE;
+ AcpiGbl_LastOwnerIdIndex = 0;
+ AcpiGbl_NextOwnerIdOffset = 0;
+ AcpiGbl_TraceDbgLevel = 0;
+ AcpiGbl_TraceDbgLayer = 0;
+ AcpiGbl_DebuggerConfiguration = DEBUGGER_THREADING;
+ AcpiGbl_OsiMutex = NULL;
+ AcpiGbl_RegMethodsExecuted = FALSE;
+
+ /* Hardware oriented */
+
+ AcpiGbl_EventsInitialized = FALSE;
+ AcpiGbl_SystemAwakeAndRunning = TRUE;
+
+ /* Namespace */
+
+ AcpiGbl_ModuleCodeList = NULL;
+ AcpiGbl_RootNode = NULL;
+ AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME;
+ AcpiGbl_RootNodeStruct.DescriptorType = ACPI_DESC_TYPE_NAMED;
+ AcpiGbl_RootNodeStruct.Type = ACPI_TYPE_DEVICE;
+ AcpiGbl_RootNodeStruct.Parent = NULL;
+ AcpiGbl_RootNodeStruct.Child = NULL;
+ AcpiGbl_RootNodeStruct.Peer = NULL;
+ AcpiGbl_RootNodeStruct.Object = NULL;
+
+
+#ifdef ACPI_DISASSEMBLER
+ AcpiGbl_ExternalList = NULL;
+ AcpiGbl_NumExternalMethods = 0;
+ AcpiGbl_ResolvedExternalMethods = 0;
+#endif
+
+#ifdef ACPI_DEBUG_OUTPUT
+ AcpiGbl_LowestStackPointer = ACPI_CAST_PTR (ACPI_SIZE, ACPI_SIZE_MAX);
+#endif
+
+#ifdef ACPI_DBG_TRACK_ALLOCATIONS
+ AcpiGbl_DisplayFinalMemStats = FALSE;
+ AcpiGbl_DisableMemTracking = FALSE;
+#endif
+
+ ACPI_DEBUGGER_EXEC (AcpiGbl_DbTerminateThreads = FALSE);
+
+ return_ACPI_STATUS (AE_OK);
+}
+
+
/******************************************************************************
*
* FUNCTION: AcpiUtTerminate
*
*****************************************************************************/
-#define __UTLOCK_C__
-
#include "acpi.h"
#include "accommon.h"
*
*****************************************************************************/
-
-#define __UTMATH_C__
-
#include "acpi.h"
#include "accommon.h"
*
*****************************************************************************/
-
-#define __UTMISC_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
*
*****************************************************************************/
-
-#define __UTMUTEX_C__
-
#include "acpi.h"
#include "accommon.h"
*
*****************************************************************************/
-#define __UTOBJECT_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
default:
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "%p is not not an ACPI operand obj [%s]\n",
+ "%p is not an ACPI operand obj [%s]\n",
Object, AcpiUtGetDescriptorName (Object)));
break;
}
*
*****************************************************************************/
-#define __UTOSI_C__
-
#include "acpi.h"
#include "accommon.h"
*
*****************************************************************************/
-
-#define __UTOWNERID_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
*
*****************************************************************************/
-#define __UTPREDEF_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acpredef.h"
--- /dev/null
+/******************************************************************************
+ *
+ * Module Name: utprint - Formatted printing routines
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2014, 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.
+ *
+ *****************************************************************************/
+
+#include "acpi.h"
+#include "accommon.h"
+
+#define _COMPONENT ACPI_UTILITIES
+ ACPI_MODULE_NAME ("utprint")
+
+
+#define ACPI_FORMAT_SIGN 0x01
+#define ACPI_FORMAT_SIGN_PLUS 0x02
+#define ACPI_FORMAT_SIGN_PLUS_SPACE 0x04
+#define ACPI_FORMAT_ZERO 0x08
+#define ACPI_FORMAT_LEFT 0x10
+#define ACPI_FORMAT_UPPER 0x20
+#define ACPI_FORMAT_PREFIX 0x40
+
+
+/* Local prototypes */
+
+static ACPI_SIZE
+AcpiUtBoundStringLength (
+ const char *String,
+ ACPI_SIZE Count);
+
+static char *
+AcpiUtBoundStringOutput (
+ char *String,
+ const char *End,
+ char c);
+
+static char *
+AcpiUtFormatNumber (
+ char *String,
+ char *End,
+ UINT64 Number,
+ UINT8 Base,
+ INT32 Width,
+ INT32 Precision,
+ UINT8 Type);
+
+static char *
+AcpiUtPutNumber (
+ char *String,
+ UINT64 Number,
+ UINT8 Base,
+ BOOLEAN Upper);
+
+
+/* Module globals */
+
+static const char AcpiGbl_LowerHexDigits[] = "0123456789abcdef";
+static const char AcpiGbl_UpperHexDigits[] = "0123456789ABCDEF";
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtBoundStringLength
+ *
+ * PARAMETERS: String - String with boundary
+ * Count - Boundary of the string
+ *
+ * RETURN: Length of the string. Less than or equal to Count.
+ *
+ * DESCRIPTION: Calculate the length of a string with boundary.
+ *
+ ******************************************************************************/
+
+static ACPI_SIZE
+AcpiUtBoundStringLength (
+ const char *String,
+ ACPI_SIZE Count)
+{
+ UINT32 Length = 0;
+
+
+ while (*String && Count)
+ {
+ Length++;
+ String++;
+ Count--;
+ }
+
+ return (Length);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtBoundStringOutput
+ *
+ * PARAMETERS: String - String with boundary
+ * End - Boundary of the string
+ * c - Character to be output to the string
+ *
+ * RETURN: Updated position for next valid character
+ *
+ * DESCRIPTION: Output a character into a string with boundary check.
+ *
+ ******************************************************************************/
+
+static char *
+AcpiUtBoundStringOutput (
+ char *String,
+ const char *End,
+ char c)
+{
+
+ if (String < End)
+ {
+ *String = c;
+ }
+
+ ++String;
+ return (String);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtPutNumber
+ *
+ * PARAMETERS: String - Buffer to hold reverse-ordered string
+ * Number - Integer to be converted
+ * Base - Base of the integer
+ * Upper - Whether or not using upper cased digits
+ *
+ * RETURN: Updated position for next valid character
+ *
+ * DESCRIPTION: Convert an integer into a string, note that, the string holds a
+ * reversed ordered number without the trailing zero.
+ *
+ ******************************************************************************/
+
+static char *
+AcpiUtPutNumber (
+ char *String,
+ UINT64 Number,
+ UINT8 Base,
+ BOOLEAN Upper)
+{
+ const char *Digits;
+ UINT64 DigitIndex;
+ char *Pos;
+
+
+ Pos = String;
+ Digits = Upper ? AcpiGbl_UpperHexDigits : AcpiGbl_LowerHexDigits;
+
+ if (Number == 0)
+ {
+ *(Pos++) = '0';
+ }
+ else
+ {
+ while (Number)
+ {
+ (void) AcpiUtDivide (Number, Base, &Number, &DigitIndex);
+ *(Pos++) = Digits[DigitIndex];
+ }
+ }
+
+ /* *(Pos++) = '0'; */
+ return (Pos);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtScanNumber
+ *
+ * PARAMETERS: String - String buffer
+ * NumberPtr - Where the number is returned
+ *
+ * RETURN: Updated position for next valid character
+ *
+ * DESCRIPTION: Scan a string for a decimal integer.
+ *
+ ******************************************************************************/
+
+const char *
+AcpiUtScanNumber (
+ const char *String,
+ UINT64 *NumberPtr)
+{
+ UINT64 Number = 0;
+
+
+ while (ACPI_IS_DIGIT (*String))
+ {
+ Number *= 10;
+ Number += *(String++) - '0';
+ }
+
+ *NumberPtr = Number;
+ return (String);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtPrintNumber
+ *
+ * PARAMETERS: String - String buffer
+ * Number - The number to be converted
+ *
+ * RETURN: Updated position for next valid character
+ *
+ * DESCRIPTION: Print a decimal integer into a string.
+ *
+ ******************************************************************************/
+
+const char *
+AcpiUtPrintNumber (
+ char *String,
+ UINT64 Number)
+{
+ char AsciiString[20];
+ const char *Pos1;
+ char *Pos2;
+
+
+ Pos1 = AcpiUtPutNumber (AsciiString, Number, 10, FALSE);
+ Pos2 = String;
+
+ while (Pos1 != AsciiString)
+ {
+ *(Pos2++) = *(--Pos1);
+ }
+
+ *Pos2 = 0;
+ return (String);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtFormatNumber
+ *
+ * PARAMETERS: String - String buffer with boundary
+ * End - Boundary of the string
+ * Number - The number to be converted
+ * Base - Base of the integer
+ * Width - Field width
+ * Precision - Precision of the integer
+ * Type - Special printing flags
+ *
+ * RETURN: Updated position for next valid character
+ *
+ * DESCRIPTION: Print an integer into a string with any base and any precision.
+ *
+ ******************************************************************************/
+
+static char *
+AcpiUtFormatNumber (
+ char *String,
+ char *End,
+ UINT64 Number,
+ UINT8 Base,
+ INT32 Width,
+ INT32 Precision,
+ UINT8 Type)
+{
+ char *Pos;
+ char Sign;
+ char Zero;
+ BOOLEAN NeedPrefix;
+ BOOLEAN Upper;
+ INT32 i;
+ char ReversedString[66];
+
+
+ /* Parameter validation */
+
+ if (Base < 2 || Base > 16)
+ {
+ return (NULL);
+ }
+
+ if (Type & ACPI_FORMAT_LEFT)
+ {
+ Type &= ~ACPI_FORMAT_ZERO;
+ }
+
+ NeedPrefix = ((Type & ACPI_FORMAT_PREFIX) && Base != 10) ? TRUE : FALSE;
+ Upper = (Type & ACPI_FORMAT_UPPER) ? TRUE : FALSE;
+ Zero = (Type & ACPI_FORMAT_ZERO) ? '0' : ' ';
+
+ /* Calculate size according to sign and prefix */
+
+ Sign = '\0';
+ if (Type & ACPI_FORMAT_SIGN)
+ {
+ if ((INT64) Number < 0)
+ {
+ Sign = '-';
+ Number = - (INT64) Number;
+ Width--;
+ }
+ else if (Type & ACPI_FORMAT_SIGN_PLUS)
+ {
+ Sign = '+';
+ Width--;
+ }
+ else if (Type & ACPI_FORMAT_SIGN_PLUS_SPACE)
+ {
+ Sign = ' ';
+ Width--;
+ }
+ }
+ if (NeedPrefix)
+ {
+ Width--;
+ if (Base == 16)
+ {
+ Width--;
+ }
+ }
+
+ /* Generate full string in reverse order */
+
+ Pos = AcpiUtPutNumber (ReversedString, Number, Base, Upper);
+ i = ACPI_PTR_DIFF (Pos, ReversedString);
+
+ /* Printing 100 using %2d gives "100", not "00" */
+
+ if (i > Precision)
+ {
+ Precision = i;
+ }
+
+ Width -= Precision;
+
+ /* Output the string */
+
+ if (!(Type & (ACPI_FORMAT_ZERO | ACPI_FORMAT_LEFT)))
+ {
+ while (--Width >= 0)
+ {
+ String = AcpiUtBoundStringOutput (String, End, ' ');
+ }
+ }
+ if (Sign)
+ {
+ String = AcpiUtBoundStringOutput (String, End, Sign);
+ }
+ if (NeedPrefix)
+ {
+ String = AcpiUtBoundStringOutput (String, End, '0');
+ if (Base == 16)
+ {
+ String = AcpiUtBoundStringOutput (String, End,
+ Upper ? 'X' : 'x');
+ }
+ }
+ if (!(Type & ACPI_FORMAT_LEFT))
+ {
+ while (--Width >= 0)
+ {
+ String = AcpiUtBoundStringOutput (String, End, Zero);
+ }
+ }
+
+ while (i <= --Precision)
+ {
+ String = AcpiUtBoundStringOutput (String, End, '0');
+ }
+ while (--i >= 0)
+ {
+ String = AcpiUtBoundStringOutput (String, End,
+ ReversedString[i]);
+ }
+ while (--Width >= 0)
+ {
+ String = AcpiUtBoundStringOutput (String, End, ' ');
+ }
+
+ return (String);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtVsnprintf
+ *
+ * PARAMETERS: String - String with boundary
+ * Size - Boundary of the string
+ * Format - Standard printf format
+ * Args - Argument list
+ *
+ * RETURN: Number of bytes actually written.
+ *
+ * DESCRIPTION: Formatted output to a string using argument list pointer.
+ *
+ ******************************************************************************/
+
+int
+AcpiUtVsnprintf (
+ char *String,
+ ACPI_SIZE Size,
+ const char *Format,
+ va_list Args)
+{
+ UINT8 Base = 10;
+ UINT8 Type = 0;
+ INT32 Width = -1;
+ INT32 Precision = -1;
+ char Qualifier = 0;
+ UINT64 Number;
+ char *Pos;
+ char *End;
+ char c;
+ const char *s;
+ const void *p;
+ INT32 Length;
+ int i;
+
+
+ Pos = String;
+ End = String + Size;
+
+ for (; *Format; ++Format)
+ {
+ if (*Format != '%')
+ {
+ Pos = AcpiUtBoundStringOutput (Pos, End, *Format);
+ continue;
+ }
+
+ /* Process sign */
+
+ do
+ {
+ ++Format;
+ if (*Format == '#')
+ {
+ Type |= ACPI_FORMAT_PREFIX;
+ }
+ else if (*Format == '0')
+ {
+ Type |= ACPI_FORMAT_ZERO;
+ }
+ else if (*Format == '+')
+ {
+ Type |= ACPI_FORMAT_SIGN_PLUS;
+ }
+ else if (*Format == ' ')
+ {
+ Type |= ACPI_FORMAT_SIGN_PLUS_SPACE;
+ }
+ else if (*Format == '-')
+ {
+ Type |= ACPI_FORMAT_LEFT;
+ }
+ else
+ {
+ break;
+ }
+ } while (1);
+
+ /* Process width */
+
+ Width = -1;
+ if (ACPI_IS_DIGIT (*Format))
+ {
+ Format = AcpiUtScanNumber (Format, &Number);
+ Width = (INT32) Number;
+ }
+ else if (*Format == '*')
+ {
+ ++Format;
+ Width = va_arg (Args, int);
+ if (Width < 0)
+ {
+ Width = -Width;
+ Type |= ACPI_FORMAT_LEFT;
+ }
+ }
+
+ /* Process precision */
+
+ Precision = -1;
+ if (*Format == '.')
+ {
+ ++Format;
+ if (ACPI_IS_DIGIT(*Format))
+ {
+ Format = AcpiUtScanNumber (Format, &Number);
+ Precision = (INT32) Number;
+ }
+ else if (*Format == '*')
+ {
+ ++Format;
+ Precision = va_arg (Args, int);
+ }
+ if (Precision < 0)
+ {
+ Precision = 0;
+ }
+ }
+
+ /* Process qualifier */
+
+ Qualifier = -1;
+ if (*Format == 'h' || *Format == 'l' || *Format == 'L')
+ {
+ Qualifier = *Format;
+ ++Format;
+
+ if (Qualifier == 'l' && *Format == 'l')
+ {
+ Qualifier = 'L';
+ ++Format;
+ }
+ }
+
+ switch (*Format)
+ {
+ case '%':
+
+ Pos = AcpiUtBoundStringOutput (Pos, End, '%');
+ continue;
+
+ case 'c':
+
+ if (!(Type & ACPI_FORMAT_LEFT))
+ {
+ while (--Width > 0)
+ {
+ Pos = AcpiUtBoundStringOutput (Pos, End, ' ');
+ }
+ }
+
+ c = (char) va_arg (Args, int);
+ Pos = AcpiUtBoundStringOutput (Pos, End, c);
+
+ while (--Width > 0)
+ {
+ Pos = AcpiUtBoundStringOutput (Pos, End, ' ');
+ }
+ continue;
+
+ case 's':
+
+ s = va_arg (Args, char *);
+ if (!s)
+ {
+ s = "<NULL>";
+ }
+ Length = AcpiUtBoundStringLength (s, Precision);
+ if (!(Type & ACPI_FORMAT_LEFT))
+ {
+ while (Length < Width--)
+ {
+ Pos = AcpiUtBoundStringOutput (Pos, End, ' ');
+ }
+ }
+ for (i = 0; i < Length; ++i)
+ {
+ Pos = AcpiUtBoundStringOutput (Pos, End, *s);
+ ++s;
+ }
+ while (Length < Width--)
+ {
+ Pos = AcpiUtBoundStringOutput (Pos, End, ' ');
+ }
+ continue;
+
+ case 'o':
+
+ Base = 8;
+ break;
+
+ case 'X':
+
+ Type |= ACPI_FORMAT_UPPER;
+
+ case 'x':
+
+ Base = 16;
+ break;
+
+ case 'd':
+ case 'i':
+
+ Type |= ACPI_FORMAT_SIGN;
+
+ case 'u':
+
+ break;
+
+ case 'p':
+
+ if (Width == -1)
+ {
+ Width = 2 * sizeof (void *);
+ Type |= ACPI_FORMAT_ZERO;
+ }
+
+ p = va_arg (Args, void *);
+ Pos = AcpiUtFormatNumber (Pos, End,
+ ACPI_TO_INTEGER (p), 16, Width, Precision, Type);
+ continue;
+
+ default:
+
+ Pos = AcpiUtBoundStringOutput (Pos, End, '%');
+ if (*Format)
+ {
+ Pos = AcpiUtBoundStringOutput (Pos, End, *Format);
+ }
+ else
+ {
+ --Format;
+ }
+ continue;
+ }
+
+ if (Qualifier == 'L')
+ {
+ Number = va_arg (Args, UINT64);
+ if (Type & ACPI_FORMAT_SIGN)
+ {
+ Number = (INT64) Number;
+ }
+ }
+ else if (Qualifier == 'l')
+ {
+ Number = va_arg (Args, unsigned long);
+ if (Type & ACPI_FORMAT_SIGN)
+ {
+ Number = (INT32) Number;
+ }
+ }
+ else if (Qualifier == 'h')
+ {
+ Number = (UINT16) va_arg (Args, int);
+ if (Type & ACPI_FORMAT_SIGN)
+ {
+ Number = (INT16) Number;
+ }
+ }
+ else
+ {
+ Number = va_arg (Args, unsigned int);
+ if (Type & ACPI_FORMAT_SIGN)
+ {
+ Number = (signed int) Number;
+ }
+ }
+
+ Pos = AcpiUtFormatNumber (Pos, End, Number, Base,
+ Width, Precision, Type);
+ }
+
+ if (Size > 0)
+ {
+ if (Pos < End)
+ {
+ *Pos = '\0';
+ }
+ else
+ {
+ End[-1] = '\0';
+ }
+ }
+
+ return (ACPI_PTR_DIFF (Pos, String));
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtSnprintf
+ *
+ * PARAMETERS: String - String with boundary
+ * Size - Boundary of the string
+ * Format, ... - Standard printf format
+ *
+ * RETURN: Number of bytes actually written.
+ *
+ * DESCRIPTION: Formatted output to a string.
+ *
+ ******************************************************************************/
+
+int
+AcpiUtSnprintf (
+ char *String,
+ ACPI_SIZE Size,
+ const char *Format,
+ ...)
+{
+ va_list Args;
+ int Length;
+
+
+ va_start (Args, Format);
+ Length = AcpiUtVsnprintf (String, Size, Format, Args);
+ va_end (Args);
+
+ return (Length);
+}
+
+
+#ifdef ACPI_APPLICATION
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtFileVprintf
+ *
+ * PARAMETERS: File - File descriptor
+ * Format - Standard printf format
+ * Args - Argument list
+ *
+ * RETURN: Number of bytes actually written.
+ *
+ * DESCRIPTION: Formatted output to a file using argument list pointer.
+ *
+ ******************************************************************************/
+
+int
+AcpiUtFileVprintf (
+ ACPI_FILE File,
+ const char *Format,
+ va_list Args)
+{
+ ACPI_CPU_FLAGS Flags;
+ int Length;
+
+
+ Flags = AcpiOsAcquireLock (AcpiGbl_PrintLock);
+ Length = AcpiUtVsnprintf (AcpiGbl_PrintBuffer,
+ sizeof (AcpiGbl_PrintBuffer), Format, Args);
+
+ (void) AcpiOsWriteFile (File, AcpiGbl_PrintBuffer, Length, 1);
+ AcpiOsReleaseLock (AcpiGbl_PrintLock, Flags);
+
+ return (Length);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtFilePrintf
+ *
+ * PARAMETERS: File - File descriptor
+ * Format, ... - Standard printf format
+ *
+ * RETURN: Number of bytes actually written.
+ *
+ * DESCRIPTION: Formatted output to a file.
+ *
+ ******************************************************************************/
+
+int
+AcpiUtFilePrintf (
+ ACPI_FILE File,
+ const char *Format,
+ ...)
+{
+ va_list Args;
+ int Length;
+
+
+ va_start (Args, Format);
+ Length = AcpiUtFileVprintf (File, Format, Args);
+ va_end (Args);
+
+ return (Length);
+}
+#endif
*
*****************************************************************************/
-
-#define __UTRESRC_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acresrc.h"
const char *AcpiGbl_LlDecode[] =
{
"ActiveHigh",
- "ActiveLow"
+ "ActiveLow",
+ "ActiveBoth",
+ "Reserved"
};
const char *AcpiGbl_MaxDecode[] =
const char *AcpiGbl_SbDecode[] =
{
- "StopBitsNone",
+ "StopBitsZero",
"StopBitsOne",
"StopBitsOnePlusHalf",
"StopBitsTwo"
*
*****************************************************************************/
-
-#define __UTSTATE_C__
-
#include "acpi.h"
#include "accommon.h"
*
*****************************************************************************/
-
-#define __UTSTRING_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
* occurs in the body of AcpiUtFree.
*/
-#define __UTTRACK_C__
-
#include "acpi.h"
#include "accommon.h"
--- /dev/null
+/******************************************************************************
+ *
+ * Module Name: utuuid -- UUID support functions
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2014, 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.
+ *
+ *****************************************************************************/
+
+#include "acpi.h"
+#include "accommon.h"
+
+#define _COMPONENT ACPI_COMPILER
+ ACPI_MODULE_NAME ("utuuid")
+
+
+/*
+ * UUID support functions.
+ *
+ * This table is used to convert an input UUID ascii string to a 16 byte
+ * buffer and the reverse. The table maps a UUID buffer index 0-15 to
+ * the index within the 36-byte UUID string where the associated 2-byte
+ * hex value can be found.
+ *
+ * 36-byte UUID strings are of the form:
+ * aabbccdd-eeff-gghh-iijj-kkllmmnnoopp
+ * Where aa-pp are one byte hex numbers, made up of two hex digits
+ *
+ * Note: This table is basically the inverse of the string-to-offset table
+ * found in the ACPI spec in the description of the ToUUID macro.
+ */
+const UINT8 AcpiGbl_MapToUuidOffset[UUID_BUFFER_LENGTH] =
+{
+ 6,4,2,0,11,9,16,14,19,21,24,26,28,30,32,34
+};
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtConvertStringToUuid
+ *
+ * PARAMETERS: InString - 36-byte formatted UUID string
+ * UuidBuffer - Where the 16-byte UUID buffer is returned
+ *
+ * RETURN: None. Output data is returned in the UuidBuffer
+ *
+ * DESCRIPTION: Convert a 36-byte formatted UUID string to 16-byte UUID buffer
+ *
+ ******************************************************************************/
+
+void
+AcpiUtConvertStringToUuid (
+ char *InString,
+ UINT8 *UuidBuffer)
+{
+ UINT32 i;
+
+
+ for (i = 0; i < UUID_BUFFER_LENGTH; i++)
+ {
+ UuidBuffer[i] =
+ (AcpiUtAsciiCharToHex (InString[AcpiGbl_MapToUuidOffset[i]]) << 4);
+
+ UuidBuffer[i] |=
+ AcpiUtAsciiCharToHex (InString[AcpiGbl_MapToUuidOffset[i] + 1]);
+ }
+}
*
*****************************************************************************/
-
-#define __UTXFACE_C__
#define EXPORT_ACPI_INTERFACES
#include "acpi.h"
ACPI_MOVE_32_TO_32 (&Dword, &Buffer[0]);
PldInfo->Revision = ACPI_PLD_GET_REVISION (&Dword);
PldInfo->IgnoreColor = ACPI_PLD_GET_IGNORE_COLOR (&Dword);
- PldInfo->Color = ACPI_PLD_GET_COLOR (&Dword);
+ PldInfo->Red = ACPI_PLD_GET_RED (&Dword);
+ PldInfo->Green = ACPI_PLD_GET_GREEN (&Dword);
+ PldInfo->Blue = ACPI_PLD_GET_BLUE (&Dword);
/* Second 32-bit DWord */
*
*****************************************************************************/
-#define __UTXFERROR_C__
#define EXPORT_ACPI_INTERFACES
#include "acpi.h"
* tools/applications.
*/
+#ifndef ACPI_NO_ERROR_MESSAGES /* Entire module */
+
/*******************************************************************************
*
* FUNCTION: AcpiError
}
ACPI_EXPORT_SYMBOL (AcpiBiosWarning)
+
+#endif /* ACPI_NO_ERROR_MESSAGES */
*
*****************************************************************************/
-
-#define __UTXFINIT_C__
#define EXPORT_ACPI_INTERFACES
#include "acpi.h"
#define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME ("utxfinit")
+/* For AcpiExec only */
+void
+AeDoObjectOverrides (
+ void);
+
/*******************************************************************************
*
}
}
+#ifdef ACPI_EXEC_APP
+ /*
+ * This call implements the "initialization file" option for AcpiExec.
+ * This is the precise point that we want to perform the overrides.
+ */
+ AeDoObjectOverrides ();
+#endif
+
/*
* Execute any module-level code that was detected during the table load
* phase. Although illegal since ACPI 2.0, there are many machines that
*
*****************************************************************************/
-#define __UTXFMUTEX_C__
-
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"