OSL: Export variables of AcpiOsPrintf() and AcpiOsVprintf() to improve portability of generic OSL.

This patch exports global variable used in AcpiOsVprintf() and
AcpiOsPrintf() for ACPICA applications to improve the portability of the
generic OSL. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
OSL: Add ACPI_USE_NATIVE_MEMORY_MAPPING to improve portability of generic OSL.

This patch adds new compilation environment ACPI_USE_NATIVE_MEMORY_MAPPING
to improve the portability of the generic OSL. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
OSL: Add AcpiOsAllocateZeroed() to improve portability of generic OSL.

This patch implements AcpiOsAllocateZeroed() in generic OSL for the build
that having USE_NATIVE_ALLOCATED_ZEROED enabled. This can help to improve
the portability of the generic OSL. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
OSL: Cleanup AcpiOsGetRootPointer() to improve portability of generic OSL.

This patch cleans up AcpiOsGetRootPointer() by deleting the
AeLocalGetRootPointer() and adding ACPI_USE_NATIVE_RSDP_POINTER.  This can
help to improve the portability of the generic OSL (allow portable tools
linking osPLATxf.c directly). Lv Zheng

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
OSL: Add file IO and AcpiLogError() to improve portability of generic OSL.

This patch adds file IO to generic OSL and a wrapper AcpiLogError() to use
it logging to the stderr. The new interfaces can be used by applications
and can be replaced with platform specific implementations. Thus they can
improve the portability of the generic OSL. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Application: Enhance ACPI_USAGE_xxx/ACPI_OPTION with AcpiOsPrintf() to improve portability.

This patch adds AcpiOsInitialize() invocations for ACPICA applications
where their usage() functions are implemented with ACPI_USAGE_xxx and
ACPI_OPTION macros. The macros are enhanced by using AcpiOsPrintf() to
improve portability. The global variables used in AcpiOsPrintf() need to be
initialized for the applications, this is done by defining
EXPORT_ACPI_GLOBALS for the tools having osunixxf.o newly added to their
makefiles. Lv Zheng.

Note:
1. acpiexec/acpinames have already invoked AcpiInitializeSubsystem() very
   early, thus no need to add AcpiOsInitialize() for them.
2. acpidump has been released to Linux kernel, thus libacpica.sh is also
   changed to release osunixxf.c to Linux.
3. acpidump has its own AcpiOsPrintf() implementation, this is not needed
   after applying this patch to use generic OSL.
4. acpiexamples is not using usage macros.
5. msvc9/msvc project files are not updated in this patch, it can be done
   by follow up commits.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Common: Enhance CmGetFileSize() to improve portability.

This patch uses AcpiOsXXXFileXXX() and AcpiLogError() APIs to enhance
CmGetFileSize() so that applications that invoke this API could have
portability improved. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Common: Enhance AcpiGetopt() to improve portability.

This patch enhances AcpiGetopt() by converting the libc invocations into
portable ACPI string APIs and AcpiLogError() to improve portability.
Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
acpidump: Add memory/string OSL usage to improve portability.

This patch adds code to use generic OSL for acpidump to improve the
portability of this tool. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
acpidump: Remove exit() from generic layer to improve portability.

This patch removes exit() from generic acpidump code to improve the
portability of this tool. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
acpidump: Replace file IOs with new APIs to improve portability.

The new APIs are enabled to offer a portable layer to access files:
1. AcpiOsXXXFileXXX: Wrapper of fopen/fclose/fread/fwrite
2. AcpiOsPrintf: Wrapper of printf
3. ACPI_OPTION: Wrapper of AcpiOsPrintf
4. AcpiLogError: Wrapper of fprintf(stderr)

This patch deploys such mechanisms to acpidump to improve the portability
of this tool. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
acpidump: Reduce freopen() invocations to improve portability.

This patch reduces the requirement of invoking freopen() in acpidump in order
to reduce the porting effort of acpidump. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
acpidump: Remove sprintf invocation to improve portability.

This patch removes sprintf invocation to improve portability. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
EFI: Add build environment support for GNU EFI development.

This patch adds build environment for GNU EFI shell development.

Note that only the Makefiles used by EFI development are created in this
patch, actual OSL is not implemented and ACPICA tool is enabled in this
patch. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
EFI: Adds generic OSL support for GNU EFI development.

This patch adds generic OSL for GNU EFI shell development.

The following files are enhanced with GNU EFI builds:
1. os_specific/service_layers/osefixf.c
2. include/platform/acefi.h

ACPICA EFI tools will have efi_main() entry points.  Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
EFI: Add build environment support for acpidump.

This patch enables acpidump build for EFI. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
UEFI: Test program to split porting tasks.

This is an intermediate utility, created to split porting tasks.  Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>