summaryrefslogtreecommitdiff
path: root/source/include/platform
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2016-08-01 21:20:41 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2016-08-01 21:20:41 +0000
commit8bc6ab62dbdb3e8b0d2253e0440f6f58ac9afd3d (patch)
treeb2316b6fda5368bb277671853a71b2a758582b05 /source/include/platform
parent4d46bb7749ef0cf25eb2b25f2d7324023cb754b4 (diff)
Notes
Diffstat (limited to 'source/include/platform')
-rw-r--r--source/include/platform/accygwin.h11
-rw-r--r--source/include/platform/acdragonfly.h1
-rw-r--r--source/include/platform/acefi.h72
-rw-r--r--source/include/platform/acefiex.h877
-rw-r--r--source/include/platform/acenv.h90
-rw-r--r--source/include/platform/acenvex.h21
-rw-r--r--source/include/platform/acfreebsd.h3
-rw-r--r--source/include/platform/acgcc.h17
-rw-r--r--source/include/platform/acgccex.h (renamed from source/include/platform/acwinex.h)20
-rw-r--r--source/include/platform/achaiku.h7
-rw-r--r--source/include/platform/acintel.h6
-rw-r--r--source/include/platform/aclinux.h14
-rw-r--r--source/include/platform/aclinuxex.h2
-rw-r--r--source/include/platform/acmsvc.h20
-rw-r--r--source/include/platform/acmsvcex.h43
-rw-r--r--source/include/platform/acnetbsd.h4
-rw-r--r--source/include/platform/acos2.h5
-rw-r--r--source/include/platform/acqnx.h8
-rw-r--r--source/include/platform/acwin.h11
-rw-r--r--source/include/platform/acwin64.h8
20 files changed, 631 insertions, 609 deletions
diff --git a/source/include/platform/accygwin.h b/source/include/platform/accygwin.h
index 518fc27d6bd7..be2219210179 100644
--- a/source/include/platform/accygwin.h
+++ b/source/include/platform/accygwin.h
@@ -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()
@@ -58,11 +59,9 @@
#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
@@ -86,10 +85,6 @@
#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
diff --git a/source/include/platform/acdragonfly.h b/source/include/platform/acdragonfly.h
index 73a1867f75db..90b9438e0b9a 100644
--- a/source/include/platform/acdragonfly.h
+++ b/source/include/platform/acdragonfly.h
@@ -44,7 +44,6 @@
#ifndef __ACDRAGONFLY_H_
#define __ACDRAGONFLY_H_
-#include <platform/acgcc.h> /* DragonFly uses GCC */
#include <sys/types.h>
#ifdef __LP64__
diff --git a/source/include/platform/acefi.h b/source/include/platform/acefi.h
index 1a9e7c402fcc..56c4b0aaa19e 100644
--- a/source/include/platform/acefi.h
+++ b/source/include/platform/acefi.h
@@ -44,10 +44,12 @@
#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__)
@@ -57,23 +59,13 @@
#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__ */
diff --git a/source/include/platform/acefiex.h b/source/include/platform/acefiex.h
index 7df5012806da..8f98a6266dee 100644
--- a/source/include/platform/acefiex.h
+++ b/source/include/platform/acefiex.h
@@ -45,177 +45,190 @@
#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)
+#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;
-typedef UINTN EFI_STATUS;
-typedef VOID *EFI_HANDLE;
-typedef VOID *EFI_EVENT;
+#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;
+ ACPI_EFI_HANDLE AgentHandle;
+ ACPI_EFI_HANDLE ControllerHandle;
+ UINT32 Attributes;
+ UINT32 OpenCount;
+} ACPI_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_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;
+ 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;
- EFI_IMAGE_LOAD LoadImage;
- EFI_IMAGE_START StartImage;
- EFI_EXIT Exit;
- EFI_IMAGE_UNLOAD UnloadImage;
+ 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__ */
diff --git a/source/include/platform/acenv.h b/source/include/platform/acenv.h
index 99adf5f4913d..97187f8b0c1d 100644
--- a/source/include/platform/acenv.h
+++ b/source/include/platform/acenv.h
@@ -79,6 +79,7 @@
(defined ACPI_EXAMPLE_APP)
#define ACPI_APPLICATION
#define ACPI_SINGLE_THREADED
+#define USE_NATIVE_ALLOCATE_ZEROED
#endif
/* iASL configuration */
@@ -125,7 +126,6 @@
#ifdef ACPI_DUMP_APP
#define ACPI_USE_NATIVE_MEMORY_MAPPING
-#define USE_NATIVE_ALLOCATE_ZEROED
#endif
/* AcpiNames/Example configuration. Hardware disabled */
@@ -150,7 +150,6 @@
/* Common for all ACPICA applications */
#ifdef ACPI_APPLICATION
-#define ACPI_USE_SYSTEM_CLIBRARY
#define ACPI_USE_LOCAL_CACHE
#endif
@@ -167,10 +166,21 @@
/******************************************************************************
*
* 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"
@@ -210,18 +220,20 @@
#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 */
@@ -330,7 +342,8 @@
* 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.
@@ -338,7 +351,6 @@
* 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. */
@@ -346,57 +358,20 @@
/* 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
@@ -405,6 +380,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__ */
diff --git a/source/include/platform/acenvex.h b/source/include/platform/acenvex.h
index 02a46f148b33..d7da594b926e 100644
--- a/source/include/platform/acenvex.h
+++ b/source/include/platform/acenvex.h
@@ -56,17 +56,24 @@
#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
diff --git a/source/include/platform/acfreebsd.h b/source/include/platform/acfreebsd.h
index a968e12cc201..928aaa64bd54 100644
--- a/source/include/platform/acfreebsd.h
+++ b/source/include/platform/acfreebsd.h
@@ -45,9 +45,6 @@
#define __ACFREEBSD_H__
-/* FreeBSD uses GCC */
-
-#include "acgcc.h"
#include <sys/types.h>
#ifdef __LP64__
diff --git a/source/include/platform/acgcc.h b/source/include/platform/acgcc.h
index 7d703da3dcfb..9adb603958d0 100644
--- a/source/include/platform/acgcc.h
+++ b/source/include/platform/acgcc.h
@@ -44,6 +44,12 @@
#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 */
@@ -64,17 +70,6 @@
*/
#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
diff --git a/source/include/platform/acwinex.h b/source/include/platform/acgccex.h
index 8c8e21b2507c..3c02ad50649f 100644
--- a/source/include/platform/acwinex.h
+++ b/source/include/platform/acgccex.h
@@ -1,6 +1,6 @@
/******************************************************************************
*
- * Name: acwinex.h - Extra OS specific defines, etc.
+ * Name: acgccex.h - Extra GCC specific defines, etc.
*
*****************************************************************************/
@@ -41,12 +41,18 @@
* 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__ */
diff --git a/source/include/platform/achaiku.h b/source/include/platform/achaiku.h
index 10aa6a3f4a7c..75ee9e745ba5 100644
--- a/source/include/platform/achaiku.h
+++ b/source/include/platform/achaiku.h
@@ -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 *
diff --git a/source/include/platform/acintel.h b/source/include/platform/acintel.h
index b8dda571f2cd..15683d61e621 100644
--- a/source/include/platform/acintel.h
+++ b/source/include/platform/acintel.h
@@ -44,6 +44,12 @@
#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
diff --git a/source/include/platform/aclinux.h b/source/include/platform/aclinux.h
index bd45cdb14e37..048f76a598ac 100644
--- a/source/include/platform/aclinux.h
+++ b/source/include/platform/aclinux.h
@@ -89,6 +89,8 @@
#include <asm/acenv.h>
#endif
+#define ACPI_INIT_FUNCTION __init
+
#ifndef CONFIG_ACPI
/* External globals for __KERNEL__, stubs is needed */
@@ -173,11 +175,11 @@
#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 */
@@ -208,8 +210,4 @@
#endif /* __KERNEL__ */
-/* Linux uses GCC */
-
-#include "acgcc.h"
-
#endif /* __ACLINUX_H__ */
diff --git a/source/include/platform/aclinuxex.h b/source/include/platform/aclinuxex.h
index c262e4081999..f1f9c9a21a23 100644
--- a/source/include/platform/aclinuxex.h
+++ b/source/include/platform/aclinuxex.h
@@ -71,7 +71,7 @@
/*
* Overrides for in-kernel ACPICA
*/
-ACPI_STATUS __init AcpiOsInitialize (
+ACPI_STATUS ACPI_INIT_FUNCTION AcpiOsInitialize (
void);
ACPI_STATUS AcpiOsTerminate (
diff --git a/source/include/platform/acmsvc.h b/source/include/platform/acmsvc.h
index e8c801f568ea..039fef023205 100644
--- a/source/include/platform/acmsvc.h
+++ b/source/include/platform/acmsvc.h
@@ -64,6 +64,10 @@
#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
@@ -102,6 +106,10 @@
#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
@@ -136,6 +144,7 @@
n_lo >>= 1; \
}
#endif
+#endif
/* warn C4100: unreferenced formal parameter */
#pragma warning(disable:4100)
@@ -192,4 +201,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__ */
diff --git a/source/include/platform/acmsvcex.h b/source/include/platform/acmsvcex.h
index f99a034a47bf..45233e715dbf 100644
--- a/source/include/platform/acmsvcex.h
+++ b/source/include/platform/acmsvcex.h
@@ -44,6 +44,14 @@
#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
@@ -51,4 +59,39 @@
#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__ */
diff --git a/source/include/platform/acnetbsd.h b/source/include/platform/acnetbsd.h
index 09259af3aae4..c0a9c6da154f 100644
--- a/source/include/platform/acnetbsd.h
+++ b/source/include/platform/acnetbsd.h
@@ -44,10 +44,6 @@
#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))
diff --git a/source/include/platform/acos2.h b/source/include/platform/acos2.h
index 419579bac090..b96d2758efa6 100644
--- a/source/include/platform/acos2.h
+++ b/source/include/platform/acos2.h
@@ -43,6 +43,10 @@
#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()
diff --git a/source/include/platform/acqnx.h b/source/include/platform/acqnx.h
index 76252f8668d9..3480ecb2f86e 100644
--- a/source/include/platform/acqnx.h
+++ b/source/include/platform/acqnx.h
@@ -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
@@ -62,13 +61,10 @@
#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__ */
diff --git a/source/include/platform/acwin.h b/source/include/platform/acwin.h
index dd5b334b236c..31a99bd16766 100644
--- a/source/include/platform/acwin.h
+++ b/source/include/platform/acwin.h
@@ -44,18 +44,11 @@
#ifndef __ACWIN_H__
#define __ACWIN_H__
-/*! [Begin] no source code translation (Keep the include) */
-
-/* Windows uses VC */
-#ifdef _MSC_VER
-#include "acmsvc.h"
-#endif
-/*! [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
diff --git a/source/include/platform/acwin64.h b/source/include/platform/acwin64.h
index 6481f4611473..f25a4cb2a7a5 100644
--- a/source/include/platform/acwin64.h
+++ b/source/include/platform/acwin64.h
@@ -44,15 +44,11 @@
#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.
*