[ACPICA]
authorThomas Faber <thomas.faber@reactos.org>
Sat, 25 Feb 2017 20:45:15 +0000 (20:45 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Sat, 25 Feb 2017 20:45:15 +0000 (20:45 +0000)
- Update to version 20160729
CORE-12833

svn path=/trunk/; revision=73910

45 files changed:
reactos/drivers/bus/acpi/CMakeLists.txt
reactos/drivers/bus/acpi/acpica/include/acapps.h
reactos/drivers/bus/acpi/acpica/include/acclib.h
reactos/drivers/bus/acpi/acpica/include/acconfig.h
reactos/drivers/bus/acpi/acpica/include/acdisasm.h
reactos/drivers/bus/acpi/acpica/include/acglobal.h
reactos/drivers/bus/acpi/acpica/include/acpiosxf.h
reactos/drivers/bus/acpi/acpica/include/acpixf.h
reactos/drivers/bus/acpi/acpica/include/actables.h
reactos/drivers/bus/acpi/acpica/include/actbl.h
reactos/drivers/bus/acpi/acpica/include/actypes.h
reactos/drivers/bus/acpi/acpica/include/acutils.h
reactos/drivers/bus/acpi/acpica/include/platform/accygwin.h
reactos/drivers/bus/acpi/acpica/include/platform/acdragonfly.h
reactos/drivers/bus/acpi/acpica/include/platform/acefi.h
reactos/drivers/bus/acpi/acpica/include/platform/acefiex.h
reactos/drivers/bus/acpi/acpica/include/platform/acenv.h
reactos/drivers/bus/acpi/acpica/include/platform/acenvex.h
reactos/drivers/bus/acpi/acpica/include/platform/acfreebsd.h
reactos/drivers/bus/acpi/acpica/include/platform/acgcc.h
reactos/drivers/bus/acpi/acpica/include/platform/acgccex.h [moved from reactos/drivers/bus/acpi/acpica/include/platform/acwinex.h with 83% similarity]
reactos/drivers/bus/acpi/acpica/include/platform/achaiku.h
reactos/drivers/bus/acpi/acpica/include/platform/acintel.h
reactos/drivers/bus/acpi/acpica/include/platform/aclinux.h
reactos/drivers/bus/acpi/acpica/include/platform/aclinuxex.h
reactos/drivers/bus/acpi/acpica/include/platform/acmsvc.h
reactos/drivers/bus/acpi/acpica/include/platform/acmsvcex.h
reactos/drivers/bus/acpi/acpica/include/platform/acnetbsd.h
reactos/drivers/bus/acpi/acpica/include/platform/acos2.h
reactos/drivers/bus/acpi/acpica/include/platform/acqnx.h
reactos/drivers/bus/acpi/acpica/include/platform/acwin.h
reactos/drivers/bus/acpi/acpica/include/platform/acwin64.h
reactos/drivers/bus/acpi/acpica/tables/tbfadt.c
reactos/drivers/bus/acpi/acpica/tables/tbutils.c
reactos/drivers/bus/acpi/acpica/tables/tbxface.c
reactos/drivers/bus/acpi/acpica/tables/tbxfload.c
reactos/drivers/bus/acpi/acpica/tables/tbxfroot.c
reactos/drivers/bus/acpi/acpica/utilities/utbuffer.c
reactos/drivers/bus/acpi/acpica/utilities/utdebug.c
reactos/drivers/bus/acpi/acpica/utilities/utinit.c
reactos/drivers/bus/acpi/acpica/utilities/utpredef.c
reactos/drivers/bus/acpi/acpica/utilities/utprint.c
reactos/drivers/bus/acpi/acpica/utilities/uttrack.c
reactos/drivers/bus/acpi/acpica/utilities/utxface.c
reactos/drivers/bus/acpi/acpica/utilities/utxfinit.c

index 6c63eac..abe13dc 100644 (file)
@@ -173,7 +173,7 @@ add_library(acpica
     acpica/utilities/utglobal.c)
 
 add_pch(acpica acpica/include/acpi.h ACPICA_SOURCE)
-set_target_properties(acpica PROPERTIES COMPILE_DEFINITIONS "ACPI_USE_LOCAL_CACHE;ACPI_USE_SYSTEM_CLIBRARY")
+set_target_properties(acpica PROPERTIES COMPILE_DEFINITIONS "ACPI_USE_LOCAL_CACHE;ACPI_USE_SYSTEM_INTTYPES")
 add_dependencies(acpica bugcodes xdk)
 
 list(APPEND ACPI_SOURCE
index 87284f2..d14bce1 100644 (file)
 #ifndef _ACAPPS
 #define _ACAPPS
 
-#include <stdio.h>
-
-#ifdef _MSC_VER                 /* disable some level-4 warnings */
-#pragma warning(disable:4100)   /* warning C4100: unreferenced formal parameter */
-#endif
+#ifdef ACPI_USE_STANDARD_HEADERS
+#include <sys/stat.h>
+#endif /* ACPI_USE_STANDARD_HEADERS */
 
 /* Common info for tool signons */
 
 /* Macros for usage messages */
 
 #define ACPI_USAGE_HEADER(Usage) \
-    AcpiOsPrintf ("Usage: %s\nOptions:\n", Usage);
+    printf ("Usage: %s\nOptions:\n", Usage);
 
 #define ACPI_USAGE_TEXT(Description) \
-    AcpiOsPrintf (Description);
+    printf (Description);
 
 #define ACPI_OPTION(Name, Description) \
-    AcpiOsPrintf ("  %-20s%s\n", Name, Description);
+    printf ("  %-20s%s\n", Name, Description);
 
 
 /* Check for unexpected exceptions */
index 56a3072..0b104b6 100644 (file)
@@ -73,6 +73,23 @@ extern const UINT8 AcpiGbl_Ctypes[];
 #define isprint(c)  (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_XS | _ACPI_PU))
 #define isalpha(c)  (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP))
 
+/* Error code */
+
+#define EPERM            1 /* Operation not permitted */
+#define ENOENT           2 /* No such file or directory */
+#define EINTR            4 /* Interrupted system call */
+#define EIO              5 /* I/O error */
+#define EBADF            9 /* Bad file number */
+#define EAGAIN          11 /* Try again */
+#define ENOMEM          12 /* Out of memory */
+#define EACCES          13 /* Permission denied */
+#define EFAULT          14 /* Bad address */
+#define EBUSY           16 /* Device or resource busy */
+#define EEXIST          17 /* File exists */
+#define ENODEV          19 /* No such device */
+#define EINVAL          22 /* Invalid argument */
+#define EPIPE           32 /* Broken pipe */
+#define ERANGE          34 /* Math result not representable */
 
 /* Strings */
 
@@ -164,4 +181,105 @@ int
 toupper (
     int                     c);
 
+/*
+ * utprint - printf/vprintf output functions
+ */
+const char *
+AcpiUtScanNumber (
+    const char              *String,
+    UINT64                  *NumberPtr);
+
+const char *
+AcpiUtPrintNumber (
+    char                    *String,
+    UINT64                  Number);
+
+int
+vsnprintf (
+    char                    *String,
+    ACPI_SIZE               Size,
+    const char              *Format,
+    va_list                 Args);
+
+int
+snprintf (
+    char                    *String,
+    ACPI_SIZE               Size,
+    const char              *Format,
+    ...);
+
+int
+sprintf (
+    char                    *String,
+    const char              *Format,
+    ...);
+
+#ifdef ACPI_APPLICATION
+#define SEEK_SET            0
+#define SEEK_CUR            1
+#define SEEK_END            2
+
+/*
+ * NOTE: Currently we only need to update errno for file IOs. Other
+ *       Clibrary invocations in ACPICA do not make descisions according to
+ *       the errno.
+ */
+extern int errno;
+
+int
+vprintf (
+    const char              *Format,
+    va_list                 Args);
+
+int
+printf (
+    const char              *Format,
+    ...);
+
+int
+vfprintf (
+    FILE                    *File,
+    const char              *Format,
+    va_list                 Args);
+
+int
+fprintf (
+    FILE                    *File,
+    const char              *Format,
+    ...);
+
+FILE *
+fopen (
+    const char              *Path,
+    const char              *Modes);
+
+void
+fclose (
+    FILE                    *File);
+
+int
+fread (
+    void                    *Buffer,
+    ACPI_SIZE               Size,
+    ACPI_SIZE               Count,
+    FILE                    *File);
+
+int
+fwrite (
+    void                    *Buffer,
+    ACPI_SIZE               Size,
+    ACPI_SIZE               Count,
+    FILE                    *File);
+
+int
+fseek (
+    FILE                    *File,
+    long                    Offset,
+    int                     From);
+
+long
+ftell (
+    FILE                    *File);
+#endif
+
 #endif /* _ACCLIB_H */
index a626f87..fb97271 100644 (file)
 
 #define ACPI_ADDRESS_RANGE_MAX          2
 
+/* Maximum number of While() loops before abort */
+
+#define ACPI_MAX_LOOP_COUNT             0xFFFF
+
 
 /******************************************************************************
  *
index 545622d..d60be8f 100644 (file)
@@ -109,6 +109,7 @@ typedef enum
     ACPI_DMT_UINT64,
     ACPI_DMT_BUF7,
     ACPI_DMT_BUF10,
+    ACPI_DMT_BUF12,
     ACPI_DMT_BUF16,
     ACPI_DMT_BUF128,
     ACPI_DMT_SIG,
@@ -279,8 +280,8 @@ extern ACPI_DMTABLE_INFO        AcpiDmTableInfoErst[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoErst0[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoFacs[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoFadt1[];
-extern ACPI_DMTABLE_INFO        AcpiDmTableInfoFadt2[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoFadt3[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoFadt4[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoFadt5[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoFadt6[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoFpdt[];
@@ -386,6 +387,7 @@ extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPcctHdr[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPcct0[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPcct1[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPcct2[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoRasf[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoRsdp1[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoRsdp2[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoS3pt[];
@@ -423,6 +425,9 @@ extern ACPI_DMTABLE_INFO        AcpiDmTableInfoXenv[];
 
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoGeneric[][2];
 
+extern ACPI_DMTABLE_INFO        *FadtRevisionInfo [ACPI_FADT_MAX_VERSION + 1];
+
+
 /*
  * dmtable and ahtable
  */
index a883ac4..fc7a7a2 100644 (file)
@@ -392,6 +392,7 @@ ACPI_GLOBAL (const char,                *AcpiGbl_PldShapeList[]);
 
 ACPI_INIT_GLOBAL (ACPI_FILE,            AcpiGbl_DebugFile, NULL);
 ACPI_INIT_GLOBAL (ACPI_FILE,            AcpiGbl_OutputFile, NULL);
+ACPI_INIT_GLOBAL (BOOLEAN,              AcpiGbl_DebugTimeout, FALSE);
 
 /* Print buffer */
 
index eb61d9a..788e066 100644 (file)
@@ -492,6 +492,15 @@ AcpiOsGetLine (
     UINT32                  *BytesRead);
 #endif
 
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsTracePoint
+void
+AcpiOsTracePoint (
+    ACPI_TRACE_EVENT_TYPE   Type,
+    BOOLEAN                 Begin,
+    UINT8                   *Aml,
+    char                    *Pathname);
+#endif
+
 
 /*
  * Obtain ACPI table(s)
@@ -552,62 +561,4 @@ AcpiOsCloseDirectory (
 #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
-
-#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsTracePoint
-void
-AcpiOsTracePoint (
-    ACPI_TRACE_EVENT_TYPE   Type,
-    BOOLEAN                 Begin,
-    UINT8                   *Aml,
-    char                    *Pathname);
-#endif
-
-
 #endif /* __ACPIOSXF_H__ */
index 10eeb11..33f000f 100644 (file)
@@ -46,7 +46,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20160527
+#define ACPI_CA_VERSION                 0x20160729
 
 #include "acconfig.h"
 #include "actypes.h"
@@ -420,29 +420,29 @@ ACPI_GLOBAL (BOOLEAN,               AcpiGbl_SystemAwakeAndRunning);
  * Initialization
  */
 ACPI_EXTERNAL_RETURN_STATUS (
-ACPI_STATUS
+ACPI_STATUS ACPI_INIT_FUNCTION
 AcpiInitializeTables (
     ACPI_TABLE_DESC         *InitialStorage,
     UINT32                  InitialTableCount,
     BOOLEAN                 AllowResize))
 
 ACPI_EXTERNAL_RETURN_STATUS (
-ACPI_STATUS
+ACPI_STATUS ACPI_INIT_FUNCTION
 AcpiInitializeSubsystem (
     void))
 
 ACPI_EXTERNAL_RETURN_STATUS (
-ACPI_STATUS
+ACPI_STATUS ACPI_INIT_FUNCTION
 AcpiEnableSubsystem (
     UINT32                  Flags))
 
 ACPI_EXTERNAL_RETURN_STATUS (
-ACPI_STATUS
+ACPI_STATUS ACPI_INIT_FUNCTION
 AcpiInitializeObjects (
     UINT32                  Flags))
 
 ACPI_EXTERNAL_RETURN_STATUS (
-ACPI_STATUS
+ACPI_STATUS ACPI_INIT_FUNCTION
 AcpiTerminate (
     void))
 
@@ -520,7 +520,7 @@ AcpiDecodePldBuffer (
  * ACPI table load/unload interfaces
  */
 ACPI_EXTERNAL_RETURN_STATUS (
-ACPI_STATUS
+ACPI_STATUS ACPI_INIT_FUNCTION
 AcpiInstallTable (
     ACPI_PHYSICAL_ADDRESS   Address,
     BOOLEAN                 Physical))
@@ -536,7 +536,7 @@ AcpiUnloadParentTable (
     ACPI_HANDLE             Object))
 
 ACPI_EXTERNAL_RETURN_STATUS (
-ACPI_STATUS
+ACPI_STATUS ACPI_INIT_FUNCTION
 AcpiLoadTables (
     void))
 
@@ -545,12 +545,12 @@ AcpiLoadTables (
  * ACPI table manipulation interfaces
  */
 ACPI_EXTERNAL_RETURN_STATUS (
-ACPI_STATUS
+ACPI_STATUS ACPI_INIT_FUNCTION
 AcpiReallocateRootTable (
     void))
 
 ACPI_EXTERNAL_RETURN_STATUS (
-ACPI_STATUS
+ACPI_STATUS ACPI_INIT_FUNCTION
 AcpiFindRootPointer (
     ACPI_PHYSICAL_ADDRESS   *RsdpAddress))
 
@@ -1232,13 +1232,6 @@ AcpiTracePoint (
     UINT8                   *Aml,
     char                    *Pathname))
 
-ACPI_APP_DEPENDENT_RETURN_VOID (
-ACPI_PRINTF_LIKE(1)
-void ACPI_INTERNAL_VAR_XFACE
-AcpiLogError (
-    const char              *Format,
-    ...))
-
 ACPI_STATUS
 AcpiInitializeDebugger (
     void);
index e1a4a6e..6abb14c 100644 (file)
@@ -242,7 +242,7 @@ AcpiTbInstallFixedTable (
     char                    *Signature,
     UINT32                  *TableIndex);
 
-ACPI_STATUS
+ACPI_STATUS ACPI_INIT_FUNCTION
 AcpiTbParseRootTable (
     ACPI_PHYSICAL_ADDRESS   RsdpAddress);
 
index faeb744..b5c76c9 100644 (file)
@@ -256,62 +256,72 @@ typedef struct acpi_table_facs
 
 typedef struct acpi_table_fadt
 {
-    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT32                  Facs;               /* 32-bit physical address of FACS */
-    UINT32                  Dsdt;               /* 32-bit physical address of DSDT */
-    UINT8                   Model;              /* System Interrupt Model (ACPI 1.0) - not used in ACPI 2.0+ */
-    UINT8                   PreferredProfile;   /* Conveys preferred power management profile to OSPM. */
-    UINT16                  SciInterrupt;       /* System vector of SCI interrupt */
-    UINT32                  SmiCommand;         /* 32-bit Port address of SMI command port */
-    UINT8                   AcpiEnable;         /* Value to write to SMI_CMD to enable ACPI */
-    UINT8                   AcpiDisable;        /* Value to write to SMI_CMD to disable ACPI */
-    UINT8                   S4BiosRequest;      /* Value to write to SMI_CMD to enter S4BIOS state */
-    UINT8                   PstateControl;      /* Processor performance state control*/
-    UINT32                  Pm1aEventBlock;     /* 32-bit port address of Power Mgt 1a Event Reg Blk */
-    UINT32                  Pm1bEventBlock;     /* 32-bit port address of Power Mgt 1b Event Reg Blk */
-    UINT32                  Pm1aControlBlock;   /* 32-bit port address of Power Mgt 1a Control Reg Blk */
-    UINT32                  Pm1bControlBlock;   /* 32-bit port address of Power Mgt 1b Control Reg Blk */
-    UINT32                  Pm2ControlBlock;    /* 32-bit port address of Power Mgt 2 Control Reg Blk */
-    UINT32                  PmTimerBlock;       /* 32-bit port address of Power Mgt Timer Ctrl Reg Blk */
-    UINT32                  Gpe0Block;          /* 32-bit port address of General Purpose Event 0 Reg Blk */
-    UINT32                  Gpe1Block;          /* 32-bit port address of General Purpose Event 1 Reg Blk */
-    UINT8                   Pm1EventLength;     /* Byte Length of ports at Pm1xEventBlock */
-    UINT8                   Pm1ControlLength;   /* Byte Length of ports at Pm1xControlBlock */
-    UINT8                   Pm2ControlLength;   /* Byte Length of ports at Pm2ControlBlock */
-    UINT8                   PmTimerLength;      /* Byte Length of ports at PmTimerBlock */
-    UINT8                   Gpe0BlockLength;    /* Byte Length of ports at Gpe0Block */
-    UINT8                   Gpe1BlockLength;    /* Byte Length of ports at Gpe1Block */
-    UINT8                   Gpe1Base;           /* Offset in GPE number space where GPE1 events start */
-    UINT8                   CstControl;         /* Support for the _CST object and C-States change notification */
-    UINT16                  C2Latency;          /* Worst case HW latency to enter/exit C2 state */
-    UINT16                  C3Latency;          /* Worst case HW latency to enter/exit C3 state */
-    UINT16                  FlushSize;          /* Processor memory cache line width, in bytes */
-    UINT16                  FlushStride;        /* Number of flush strides that need to be read */
-    UINT8                   DutyOffset;         /* Processor duty cycle index in processor P_CNT reg */
-    UINT8                   DutyWidth;          /* Processor duty cycle value bit width in P_CNT register */
-    UINT8                   DayAlarm;           /* Index to day-of-month alarm in RTC CMOS RAM */
-    UINT8                   MonthAlarm;         /* Index to month-of-year alarm in RTC CMOS RAM */
-    UINT8                   Century;            /* Index to century in RTC CMOS RAM */
-    UINT16                  BootFlags;          /* IA-PC Boot Architecture Flags (see below for individual flags) */
-    UINT8                   Reserved;           /* Reserved, must be zero */
-    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 */
-    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_GENERIC_ADDRESS    XPm1bEventBlock;    /* 64-bit Extended Power Mgt 1b Event Reg Blk address */
-    ACPI_GENERIC_ADDRESS    XPm1aControlBlock;  /* 64-bit Extended Power Mgt 1a Control Reg Blk address */
-    ACPI_GENERIC_ADDRESS    XPm1bControlBlock;  /* 64-bit Extended Power Mgt 1b Control Reg Blk address */
-    ACPI_GENERIC_ADDRESS    XPm2ControlBlock;   /* 64-bit Extended Power Mgt 2 Control Reg Blk address */
-    ACPI_GENERIC_ADDRESS    XPmTimerBlock;      /* 64-bit Extended Power Mgt Timer Ctrl Reg Blk address */
-    ACPI_GENERIC_ADDRESS    XGpe0Block;         /* 64-bit Extended General Purpose Event 0 Reg Blk address */
-    ACPI_GENERIC_ADDRESS    XGpe1Block;         /* 64-bit Extended General Purpose Event 1 Reg Blk address */
-    ACPI_GENERIC_ADDRESS    SleepControl;       /* 64-bit Sleep Control register (ACPI 5.0) */
-    ACPI_GENERIC_ADDRESS    SleepStatus;        /* 64-bit Sleep Status register (ACPI 5.0) */
-    UINT64                  HypervisorId;       /* Hypervisor Vendor ID (ACPI 6.0) */
+    ACPI_TABLE_HEADER       Header;             /* [V1] Common ACPI table header */
+    UINT32                  Facs;               /* [V1] 32-bit physical address of FACS */
+    UINT32                  Dsdt;               /* [V1] 32-bit physical address of DSDT */
+    UINT8                   Model;              /* [V1] System Interrupt Model (ACPI 1.0) - not used in ACPI 2.0+ */
+    UINT8                   PreferredProfile;   /* [V1] Conveys preferred power management profile to OSPM. */
+    UINT16                  SciInterrupt;       /* [V1] System vector of SCI interrupt */
+    UINT32                  SmiCommand;         /* [V1] 32-bit Port address of SMI command port */
+    UINT8                   AcpiEnable;         /* [V1] Value to write to SMI_CMD to enable ACPI */
+    UINT8                   AcpiDisable;        /* [V1] Value to write to SMI_CMD to disable ACPI */
+    UINT8                   S4BiosRequest;      /* [V1] Value to write to SMI_CMD to enter S4BIOS state */
+    UINT8                   PstateControl;      /* [V1] Processor performance state control*/
+    UINT32                  Pm1aEventBlock;     /* [V1] 32-bit port address of Power Mgt 1a Event Reg Blk */
+    UINT32                  Pm1bEventBlock;     /* [V1] 32-bit port address of Power Mgt 1b Event Reg Blk */
+    UINT32                  Pm1aControlBlock;   /* [V1] 32-bit port address of Power Mgt 1a Control Reg Blk */
+    UINT32                  Pm1bControlBlock;   /* [V1] 32-bit port address of Power Mgt 1b Control Reg Blk */
+    UINT32                  Pm2ControlBlock;    /* [V1] 32-bit port address of Power Mgt 2 Control Reg Blk */
+    UINT32                  PmTimerBlock;       /* [V1] 32-bit port address of Power Mgt Timer Ctrl Reg Blk */
+    UINT32                  Gpe0Block;          /* [V1] 32-bit port address of General Purpose Event 0 Reg Blk */
+    UINT32                  Gpe1Block;          /* [V1] 32-bit port address of General Purpose Event 1 Reg Blk */
+    UINT8                   Pm1EventLength;     /* [V1] Byte Length of ports at Pm1xEventBlock */
+    UINT8                   Pm1ControlLength;   /* [V1] Byte Length of ports at Pm1xControlBlock */
+    UINT8                   Pm2ControlLength;   /* [V1] Byte Length of ports at Pm2ControlBlock */
+    UINT8                   PmTimerLength;      /* [V1] Byte Length of ports at PmTimerBlock */
+    UINT8                   Gpe0BlockLength;    /* [V1] Byte Length of ports at Gpe0Block */
+    UINT8                   Gpe1BlockLength;    /* [V1] Byte Length of ports at Gpe1Block */
+    UINT8                   Gpe1Base;           /* [V1] Offset in GPE number space where GPE1 events start */
+    UINT8                   CstControl;         /* [V1] Support for the _CST object and C-States change notification */
+    UINT16                  C2Latency;          /* [V1] Worst case HW latency to enter/exit C2 state */
+    UINT16                  C3Latency;          /* [V1] Worst case HW latency to enter/exit C3 state */
+    UINT16                  FlushSize;          /* [V1] Processor memory cache line width, in bytes */
+    UINT16                  FlushStride;        /* [V1] Number of flush strides that need to be read */
+    UINT8                   DutyOffset;         /* [V1] Processor duty cycle index in processor P_CNT reg */
+    UINT8                   DutyWidth;          /* [V1] Processor duty cycle value bit width in P_CNT register */
+    UINT8                   DayAlarm;           /* [V1] Index to day-of-month alarm in RTC CMOS RAM */
+    UINT8                   MonthAlarm;         /* [V1] Index to month-of-year alarm in RTC CMOS RAM */
+    UINT8                   Century;            /* [V1] Index to century in RTC CMOS RAM */
+    UINT16                  BootFlags;          /* [V3] IA-PC Boot Architecture Flags (see below for individual flags) */
+    UINT8                   Reserved;           /* [V1] Reserved, must be zero */
+    UINT32                  Flags;              /* [V1] Miscellaneous flag bits (see below for individual flags) */
+    /* End of Version 1 FADT fields (ACPI 1.0) */
+
+    ACPI_GENERIC_ADDRESS    ResetRegister;      /* [V3] 64-bit address of the Reset register */
+    UINT8                   ResetValue;         /* [V3] Value to write to the ResetRegister port to reset the system */
+    UINT16                  ArmBootFlags;       /* [V5] ARM-Specific Boot Flags (see below for individual flags) (ACPI 5.1) */
+    UINT8                   MinorRevision;      /* [V5] FADT Minor Revision (ACPI 5.1) */
+    UINT64                  XFacs;              /* [V3] 64-bit physical address of FACS */
+    UINT64                  XDsdt;              /* [V3] 64-bit physical address of DSDT */
+    ACPI_GENERIC_ADDRESS    XPm1aEventBlock;    /* [V3] 64-bit Extended Power Mgt 1a Event Reg Blk address */
+    ACPI_GENERIC_ADDRESS    XPm1bEventBlock;    /* [V3] 64-bit Extended Power Mgt 1b Event Reg Blk address */
+    ACPI_GENERIC_ADDRESS    XPm1aControlBlock;  /* [V3] 64-bit Extended Power Mgt 1a Control Reg Blk address */
+    ACPI_GENERIC_ADDRESS    XPm1bControlBlock;  /* [V3] 64-bit Extended Power Mgt 1b Control Reg Blk address */
+    ACPI_GENERIC_ADDRESS    XPm2ControlBlock;   /* [V3] 64-bit Extended Power Mgt 2 Control Reg Blk address */
+    ACPI_GENERIC_ADDRESS    XPmTimerBlock;      /* [V3] 64-bit Extended Power Mgt Timer Ctrl Reg Blk address */
+    ACPI_GENERIC_ADDRESS    XGpe0Block;         /* [V3] 64-bit Extended General Purpose Event 0 Reg Blk address */
+    ACPI_GENERIC_ADDRESS    XGpe1Block;         /* [V3] 64-bit Extended General Purpose Event 1 Reg Blk address */
+    /* End of Version 3 FADT fields (ACPI 2.0) */
+
+    ACPI_GENERIC_ADDRESS    SleepControl;       /* [V4] 64-bit Sleep Control register (ACPI 5.0) */
+    /* End of Version 4 FADT fields (ACPI 3.0 and ACPI 4.0) (Field was originally reserved in ACPI 3.0) */
+
+    ACPI_GENERIC_ADDRESS    SleepStatus;        /* [V5] 64-bit Sleep Status register (ACPI 5.0) */
+    /* End of Version 5 FADT fields (ACPI 5.0) */
+
+    UINT64                  HypervisorId;       /* [V6] Hypervisor Vendor ID (ACPI 6.0) */
+    /* End of Version 6 FADT fields (ACPI 6.0) */
+
 
 } ACPI_TABLE_FADT;
 
@@ -327,8 +337,8 @@ typedef struct acpi_table_fadt
 
 /* 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 */
+#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 */
 
@@ -435,20 +445,34 @@ typedef struct acpi_table_desc
  * match the expected length. In other words, the length of the
  * FADT is the bottom line as to what the version really is.
  *
- * For reference, the values below are as follows:
- *     FADT V1 size: 0x074
- *     FADT V2 size: 0x084
- *     FADT V3 size: 0x0F4
- *     FADT V4 size: 0x0F4
- *     FADT V5 size: 0x10C
- *     FADT V6 size: 0x114
+ * NOTE: There is no officialy released V2 of the FADT. This
+ * version was used only for prototyping and testing during the
+ * 32-bit to 64-bit transition. V3 was the first official 64-bit
+ * version of the FADT.
+ *
+ * Update this list of defines when a new version of the FADT is
+ * added to the ACPI specification. Note that the FADT version is
+ * only incremented when new fields are appended to the existing
+ * version. Therefore, the FADT version is competely independent
+ * from the version of the ACPI specification where it is
+ * defined.
+ *
+ * For reference, the various FADT lengths are as follows:
+ *     FADT V1 size: 0x074      ACPI 1.0
+ *     FADT V3 size: 0x0F4      ACPI 2.0
+ *     FADT V4 size: 0x100      ACPI 3.0 and ACPI 4.0
+ *     FADT V5 size: 0x10C      ACPI 5.0
+ *     FADT V6 size: 0x114      ACPI 6.0
  */
-#define ACPI_FADT_V1_SIZE       (UINT32) (ACPI_FADT_OFFSET (Flags) + 4)
-#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) (ACPI_FADT_OFFSET (HypervisorId))
-#define ACPI_FADT_V6_SIZE       (UINT32) (sizeof (ACPI_TABLE_FADT))
+#define ACPI_FADT_V1_SIZE       (UINT32) (ACPI_FADT_OFFSET (Flags) + 4)         /* ACPI 1.0 */
+#define ACPI_FADT_V3_SIZE       (UINT32) (ACPI_FADT_OFFSET (SleepControl))      /* ACPI 2.0 */
+#define ACPI_FADT_V4_SIZE       (UINT32) (ACPI_FADT_OFFSET (SleepStatus))       /* ACPI 3.0 and ACPI 4.0 */
+#define ACPI_FADT_V5_SIZE       (UINT32) (ACPI_FADT_OFFSET (HypervisorId))      /* ACPI 5.0 */
+#define ACPI_FADT_V6_SIZE       (UINT32) (sizeof (ACPI_TABLE_FADT))             /* ACPI 6.0 */
+
+/* Update these when new FADT versions are added */
 
+#define ACPI_FADT_MAX_VERSION   6
 #define ACPI_FADT_CONFORMANCE   "ACPI 6.1 (FADT version 6)"
 
 #endif /* __ACTBL_H__ */
index 395b915..3861f12 100644 (file)
@@ -1387,16 +1387,6 @@ typedef enum
 #define ACPI_OSI_WIN_10                 0x0D
 
 
-/* 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
index 7e53961..f83996a 100644 (file)
@@ -1067,48 +1067,6 @@ 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
  */
index 518fc27..be22192 100644 (file)
@@ -47,6 +47,7 @@
 /*
  * ACPICA configuration
  */
+#define ACPI_USE_STANDARD_HEADERS
 #define ACPI_USE_SYSTEM_CLIBRARY
 #define ACPI_USE_DO_WHILE_0
 #define ACPI_FLUSH_CPU_CACHE()
 #define ACPI_USE_ALTERNATE_TIMEOUT
 
 
-#include <stdarg.h>
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
+#ifdef ACPI_USE_STANDARD_HEADERS
 #include <unistd.h>
+#endif
 
 #if defined(__ia64__) || defined(__x86_64__)
 #define ACPI_MACHINE_WIDTH          64
 
 #define ACPI_CAST_PTHREAD_T(pthread) ((ACPI_THREAD_ID) ACPI_TO_INTEGER (pthread))
 
-/* Cygwin uses GCC */
-
-#include "acgcc.h"
-
 
 /*
  * The vsnprintf/snprintf functions are defined by c99, but cygwin/gcc
index 73a1867..90b9438 100644 (file)
@@ -44,7 +44,6 @@
 #ifndef __ACDRAGONFLY_H_
 #define __ACDRAGONFLY_H_
 
-#include <platform/acgcc.h>     /* DragonFly uses GCC */
 #include <sys/types.h>
 
 #ifdef __LP64__
index 1a9e7c4..56c4b0a 100644 (file)
 #ifndef __ACEFI_H__
 #define __ACEFI_H__
 
-#include <stdarg.h>
-#if defined(_GNU_EFI)
-#include <stdint.h>
-#include <unistd.h>
+/* EDK2 EFI environemnt */
+
+#if defined(_EDK2_EFI)
+
+#define _GNU_EFI
+
 #endif
 
 #if defined(__x86_64__)
 #endif
 
 #ifdef _MSC_EXTENSIONS
-#define EFIAPI __cdecl
+#define ACPI_EFI_API __cdecl
 #elif USE_MS_ABI
-#define EFIAPI __attribute__((ms_abi))
+#define ACPI_EFI_API __attribute__((ms_abi))
 #else
-#define EFIAPI
+#define ACPI_EFI_API
 #endif
 
-typedef uint8_t     UINT8;
-typedef uint16_t    UINT16;
-typedef int16_t     INT16;
-typedef uint32_t    UINT32;
-typedef int32_t     INT32;
-typedef uint64_t    UINT64;
-typedef int64_t     INT64;
-typedef uint8_t     BOOLEAN;
-typedef uint16_t    CHAR16;
-
 #define VOID        void
 
 #if defined(__ia64__) || defined(__x86_64__)
@@ -94,23 +86,23 @@ typedef uint16_t    CHAR16;
 
 #endif
 
-typedef uint64_t    UINTN;
-typedef int64_t     INTN;
+#define UINTN       uint64_t
+#define INTN        int64_t
 
-#define EFIERR(a)           (0x8000000000000000 | a)
+#define ACPI_EFI_ERR(a)             (0x8000000000000000 | a)
 
 #else
 
 #define ACPI_MACHINE_WIDTH          32
-#define ACPI_USE_NATIVE_DIVIDE
 
-typedef uint32_t UINTN;
-typedef int32_t INTN;
+#define UINTN       uint32_t
+#define INTN        int32_t
 
-#define EFIERR(a)           (0x80000000 | a)
+#define ACPI_EFI_ERR(a)             (0x80000000 | a)
 
 #endif
 
+#define CHAR16      uint16_t
 
 #ifdef USE_EFI_FUNCTION_WRAPPER
 #define __VA_NARG__(...)                        \
@@ -230,15 +222,6 @@ UINT64 efi_call10(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3,
 
 #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
-
 /*
  * Math helpers
  */
@@ -255,21 +238,20 @@ UINT64 efi_call10(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3,
         (n_hi) >>= 1;                   \
     } while (0)
 
-
 #endif
 
-struct _SIMPLE_TEXT_OUTPUT_INTERFACE;
-struct _SIMPLE_INPUT_INTERFACE;
-struct _EFI_FILE_IO_INTERFACE;
-struct _EFI_FILE_HANDLE;
-struct _EFI_BOOT_SERVICES;
-struct _EFI_SYSTEM_TABLE;
+struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE;
+struct _ACPI_SIMPLE_INPUT_INTERFACE;
+struct _ACPI_EFI_FILE_IO_INTERFACE;
+struct _ACPI_EFI_FILE_HANDLE;
+struct _ACPI_EFI_BOOT_SERVICES;
+struct _ACPI_EFI_SYSTEM_TABLE;
 
-extern struct _EFI_SYSTEM_TABLE         *ST;
-extern struct _EFI_BOOT_SERVICES        *BS;
+extern struct _ACPI_EFI_SYSTEM_TABLE        *ST;
+extern struct _ACPI_EFI_BOOT_SERVICES       *BS;
 
-#define ACPI_FILE           struct _SIMPLE_TEXT_OUTPUT_INTERFACE *
-#define ACPI_FILE_OUT       ST->ConOut
-#define ACPI_FILE_ERR       ST->ConOut
+#define FILE                struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE
+#define stdout              ST->ConOut
+#define stderr              ST->ConOut
 
 #endif /* __ACEFI_H__ */
index 7df5012..8f98a62 100644 (file)
 #define __ACEFIEX_H__
 
 
-#define EFI_ERROR(a)              (((INTN) a) < 0)
-#define EFI_SUCCESS                             0
-#define EFI_LOAD_ERROR                  EFIERR(1)
-#define EFI_INVALID_PARAMETER           EFIERR(2)
-#define EFI_UNSUPPORTED                 EFIERR(3)
-#define EFI_BAD_BUFFER_SIZE             EFIERR(4)
-#define EFI_BUFFER_TOO_SMALL            EFIERR(5)
-#define EFI_NOT_READY                   EFIERR(6)
-#define EFI_DEVICE_ERROR                EFIERR(7)
-#define EFI_WRITE_PROTECTED             EFIERR(8)
-#define EFI_OUT_OF_RESOURCES            EFIERR(9)
-#define EFI_VOLUME_CORRUPTED            EFIERR(10)
-#define EFI_VOLUME_FULL                 EFIERR(11)
-#define EFI_NO_MEDIA                    EFIERR(12)
-#define EFI_MEDIA_CHANGED               EFIERR(13)
-#define EFI_NOT_FOUND                   EFIERR(14)
-#define EFI_ACCESS_DENIED               EFIERR(15)
-#define EFI_NO_RESPONSE                 EFIERR(16)
-#define EFI_NO_MAPPING                  EFIERR(17)
-#define EFI_TIMEOUT                     EFIERR(18)
-#define EFI_NOT_STARTED                 EFIERR(19)
-#define EFI_ALREADY_STARTED             EFIERR(20)
-#define EFI_ABORTED                     EFIERR(21)
-#define EFI_PROTOCOL_ERROR              EFIERR(24)
-
-
-typedef UINTN EFI_STATUS;
-typedef VOID *EFI_HANDLE;
-typedef VOID *EFI_EVENT;
+#ifndef ACPI_USE_SYSTEM_CLIBRARY
+
+typedef signed char                     int8_t;
+typedef short int                       int16_t;
+typedef int                             int32_t;
+typedef unsigned char                   uint8_t;
+typedef unsigned short int              uint16_t;
+typedef unsigned int                    uint32_t;
+typedef COMPILER_DEPENDENT_INT64        int64_t;
+typedef COMPILER_DEPENDENT_UINT64       uint64_t;
+
+#endif /* ACPI_USE_SYSTEM_CLIBRARY */
+
+#define ACPI_EFI_ERROR(a)               (((INTN) a) < 0)
+#define ACPI_EFI_SUCCESS                0
+#define ACPI_EFI_LOAD_ERROR             ACPI_EFI_ERR(1)
+#define ACPI_EFI_INVALID_PARAMETER      ACPI_EFI_ERR(2)
+#define ACPI_EFI_UNSUPPORTED            ACPI_EFI_ERR(3)
+#define ACPI_EFI_BAD_BUFFER_SIZE        ACPI_EFI_ERR(4)
+#define ACPI_EFI_BUFFER_TOO_SMALL       ACPI_EFI_ERR(5)
+#define ACPI_EFI_NOT_READY              ACPI_EFI_ERR(6)
+#define ACPI_EFI_DEVICE_ERROR           ACPI_EFI_ERR(7)
+#define ACPI_EFI_WRITE_PROTECTED        ACPI_EFI_ERR(8)
+#define ACPI_EFI_OUT_OF_RESOURCES       ACPI_EFI_ERR(9)
+#define ACPI_EFI_VOLUME_CORRUPTED       ACPI_EFI_ERR(10)
+#define ACPI_EFI_VOLUME_FULL            ACPI_EFI_ERR(11)
+#define ACPI_EFI_NO_MEDIA               ACPI_EFI_ERR(12)
+#define ACPI_EFI_MEDIA_CHANGED          ACPI_EFI_ERR(13)
+#define ACPI_EFI_NOT_FOUND              ACPI_EFI_ERR(14)
+#define ACPI_EFI_ACCESS_DENIED          ACPI_EFI_ERR(15)
+#define ACPI_EFI_NO_RESPONSE            ACPI_EFI_ERR(16)
+#define ACPI_EFI_NO_MAPPING             ACPI_EFI_ERR(17)
+#define ACPI_EFI_TIMEOUT                ACPI_EFI_ERR(18)
+#define ACPI_EFI_NOT_STARTED            ACPI_EFI_ERR(19)
+#define ACPI_EFI_ALREADY_STARTED        ACPI_EFI_ERR(20)
+#define ACPI_EFI_ABORTED                ACPI_EFI_ERR(21)
+#define ACPI_EFI_PROTOCOL_ERROR         ACPI_EFI_ERR(24)
+
+
+typedef UINTN ACPI_EFI_STATUS;
+typedef VOID *ACPI_EFI_HANDLE;
+typedef VOID *ACPI_EFI_EVENT;
 
 typedef struct {
     UINT32  Data1;
     UINT16  Data2;
     UINT16  Data3;
     UINT8   Data4[8];
-} EFI_GUID;
+} ACPI_EFI_GUID;
 
-typedef struct _EFI_DEVICE_PATH {
+typedef struct _ACPI_EFI_DEVICE_PATH {
         UINT8                           Type;
         UINT8                           SubType;
         UINT8                           Length[2];
-} EFI_DEVICE_PATH;
+} ACPI_EFI_DEVICE_PATH;
 
-typedef UINT64          EFI_PHYSICAL_ADDRESS;
-typedef UINT64          EFI_VIRTUAL_ADDRESS;
+typedef UINT64          ACPI_EFI_PHYSICAL_ADDRESS;
+typedef UINT64          ACPI_EFI_VIRTUAL_ADDRESS;
 
 typedef enum {
-    AllocateAnyPages,
-    AllocateMaxAddress,
-    AllocateAddress,
-    MaxAllocateType
-} EFI_ALLOCATE_TYPE;
+    AcpiEfiAllocateAnyPages,
+    AcpiEfiAllocateMaxAddress,
+    AcpiEfiAllocateAddress,
+    AcpiEfiMaxAllocateType
+} ACPI_EFI_ALLOCATE_TYPE;
 
 typedef enum {
-    EfiReservedMemoryType,
-    EfiLoaderCode,
-    EfiLoaderData,
-    EfiBootServicesCode,
-    EfiBootServicesData,
-    EfiRuntimeServicesCode,
-    EfiRuntimeServicesData,
-    EfiConventionalMemory,
-    EfiUnusableMemory,
-    EfiACPIReclaimMemory,
-    EfiACPIMemoryNVS,
-    EfiMemoryMappedIO,
-    EfiMemoryMappedIOPortSpace,
-    EfiPalCode,
-    EfiMaxMemoryType
-} EFI_MEMORY_TYPE;
+    AcpiEfiReservedMemoryType,
+    AcpiEfiLoaderCode,
+    AcpiEfiLoaderData,
+    AcpiEfiBootServicesCode,
+    AcpiEfiBootServicesData,
+    AcpiEfiRuntimeServicesCode,
+    AcpiEfiRuntimeServicesData,
+    AcpiEfiConventionalMemory,
+    AcpiEfiUnusableMemory,
+    AcpiEfiACPIReclaimMemory,
+    AcpiEfiACPIMemoryNVS,
+    AcpiEfiMemoryMappedIO,
+    AcpiEfiMemoryMappedIOPortSpace,
+    AcpiEfiPalCode,
+    AcpiEfiMaxMemoryType
+} ACPI_EFI_MEMORY_TYPE;
 
 /* possible caching types for the memory range */
-#define EFI_MEMORY_UC           0x0000000000000001
-#define EFI_MEMORY_WC           0x0000000000000002
-#define EFI_MEMORY_WT           0x0000000000000004
-#define EFI_MEMORY_WB           0x0000000000000008
-#define EFI_MEMORY_UCE          0x0000000000000010
+#define ACPI_EFI_MEMORY_UC      0x0000000000000001
+#define ACPI_EFI_MEMORY_WC      0x0000000000000002
+#define ACPI_EFI_MEMORY_WT      0x0000000000000004
+#define ACPI_EFI_MEMORY_WB      0x0000000000000008
+#define ACPI_EFI_MEMORY_UCE     0x0000000000000010
 
 /* physical memory protection on range */
-#define EFI_MEMORY_WP           0x0000000000001000
-#define EFI_MEMORY_RP           0x0000000000002000
-#define EFI_MEMORY_XP           0x0000000000004000
+#define ACPI_EFI_MEMORY_WP      0x0000000000001000
+#define ACPI_EFI_MEMORY_RP      0x0000000000002000
+#define ACPI_EFI_MEMORY_XP      0x0000000000004000
 
 /* range requires a runtime mapping */
-#define EFI_MEMORY_RUNTIME      0x8000000000000000
+#define ACPI_EFI_MEMORY_RUNTIME 0x8000000000000000
 
-#define EFI_MEMORY_DESCRIPTOR_VERSION  1
+#define ACPI_EFI_MEMORY_DESCRIPTOR_VERSION  1
 typedef struct {
     UINT32                          Type;
     UINT32                          Pad;
-    EFI_PHYSICAL_ADDRESS            PhysicalStart;
-    EFI_VIRTUAL_ADDRESS             VirtualStart;
+    ACPI_EFI_PHYSICAL_ADDRESS       PhysicalStart;
+    ACPI_EFI_VIRTUAL_ADDRESS        VirtualStart;
     UINT64                          NumberOfPages;
     UINT64                          Attribute;
-} EFI_MEMORY_DESCRIPTOR;
+} ACPI_EFI_MEMORY_DESCRIPTOR;
 
-typedef struct _EFI_TABLE_HEARDER {
+typedef struct _ACPI_EFI_TABLE_HEARDER {
     UINT64                      Signature;
     UINT32                      Revision;
     UINT32                      HeaderSize;
     UINT32                      CRC32;
     UINT32                      Reserved;
-} EFI_TABLE_HEADER;
+} ACPI_EFI_TABLE_HEADER;
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_UNKNOWN_INTERFACE) (
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_UNKNOWN_INTERFACE) (
     void);
 
 
 /*
  * Text output protocol
  */
-#define SIMPLE_TEXT_OUTPUT_PROTOCOL \
+#define ACPI_SIMPLE_TEXT_OUTPUT_PROTOCOL \
     { 0x387477c2, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_TEXT_RESET) (
-    struct _SIMPLE_TEXT_OUTPUT_INTERFACE    *This,
-    BOOLEAN                                 ExtendedVerification);
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_TEXT_RESET) (
+    struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE   *This,
+    BOOLEAN                                     ExtendedVerification);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_TEXT_OUTPUT_STRING) (
-    struct _SIMPLE_TEXT_OUTPUT_INTERFACE    *This,
-    CHAR16                                  *String);
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_TEXT_OUTPUT_STRING) (
+    struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE   *This,
+    CHAR16                                      *String);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_TEXT_TEST_STRING) (
-    struct _SIMPLE_TEXT_OUTPUT_INTERFACE    *This,
-    CHAR16                                  *String);
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_TEXT_TEST_STRING) (
+    struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE   *This,
+    CHAR16                                      *String);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_TEXT_QUERY_MODE) (
-    struct _SIMPLE_TEXT_OUTPUT_INTERFACE    *This,
-    UINTN                                   ModeNumber,
-    UINTN                                   *Columns,
-    UINTN                                   *Rows);
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_TEXT_QUERY_MODE) (
+    struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE   *This,
+    UINTN                                       ModeNumber,
+    UINTN                                       *Columns,
+    UINTN                                       *Rows);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_TEXT_SET_MODE) (
-    struct _SIMPLE_TEXT_OUTPUT_INTERFACE    *This,
-    UINTN                                   ModeNumber);
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_TEXT_SET_MODE) (
+    struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE   *This,
+    UINTN                                       ModeNumber);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_TEXT_SET_ATTRIBUTE) (
-    struct _SIMPLE_TEXT_OUTPUT_INTERFACE    *This,
-    UINTN                                   Attribute);
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_TEXT_SET_ATTRIBUTE) (
+    struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE   *This,
+    UINTN                                       Attribute);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_TEXT_CLEAR_SCREEN) (
-    struct _SIMPLE_TEXT_OUTPUT_INTERFACE    *This);
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_TEXT_CLEAR_SCREEN) (
+    struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE   *This);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_TEXT_SET_CURSOR_POSITION) (
-    struct _SIMPLE_TEXT_OUTPUT_INTERFACE    *This,
-    UINTN                                   Column,
-    UINTN                                   Row);
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_TEXT_SET_CURSOR_POSITION) (
+    struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE   *This,
+    UINTN                                       Column,
+    UINTN                                       Row);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_TEXT_ENABLE_CURSOR) (
-    struct _SIMPLE_TEXT_OUTPUT_INTERFACE    *This,
-    BOOLEAN                                 Enable);
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_TEXT_ENABLE_CURSOR) (
+    struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE   *This,
+    BOOLEAN                                     Enable);
 
 typedef struct {
     INT32                           MaxMode;
@@ -224,35 +237,35 @@ typedef struct {
     INT32                           CursorColumn;
     INT32                           CursorRow;
     BOOLEAN                         CursorVisible;
-} SIMPLE_TEXT_OUTPUT_MODE;
+} ACPI_SIMPLE_TEXT_OUTPUT_MODE;
 
-typedef struct _SIMPLE_TEXT_OUTPUT_INTERFACE {
-    EFI_TEXT_RESET                  Reset;
+typedef struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE {
+    ACPI_EFI_TEXT_RESET                 Reset;
 
-    EFI_TEXT_OUTPUT_STRING          OutputString;
-    EFI_TEXT_TEST_STRING            TestString;
+    ACPI_EFI_TEXT_OUTPUT_STRING         OutputString;
+    ACPI_EFI_TEXT_TEST_STRING           TestString;
 
-    EFI_TEXT_QUERY_MODE             QueryMode;
-    EFI_TEXT_SET_MODE               SetMode;
-    EFI_TEXT_SET_ATTRIBUTE          SetAttribute;
+    ACPI_EFI_TEXT_QUERY_MODE            QueryMode;
+    ACPI_EFI_TEXT_SET_MODE              SetMode;
+    ACPI_EFI_TEXT_SET_ATTRIBUTE         SetAttribute;
 
-    EFI_TEXT_CLEAR_SCREEN           ClearScreen;
-    EFI_TEXT_SET_CURSOR_POSITION    SetCursorPosition;
-    EFI_TEXT_ENABLE_CURSOR          EnableCursor;
+    ACPI_EFI_TEXT_CLEAR_SCREEN          ClearScreen;
+    ACPI_EFI_TEXT_SET_CURSOR_POSITION   SetCursorPosition;
+    ACPI_EFI_TEXT_ENABLE_CURSOR         EnableCursor;
 
-    SIMPLE_TEXT_OUTPUT_MODE         *Mode;
-} SIMPLE_TEXT_OUTPUT_INTERFACE;
+    ACPI_SIMPLE_TEXT_OUTPUT_MODE        *Mode;
+} ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE;
 
 /*
  * Text input protocol
  */
-#define SIMPLE_TEXT_INPUT_PROTOCOL  \
+#define ACPI_SIMPLE_TEXT_INPUT_PROTOCOL  \
     { 0x387477c1, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
 
 typedef struct {
     UINT16                              ScanCode;
     CHAR16                              UnicodeChar;
-} EFI_INPUT_KEY;
+} ACPI_EFI_INPUT_KEY;
 
 /*
  * Baseline unicode control chars
@@ -264,243 +277,243 @@ typedef struct {
 #define CHAR_CARRIAGE_RETURN            0x000D
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_INPUT_RESET) (
-    struct _SIMPLE_INPUT_INTERFACE              *This,
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_INPUT_RESET) (
+    struct _ACPI_SIMPLE_INPUT_INTERFACE         *This,
     BOOLEAN                                     ExtendedVerification);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_INPUT_READ_KEY) (
-    struct _SIMPLE_INPUT_INTERFACE              *This,
-    EFI_INPUT_KEY                               *Key);
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_INPUT_READ_KEY) (
+    struct _ACPI_SIMPLE_INPUT_INTERFACE         *This,
+    ACPI_EFI_INPUT_KEY                          *Key);
 
-typedef struct _SIMPLE_INPUT_INTERFACE {
-    EFI_INPUT_RESET                     Reset;
-    EFI_INPUT_READ_KEY                  ReadKeyStroke;
-    EFI_EVENT                           WaitForKey;
-} SIMPLE_INPUT_INTERFACE;
+typedef struct _ACPI_SIMPLE_INPUT_INTERFACE {
+    ACPI_EFI_INPUT_RESET                    Reset;
+    ACPI_EFI_INPUT_READ_KEY                 ReadKeyStroke;
+    ACPI_EFI_EVENT                          WaitForKey;
+} ACPI_SIMPLE_INPUT_INTERFACE;
 
 
 /*
  * Simple file system protocol
  */
-#define SIMPLE_FILE_SYSTEM_PROTOCOL \
+#define ACPI_SIMPLE_FILE_SYSTEM_PROTOCOL \
     { 0x964e5b22, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_VOLUME_OPEN) (
-    struct _EFI_FILE_IO_INTERFACE               *This,
-    struct _EFI_FILE_HANDLE                     **Root);
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_VOLUME_OPEN) (
+    struct _ACPI_EFI_FILE_IO_INTERFACE          *This,
+    struct _ACPI_EFI_FILE_HANDLE                **Root);
 
-#define EFI_FILE_IO_INTERFACE_REVISION   0x00010000
+#define ACPI_EFI_FILE_IO_INTERFACE_REVISION     0x00010000
 
-typedef struct _EFI_FILE_IO_INTERFACE {
+typedef struct _ACPI_EFI_FILE_IO_INTERFACE {
     UINT64                  Revision;
-    EFI_VOLUME_OPEN         OpenVolume;
-} EFI_FILE_IO_INTERFACE;
+    ACPI_EFI_VOLUME_OPEN    OpenVolume;
+} ACPI_EFI_FILE_IO_INTERFACE;
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_FILE_OPEN) (
-    struct _EFI_FILE_HANDLE                     *File,
-    struct _EFI_FILE_HANDLE                     **NewHandle,
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_FILE_OPEN) (
+    struct _ACPI_EFI_FILE_HANDLE                *File,
+    struct _ACPI_EFI_FILE_HANDLE                **NewHandle,
     CHAR16                                      *FileName,
     UINT64                                      OpenMode,
     UINT64                                      Attributes);
 
 /* Values for OpenMode used above */
 
-#define EFI_FILE_MODE_READ      0x0000000000000001
-#define EFI_FILE_MODE_WRITE     0x0000000000000002
-#define EFI_FILE_MODE_CREATE    0x8000000000000000
+#define ACPI_EFI_FILE_MODE_READ     0x0000000000000001
+#define ACPI_EFI_FILE_MODE_WRITE    0x0000000000000002
+#define ACPI_EFI_FILE_MODE_CREATE   0x8000000000000000
 
 /* Values for Attribute used above */
 
-#define EFI_FILE_READ_ONLY      0x0000000000000001
-#define EFI_FILE_HIDDEN         0x0000000000000002
-#define EFI_FILE_SYSTEM         0x0000000000000004
-#define EFI_FILE_RESERVIED      0x0000000000000008
-#define EFI_FILE_DIRECTORY      0x0000000000000010
-#define EFI_FILE_ARCHIVE        0x0000000000000020
-#define EFI_FILE_VALID_ATTR     0x0000000000000037
+#define ACPI_EFI_FILE_READ_ONLY     0x0000000000000001
+#define ACPI_EFI_FILE_HIDDEN        0x0000000000000002
+#define ACPI_EFI_FILE_SYSTEM        0x0000000000000004
+#define ACPI_EFI_FILE_RESERVIED     0x0000000000000008
+#define ACPI_EFI_FILE_DIRECTORY     0x0000000000000010
+#define ACPI_EFI_FILE_ARCHIVE       0x0000000000000020
+#define ACPI_EFI_FILE_VALID_ATTR    0x0000000000000037
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_FILE_CLOSE) (
-    struct _EFI_FILE_HANDLE                     *File);
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_FILE_CLOSE) (
+    struct _ACPI_EFI_FILE_HANDLE                *File);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_FILE_DELETE) (
-    struct _EFI_FILE_HANDLE                     *File);
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_FILE_DELETE) (
+    struct _ACPI_EFI_FILE_HANDLE                *File);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_FILE_READ) (
-    struct _EFI_FILE_HANDLE                     *File,
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_FILE_READ) (
+    struct _ACPI_EFI_FILE_HANDLE                *File,
     UINTN                                       *BufferSize,
     VOID                                        *Buffer);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_FILE_WRITE) (
-    struct _EFI_FILE_HANDLE                     *File,
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_FILE_WRITE) (
+    struct _ACPI_EFI_FILE_HANDLE                *File,
     UINTN                                       *BufferSize,
     VOID                                        *Buffer);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_FILE_SET_POSITION) (
-    struct _EFI_FILE_HANDLE                     *File,
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_FILE_SET_POSITION) (
+    struct _ACPI_EFI_FILE_HANDLE                *File,
     UINT64                                      Position);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_FILE_GET_POSITION) (
-    struct _EFI_FILE_HANDLE                     *File,
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_FILE_GET_POSITION) (
+    struct _ACPI_EFI_FILE_HANDLE                *File,
     UINT64                                      *Position);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_FILE_GET_INFO) (
-    struct _EFI_FILE_HANDLE                     *File,
-    EFI_GUID                                    *InformationType,
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_FILE_GET_INFO) (
+    struct _ACPI_EFI_FILE_HANDLE                *File,
+    ACPI_EFI_GUID                               *InformationType,
     UINTN                                       *BufferSize,
     VOID                                        *Buffer);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_FILE_SET_INFO) (
-    struct _EFI_FILE_HANDLE                     *File,
-    EFI_GUID                                    *InformationType,
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_FILE_SET_INFO) (
+    struct _ACPI_EFI_FILE_HANDLE                *File,
+    ACPI_EFI_GUID                               *InformationType,
     UINTN                                       BufferSize,
     VOID                                        *Buffer);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_FILE_FLUSH) (
-    struct _EFI_FILE_HANDLE                     *File);
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_FILE_FLUSH) (
+    struct _ACPI_EFI_FILE_HANDLE                *File);
 
 
-#define EFI_FILE_HANDLE_REVISION         0x00010000
+#define ACPI_EFI_FILE_HANDLE_REVISION           0x00010000
 
-typedef struct _EFI_FILE_HANDLE {
-    UINT64                  Revision;
-    EFI_FILE_OPEN           Open;
-    EFI_FILE_CLOSE          Close;
-    EFI_FILE_DELETE         Delete;
-    EFI_FILE_READ           Read;
-    EFI_FILE_WRITE          Write;
-    EFI_FILE_GET_POSITION   GetPosition;
-    EFI_FILE_SET_POSITION   SetPosition;
-    EFI_FILE_GET_INFO       GetInfo;
-    EFI_FILE_SET_INFO       SetInfo;
-    EFI_FILE_FLUSH          Flush;
-} EFI_FILE, *EFI_FILE_HANDLE;
+typedef struct _ACPI_EFI_FILE_HANDLE {
+    UINT64                      Revision;
+    ACPI_EFI_FILE_OPEN          Open;
+    ACPI_EFI_FILE_CLOSE         Close;
+    ACPI_EFI_FILE_DELETE        Delete;
+    ACPI_EFI_FILE_READ          Read;
+    ACPI_EFI_FILE_WRITE         Write;
+    ACPI_EFI_FILE_GET_POSITION  GetPosition;
+    ACPI_EFI_FILE_SET_POSITION  SetPosition;
+    ACPI_EFI_FILE_GET_INFO      GetInfo;
+    ACPI_EFI_FILE_SET_INFO      SetInfo;
+    ACPI_EFI_FILE_FLUSH         Flush;
+} ACPI_EFI_FILE_STRUCT, *ACPI_EFI_FILE_HANDLE;
 
 
 /*
  * Loaded image protocol
  */
-#define LOADED_IMAGE_PROTOCOL      \
+#define ACPI_EFI_LOADED_IMAGE_PROTOCOL \
     { 0x5B1B31A1, 0x9562, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B} }
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_IMAGE_ENTRY_POINT) (
-    EFI_HANDLE                              ImageHandle,
-    struct _EFI_SYSTEM_TABLE                *SystemTable);
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_IMAGE_ENTRY_POINT) (
+    ACPI_EFI_HANDLE                         ImageHandle,
+    struct _ACPI_EFI_SYSTEM_TABLE           *SystemTable);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_IMAGE_LOAD) (
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_IMAGE_LOAD) (
     BOOLEAN                         BootPolicy,
-    EFI_HANDLE                      ParentImageHandle,
-    EFI_DEVICE_PATH                 *FilePath,
+    ACPI_EFI_HANDLE                 ParentImageHandle,
+    ACPI_EFI_DEVICE_PATH            *FilePath,
     VOID                            *SourceBuffer,
     UINTN                           SourceSize,
-    EFI_HANDLE                      *ImageHandle);
+    ACPI_EFI_HANDLE                 *ImageHandle);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_IMAGE_START) (
-    EFI_HANDLE                      ImageHandle,
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_IMAGE_START) (
+    ACPI_EFI_HANDLE                 ImageHandle,
     UINTN                           *ExitDataSize,
     CHAR16                          **ExitData);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_EXIT) (
-    EFI_HANDLE                      ImageHandle,
-    EFI_STATUS                      ExitStatus,
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_EXIT) (
+    ACPI_EFI_HANDLE                 ImageHandle,
+    ACPI_EFI_STATUS                 ExitStatus,
     UINTN                           ExitDataSize,
     CHAR16                          *ExitData);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_IMAGE_UNLOAD) (
-    EFI_HANDLE                      ImageHandle);
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_IMAGE_UNLOAD) (
+    ACPI_EFI_HANDLE                 ImageHandle);
 
 
 #define EFI_IMAGE_INFORMATION_REVISION      0x1000
 typedef struct {
     UINT32                          Revision;
-    EFI_HANDLE                      ParentHandle;
-    struct _EFI_SYSTEM_TABLE        *SystemTable;
-    EFI_HANDLE                      DeviceHandle;
-    EFI_DEVICE_PATH                 *FilePath;
+    ACPI_EFI_HANDLE                 ParentHandle;
+    struct _ACPI_EFI_SYSTEM_TABLE   *SystemTable;
+    ACPI_EFI_HANDLE                 DeviceHandle;
+    ACPI_EFI_DEVICE_PATH            *FilePath;
     VOID                            *Reserved;
     UINT32                          LoadOptionsSize;
     VOID                            *LoadOptions;
     VOID                            *ImageBase;
     UINT64                          ImageSize;
-    EFI_MEMORY_TYPE                 ImageCodeType;
-    EFI_MEMORY_TYPE                 ImageDataType;
-    EFI_IMAGE_UNLOAD                Unload;
+    ACPI_EFI_MEMORY_TYPE            ImageCodeType;
+    ACPI_EFI_MEMORY_TYPE            ImageDataType;
+    ACPI_EFI_IMAGE_UNLOAD           Unload;
 
-} EFI_LOADED_IMAGE;
+} ACPI_EFI_LOADED_IMAGE;
 
 
 /*
  * EFI Memory
  */
 typedef
-EFI_STATUS
-(EFIAPI *EFI_ALLOCATE_PAGES) (
-    EFI_ALLOCATE_TYPE               Type,
-    EFI_MEMORY_TYPE                 MemoryType,
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_ALLOCATE_PAGES) (
+    ACPI_EFI_ALLOCATE_TYPE          Type,
+    ACPI_EFI_MEMORY_TYPE            MemoryType,
     UINTN                           NoPages,
-    EFI_PHYSICAL_ADDRESS            *Memory);
+    ACPI_EFI_PHYSICAL_ADDRESS       *Memory);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_FREE_PAGES) (
-    EFI_PHYSICAL_ADDRESS            Memory,
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_FREE_PAGES) (
+    ACPI_EFI_PHYSICAL_ADDRESS       Memory,
     UINTN                           NoPages);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_GET_MEMORY_MAP) (
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_GET_MEMORY_MAP) (
     UINTN                           *MemoryMapSize,
-    EFI_MEMORY_DESCRIPTOR           *MemoryMap,
+    ACPI_EFI_MEMORY_DESCRIPTOR      *MemoryMap,
     UINTN                           *MapKey,
     UINTN                           *DescriptorSize,
     UINT32                          *DescriptorVersion);
 
-#define NextMemoryDescriptor(Ptr,Size)  ((EFI_MEMORY_DESCRIPTOR *) (((UINT8 *) Ptr) + Size))
+#define NextMemoryDescriptor(Ptr,Size)  ((ACPI_EFI_MEMORY_DESCRIPTOR *) (((UINT8 *) Ptr) + Size))
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_ALLOCATE_POOL) (
-    EFI_MEMORY_TYPE                 PoolType,
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_ALLOCATE_POOL) (
+    ACPI_EFI_MEMORY_TYPE            PoolType,
     UINTN                           Size,
     VOID                            **Buffer);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_FREE_POOL) (
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_FREE_POOL) (
     VOID                            *Buffer);
 
 
@@ -508,167 +521,167 @@ EFI_STATUS
  * Protocol handler functions
  */
 typedef enum {
-    EFI_NATIVE_INTERFACE,
-    EFI_PCODE_INTERFACE
-} EFI_INTERFACE_TYPE;
+    ACPI_EFI_NATIVE_INTERFACE,
+    ACPI_EFI_PCODE_INTERFACE
+} ACPI_EFI_INTERFACE_TYPE;
 
 typedef enum {
-    AllHandles,
-    ByRegisterNotify,
-    ByProtocol
-} EFI_LOCATE_SEARCH_TYPE;
+    AcpiEfiAllHandles,
+    AcpiEfiByRegisterNotify,
+    AcpiEfiByProtocol
+} ACPI_EFI_LOCATE_SEARCH_TYPE;
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_INSTALL_PROTOCOL_INTERFACE) (
-    EFI_HANDLE                      *Handle,
-    EFI_GUID                        *Protocol,
-    EFI_INTERFACE_TYPE              InterfaceType,
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_INSTALL_PROTOCOL_INTERFACE) (
+    ACPI_EFI_HANDLE                 *Handle,
+    ACPI_EFI_GUID                   *Protocol,
+    ACPI_EFI_INTERFACE_TYPE         InterfaceType,
     VOID                            *Interface);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_REINSTALL_PROTOCOL_INTERFACE) (
-    EFI_HANDLE                      Handle,
-    EFI_GUID                        *Protocol,
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_REINSTALL_PROTOCOL_INTERFACE) (
+    ACPI_EFI_HANDLE                 Handle,
+    ACPI_EFI_GUID                   *Protocol,
     VOID                            *OldInterface,
     VOID                            *NewInterface);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_UNINSTALL_PROTOCOL_INTERFACE) (
-    EFI_HANDLE                      Handle,
-    EFI_GUID                        *Protocol,
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_UNINSTALL_PROTOCOL_INTERFACE) (
+    ACPI_EFI_HANDLE                 Handle,
+    ACPI_EFI_GUID                   *Protocol,
     VOID                            *Interface);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_HANDLE_PROTOCOL) (
-    EFI_HANDLE                      Handle,
-    EFI_GUID                        *Protocol,
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_HANDLE_PROTOCOL) (
+    ACPI_EFI_HANDLE                 Handle,
+    ACPI_EFI_GUID                   *Protocol,
     VOID                            **Interface);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_REGISTER_PROTOCOL_NOTIFY) (
-    EFI_GUID                        *Protocol,
-    EFI_EVENT                       Event,
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_REGISTER_PROTOCOL_NOTIFY) (
+    ACPI_EFI_GUID                   *Protocol,
+    ACPI_EFI_EVENT                  Event,
     VOID                            **Registration);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_LOCATE_HANDLE) (
-    EFI_LOCATE_SEARCH_TYPE          SearchType,
-    EFI_GUID                        *Protocol,
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_LOCATE_HANDLE) (
+    ACPI_EFI_LOCATE_SEARCH_TYPE     SearchType,
+    ACPI_EFI_GUID                   *Protocol,
     VOID                            *SearchKey,
     UINTN                           *BufferSize,
-    EFI_HANDLE                      *Buffer);
+    ACPI_EFI_HANDLE                 *Buffer);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_LOCATE_DEVICE_PATH) (
-    EFI_GUID                        *Protocol,
-    EFI_DEVICE_PATH                 **DevicePath,
-    EFI_HANDLE                      *Device);
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_LOCATE_DEVICE_PATH) (
+    ACPI_EFI_GUID                   *Protocol,
+    ACPI_EFI_DEVICE_PATH            **DevicePath,
+    ACPI_EFI_HANDLE                 *Device);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_INSTALL_CONFIGURATION_TABLE) (
-    EFI_GUID                        *Guid,
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_INSTALL_CONFIGURATION_TABLE) (
+    ACPI_EFI_GUID                   *Guid,
     VOID                            *Table);
 
-#define EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL  0x00000001
-#define EFI_OPEN_PROTOCOL_GET_PROTOCOL        0x00000002
-#define EFI_OPEN_PROTOCOL_TEST_PROTOCOL       0x00000004
-#define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008
-#define EFI_OPEN_PROTOCOL_BY_DRIVER           0x00000010
-#define EFI_OPEN_PROTOCOL_EXCLUSIVE           0x00000020
+#define ACPI_EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL  0x00000001
+#define ACPI_EFI_OPEN_PROTOCOL_GET_PROTOCOL        0x00000002
+#define ACPI_EFI_OPEN_PROTOCOL_TEST_PROTOCOL       0x00000004
+#define ACPI_EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008
+#define ACPI_EFI_OPEN_PROTOCOL_BY_DRIVER           0x00000010
+#define ACPI_EFI_OPEN_PROTOCOL_EXCLUSIVE           0x00000020
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_OPEN_PROTOCOL) (
-    EFI_HANDLE                      Handle,
-    EFI_GUID                        *Protocol,
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_OPEN_PROTOCOL) (
+    ACPI_EFI_HANDLE                 Handle,
+    ACPI_EFI_GUID                   *Protocol,
     VOID                            **Interface,
-    EFI_HANDLE                      AgentHandle,
-    EFI_HANDLE                      ControllerHandle,
+    ACPI_EFI_HANDLE                 AgentHandle,
+    ACPI_EFI_HANDLE                 ControllerHandle,
     UINT32                          Attributes);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_CLOSE_PROTOCOL) (
-    EFI_HANDLE                      Handle,
-    EFI_GUID                        *Protocol,
-    EFI_HANDLE                      AgentHandle,
-    EFI_HANDLE                      ControllerHandle);
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_CLOSE_PROTOCOL) (
+    ACPI_EFI_HANDLE                 Handle,
+    ACPI_EFI_GUID                   *Protocol,
+    ACPI_EFI_HANDLE                 AgentHandle,
+    ACPI_EFI_HANDLE                 ControllerHandle);
 
 typedef struct {
-    EFI_HANDLE                  AgentHandle;
-    EFI_HANDLE                  ControllerHandle;
-    UINT32                      Attributes;
-    UINT32                      OpenCount;
-} EFI_OPEN_PROTOCOL_INFORMATION_ENTRY;
-
-typedef
-EFI_STATUS
-(EFIAPI *EFI_OPEN_PROTOCOL_INFORMATION) (
-    EFI_HANDLE                      Handle,
-    EFI_GUID                        *Protocol,
-    EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer,
+    ACPI_EFI_HANDLE                 AgentHandle;
+    ACPI_EFI_HANDLE                 ControllerHandle;
+    UINT32                          Attributes;
+    UINT32                          OpenCount;
+} ACPI_EFI_OPEN_PROTOCOL_INFORMATION_ENTRY;
+
+typedef
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_OPEN_PROTOCOL_INFORMATION) (
+    ACPI_EFI_HANDLE                 Handle,
+    ACPI_EFI_GUID                   *Protocol,
+    ACPI_EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer,
     UINTN                           *EntryCount);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_PROTOCOLS_PER_HANDLE) (
-    EFI_HANDLE                      Handle,
-    EFI_GUID                        ***ProtocolBuffer,
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_PROTOCOLS_PER_HANDLE) (
+    ACPI_EFI_HANDLE                 Handle,
+    ACPI_EFI_GUID                   ***ProtocolBuffer,
     UINTN                           *ProtocolBufferCount);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_LOCATE_HANDLE_BUFFER) (
-    EFI_LOCATE_SEARCH_TYPE          SearchType,
-    EFI_GUID                        *Protocol,
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_LOCATE_HANDLE_BUFFER) (
+    ACPI_EFI_LOCATE_SEARCH_TYPE     SearchType,
+    ACPI_EFI_GUID                   *Protocol,
     VOID                            *SearchKey,
     UINTN                           *NoHandles,
-    EFI_HANDLE                      **Buffer);
+    ACPI_EFI_HANDLE                 **Buffer);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_LOCATE_PROTOCOL) (
-    EFI_GUID                        *Protocol,
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_LOCATE_PROTOCOL) (
+    ACPI_EFI_GUID                   *Protocol,
     VOID                            *Registration,
     VOID                            **Interface);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES) (
-    EFI_HANDLE                      *Handle,
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES) (
+    ACPI_EFI_HANDLE                 *Handle,
     ...);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES) (
-    EFI_HANDLE                      Handle,
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES) (
+    ACPI_EFI_HANDLE                 Handle,
     ...);
 
 typedef
-EFI_STATUS
-(EFIAPI *EFI_CALCULATE_CRC32) (
+ACPI_EFI_STATUS
+(ACPI_EFI_API *ACPI_EFI_CALCULATE_CRC32) (
     VOID                            *Data,
     UINTN                           DataSize,
     UINT32                          *Crc32);
 
 typedef
 VOID
-(EFIAPI *EFI_COPY_MEM) (
+(ACPI_EFI_API *ACPI_EFI_COPY_MEM) (
     VOID                            *Destination,
     VOID                            *Source,
     UINTN                           Length);
 
 typedef
 VOID
-(EFIAPI *EFI_SET_MEM) (
+(ACPI_EFI_API *ACPI_EFI_SET_MEM) (
     VOID                            *Buffer,
     UINTN                           Size,
     UINT8                           Value);
@@ -676,97 +689,97 @@ VOID
 /*
  * EFI Boot Services Table
  */
-#define EFI_BOOT_SERVICES_SIGNATURE     0x56524553544f4f42
-#define EFI_BOOT_SERVICES_REVISION      (EFI_SPECIFICATION_MAJOR_REVISION<<16) | (EFI_SPECIFICATION_MINOR_REVISION)
+#define ACPI_EFI_BOOT_SERVICES_SIGNATURE 0x56524553544f4f42
+#define ACPI_EFI_BOOT_SERVICES_REVISION  (ACPI_EFI_SPECIFICATION_MAJOR_REVISION<<16) | (ACPI_EFI_SPECIFICATION_MINOR_REVISION)
 
-typedef struct _EFI_BOOT_SERVICES {
-    EFI_TABLE_HEADER                Hdr;
+typedef struct _ACPI_EFI_BOOT_SERVICES {
+    ACPI_EFI_TABLE_HEADER               Hdr;
 
 #if 0
-    EFI_RAISE_TPL                   RaiseTPL;
-    EFI_RESTORE_TPL                 RestoreTPL;
+    ACPI_EFI_RAISE_TPL                  RaiseTPL;
+    ACPI_EFI_RESTORE_TPL                RestoreTPL;
 #else
-    EFI_UNKNOWN_INTERFACE           RaiseTPL;
-    EFI_UNKNOWN_INTERFACE           RestoreTPL;
+    ACPI_EFI_UNKNOWN_INTERFACE          RaiseTPL;
+    ACPI_EFI_UNKNOWN_INTERFACE          RestoreTPL;
 #endif
 
-    EFI_ALLOCATE_PAGES              AllocatePages;
-    EFI_FREE_PAGES                  FreePages;
-    EFI_GET_MEMORY_MAP              GetMemoryMap;
-    EFI_ALLOCATE_POOL               AllocatePool;
-    EFI_FREE_POOL                   FreePool;
+    ACPI_EFI_ALLOCATE_PAGES             AllocatePages;
+    ACPI_EFI_FREE_PAGES                 FreePages;
+    ACPI_EFI_GET_MEMORY_MAP             GetMemoryMap;
+    ACPI_EFI_ALLOCATE_POOL              AllocatePool;
+    ACPI_EFI_FREE_POOL                  FreePool;
 
 #if 0
-    EFI_CREATE_EVENT                CreateEvent;
-    EFI_SET_TIMER                   SetTimer;
-    EFI_WAIT_FOR_EVENT              WaitForEvent;
-    EFI_SIGNAL_EVENT                SignalEvent;
-    EFI_CLOSE_EVENT                 CloseEvent;
-    EFI_CHECK_EVENT                 CheckEvent;
+    ACPI_EFI_CREATE_EVENT               CreateEvent;
+    ACPI_EFI_SET_TIMER                  SetTimer;
+    ACPI_EFI_WAIT_FOR_EVENT             WaitForEvent;
+    ACPI_EFI_SIGNAL_EVENT               SignalEvent;
+    ACPI_EFI_CLOSE_EVENT                CloseEvent;
+    ACPI_EFI_CHECK_EVENT                CheckEvent;
 #else
-    EFI_UNKNOWN_INTERFACE           CreateEvent;
-    EFI_UNKNOWN_INTERFACE           SetTimer;
-    EFI_UNKNOWN_INTERFACE           WaitForEvent;
-    EFI_UNKNOWN_INTERFACE           SignalEvent;
-    EFI_UNKNOWN_INTERFACE           CloseEvent;
-    EFI_UNKNOWN_INTERFACE           CheckEvent;
+    ACPI_EFI_UNKNOWN_INTERFACE          CreateEvent;
+    ACPI_EFI_UNKNOWN_INTERFACE          SetTimer;
+    ACPI_EFI_UNKNOWN_INTERFACE          WaitForEvent;
+    ACPI_EFI_UNKNOWN_INTERFACE          SignalEvent;
+    ACPI_EFI_UNKNOWN_INTERFACE          CloseEvent;
+    ACPI_EFI_UNKNOWN_INTERFACE          CheckEvent;
 #endif
 
-    EFI_INSTALL_PROTOCOL_INTERFACE  InstallProtocolInterface;
-    EFI_REINSTALL_PROTOCOL_INTERFACE ReinstallProtocolInterface;
-    EFI_UNINSTALL_PROTOCOL_INTERFACE UninstallProtocolInterface;
-    EFI_HANDLE_PROTOCOL             HandleProtocol;
-    EFI_HANDLE_PROTOCOL             PCHandleProtocol;
-    EFI_REGISTER_PROTOCOL_NOTIFY    RegisterProtocolNotify;
-    EFI_LOCATE_HANDLE               LocateHandle;
-    EFI_LOCATE_DEVICE_PATH          LocateDevicePath;
-    EFI_INSTALL_CONFIGURATION_TABLE InstallConfigurationTable;
-
-    EFI_IMAGE_LOAD                  LoadImage;
-    EFI_IMAGE_START                 StartImage;
-    EFI_EXIT                        Exit;
-    EFI_IMAGE_UNLOAD                UnloadImage;
+    ACPI_EFI_INSTALL_PROTOCOL_INTERFACE InstallProtocolInterface;
+    ACPI_EFI_REINSTALL_PROTOCOL_INTERFACE ReinstallProtocolInterface;
+    ACPI_EFI_UNINSTALL_PROTOCOL_INTERFACE UninstallProtocolInterface;
+    ACPI_EFI_HANDLE_PROTOCOL            HandleProtocol;
+    ACPI_EFI_HANDLE_PROTOCOL            PCHandleProtocol;
+    ACPI_EFI_REGISTER_PROTOCOL_NOTIFY   RegisterProtocolNotify;
+    ACPI_EFI_LOCATE_HANDLE              LocateHandle;
+    ACPI_EFI_LOCATE_DEVICE_PATH         LocateDevicePath;
+    ACPI_EFI_INSTALL_CONFIGURATION_TABLE InstallConfigurationTable;
+
+    ACPI_EFI_IMAGE_LOAD                 LoadImage;
+    ACPI_EFI_IMAGE_START                StartImage;
+    ACPI_EFI_EXIT                       Exit;
+    ACPI_EFI_IMAGE_UNLOAD               UnloadImage;
 
 #if 0
-    EFI_EXIT_BOOT_SERVICES          ExitBootServices;
-    EFI_GET_NEXT_MONOTONIC_COUNT    GetNextMonotonicCount;
-    EFI_STALL                       Stall;
-    EFI_SET_WATCHDOG_TIMER          SetWatchdogTimer;
+    ACPI_EFI_EXIT_BOOT_SERVICES         ExitBootServices;
+    ACPI_EFI_GET_NEXT_MONOTONIC_COUNT   GetNextMonotonicCount;
+    ACPI_EFI_STALL                      Stall;
+    ACPI_EFI_SET_WATCHDOG_TIMER         SetWatchdogTimer;
 #else
-    EFI_UNKNOWN_INTERFACE           ExitBootServices;
-    EFI_UNKNOWN_INTERFACE           GetNextMonotonicCount;
-    EFI_UNKNOWN_INTERFACE           Stall;
-    EFI_UNKNOWN_INTERFACE           SetWatchdogTimer;
+    ACPI_EFI_UNKNOWN_INTERFACE          ExitBootServices;
+    ACPI_EFI_UNKNOWN_INTERFACE          GetNextMonotonicCount;
+    ACPI_EFI_UNKNOWN_INTERFACE          Stall;
+    ACPI_EFI_UNKNOWN_INTERFACE          SetWatchdogTimer;
 #endif
 
 #if 0
-    EFI_CONNECT_CONTROLLER          ConnectController;
-    EFI_DISCONNECT_CONTROLLER       DisconnectController;
+    ACPI_EFI_CONNECT_CONTROLLER         ConnectController;
+    ACPI_EFI_DISCONNECT_CONTROLLER      DisconnectController;
 #else
-    EFI_UNKNOWN_INTERFACE           ConnectController;
-    EFI_UNKNOWN_INTERFACE           DisconnectController;
+    ACPI_EFI_UNKNOWN_INTERFACE          ConnectController;
+    ACPI_EFI_UNKNOWN_INTERFACE          DisconnectController;
 #endif
 
-    EFI_OPEN_PROTOCOL               OpenProtocol;
-    EFI_CLOSE_PROTOCOL              CloseProtocol;
-    EFI_OPEN_PROTOCOL_INFORMATION   OpenProtocolInformation;
-    EFI_PROTOCOLS_PER_HANDLE        ProtocolsPerHandle;
-    EFI_LOCATE_HANDLE_BUFFER        LocateHandleBuffer;
-    EFI_LOCATE_PROTOCOL             LocateProtocol;
-    EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES InstallMultipleProtocolInterfaces;
-    EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES UninstallMultipleProtocolInterfaces;
+    ACPI_EFI_OPEN_PROTOCOL              OpenProtocol;
+    ACPI_EFI_CLOSE_PROTOCOL             CloseProtocol;
+    ACPI_EFI_OPEN_PROTOCOL_INFORMATION  OpenProtocolInformation;
+    ACPI_EFI_PROTOCOLS_PER_HANDLE       ProtocolsPerHandle;
+    ACPI_EFI_LOCATE_HANDLE_BUFFER       LocateHandleBuffer;
+    ACPI_EFI_LOCATE_PROTOCOL            LocateProtocol;
+    ACPI_EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES InstallMultipleProtocolInterfaces;
+    ACPI_EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES UninstallMultipleProtocolInterfaces;
 
-    EFI_CALCULATE_CRC32             CalculateCrc32;
+    ACPI_EFI_CALCULATE_CRC32        CalculateCrc32;
 
-    EFI_COPY_MEM                    CopyMem;
-    EFI_SET_MEM                     SetMem;
+    ACPI_EFI_COPY_MEM               CopyMem;
+    ACPI_EFI_SET_MEM                SetMem;
 
 #if 0
-    EFI_CREATE_EVENT_EX             CreateEventEx;
+    ACPI_EFI_CREATE_EVENT_EX        CreateEventEx;
 #else
-    EFI_UNKNOWN_INTERFACE           CreateEventEx;
+    ACPI_EFI_UNKNOWN_INTERFACE      CreateEventEx;
 #endif
-} EFI_BOOT_SERVICES;
+} ACPI_EFI_BOOT_SERVICES;
 
 
 /*
@@ -776,46 +789,46 @@ typedef struct _EFI_BOOT_SERVICES {
 /*
  * EFI Configuration Table and GUID definitions
  */
-#define ACPI_TABLE_GUID    \
+#define ACPI_TABLE_GUID \
     { 0xeb9d2d30, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
-#define ACPI_20_TABLE_GUID  \
+#define ACPI_20_TABLE_GUID \
     { 0x8868e871, 0xe4f1, 0x11d3, {0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81} }
 
-typedef struct _EFI_CONFIGURATION_TABLE {
-    EFI_GUID                VendorGuid;
+typedef struct _ACPI_EFI_CONFIGURATION_TABLE {
+    ACPI_EFI_GUID           VendorGuid;
     VOID                    *VendorTable;
-} EFI_CONFIGURATION_TABLE;
+} ACPI_EFI_CONFIGURATION_TABLE;
 
 
-#define EFI_SYSTEM_TABLE_SIGNATURE      0x5453595320494249
-#define EFI_SYSTEM_TABLE_REVISION      (EFI_SPECIFICATION_MAJOR_REVISION<<16) | (EFI_SPECIFICATION_MINOR_REVISION)
+#define ACPI_EFI_SYSTEM_TABLE_SIGNATURE 0x5453595320494249
+#define ACPI_EFI_SYSTEM_TABLE_REVISION  (ACPI_EFI_SPECIFICATION_MAJOR_REVISION<<16) | (ACPI_EFI_SPECIFICATION_MINOR_REVISION)
 
-typedef struct _EFI_SYSTEM_TABLE {
-    EFI_TABLE_HEADER                Hdr;
+typedef struct _ACPI_EFI_SYSTEM_TABLE {
+    ACPI_EFI_TABLE_HEADER               Hdr;
 
-    CHAR16                          *FirmwareVendor;
-    UINT32                          FirmwareRevision;
+    CHAR16                              *FirmwareVendor;
+    UINT32                              FirmwareRevision;
 
-    EFI_HANDLE                      ConsoleInHandle;
-    SIMPLE_INPUT_INTERFACE          *ConIn;
+    ACPI_EFI_HANDLE                     ConsoleInHandle;
+    ACPI_SIMPLE_INPUT_INTERFACE         *ConIn;
 
-    EFI_HANDLE                      ConsoleOutHandle;
-    SIMPLE_TEXT_OUTPUT_INTERFACE    *ConOut;
+    ACPI_EFI_HANDLE                     ConsoleOutHandle;
+    ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE   *ConOut;
 
-    EFI_HANDLE                      StandardErrorHandle;
-    SIMPLE_TEXT_OUTPUT_INTERFACE    *StdErr;
+    ACPI_EFI_HANDLE                     StandardErrorHandle;
+    ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE   *StdErr;
 
 #if 0
-    EFI_RUNTIME_SERVICES            *RuntimeServices;
+    ACPI_EFI_RUNTIME_SERVICES           *RuntimeServices;
 #else
-    EFI_HANDLE                      *RuntimeServices;
+    ACPI_EFI_HANDLE                     *RuntimeServices;
 #endif
-    EFI_BOOT_SERVICES               *BootServices;
+    ACPI_EFI_BOOT_SERVICES              *BootServices;
 
-    UINTN                           NumberOfTableEntries;
-    EFI_CONFIGURATION_TABLE         *ConfigurationTable;
+    UINTN                               NumberOfTableEntries;
+    ACPI_EFI_CONFIGURATION_TABLE        *ConfigurationTable;
 
-} EFI_SYSTEM_TABLE;
+} ACPI_EFI_SYSTEM_TABLE;
 
 
 /* GNU EFI definitions */
@@ -834,10 +847,10 @@ DivU64x32 (
 /*
  * EFI specific prototypes
  */
-EFI_STATUS
+ACPI_EFI_STATUS
 efi_main (
-    EFI_HANDLE              Image,
-    EFI_SYSTEM_TABLE        *SystemTab);
+    ACPI_EFI_HANDLE         Image,
+    ACPI_EFI_SYSTEM_TABLE   *SystemTab);
 
 int
 acpi_main (
@@ -847,9 +860,9 @@ acpi_main (
 
 #endif
 
-extern EFI_GUID AcpiGbl_LoadedImageProtocol;
-extern EFI_GUID AcpiGbl_TextInProtocol;
-extern EFI_GUID AcpiGbl_TextOutProtocol;
-extern EFI_GUID AcpiGbl_FileSystemProtocol;
+extern ACPI_EFI_GUID AcpiGbl_LoadedImageProtocol;
+extern ACPI_EFI_GUID AcpiGbl_TextInProtocol;
+extern ACPI_EFI_GUID AcpiGbl_TextOutProtocol;
+extern ACPI_EFI_GUID AcpiGbl_FileSystemProtocol;
 
 #endif /* __ACEFIEX_H__ */
index 410e097..72ee682 100644 (file)
@@ -79,6 +79,7 @@
     (defined ACPI_EXAMPLE_APP)
 #define ACPI_APPLICATION
 #define ACPI_SINGLE_THREADED
+#define USE_NATIVE_ALLOCATE_ZEROED
 #endif
 
 /* iASL configuration */
 
 #ifdef ACPI_DUMP_APP
 #define ACPI_USE_NATIVE_MEMORY_MAPPING
-#define USE_NATIVE_ALLOCATE_ZEROED
 #endif
 
 /* AcpiNames/Example configuration. Hardware disabled */
 /* Common for all ACPICA applications */
 
 #ifdef ACPI_APPLICATION
-#define ACPI_USE_SYSTEM_CLIBRARY
 #define ACPI_USE_LOCAL_CACHE
 #endif
 
 /******************************************************************************
  *
  * Host configuration files. The compiler configuration files are included
- * by the host files.
+ * first.
  *
  *****************************************************************************/
 
+#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
+#include "acgcc.h"
+
+#elif defined(_MSC_VER)
+#include "acmsvc.h"
+
+#elif defined(__INTEL_COMPILER)
+#include "acintel.h"
+
+#endif
+
 #if defined(_LINUX) || defined(__linux__)
 #include "aclinux.h"
 
 #elif defined(__OS2__)
 #include "acos2.h"
 
-#elif defined(_AED_EFI)
-#include "acefi.h"
-
-#elif defined(_GNU_EFI)
-#include "acefi.h"
-
 #elif defined(__HAIKU__)
 #include "achaiku.h"
 
 #elif defined(__QNX__)
 #include "acqnx.h"
 
+/*
+ * EFI applications can be built with -nostdlib, in this case, it must be
+ * included after including all other host environmental definitions, in
+ * order to override the definitions.
+ */
+#elif defined(_AED_EFI) || defined(_GNU_EFI) || defined(_EDK2_EFI)
+#include "acefi.h"
+
 #else
 
 /* Unknown environment */
  * ACPI_USE_SYSTEM_CLIBRARY - Define this if linking to an actual C library.
  *      Otherwise, local versions of string/memory functions will be used.
  * ACPI_USE_STANDARD_HEADERS - Define this if linking to a C library and
- *      the standard header files may be used.
+ *      the standard header files may be used. Defining this implies that
+ *      ACPI_USE_SYSTEM_CLIBRARY has been defined.
  *
  * The ACPICA subsystem only uses low level C library functions that do not
  * call operating system services and may therefore be inlined in the code.
  * It may be necessary to tailor these include files to the target
  * generation environment.
  */
-#ifdef ACPI_USE_SYSTEM_CLIBRARY
 
 /* Use the standard C library headers. We want to keep these to a minimum. */
 
 
 /* Use the standard headers from the standard locations */
 
-#include <stdarg.h>
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
+#ifdef ACPI_APPLICATION
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <time.h>
+#include <signal.h>
+#endif
 
 #endif /* ACPI_USE_STANDARD_HEADERS */
 
-/* We will be linking to the standard Clib functions */
-
-#else
-
-/******************************************************************************
- *
- * Not using native C library, use local implementations
- *
- *****************************************************************************/
-
-/*
- * Use local definitions of C library macros and functions. These function
- * implementations may not be as efficient as an inline or assembly code
- * implementation provided by a native C library, but they are functionally
- * equivalent.
- */
-#ifndef va_arg
-
-#ifndef _VALIST
-#define _VALIST
-typedef char *va_list;
-#endif /* _VALIST */
-
-/* Storage alignment properties */
-
-#define  _AUPBND                (sizeof (ACPI_NATIVE_INT) - 1)
-#define  _ADNBND                (sizeof (ACPI_NATIVE_INT) - 1)
-
-/* Variable argument list macro definitions */
-
-#define _Bnd(X, bnd)            (((sizeof (X)) + (bnd)) & (~(bnd)))
-#define va_arg(ap, T)           (*(T *)(((ap) += (_Bnd (T, _AUPBND))) - (_Bnd (T,_ADNBND))))
-#define va_end(ap)              (ap = (va_list) NULL)
-#define va_start(ap, A)         (void) ((ap) = (((char *) &(A)) + (_Bnd (A,_AUPBND))))
-
-#endif /* va_arg */
-
-/* Use the local (ACPICA) definitions of the clib functions */
-
-#endif /* ACPI_USE_SYSTEM_CLIBRARY */
-
-#ifndef ACPI_FILE
 #ifdef ACPI_APPLICATION
-#include <stdio.h>
 #define ACPI_FILE              FILE *
 #define ACPI_FILE_OUT          stdout
 #define ACPI_FILE_ERR          stderr
@@ -409,6 +384,9 @@ typedef char *va_list;
 #define ACPI_FILE_OUT          NULL
 #define ACPI_FILE_ERR          NULL
 #endif /* ACPI_APPLICATION */
-#endif /* ACPI_FILE */
+
+#ifndef ACPI_INIT_FUNCTION
+#define ACPI_INIT_FUNCTION
+#endif
 
 #endif /* __ACENV_H__ */
index 02a46f1..d7da594 100644 (file)
 #if defined(_LINUX) || defined(__linux__)
 #include "aclinuxex.h"
 
-#elif defined(WIN32)
-#include "acwinex.h"
+#elif defined(__DragonFly__)
+#include "acdragonflyex.h"
 
-#elif defined(_AED_EFI)
+/*
+ * EFI applications can be built with -nostdlib, in this case, it must be
+ * included after including all other host environmental definitions, in
+ * order to override the definitions.
+ */
+#elif defined(_AED_EFI) || defined(_GNU_EFI) || defined(_EDK2_EFI)
 #include "acefiex.h"
 
-#elif defined(_GNU_EFI)
-#include "acefiex.h"
+#endif
 
-#elif defined(__DragonFly__)
-#include "acdragonflyex.h"
+#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
+#include "acgccex.h"
+
+#elif defined(_MSC_VER)
+#include "acmsvcex.h"
 
 #endif
 
index a968e12..928aaa6 100644 (file)
@@ -45,9 +45,6 @@
 #define __ACFREEBSD_H__
 
 
-/* FreeBSD uses GCC */
-
-#include "acgcc.h"
 #include <sys/types.h>
 
 #ifdef __LP64__
index 47588a2..e3678c8 100644 (file)
 #ifndef __ACGCC_H__
 #define __ACGCC_H__
 
+/*
+ * Use compiler specific <stdarg.h> is a good practice for even when
+ * -nostdinc is specified (i.e., ACPI_USE_STANDARD_HEADERS undefined.
+ */
+#include <stdarg.h>
+
 #define ACPI_INLINE             __inline__
 
 /* Function name is used for debug output. Non-ANSI, compiler-dependent */
  */
 #define ACPI_UNUSED_VAR __attribute__ ((unused))
 
-/*
- * Some versions of gcc implement strchr() with a buggy macro. So,
- * undef it here. Prevents error messages of this form (usually from the
- * file getopt.c):
- *
- * error: logical '&&' with non-zero constant will always evaluate as true
- */
-#ifdef strchr
-#undef strchr
-#endif
-
 /* GCC supports __VA_ARGS__ in macros */
 
 #define COMPILER_VA_MACRO               1
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * Name: acwinex.h - Extra OS specific defines, etc.
+ * Name: acgccex.h - Extra GCC specific defines, etc.
  *
  *****************************************************************************/
 
  * POSSIBILITY OF SUCH DAMAGES.
  */
 
-#ifndef __ACWINEX_H__
-#define __ACWINEX_H__
+#ifndef __ACGCCEX_H__
+#define __ACGCCEX_H__
 
-/* Windows uses VC */
-#ifdef _MSC_VER
-#include "acmsvcex.h"
+/*
+ * Some versions of gcc implement strchr() with a buggy macro. So,
+ * undef it here. Prevents error messages of this form (usually from the
+ * file getopt.c):
+ *
+ * error: logical '&&' with non-zero constant will always evaluate as true
+ */
+#ifdef strchr
+#undef strchr
 #endif
 
-#endif /* __ACWINEX_H__ */
+#endif /* __ACGCCEX_H__ */
index 10aa6a3..75ee9e7 100644 (file)
@@ -44,7 +44,9 @@
 #ifndef __ACHAIKU_H__
 #define __ACHAIKU_H__
 
-#include "acgcc.h"
+#define ACPI_USE_STANDARD_HEADERS
+#define ACPI_USE_SYSTEM_CLIBRARY
+
 #include <KernelExport.h>
 
 struct mutex;
@@ -52,9 +54,6 @@ struct mutex;
 
 /* Host-dependent types and defines for user- and kernel-space ACPICA */
 
-#define ACPI_USE_SYSTEM_CLIBRARY
-#define ACPI_USE_STANDARD_HEADERS
-
 #define ACPI_MUTEX_TYPE             ACPI_OSL_MUTEX
 #define ACPI_MUTEX                  struct mutex *
 
index b8dda57..15683d6 100644 (file)
 #ifndef __ACINTEL_H__
 #define __ACINTEL_H__
 
+/*
+ * Use compiler specific <stdarg.h> is a good practice for even when
+ * -nostdinc is specified (i.e., ACPI_USE_STANDARD_HEADERS undefined.
+ */
+#include <stdarg.h>
+
 /* Configuration specific to Intel 64-bit C compiler */
 
 #define COMPILER_DEPENDENT_INT64    __int64
index bd45cdb..048f76a 100644 (file)
@@ -89,6 +89,8 @@
 #include <asm/acenv.h>
 #endif
 
+#define ACPI_INIT_FUNCTION __init
+
 #ifndef CONFIG_ACPI
 
 /* External globals for __KERNEL__, stubs is needed */
 
 #else /* !__KERNEL__ */
 
-#include <stdarg.h>
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
+#define ACPI_USE_STANDARD_HEADERS
+
+#ifdef ACPI_USE_STANDARD_HEADERS
 #include <unistd.h>
+#endif
 
 /* Define/disable kernel-specific declarators */
 
 
 #endif /* __KERNEL__ */
 
-/* Linux uses GCC */
-
-#include "acgcc.h"
-
 #endif /* __ACLINUX_H__ */
index c262e40..f1f9c9a 100644 (file)
@@ -71,7 +71,7 @@
 /*
  * Overrides for in-kernel ACPICA
  */
-ACPI_STATUS __init AcpiOsInitialize (
+ACPI_STATUS ACPI_INIT_FUNCTION AcpiOsInitialize (
     void);
 
 ACPI_STATUS AcpiOsTerminate (
index 1a38a3e..aac2b38 100644 (file)
 #define stat            _stat
 #define fstat           _fstat
 #define mkdir           _mkdir
+#define snprintf        _snprintf
+#if _MSC_VER <= 1200 /* Versions below VC++ 6 */
+#define vsnprintf       _vsnprintf
+#endif
 #define O_RDONLY        _O_RDONLY
 #define O_BINARY        _O_BINARY
 #define O_CREAT         _O_CREAT
 #define ACPI_INTERNAL_XFACE
 #define ACPI_INTERNAL_VAR_XFACE     __cdecl
 
+
+/* Do not maintain the architecture specific stuffs for the EFI ports */
+
+#if !defined(_EDK2_EFI) && !defined(_GNU_EFI)
 #ifndef _LINT
 /*
  * Math helper functions
     n_lo >>= 1;    \
 }
 #endif
+#endif
 
 #ifdef __REACTOS__
 
@@ -255,4 +264,15 @@ _CrtSetBreakAlloc (937);
 #else
 #endif
 
+/* Begin standard headers */
+
+/*
+ * warn C4001: nonstandard extension 'single line comment' was used
+ *
+ * We need to enable this for ACPICA internal files, but disable it for
+ * buggy MS runtime headers.
+ */
+#pragma warning(push)
+#pragma warning(disable:4001)
+
 #endif /* __ACMSVC_H__ */
index f99a034..45233e7 100644 (file)
 #ifndef __ACMSVCEX_H__
 #define __ACMSVCEX_H__
 
+/* va_arg implementation can be compiler specific */
+
+#ifdef ACPI_USE_STANDARD_HEADERS
+
+#include <stdarg.h>
+
+#endif /* ACPI_USE_STANDARD_HEADERS */
+
 /* Debug support. */
 
 #ifdef _DEBUG
 #include <crtdbg.h>
 #endif
 
+/* End standard headers */
+
+#pragma warning(pop)
+
+#ifndef ACPI_USE_SYSTEM_CLIBRARY
+
+/******************************************************************************
+ *
+ * Not using native C library, use local implementations
+ *
+ *****************************************************************************/
+
+#ifndef va_arg
+
+#ifndef _VALIST
+#define _VALIST
+typedef char *va_list;
+#endif /* _VALIST */
+
+/* Storage alignment properties */
+
+#define  _AUPBND                (sizeof (ACPI_NATIVE_INT) - 1)
+#define  _ADNBND                (sizeof (ACPI_NATIVE_INT) - 1)
+
+/* Variable argument list macro definitions */
+
+#define _Bnd(X, bnd)            (((sizeof (X)) + (bnd)) & (~(bnd)))
+#define va_arg(ap, T)           (*(T *)(((ap) += (_Bnd (T, _AUPBND))) - (_Bnd (T,_ADNBND))))
+#define va_end(ap)              (ap = (va_list) NULL)
+#define va_start(ap, A)         (void) ((ap) = (((char *) &(A)) + (_Bnd (A,_AUPBND))))
+
+#endif /* va_arg */
+
+#endif /* !ACPI_USE_SYSTEM_CLIBRARY */
+
 #endif /* __ACMSVCEX_H__ */
index 09259af..c0a9c6d 100644 (file)
 #ifndef __ACNETBSD_H__
 #define __ACNETBSD_H__
 
-/* NetBSD uses GCC */
-
-#include "acgcc.h"
-
 #define ACPI_UINTPTR_T          uintptr_t
 #define ACPI_USE_LOCAL_CACHE
 #define ACPI_CAST_PTHREAD_T(x)  ((ACPI_THREAD_ID) ACPI_TO_INTEGER (x))
index 419579b..b96d275 100644 (file)
 
 #ifndef __ACOS2_H__
 #define __ACOS2_H__
+
+#define ACPI_USE_STANDARD_HEADERS
+#define ACPI_USE_SYSTEM_CLIBRARY
+
 #define INCL_LONGLONG
 #include <os2.h>
 
@@ -66,7 +70,6 @@
  */
 #define ACPI_UNUSED_VAR
 
-#define ACPI_USE_STANDARD_HEADERS
 #include <io.h>
 
 #define ACPI_FLUSH_CPU_CACHE() Wbinvd()
index 76252f8..3480ecb 100644 (file)
@@ -44,9 +44,8 @@
 #ifndef __ACQNX_H__
 #define __ACQNX_H__
 
-/* QNX uses GCC */
-
-#include "acgcc.h"
+#define ACPI_USE_STANDARD_HEADERS
+#define ACPI_USE_SYSTEM_CLIBRARY
 
 #define ACPI_UINTPTR_T          uintptr_t
 #define ACPI_USE_LOCAL_CACHE
 #include <stdint.h>
 #include <sys/neutrino.h>
 
-#define ACPI_USE_STANDARD_HEADERS
-
 #define __cli() InterruptDisable();
 #define __sti() InterruptEnable();
 #define __cdecl
 
-#define ACPI_USE_SYSTEM_CLIBRARY
 #define ACPI_USE_NATIVE_DIVIDE
 
 #endif /* __ACQNX_H__ */
index abd0527..5bcfde5 100644 (file)
 #ifndef __ACWIN_H__
 #define __ACWIN_H__
 
-/*! [Begin] no source code translation (Keep the include) */
-
-/* Windows uses VC */
-#ifdef _MSC_VER
-#include "acmsvc.h"
-#endif
-#ifdef __REACTOS__
-#if !defined(_MSC_VER) && defined(__GNUC__)
-#include "acgcc.h"
-#endif
-
-#define ACPI_USE_SYSTEM_INTTYPES
-#endif /* __REACTOS __ */
-/*! [End] no source code translation !*/
+#define ACPI_USE_STANDARD_HEADERS
+#define ACPI_USE_SYSTEM_CLIBRARY
 
 #define ACPI_MACHINE_WIDTH      32
 
-#define ACPI_USE_STANDARD_HEADERS
-
 #ifdef ACPI_DEFINE_ALTERNATE_TYPES
 /*
  * Types used only in (Linux) translated source, defined here to enable
index 6481f46..f25a4cb 100644 (file)
 #ifndef __ACWIN64_H__
 #define __ACWIN64_H__
 
-/*! [Begin] no source code translation (Keep the include) */
-
-#include "acintel.h"
-/*! [End] no source code translation !*/
+#define ACPI_USE_STANDARD_HEADERS
+#define ACPI_USE_SYSTEM_CLIBRARY
 
 #define ACPI_MACHINE_WIDTH          64
 
-#define ACPI_USE_STANDARD_HEADERS
-
 /*
  * Handle platform- and compiler-specific assembly language differences.
  *
index 51eb49b..ba49633 100644 (file)
@@ -516,17 +516,19 @@ AcpiTbConvertFadt (
 
 
     /*
-     * For ACPI 1.0 FADTs (revision 1 or 2), ensure that reserved fields which
+     * For ACPI 1.0 FADTs (revision 1), ensure that reserved fields which
      * should be zero are indeed zero. This will workaround BIOSs that
      * inadvertently place values in these fields.
      *
      * The ACPI 1.0 reserved fields that will be zeroed are the bytes located
      * at offset 45, 55, 95, and the word located at offset 109, 110.
      *
-     * Note: The FADT revision value is unreliable. Only the length can be
-     * trusted.
+     * Note: The FADT revision value is unreliable because of BIOS errors.
+     * The table length is instead used as the final word on the version.
+     *
+     * Note: FADT revision 3 is the ACPI 2.0 version of the FADT.
      */
-    if (AcpiGbl_FADT.Header.Length <= ACPI_FADT_V2_SIZE)
+    if (AcpiGbl_FADT.Header.Length <= ACPI_FADT_V3_SIZE)
     {
         AcpiGbl_FADT.PreferredProfile = 0;
         AcpiGbl_FADT.PstateControl = 0;
index 5fc07b7..85b9c3e 100644 (file)
@@ -273,7 +273,7 @@ AcpiTbGetRootTableEntry (
  *
  ******************************************************************************/
 
-ACPI_STATUS
+ACPI_STATUS ACPI_INIT_FUNCTION
 AcpiTbParseRootTable (
     ACPI_PHYSICAL_ADDRESS   RsdpAddress)
 {
index 8c0caae..4c8c065 100644 (file)
@@ -103,7 +103,7 @@ AcpiAllocateRootTable (
  *
  ******************************************************************************/
 
-ACPI_STATUS
+ACPI_STATUS ACPI_INIT_FUNCTION
 AcpiInitializeTables (
     ACPI_TABLE_DESC         *InitialTableArray,
     UINT32                  InitialTableCount,
@@ -179,7 +179,7 @@ ACPI_EXPORT_SYMBOL_INIT (AcpiInitializeTables)
  *
  ******************************************************************************/
 
-ACPI_STATUS
+ACPI_STATUS ACPI_INIT_FUNCTION
 AcpiReallocateRootTable (
     void)
 {
index 645b9d5..9fc26bd 100644 (file)
@@ -65,7 +65,7 @@
  *
  ******************************************************************************/
 
-ACPI_STATUS
+ACPI_STATUS ACPI_INIT_FUNCTION
 AcpiLoadTables (
     void)
 {
@@ -300,7 +300,7 @@ UnlockAndExit:
  *
  ******************************************************************************/
 
-ACPI_STATUS
+ACPI_STATUS ACPI_INIT_FUNCTION
 AcpiInstallTable (
     ACPI_PHYSICAL_ADDRESS   Address,
     BOOLEAN                 Physical)
index aaa24c4..2c7bce7 100644 (file)
@@ -156,7 +156,7 @@ AcpiTbValidateRsdp (
  *
  ******************************************************************************/
 
-ACPI_STATUS
+ACPI_STATUS ACPI_INIT_FUNCTION
 AcpiFindRootPointer (
     ACPI_PHYSICAL_ADDRESS   *TableAddress)
 {
@@ -262,7 +262,7 @@ AcpiFindRootPointer (
     return_ACPI_STATUS (AE_NOT_FOUND);
 }
 
-ACPI_EXPORT_SYMBOL (AcpiFindRootPointer)
+ACPI_EXPORT_SYMBOL_INIT (AcpiFindRootPointer)
 
 
 /*******************************************************************************
index 863055f..19c6707 100644 (file)
@@ -264,7 +264,7 @@ AcpiUtDumpBufferToFile (
 
     if (!Buffer)
     {
-        AcpiUtFilePrintf (File, "Null Buffer Pointer in DumpBuffer!\n");
+        fprintf (File, "Null Buffer Pointer in DumpBuffer!\n");
         return;
     }
 
@@ -279,7 +279,7 @@ AcpiUtDumpBufferToFile (
     {
         /* Print current offset */
 
-        AcpiUtFilePrintf (File, "%6.4X: ", (BaseOffset + i));
+        fprintf (File, "%6.4X: ", (BaseOffset + i));
 
         /* Print 16 hex chars */
 
@@ -289,7 +289,7 @@ AcpiUtDumpBufferToFile (
             {
                 /* Dump fill spaces */
 
-                AcpiUtFilePrintf (File, "%*s", ((Display * 2) + 1), " ");
+                fprintf (File, "%*s", ((Display * 2) + 1), " ");
                 j += Display;
                 continue;
             }
@@ -299,28 +299,28 @@ AcpiUtDumpBufferToFile (
             case DB_BYTE_DISPLAY:
             default:    /* Default is BYTE display */
 
-                AcpiUtFilePrintf (File, "%02X ", Buffer[(ACPI_SIZE) i + j]);
+                fprintf (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);
+                fprintf (File, "%04X ", Temp32);
                 break;
 
             case DB_DWORD_DISPLAY:
 
                 ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]);
-                AcpiUtFilePrintf (File, "%08X ", Temp32);
+                fprintf (File, "%08X ", Temp32);
                 break;
 
             case DB_QWORD_DISPLAY:
 
                 ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]);
-                AcpiUtFilePrintf (File, "%08X", Temp32);
+                fprintf (File, "%08X", Temp32);
 
                 ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j + 4]);
-                AcpiUtFilePrintf (File, "%08X ", Temp32);
+                fprintf (File, "%08X ", Temp32);
                 break;
             }
 
@@ -331,29 +331,29 @@ AcpiUtDumpBufferToFile (
          * Print the ASCII equivalent characters but watch out for the bad
          * unprintable ones (printable chars are 0x20 through 0x7E)
          */
-        AcpiUtFilePrintf (File, " ");
+        fprintf (File, " ");
         for (j = 0; j < 16; j++)
         {
             if (i + j >= Count)
             {
-                AcpiUtFilePrintf (File, "\n");
+                fprintf (File, "\n");
                 return;
             }
 
             BufChar = Buffer[(ACPI_SIZE) i + j];
             if (isprint (BufChar))
             {
-                AcpiUtFilePrintf (File, "%c", BufChar);
+                fprintf (File, "%c", BufChar);
             }
             else
             {
-                AcpiUtFilePrintf (File, ".");
+                fprintf (File, ".");
             }
         }
 
         /* Done with that line. */
 
-        AcpiUtFilePrintf (File, "\n");
+        fprintf (File, "\n");
         i += 16;
     }
 
index 6a298d1..1078539 100644 (file)
@@ -708,33 +708,3 @@ AcpiTracePoint (
 ACPI_EXPORT_SYMBOL (AcpiTracePoint)
 
 #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
index 03c3e51..c3da33d 100644 (file)
@@ -226,7 +226,7 @@ AcpiUtInitGlobals (
     AcpiGbl_NextOwnerIdOffset           = 0;
     AcpiGbl_DebuggerConfiguration       = DEBUGGER_THREADING;
     AcpiGbl_OsiMutex                    = NULL;
-    AcpiGbl_MaxLoopIterations           = 0xFFFF;
+    AcpiGbl_MaxLoopIterations           = ACPI_MAX_LOOP_COUNT;
 
     /* Hardware oriented */
 
index 0f6658e..ced72a7 100644 (file)
@@ -196,8 +196,6 @@ AcpiUtGetExpectedReturnTypes (
  ******************************************************************************/
 
 #if (defined ACPI_ASL_COMPILER || defined ACPI_HELP_APP)
-#include <stdio.h>
-#include <string.h>
 
 /* Local prototypes */
 
index e01f173..7d4c489 100644 (file)
@@ -416,7 +416,7 @@ AcpiUtFormatNumber (
 
 /*******************************************************************************
  *
- * FUNCTION:    AcpiUtVsnprintf
+ * FUNCTION:    vsnprintf
  *
  * PARAMETERS:  String              - String with boundary
  *              Size                - Boundary of the string
@@ -430,7 +430,7 @@ AcpiUtFormatNumber (
  ******************************************************************************/
 
 int
-AcpiUtVsnprintf (
+vsnprintf (
     char                    *String,
     ACPI_SIZE               Size,
     const char              *Format,
@@ -713,7 +713,7 @@ AcpiUtVsnprintf (
 
 /*******************************************************************************
  *
- * FUNCTION:    AcpiUtSnprintf
+ * FUNCTION:    snprintf
  *
  * PARAMETERS:  String              - String with boundary
  *              Size                - Boundary of the string
@@ -726,7 +726,7 @@ AcpiUtVsnprintf (
  ******************************************************************************/
 
 int
-AcpiUtSnprintf (
+snprintf (
     char                    *String,
     ACPI_SIZE               Size,
     const char              *Format,
@@ -737,7 +737,38 @@ AcpiUtSnprintf (
 
 
     va_start (Args, Format);
-    Length = AcpiUtVsnprintf (String, Size, Format, Args);
+    Length = vsnprintf (String, Size, Format, Args);
+    va_end (Args);
+
+    return (Length);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    sprintf
+ *
+ * PARAMETERS:  String              - String with boundary
+ *              Format, ...         - Standard printf format
+ *
+ * RETURN:      Number of bytes actually written.
+ *
+ * DESCRIPTION: Formatted output to a string.
+ *
+ ******************************************************************************/
+
+int
+sprintf (
+    char                    *String,
+    const char              *Format,
+    ...)
+{
+    va_list                 Args;
+    int                     Length;
+
+
+    va_start (Args, Format);
+    Length = vsnprintf (String, ACPI_UINT32_MAX, Format, Args);
     va_end (Args);
 
     return (Length);
@@ -747,7 +778,69 @@ AcpiUtSnprintf (
 #ifdef ACPI_APPLICATION
 /*******************************************************************************
  *
- * FUNCTION:    AcpiUtFileVprintf
+ * FUNCTION:    vprintf
+ *
+ * PARAMETERS:  Format              - Standard printf format
+ *              Args                - Argument list
+ *
+ * RETURN:      Number of bytes actually written.
+ *
+ * DESCRIPTION: Formatted output to stdout using argument list pointer.
+ *
+ ******************************************************************************/
+
+int
+vprintf (
+    const char              *Format,
+    va_list                 Args)
+{
+    ACPI_CPU_FLAGS          Flags;
+    int                     Length;
+
+
+    Flags = AcpiOsAcquireLock (AcpiGbl_PrintLock);
+    Length = vsnprintf (AcpiGbl_PrintBuffer,
+                sizeof (AcpiGbl_PrintBuffer), Format, Args);
+
+    (void) fwrite (AcpiGbl_PrintBuffer, Length, 1, ACPI_FILE_OUT);
+    AcpiOsReleaseLock (AcpiGbl_PrintLock, Flags);
+
+    return (Length);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    printf
+ *
+ * PARAMETERS:  Format, ...         - Standard printf format
+ *
+ * RETURN:      Number of bytes actually written.
+ *
+ * DESCRIPTION: Formatted output to stdout.
+ *
+ ******************************************************************************/
+
+int
+printf (
+    const char              *Format,
+    ...)
+{
+    va_list                 Args;
+    int                     Length;
+
+
+    va_start (Args, Format);
+    Length = vprintf (Format, Args);
+    va_end (Args);
+
+    return (Length);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    vfprintf
  *
  * PARAMETERS:  File                - File descriptor
  *              Format              - Standard printf format
@@ -760,8 +853,8 @@ AcpiUtSnprintf (
  ******************************************************************************/
 
 int
-AcpiUtFileVprintf (
-    ACPI_FILE               File,
+vfprintf (
+    FILE                    *File,
     const char              *Format,
     va_list                 Args)
 {
@@ -770,10 +863,10 @@ AcpiUtFileVprintf (
 
 
     Flags = AcpiOsAcquireLock (AcpiGbl_PrintLock);
-    Length = AcpiUtVsnprintf (AcpiGbl_PrintBuffer,
+    Length = vsnprintf (AcpiGbl_PrintBuffer,
         sizeof (AcpiGbl_PrintBuffer), Format, Args);
 
-    (void) AcpiOsWriteFile (File, AcpiGbl_PrintBuffer, Length, 1);
+    (void) fwrite (AcpiGbl_PrintBuffer, Length, 1, File);
     AcpiOsReleaseLock (AcpiGbl_PrintLock, Flags);
 
     return (Length);
@@ -782,7 +875,7 @@ AcpiUtFileVprintf (
 
 /*******************************************************************************
  *
- * FUNCTION:    AcpiUtFilePrintf
+ * FUNCTION:    fprintf
  *
  * PARAMETERS:  File                - File descriptor
  *              Format, ...         - Standard printf format
@@ -794,8 +887,8 @@ AcpiUtFileVprintf (
  ******************************************************************************/
 
 int
-AcpiUtFilePrintf (
-    ACPI_FILE               File,
+fprintf (
+    FILE                    *File,
     const char              *Format,
     ...)
 {
@@ -804,7 +897,7 @@ AcpiUtFilePrintf (
 
 
     va_start (Args, Format);
-    Length = AcpiUtFileVprintf (File, Format, Args);
+    Length = vfprintf (File, Format, Args);
     va_end (Args);
 
     return (Length);
index 9efa9d6..2902e2c 100644 (file)
@@ -107,14 +107,12 @@ AcpiUtCreateList (
     ACPI_MEMORY_LIST        *Cache;
 
 
-    Cache = AcpiOsAllocate (sizeof (ACPI_MEMORY_LIST));
+    Cache = AcpiOsAllocateZeroed (sizeof (ACPI_MEMORY_LIST));
     if (!Cache)
     {
         return (AE_NO_MEMORY);
     }
 
-    memset (Cache, 0, sizeof (ACPI_MEMORY_LIST));
-
     Cache->ListName = ListName;
     Cache->ObjectSize = ObjectSize;
 
index a8452c3..ff91886 100644 (file)
@@ -63,7 +63,7 @@
  *
  ******************************************************************************/
 
-ACPI_STATUS
+ACPI_STATUS ACPI_INIT_FUNCTION
 AcpiTerminate (
     void)
 {
index 2a518bc..7d77588 100644 (file)
@@ -72,7 +72,7 @@ AeDoObjectOverrides (
  *
  ******************************************************************************/
 
-ACPI_STATUS
+ACPI_STATUS ACPI_INIT_FUNCTION
 AcpiInitializeSubsystem (
     void)
 {
@@ -151,7 +151,7 @@ ACPI_EXPORT_SYMBOL_INIT (AcpiInitializeSubsystem)
  *
  ******************************************************************************/
 
-ACPI_STATUS
+ACPI_STATUS ACPI_INIT_FUNCTION
 AcpiEnableSubsystem (
     UINT32                  Flags)
 {
@@ -263,7 +263,7 @@ ACPI_EXPORT_SYMBOL_INIT (AcpiEnableSubsystem)
  *
  ******************************************************************************/
 
-ACPI_STATUS
+ACPI_STATUS ACPI_INIT_FUNCTION
 AcpiInitializeObjects (
     UINT32                  Flags)
 {