Merge pull request #154 from zetalog/acpica-efi2

Acpica efi2
This commit is contained in:
Robert Moore 2016-07-26 10:32:17 -07:00 committed by GitHub
commit fd167da830
89 changed files with 1737 additions and 10948 deletions

25
generate/efi/AcpiPkg.dec Normal file
View File

@ -0,0 +1,25 @@
## @file
# Build description file to ACPICA applications.
#
# Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
##
[Defines]
PACKAGE_NAME = AcpiPkg
PACKAGE_GUID = 3ee43d98-2941-11e6-a597-0024e8c6d30e
PACKAGE_VERSION = 0.01
DEC_SPECIFICATION = 0x00010005
[Includes]
source/include
[Guids]
gAcpiPkgTokenSpaceGuid = { 0x81c5af5c, 0x2941, 0x11e6, { 0xa5, 0x3d, 0x00, 0x24, 0xe8, 0xc6, 0xd3, 0x0e }}

46
generate/efi/AcpiPkg.dsc Normal file
View File

@ -0,0 +1,46 @@
#/** @file
# Build discription file to generate ACPICA applications.
#
# Copyright (c) 2009 Intel Corporation. All rights reserved
# This software and associated documentation (if any) is furnished
# under a license and may only be used or copied in accordance
# with the terms of the license. Except as permitted by such
# license, no part of this software or documentation may be
# reproduced, stored in a retrieval system, or transmitted in any
# form or by any means without the express written consent of
# Intel Corporation.
#
# **/
[Defines]
PLATFORM_NAME = Acpi
PLATFORM_GUID = b03fdec4-2942-11e6-a416-0024e8c6d30e
PLATFORM_VERSION = 1.0
DSC_SPECIFICATION = 0x00010005
OUTPUT_DIRECTORY = Build/Acpi
SUPPORTED_ARCHITECTURES = IA32|X64
BUILD_TARGETS = DEBUG|RELEASE
SKUID_IDENTIFIER = DEFAULT
[LibraryClasses]
#
# Entry Point Libraries
#
UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf
#
# Common Libraries
#
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
!if $(DEBUG_ENABLE_OUTPUT)
DebugLib|MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
!else ## DEBUG_ENABLE_OUTPUT
DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
!endif ## DEBUG_ENABLE_OUTPUT
[Components.common]
AcpiPkg/source/acpidump.inf

View File

@ -27,15 +27,6 @@
# OPT_CFLAGS Optimization CFLAGS can be overridden on the make command
# line by adding the followings to the invocation:
# OPT_CFLAGS="..."
# SHARED Testing build to check if symbols are not implemented.
# GCC won't complain missing of symbols as our programs are
# compiled with -shared. This can be overridden on the make
# command line by adding the followings to the invocation:
# SHARED=false
# Link failures should only be seen for the _start and
# DivU64x32. They are the only 2 GNU EFI functions we are
# using in order not to introduce architecture specific code
# into ACPICA.
#
# Notes:
# gcc should be version 4 or greater, otherwise some of the options
@ -50,7 +41,6 @@
PROGS = acpidump
HOST = $(shell uname -m | sed s,i[3456789]86,ia32,)
TARGET = $(shell uname -m | sed s,i[3456789]86,ia32,)
SHARED ?= true
OBJDIR = obj
BINDIR = bin
@ -61,6 +51,7 @@ ACPICA_SRC = ../../../source
ACPICA_COMMON = $(ACPICA_SRC)/common
ACPICA_TOOLS = $(ACPICA_SRC)/tools
ACPICA_OSL = $(ACPICA_SRC)/os_specific/service_layers
ACPICA_EFI = $(ACPICA_SRC)/os_specific/efi
ACPICA_CORE = $(ACPICA_SRC)/components
ACPICA_INCLUDE = $(ACPICA_SRC)/include
ACPICA_DEBUGGER = $(ACPICA_CORE)/debugger
@ -95,26 +86,28 @@ LD = ld
OBJCOPY = objcopy
CFLAGS = \
--save-temps\
-nostdinc\
-nostdlib\
-std=c99\
-U__linux__\
-U_LINUX\
-D_GNU_EFI\
-D_GNU_SOURCE\
-fno-builtin\
-iwithprefix include\
-fno-stack-protector\
-fno-strict-aliasing\
-fpic\
-fshort-wchar\
-I$(ACPICA_INCLUDE)
LDFLAGS = \
-nostdinc\
-nostdlib\
-znocombreloc\
-Bsymbolic
ifeq ($(strip $(SHARED)), true)
LDFLAGS += \
-shared
endif
LIBS = \
$(shell $(CC) -print-libgcc-file-name)
-Bsymbolic\
-shared\
-no-undefined
OBJCOPYFLAGS = \
-j .text\
-j .sdata\
@ -219,9 +212,10 @@ LDFLAGS += \
-T $(EFILIB)/elf_$(TARGET)_efi.lds\
-L$(EFILIB)\
$(EFILIB)/crt0-efi-$(TARGET).o
LIBS += \
LIBS = \
-lefi\
-lgnuefi\
$(shell $(CC) -print-libgcc-file-name)
#
# Bison/Flex configuration

40
generate/efi/README Normal file
View File

@ -0,0 +1,40 @@
Build EFI ACPICA Utilities
The EFI porting of the ACPICA utilities can be built with GNU EFI and EDK2.
But the porting has only been tested in a Linux environment.
1. Build EFI ACPICA utilities with EDK2 (Linux)
In a Linux environment, you can build EFI ACPICA utilities by executing
the following commands (supposing you are using gcc-4.7):
# git clone https://github.com/tianocore/edk2
# git clone https://github.com/acpica/acpica
# cd edk2
# (cd BaseTools; make)
# source ./edksetup.sh
# ln -s ../acpica AcpiPkg
# AcpiPkg/generate/efi/edksetup.sh
# build -p AcpiPkg/AcpiPkg.dsc -t GCC47
You can find built EFI binaries (e.x., acpidump.efi) in the following
folders:
Build/Acpi/DEBUG_GCC47/IA32: i386 targets
Build/Acpi/DEBUG_GCC47/X64: x86_64 targets
2. Build EFI ACPICA utilities with GNU EFI (Linux)
In a Linux environment, you can build EFI ACPICA utilities by executing
the following commands:
# apt-get install gne-efi
# git clone https://github.com/acpica/acpica
# cd acpica
# make OS=efi
You can find built EFI binaries (e.x., acpidump.efi) in the following
folder:
generate/efi/bin
It contains i386 targets if it is built on an i386 host, or it contains
x86_64 targets if it is built on a x86_64 host.

View File

@ -21,7 +21,8 @@ vpath %.c \
$(ACPICA_TABLES)\
$(ACPICA_UTILITIES)\
$(ACPICA_COMMON)\
$(ACPICA_OSL)
$(ACPICA_OSL)\
$(ACPICA_EFI)
HEADERS = \
$(wildcard $(ACPIDUMP)/*.h)
@ -32,16 +33,19 @@ OBJECTS = \
$(OBJDIR)/apmain.o\
$(OBJDIR)/cmfsize.o\
$(OBJDIR)/getopt.o\
$(OBJDIR)/oseficlib.o\
$(OBJDIR)/osefitbl.o\
$(OBJDIR)/osefixf.o\
$(OBJDIR)/tbprint.o\
$(OBJDIR)/tbxfroot.o\
$(OBJDIR)/utascii.o\
$(OBJDIR)/utbuffer.o\
$(OBJDIR)/utdebug.o\
$(OBJDIR)/utclib.o\
$(OBJDIR)/utdebug.o\
$(OBJDIR)/utexcep.o\
$(OBJDIR)/utglobal.o\
$(OBJDIR)/utmath.o\
$(OBJDIR)/utnonansi.o\
$(OBJDIR)/utprint.o\
$(OBJDIR)/utstring.o\
$(OBJDIR)/utxferror.o

View File

@ -0,0 +1,59 @@
## @file
# acpidump.inf
#
# Copyright (c) 2016, Intel Corporation. All rights reserved.
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
#
##
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = acpidump
FILE_GUID = bf942c9a-2942-11e6-9a64-0024e8c6d30e
MODULE_TYPE = UEFI_APPLICATION
VERSION_STRING = 1.0
ENTRY_POINT = UefiMain
[Sources]
tools/acpidump/apdump.c
tools/acpidump/apfiles.c
tools/acpidump/apmain.c
common/cmfsize.c
common/getopt.c
os_specific/efi/oseficlib.c
os_specific/efi/osefitbl.c
os_specific/efi/osefixf.c
components/tables/tbprint.c
components/tables/tbxfroot.c
components/utilities/utascii.c
components/utilities/utbuffer.c
components/utilities/utclib.c
components/utilities/utdebug.c
components/utilities/utexcep.c
components/utilities/utglobal.c
components/utilities/utmath.c
components/utilities/utnonansi.c
components/utilities/utprint.c
components/utilities/utstring.c
components/utilities/utxferror.c
[Packages]
AcpiPkg/AcpiPkg.dec
MdePkg/MdePkg.dec
[LibraryClasses]
UefiApplicationEntryPoint
BaseLib
[BuildOptions]
MSFT:*_*_IA32_CC_FLAGS = /Oi- /WX- /D_EDK2_EFI /DACPI_DUMP_APP
MSFT:*_*_X64_CC_FLAGS = /Oi- /WX- /D_EDK2_EFI /DACPI_DUMP_APP
GCC:*_*_IA32_CC_FLAGS = -U__linux__ -U_LINUX -D_EDK2_EFI -DACPI_DUMP_APP -fno-builtin -iwithprefix include
GCC:*_*_X64_CC_FLAGS = -U__linux__ -U_LINUX -D_EDK2_EFI -DACPI_DUMP_APP -fno-builtin -iwithprefix include

14
generate/efi/edksetup.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/sh
EFIPROGS="acpidump"
EFIDIR=`(cd \`dirname $0\`; pwd)`
TOPDIR=`(cd ${EFIDIR}/../..; pwd)`
echo "Copying AcpiPkg package files..."
cp -f ${EFIDIR}/AcpiPkg.dec ${TOPDIR}/AcpiPkg.dec
cp -f ${EFIDIR}/AcpiPkg.dsc ${TOPDIR}/AcpiPkg.dsc
for p in ${EFIPROGS}; do
echo "Copying $p build files..."
cp -f ${EFIDIR}/$p/${p}.inf ${TOPDIR}/source/${p}.inf
done

View File

@ -128,10 +128,6 @@ SOURCE=..\..\source\Common\getopt.c
# End Source File
# Begin Source File
SOURCE=..\..\source\os_specific\service_layers\oslibcfs.c
# End Source File
# Begin Source File
SOURCE=..\..\source\os_specific\service_layers\oswinxf.c
# End Source File
# End Group
@ -144,6 +140,10 @@ SOURCE=..\..\source\components\utilities\utalloc.c
# End Source File
# Begin Source File
SOURCE=..\..\source\components\utilities\utascii.c
# End Source File
# Begin Source File
SOURCE=..\..\source\components\utilities\utbuffer.c
# End Source File
# Begin Source File
@ -184,10 +184,6 @@ SOURCE=..\..\source\components\utilities\utmutex.c
# End Source File
# Begin Source File
SOURCE=..\..\source\components\utilities\utprint.c
# End Source File
# Begin Source File
SOURCE=..\..\source\components\utilities\utstate.c
# End Source File
# Begin Source File

View File

@ -122,10 +122,6 @@ SOURCE=..\..\source\tools\acpidump\apmain.c
SOURCE=..\..\source\os_specific\service_layers\oswintbl.c
# End Source File
# Begin Source File
SOURCE=..\..\source\components\utilities\utprint.c
# End Source File
# End Group
# Begin Group "Common"
@ -140,10 +136,6 @@ SOURCE=..\..\source\common\getopt.c
# End Source File
# Begin Source File
SOURCE=..\..\source\os_specific\service_layers\oslibcfs.c
# End Source File
# Begin Source File
SOURCE=..\..\source\os_specific\SERVICE_LAYERS\oswindir.c
# End Source File
# Begin Source File
@ -156,6 +148,10 @@ SOURCE=..\..\source\os_specific\service_layers\oswinxf.c
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\source\components\utilities\utascii.c
# End Source File
# Begin Source File
SOURCE=..\..\source\components\utilities\utbuffer.c
# End Source File
# Begin Source File

View File

@ -116,6 +116,10 @@ SOURCE=..\..\source\components\utilities\utalloc.c
# End Source File
# Begin Source File
SOURCE=..\..\source\components\utilities\utascii.c
# End Source File
# Begin Source File
SOURCE=..\..\source\components\utilities\utbuffer.c
# End Source File
# Begin Source File
@ -214,10 +218,6 @@ SOURCE=..\..\source\components\utilities\utpredef.c
# End Source File
# Begin Source File
SOURCE=..\..\source\components\utilities\utprint.c
# End Source File
# Begin Source File
SOURCE=..\..\source\components\utilities\utresrc.c
# End Source File
# Begin Source File
@ -614,10 +614,6 @@ SOURCE=..\..\source\common\getopt.c
# End Source File
# Begin Source File
SOURCE=..\..\source\os_specific\service_layers\oslibcfs.c
# End Source File
# Begin Source File
SOURCE=..\..\source\os_specific\service_layers\oswindir.c
# End Source File
# Begin Source File
@ -739,6 +735,10 @@ SOURCE=..\..\source\COMPONENTS\Disassembler\dmwalk.c
# PROP Default_Filter ".c"
# Begin Source File
SOURCE=..\..\source\components\executer\exconcat.c
# End Source File
# Begin Source File
SOURCE=..\..\source\components\executer\exconfig.c
# End Source File
# Begin Source File

View File

@ -156,10 +156,6 @@ SOURCE=..\..\source\common\getopt.c
# End Source File
# Begin Source File
SOURCE=..\..\source\os_specific\service_layers\oslibcfs.c
# End Source File
# Begin Source File
SOURCE=..\..\source\os_specific\service_layers\oswinxf.c
# End Source File
# End Group
@ -196,10 +192,6 @@ SOURCE=..\..\source\components\utilities\utpredef.c
# End Source File
# Begin Source File
SOURCE=..\..\source\components\utilities\utprint.c
# End Source File
# Begin Source File
SOURCE=..\..\source\components\utilities\utuuid.c
# End Source File
# End Group

View File

@ -117,10 +117,6 @@ SOURCE=..\..\source\common\getopt.c
# End Source File
# Begin Source File
SOURCE=..\..\source\os_specific\service_layers\oslibcfs.c
# End Source File
# Begin Source File
SOURCE=..\..\source\os_specific\service_layers\oswinxf.c
# ADD CPP /Ze
# End Source File
@ -138,6 +134,10 @@ SOURCE=..\..\source\components\utilities\utalloc.c
# End Source File
# Begin Source File
SOURCE=..\..\source\components\utilities\utascii.c
# End Source File
# Begin Source File
SOURCE=..\..\source\components\utilities\utbuffer.c
# End Source File
# Begin Source File
@ -228,10 +228,6 @@ SOURCE=..\..\source\components\utilities\utownerid.c
# End Source File
# Begin Source File
SOURCE=..\..\source\components\utilities\utprint.c
# End Source File
# Begin Source File
SOURCE=..\..\source\components\utilities\utstate.c
# End Source File
# Begin Source File

View File

@ -148,10 +148,6 @@ SOURCE=..\..\source\common\getopt.c
# End Source File
# Begin Source File
SOURCE=..\..\source\os_specific\service_layers\oslibcfs.c
# End Source File
# Begin Source File
SOURCE=..\..\source\os_specific\SERVICE_LAYERS\oswindir.c
# End Source File
# Begin Source File
@ -184,10 +180,6 @@ SOURCE=..\..\source\components\utilities\utnonansi.c
# End Source File
# Begin Source File
SOURCE=..\..\source\components\utilities\utprint.c
# End Source File
# Begin Source File
SOURCE=..\..\source\components\utilities\utxferror.c
# End Source File
# End Group

View File

@ -139,10 +139,6 @@ SOURCE=..\..\source\common\getopt.c
# End Source File
# Begin Source File
SOURCE=..\..\source\os_specific\service_layers\oslibcfs.c
# End Source File
# Begin Source File
SOURCE=..\..\source\os_specific\service_layers\oswinxf.c
# End Source File
# End Group
@ -151,6 +147,10 @@ SOURCE=..\..\source\os_specific\service_layers\oswinxf.c
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\source\components\utilities\utascii.c
# End Source File
# Begin Source File
SOURCE=..\..\source\components\utilities\utdebug.c
# End Source File
# Begin Source File
@ -171,10 +171,6 @@ SOURCE=..\..\source\components\utilities\utnonansi.c
# End Source File
# Begin Source File
SOURCE=..\..\source\components\utilities\utprint.c
# End Source File
# Begin Source File
SOURCE=..\..\source\components\utilities\utxferror.c
# End Source File
# End Group

View File

@ -120,6 +120,10 @@ SOURCE=..\..\source\components\utilities\utalloc.c
# End Source File
# Begin Source File
SOURCE=..\..\source\components\utilities\utascii.c
# End Source File
# Begin Source File
SOURCE=..\..\source\components\utilities\utbuffer.c
# End Source File
# Begin Source File
@ -196,10 +200,6 @@ SOURCE=..\..\source\components\utilities\utpredef.c
# End Source File
# Begin Source File
SOURCE=..\..\source\components\utilities\utprint.c
# End Source File
# Begin Source File
SOURCE=..\..\source\components\utilities\utresrc.c
# End Source File
# Begin Source File
@ -292,10 +292,18 @@ SOURCE=..\..\source\compiler\aslcompile.c
# End Source File
# Begin Source File
SOURCE=..\..\source\compiler\asldebug.c
# End Source File
# Begin Source File
SOURCE=..\..\source\compiler\aslerror.c
# End Source File
# Begin Source File
SOURCE=..\..\source\compiler\aslexternal.c
# End Source File
# Begin Source File
SOURCE=..\..\source\compiler\aslfileio.c
# End Source File
# Begin Source File
@ -384,6 +392,10 @@ SOURCE=..\..\source\compiler\asloptions.c
# End Source File
# Begin Source File
SOURCE=..\..\source\compiler\aslpld.c
# End Source File
# Begin Source File
SOURCE=..\..\source\compiler\aslpredef.c
# End Source File
# Begin Source File
@ -466,6 +478,10 @@ SOURCE=..\..\source\compiler\aslwalks.c
SOURCE=..\..\source\compiler\aslxref.c
# End Source File
# Begin Source File
SOURCE=..\..\source\compiler\aslxrefout.c
# End Source File
# End Group
# Begin Group "Common"
@ -536,10 +552,6 @@ SOURCE=..\..\source\common\getopt.c
# End Source File
# Begin Source File
SOURCE=..\..\source\os_specific\service_layers\oslibcfs.c
# End Source File
# Begin Source File
SOURCE=..\..\source\os_specific\service_layers\oswindir.c
# End Source File
# Begin Source File
@ -670,6 +682,10 @@ SOURCE=..\..\source\components\tables\tbxfload.c
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\source\components\executer\exconcat.c
# End Source File
# Begin Source File
SOURCE=..\..\source\components\executer\exconvrt.c
# End Source File
# Begin Source File

View File

@ -116,10 +116,6 @@ SOURCE=..\..\source\tools\examples\extables.c
# End Source File
# Begin Source File
SOURCE=..\..\source\os_specific\service_layers\oslibcfs.c
# End Source File
# Begin Source File
SOURCE=..\..\source\os_specific\service_layers\oswinxf.c
# ADD CPP /Ze
# End Source File
@ -193,6 +189,10 @@ SOURCE=..\..\source\components\dispatcher\dswstate.c
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\source\components\executer\exconcat.c
# End Source File
# Begin Source File
SOURCE=..\..\source\components\executer\exconfig.c
# End Source File
# Begin Source File
@ -481,6 +481,10 @@ SOURCE=..\..\source\components\utilities\utalloc.c
# End Source File
# Begin Source File
SOURCE=..\..\source\components\utilities\utascii.c
# End Source File
# Begin Source File
SOURCE=..\..\source\components\utilities\utbuffer.c
# End Source File
# Begin Source File
@ -573,10 +577,6 @@ SOURCE=..\..\source\components\utilities\utpredef.c
# End Source File
# Begin Source File
SOURCE=..\..\source\components\utilities\utprint.c
# End Source File
# Begin Source File
SOURCE=..\..\source\components\utilities\utresrc.c
# End Source File
# Begin Source File

View File

@ -236,50 +236,10 @@
<File
RelativePath="..\..\source\tools\AcpiBin\abcompare.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
DisableLanguageExtensions="true"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
DisableLanguageExtensions="true"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\source\tools\AcpiBin\abmain.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
DisableLanguageExtensions="true"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
DisableLanguageExtensions="true"
/>
</FileConfiguration>
</File>
</Filter>
<Filter
@ -292,28 +252,6 @@
<File
RelativePath="..\..\source\Common\getopt.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\source\os_specific\service_layers\oslibcfs.c"
>
</File>
<File
RelativePath="..\..\source\os_specific\service_layers\oswinxf.c"
@ -323,8 +261,6 @@
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
DisableLanguageExtensions="false"
/>
</FileConfiguration>
@ -333,8 +269,6 @@
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
DisableLanguageExtensions="false"
/>
</FileConfiguration>
@ -347,24 +281,6 @@
<File
RelativePath="..\..\source\components\utilities\utalloc.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\source\components\utilities\utascii.c"
@ -377,24 +293,6 @@
<File
RelativePath="..\..\source\components\utilities\utcache.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\source\components\utilities\utdebug.c"
@ -403,24 +301,6 @@
<File
RelativePath="..\..\source\components\utilities\utdecode.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\source\components\utilities\utexcep.c"
@ -429,138 +309,26 @@
<File
RelativePath="..\..\source\components\utilities\utglobal.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\source\components\utilities\utlock.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\source\COMPONENTS\utilities\utmath.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\source\components\utilities\utmisc.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\source\components\utilities\utmutex.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\source\components\utilities\utprint.c"
>
</File>
<File
RelativePath="..\..\source\components\utilities\utstate.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\source\components\utilities\utstring.c"
@ -569,24 +337,6 @@
<File
RelativePath="..\..\source\components\utilities\utxferror.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
</Filter>
</Filter>

View File

@ -256,28 +256,6 @@
<File
RelativePath="..\..\source\Common\getopt.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\source\os_specific\service_layers\oslibcfs.c"
>
</File>
<File
RelativePath="..\..\source\os_specific\service_layers\oswintbl.c"
@ -352,10 +330,6 @@
RelativePath="..\..\source\components\utilities\utnonansi.c"
>
</File>
<File
RelativePath="..\..\source\components\utilities\utprint.c"
>
</File>
<File
RelativePath="..\..\source\components\utilities\utstring.c"
>

File diff suppressed because it is too large Load Diff

View File

@ -244,15 +244,6 @@
<File
RelativePath="..\..\source\tools\acpihelp\ahdecode.c"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="true"
AssemblerOutput="0"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\source\tools\acpihelp\ahgrammar.c"
@ -286,28 +277,6 @@
<File
RelativePath="..\..\source\common\getopt.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\source\os_specific\service_layers\oslibcfs.c"
>
</File>
<File
RelativePath="..\..\source\os_specific\service_layers\oswinxf.c"
@ -361,10 +330,6 @@
RelativePath="..\..\source\components\utilities\utpredef.c"
>
</File>
<File
RelativePath="..\..\source\components\utilities\utprint.c"
>
</File>
<File
RelativePath="..\..\source\components\utilities\utuuid.c"
>

File diff suppressed because it is too large Load Diff

View File

@ -233,156 +233,30 @@
<File
RelativePath="..\..\source\TOOLS\acpisrc\ascase.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\source\tools\AcpiSrc\asconvrt.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\source\tools\AcpiSrc\asfile.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\source\tools\AcpiSrc\asmain.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\source\TOOLS\acpisrc\asremove.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\source\tools\acpisrc\astable.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\source\tools\AcpiSrc\asutils.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
</Filter>
<Filter
@ -396,50 +270,10 @@
<File
RelativePath="..\..\source\common\getopt.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\source\os_specific\service_layers\oslibcfs.c"
>
</File>
<File
RelativePath="..\..\source\os_specific\SERVICE_LAYERS\oswindir.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\source\os_specific\service_layers\oswinxf.c"
@ -489,10 +323,6 @@
RelativePath="..\..\source\components\utilities\utnonansi.c"
>
</File>
<File
RelativePath="..\..\source\components\utilities\utprint.c"
>
</File>
<File
RelativePath="..\..\source\components\utilities\utstring.c"
>

File diff suppressed because it is too large Load Diff

View File

@ -253,10 +253,6 @@
RelativePath="..\..\source\components\utilities\utnonansi.c"
>
</File>
<File
RelativePath="..\..\source\components\utilities\utprint.c"
>
</File>
<File
RelativePath="..\..\source\components\utilities\utxferror.c"
>
@ -269,10 +265,6 @@
RelativePath="..\..\source\common\getopt.c"
>
</File>
<File
RelativePath="..\..\source\os_specific\service_layers\oslibcfs.c"
>
</File>
<File
RelativePath="..\..\source\os_specific\service_layers\oswinxf.c"
>
@ -300,23 +292,6 @@
<File
RelativePath="..\..\source\tools\AcpiXtract\acpixtract.c"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions=""
BrowseInformation="0"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\source\tools\acpixtract\axmain.c"

File diff suppressed because it is too large Load Diff

View File

@ -232,10 +232,6 @@
<Filter
Name="Common"
>
<File
RelativePath="..\..\source\os_specific\service_layers\oslibcfs.c"
>
</File>
<File
RelativePath="..\..\source\os_specific\service_layers\oswinxf.c"
>
@ -372,10 +368,6 @@
RelativePath="..\..\source\components\utilities\utpredef.c"
>
</File>
<File
RelativePath="..\..\source\components\utilities\utprint.c"
>
</File>
<File
RelativePath="..\..\source\components\utilities\utresrc.c"
>

View File

@ -43,11 +43,9 @@ OBJECTS = \
$(OBJDIR)/utmath.o\
$(OBJDIR)/utmisc.o\
$(OBJDIR)/utmutex.o\
$(OBJDIR)/utprint.o\
$(OBJDIR)/utstate.o\
$(OBJDIR)/utstring.o\
$(OBJDIR)/utxferror.o\
$(OBJDIR)/oslibcfs.o\
$(OBJDIR)/osunixxf.o
#

View File

@ -33,7 +33,6 @@ OBJECTS = \
$(OBJDIR)/apmain.o\
$(OBJDIR)/cmfsize.o\
$(OBJDIR)/getopt.o\
$(OBJDIR)/oslibcfs.o\
$(OBJDIR)/osunixdir.o\
$(OBJDIR)/osunixmap.o\
$(OBJDIR)/osunixxf.o\
@ -46,7 +45,6 @@ OBJECTS = \
$(OBJDIR)/utglobal.o\
$(OBJDIR)/utmath.o\
$(OBJDIR)/utnonansi.o\
$(OBJDIR)/utprint.o\
$(OBJDIR)/utstring.o\
$(OBJDIR)/utxferror.o

View File

@ -107,7 +107,6 @@ OBJECTS = \
$(OBJDIR)/nsxfeval.o\
$(OBJDIR)/nsxfname.o\
$(OBJDIR)/nsxfobj.o\
$(OBJDIR)/oslibcfs.o\
$(OBJDIR)/osunixxf.o\
$(OBJDIR)/psargs.o\
$(OBJDIR)/psloop.o\
@ -154,7 +153,6 @@ OBJECTS = \
$(OBJDIR)/utownerid.o\
$(OBJDIR)/utnonansi.o\
$(OBJDIR)/utpredef.o\
$(OBJDIR)/utprint.o\
$(OBJDIR)/utresrc.o\
$(OBJDIR)/utstate.o\
$(OBJDIR)/utstring.o\

View File

@ -163,7 +163,6 @@ OBJECTS = \
$(OBJDIR)/nsxfeval.o\
$(OBJDIR)/nsxfname.o\
$(OBJDIR)/nsxfobj.o\
$(OBJDIR)/oslibcfs.o\
$(OBJDIR)/osunixxf.o\
$(OBJDIR)/psargs.o\
$(OBJDIR)/psloop.o\
@ -224,7 +223,6 @@ OBJECTS = \
$(OBJDIR)/utownerid.o\
$(OBJDIR)/utnonansi.o\
$(OBJDIR)/utpredef.o\
$(OBJDIR)/utprint.o\
$(OBJDIR)/utresrc.o\
$(OBJDIR)/utstate.o\
$(OBJDIR)/utstring.o\

View File

@ -39,7 +39,6 @@ OBJECTS = \
$(OBJDIR)/ahtable.o\
$(OBJDIR)/ahuuids.o\
$(OBJDIR)/getopt.o\
$(OBJDIR)/oslibcfs.o\
$(OBJDIR)/osunixxf.o\
$(OBJDIR)/utdebug.o\
$(OBJDIR)/utexcep.o\
@ -48,7 +47,6 @@ OBJECTS = \
$(OBJDIR)/utmath.o\
$(OBJDIR)/utnonansi.o\
$(OBJDIR)/utpredef.o\
$(OBJDIR)/utprint.o\
$(OBJDIR)/utuuid.o
#

View File

@ -72,7 +72,6 @@ OBJECTS = \
$(OBJDIR)/nsxfeval.o\
$(OBJDIR)/nsxfname.o\
$(OBJDIR)/nsxfobj.o\
$(OBJDIR)/oslibcfs.o\
$(OBJDIR)/osunixxf.o\
$(OBJDIR)/psargs.o\
$(OBJDIR)/psloop.o\
@ -116,7 +115,6 @@ OBJECTS = \
$(OBJDIR)/utobject.o\
$(OBJDIR)/utosi.o\
$(OBJDIR)/utownerid.o\
$(OBJDIR)/utprint.o\
$(OBJDIR)/utstate.o\
$(OBJDIR)/utstring.o\
$(OBJDIR)/utxface.o\

View File

@ -36,16 +36,14 @@ OBJECTS = \
$(OBJDIR)/asutils.o\
$(OBJDIR)/cmfsize.o\
$(OBJDIR)/getopt.o \
$(OBJDIR)/oslibcfs.o\
$(OBJDIR)/osunixdir.o\
$(OBJDIR)/osunixxf.o\
$(OBJDIR)/utascii.o\
$(OBJDIR)/utascii.o\
$(OBJDIR)/utdebug.o\
$(OBJDIR)/utexcep.o\
$(OBJDIR)/utglobal.o\
$(OBJDIR)/utmath.o\
$(OBJDIR)/utnonansi.o\
$(OBJDIR)/utprint.o\
$(OBJDIR)/utnonansi.o\
$(OBJDIR)/utstring.o\
$(OBJDIR)/utxferror.o

View File

@ -31,7 +31,6 @@ OBJECTS = \
$(OBJDIR)/axmain.o\
$(OBJDIR)/axutils.o\
$(OBJDIR)/getopt.o\
$(OBJDIR)/oslibcfs.o\
$(OBJDIR)/osunixxf.o\
$(OBJDIR)/utascii.o\
$(OBJDIR)/utdebug.o\
@ -39,7 +38,6 @@ OBJECTS = \
$(OBJDIR)/utglobal.o\
$(OBJDIR)/utmath.o\
$(OBJDIR)/utnonansi.o\
$(OBJDIR)/utprint.o\
$(OBJDIR)/utxferror.o
#

View File

@ -177,7 +177,6 @@ OBJECTS = \
$(OBJDIR)/nswalk.o\
$(OBJDIR)/nsxfobj.o\
$(OBJDIR)/osunixxf.o\
$(OBJDIR)/oslibcfs.o\
$(OBJDIR)/prexpress.o\
$(OBJDIR)/prmacros.o\
$(OBJDIR)/prscan.o\
@ -221,7 +220,6 @@ OBJECTS = \
$(OBJDIR)/utobject.o\
$(OBJDIR)/utownerid.o\
$(OBJDIR)/utpredef.o\
$(OBJDIR)/utprint.o\
$(OBJDIR)/utresrc.o\
$(OBJDIR)/utstate.o\
$(OBJDIR)/utstring.o\

View File

@ -115,10 +115,9 @@
#include "acpi.h"
#include "accommon.h"
#include "acapps.h"
#include "actables.h"
#include "acutils.h"
#include <errno.h>
#include "acapps.h"
#define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME ("acfileio")
@ -170,7 +169,7 @@ AcGetAllTablesFromFile (
File = fopen (Filename, "rb");
if (!File)
{
perror ("Could not open input file");
fprintf (stderr, "Could not open input file: %s\n", Filename);
if (errno == ENOENT)
{
return (AE_NOT_EXIST);
@ -352,7 +351,7 @@ AcGetOneTableFromFile (
/* Allocate a buffer for the entire table */
Table = AcpiOsAllocate ((size_t) TableHeader.Length);
Table = AcpiOsAllocate ((ACPI_SIZE) TableHeader.Length);
if (!Table)
{
return (AE_NO_MEMORY);
@ -460,7 +459,7 @@ AcValidateTableHeader (
long TableOffset)
{
ACPI_TABLE_HEADER TableHeader;
size_t Actual;
ACPI_SIZE Actual;
long OriginalOffset;
UINT32 FileSize;
UINT32 i;

View File

@ -119,8 +119,6 @@
#include "acparser.h"
#include "acdebug.h"
#include <stdio.h>
/*
* This is an os-independent implementation of line-editing services needed
* by the AcpiExec utility. It uses getchar() and putchar() and the existing

View File

@ -121,8 +121,6 @@
#include "acparser.h"
#include "acapps.h"
#include <stdio.h>
#define _COMPONENT ACPI_TOOLS
ACPI_MODULE_NAME ("adisasm")

View File

@ -116,7 +116,6 @@
#include "acpi.h"
#include "accommon.h"
#include "acapps.h"
#include <stdio.h>
#define _COMPONENT ACPI_TOOLS
ACPI_MODULE_NAME ("cmfsize")
@ -146,19 +145,19 @@ CmGetFileSize (
/* Save the current file pointer, seek to EOF to obtain file size */
CurrentOffset = AcpiOsGetFileOffset (File);
CurrentOffset = ftell (File);
if (CurrentOffset < 0)
{
goto OffsetError;
}
Status = AcpiOsSetFileOffset (File, 0, ACPI_FILE_END);
Status = fseek (File, 0, SEEK_END);
if (ACPI_FAILURE (Status))
{
goto SeekError;
}
FileSize = AcpiOsGetFileOffset (File);
FileSize = ftell (File);
if (FileSize < 0)
{
goto OffsetError;
@ -166,7 +165,7 @@ CmGetFileSize (
/* Restore original file pointer */
Status = AcpiOsSetFileOffset (File, CurrentOffset, ACPI_FILE_BEGIN);
Status = fseek (File, CurrentOffset, SEEK_SET);
if (ACPI_FAILURE (Status))
{
goto SeekError;
@ -176,10 +175,10 @@ CmGetFileSize (
OffsetError:
AcpiLogError ("Could not get file offset");
fprintf (stderr, "Could not get file offset\n");
return (ACPI_UINT32_MAX);
SeekError:
AcpiLogError ("Could not set file offset");
fprintf (stderr, "Could not set file offset\n");
return (ACPI_UINT32_MAX);
}

View File

@ -114,14 +114,12 @@
*****************************************************************************/
#include "aslcompiler.h"
#include "acapps.h"
#include "acdispat.h"
#include "acnamesp.h"
#include "actables.h"
#include "acparser.h"
#include "acapps.h"
#include <stdio.h>
#include <time.h>
#define _COMPONENT ACPI_TOOLS
ACPI_MODULE_NAME ("dmtables")

View File

@ -129,7 +129,7 @@
#include "acapps.h"
#define ACPI_OPTION_ERROR(msg, badchar) \
if (AcpiGbl_Opterr) {AcpiLogError ("%s%c\n", msg, badchar);}
if (AcpiGbl_Opterr) {fprintf (stderr, "%s%c\n", msg, badchar);}
int AcpiGbl_Opterr = 1;

View File

@ -134,7 +134,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <errno.h>
#include <ctype.h>

View File

@ -118,15 +118,15 @@
#include "accommon.h"
#include "acdebug.h"
#include "actables.h"
#include <stdio.h>
#ifdef ACPI_APPLICATION
#include "acapps.h"
#endif
#define _COMPONENT ACPI_CA_DEBUGGER
ACPI_MODULE_NAME ("dbfileio")
#ifdef ACPI_APPLICATION
#include "acapps.h"
#ifdef ACPI_DEBUGGER
/*******************************************************************************
*
@ -145,8 +145,6 @@ AcpiDbCloseDebugFile (
void)
{
#ifdef ACPI_APPLICATION
if (AcpiGbl_DebugFile)
{
fclose (AcpiGbl_DebugFile);
@ -155,7 +153,6 @@ AcpiDbCloseDebugFile (
AcpiOsPrintf ("Debug output file %s closed\n",
AcpiGbl_DbDebugFilename);
}
#endif
}
@ -176,8 +173,6 @@ AcpiDbOpenDebugFile (
char *Name)
{
#ifdef ACPI_APPLICATION
AcpiDbCloseDebugFile ();
AcpiGbl_DebugFile = fopen (Name, "w+");
if (!AcpiGbl_DebugFile)
@ -190,8 +185,6 @@ AcpiDbOpenDebugFile (
strncpy (AcpiGbl_DbDebugFilename, Name,
sizeof (AcpiGbl_DbDebugFilename));
AcpiGbl_DbOutputToFile = TRUE;
#endif
}
#endif
@ -241,8 +234,7 @@ AcpiDbLoadTables (
return (Status);
}
fprintf (stderr,
"Acpi table [%4.4s] successfully installed and loaded\n",
AcpiOsPrintf ("Acpi table [%4.4s] successfully installed and loaded\n",
Table->Signature);
TableListHead = TableListHead->Next;
@ -250,3 +242,4 @@ AcpiDbLoadTables (
return (AE_OK);
}
#endif

View File

@ -336,7 +336,7 @@ AcpiUtDumpBufferToFile (
if (!Buffer)
{
AcpiUtFilePrintf (File, "Null Buffer Pointer in DumpBuffer!\n");
fprintf (File, "Null Buffer Pointer in DumpBuffer!\n");
return;
}
@ -351,7 +351,7 @@ AcpiUtDumpBufferToFile (
{
/* Print current offset */
AcpiUtFilePrintf (File, "%6.4X: ", (BaseOffset + i));
fprintf (File, "%6.4X: ", (BaseOffset + i));
/* Print 16 hex chars */
@ -361,7 +361,7 @@ AcpiUtDumpBufferToFile (
{
/* Dump fill spaces */
AcpiUtFilePrintf (File, "%*s", ((Display * 2) + 1), " ");
fprintf (File, "%*s", ((Display * 2) + 1), " ");
j += Display;
continue;
}
@ -371,28 +371,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;
}
@ -403,29 +403,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;
}

View File

@ -780,33 +780,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

View File

@ -268,8 +268,6 @@ AcpiUtGetExpectedReturnTypes (
******************************************************************************/
#if (defined ACPI_ASL_COMPILER || defined ACPI_HELP_APP)
#include <stdio.h>
#include <string.h>
/* Local prototypes */

View File

@ -488,7 +488,7 @@ AcpiUtFormatNumber (
/*******************************************************************************
*
* FUNCTION: AcpiUtVsnprintf
* FUNCTION: vsnprintf
*
* PARAMETERS: String - String with boundary
* Size - Boundary of the string
@ -502,7 +502,7 @@ AcpiUtFormatNumber (
******************************************************************************/
int
AcpiUtVsnprintf (
vsnprintf (
char *String,
ACPI_SIZE Size,
const char *Format,
@ -785,7 +785,7 @@ AcpiUtVsnprintf (
/*******************************************************************************
*
* FUNCTION: AcpiUtSnprintf
* FUNCTION: snprintf
*
* PARAMETERS: String - String with boundary
* Size - Boundary of the string
@ -798,7 +798,7 @@ AcpiUtVsnprintf (
******************************************************************************/
int
AcpiUtSnprintf (
snprintf (
char *String,
ACPI_SIZE Size,
const char *Format,
@ -809,7 +809,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);
@ -819,7 +850,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
@ -832,8 +925,8 @@ AcpiUtSnprintf (
******************************************************************************/
int
AcpiUtFileVprintf (
ACPI_FILE File,
vfprintf (
FILE *File,
const char *Format,
va_list Args)
{
@ -842,10 +935,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);
@ -854,7 +947,7 @@ AcpiUtFileVprintf (
/*******************************************************************************
*
* FUNCTION: AcpiUtFilePrintf
* FUNCTION: fprintf
*
* PARAMETERS: File - File descriptor
* Format, ... - Standard printf format
@ -866,8 +959,8 @@ AcpiUtFileVprintf (
******************************************************************************/
int
AcpiUtFilePrintf (
ACPI_FILE File,
fprintf (
FILE *File,
const char *Format,
...)
{
@ -876,7 +969,7 @@ AcpiUtFilePrintf (
va_start (Args, Format);
Length = AcpiUtFileVprintf (File, Format, Args);
Length = vfprintf (File, Format, Args);
va_end (Args);
return (Length);

View File

@ -116,11 +116,9 @@
#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 */
@ -157,13 +155,13 @@
/* 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 */

View File

@ -145,6 +145,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 */
@ -236,4 +253,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 */

View File

@ -464,6 +464,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 */

View File

@ -564,6 +564,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)
@ -624,62 +633,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__ */

View File

@ -1304,13 +1304,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);

View File

@ -1459,16 +1459,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

View File

@ -1139,48 +1139,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
*/

View File

@ -119,6 +119,7 @@
/*
* ACPICA configuration
*/
#define ACPI_USE_STANDARD_HEADERS
#define ACPI_USE_SYSTEM_CLIBRARY
#define ACPI_USE_DO_WHILE_0
#define ACPI_FLUSH_CPU_CACHE()
@ -130,11 +131,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

View File

@ -116,10 +116,20 @@
#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
#ifdef __GNUC__
#include "acgcc.h"
#endif
#ifdef _MSC_VER
#include "acmsvc.h"
#endif
#if defined(__x86_64__)
@ -129,23 +139,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__)
@ -166,23 +166,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__(...) \
@ -302,15 +302,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
*/
@ -327,21 +318,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__ */

File diff suppressed because it is too large Load Diff

View File

@ -151,6 +151,7 @@
(defined ACPI_EXAMPLE_APP)
#define ACPI_APPLICATION
#define ACPI_SINGLE_THREADED
#define USE_NATIVE_ALLOCATE_ZEROED
#endif
/* iASL configuration */
@ -197,7 +198,6 @@
#ifdef ACPI_DUMP_APP
#define ACPI_USE_NATIVE_MEMORY_MAPPING
#define USE_NATIVE_ALLOCATE_ZEROED
#endif
/* AcpiNames/Example configuration. Hardware disabled */
@ -222,7 +222,6 @@
/* Common for all ACPICA applications */
#ifdef ACPI_APPLICATION
#define ACPI_USE_SYSTEM_CLIBRARY
#define ACPI_USE_LOCAL_CACHE
#endif
@ -282,18 +281,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 */
@ -402,7 +403,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.
@ -410,7 +412,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. */
@ -418,57 +419,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
@ -477,7 +441,6 @@ 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

View File

@ -131,15 +131,17 @@
#elif defined(WIN32)
#include "acwinex.h"
#elif defined(_AED_EFI)
#include "acefiex.h"
#elif defined(_GNU_EFI)
#include "acefiex.h"
#elif defined(__DragonFly__)
#include "acdragonflyex.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 "acefiex.h"
#endif
/*! [End] no source code translation !*/

View File

@ -116,6 +116,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 */

View File

@ -116,6 +116,9 @@
#ifndef __ACHAIKU_H__
#define __ACHAIKU_H__
#define ACPI_USE_STANDARD_HEADERS
#define ACPI_USE_SYSTEM_CLIBRARY
#include "acgcc.h"
#include <KernelExport.h>
@ -124,9 +127,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 *

View File

@ -116,6 +116,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

View File

@ -247,11 +247,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 */

View File

@ -136,6 +136,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
@ -174,6 +178,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
@ -208,6 +216,7 @@
n_lo >>= 1; \
}
#endif
#endif
/* warn C4100: unreferenced formal parameter */
#pragma warning(disable:4100)
@ -264,4 +273,54 @@ _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)
/* va_arg implementation can be compiler specific */
#ifdef ACPI_USE_STANDARD_HEADERS
#include <stdarg.h>
#endif /* ACPI_USE_STANDARD_HEADERS */
#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 /* __ACMSVC_H__ */

View File

@ -123,4 +123,8 @@
#include <crtdbg.h>
#endif
/* End standard headers */
#pragma warning(pop)
#endif /* __ACMSVCEX_H__ */

View File

@ -115,6 +115,10 @@
#ifndef __ACOS2_H__
#define __ACOS2_H__
#define ACPI_USE_STANDARD_HEADERS
#define ACPI_USE_SYSTEM_CLIBRARY
#define INCL_LONGLONG
#include <os2.h>
@ -138,7 +142,6 @@
*/
#define ACPI_UNUSED_VAR
#define ACPI_USE_STANDARD_HEADERS
#include <io.h>
#define ACPI_FLUSH_CPU_CACHE() Wbinvd()

View File

@ -116,6 +116,9 @@
#ifndef __ACQNX_H__
#define __ACQNX_H__
#define ACPI_USE_STANDARD_HEADERS
#define ACPI_USE_SYSTEM_CLIBRARY
/* QNX uses GCC */
#include "acgcc.h"
@ -134,13 +137,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__ */

View File

@ -116,6 +116,9 @@
#ifndef __ACWIN_H__
#define __ACWIN_H__
#define ACPI_USE_STANDARD_HEADERS
#define ACPI_USE_SYSTEM_CLIBRARY
/*! [Begin] no source code translation (Keep the include) */
/* Windows uses VC */
@ -126,8 +129,6 @@
#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

View File

@ -116,6 +116,9 @@
#ifndef __ACWIN64_H__
#define __ACWIN64_H__
#define ACPI_USE_STANDARD_HEADERS
#define ACPI_USE_SYSTEM_CLIBRARY
/*! [Begin] no source code translation (Keep the include) */
#include "acintel.h"
@ -123,8 +126,6 @@
#define ACPI_MACHINE_WIDTH 64
#define ACPI_USE_STANDARD_HEADERS
/*
* Handle platform- and compiler-specific assembly language differences.
*

View File

@ -1,6 +1,6 @@
/******************************************************************************
*
* Module Name: osefixf - EFI OSL interfaces
* Module Name: oseficlib - EFI specific CLibrary interfaces
*
*****************************************************************************/
@ -118,7 +118,7 @@
#include "acapps.h"
#define _COMPONENT ACPI_OS_SERVICES
ACPI_MODULE_NAME ("osefixf")
ACPI_MODULE_NAME ("oseficlib")
/* Local definitions */
@ -128,18 +128,13 @@
/* Local prototypes */
static ACPI_STATUS
static int
AcpiEfiArgify (
char *String,
int *ArgcPtr,
char ***ArgvPtr);
static BOOLEAN
AcpiEfiCompareGuid (
EFI_GUID *Guid1,
EFI_GUID *Guid2);
static ACPI_STATUS
static int
AcpiEfiConvertArgcv (
CHAR16 *LoadOpt,
UINT32 LoadOptSize,
@ -147,13 +142,9 @@ AcpiEfiConvertArgcv (
char ***ArgvPtr,
char **BufferPtr);
static ACPI_PHYSICAL_ADDRESS
AcpiEfiGetRsdpViaGuid (
EFI_GUID *Guid);
static CHAR16 *
AcpiEfiFlushFile (
ACPI_FILE File,
FILE *File,
CHAR16 *Begin,
CHAR16 *End,
CHAR16 *Pos,
@ -162,319 +153,97 @@ AcpiEfiFlushFile (
/* Local variables */
static EFI_FILE_HANDLE AcpiGbl_EfiCurrentVolume = NULL;
EFI_GUID AcpiGbl_LoadedImageProtocol = LOADED_IMAGE_PROTOCOL;
EFI_GUID AcpiGbl_TextInProtocol = SIMPLE_TEXT_INPUT_PROTOCOL;
EFI_GUID AcpiGbl_TextOutProtocol = SIMPLE_TEXT_OUTPUT_PROTOCOL;
EFI_GUID AcpiGbl_FileSystemProtocol = SIMPLE_FILE_SYSTEM_PROTOCOL;
static ACPI_EFI_FILE_HANDLE AcpiGbl_EfiCurrentVolume = NULL;
ACPI_EFI_GUID AcpiGbl_LoadedImageProtocol = ACPI_EFI_LOADED_IMAGE_PROTOCOL;
ACPI_EFI_GUID AcpiGbl_TextInProtocol = ACPI_SIMPLE_TEXT_INPUT_PROTOCOL;
ACPI_EFI_GUID AcpiGbl_TextOutProtocol = ACPI_SIMPLE_TEXT_OUTPUT_PROTOCOL;
ACPI_EFI_GUID AcpiGbl_FileSystemProtocol = ACPI_SIMPLE_FILE_SYSTEM_PROTOCOL;
/******************************************************************************
*
* FUNCTION: AcpiEfiGetRsdpViaGuid
*
* PARAMETERS: Guid1 - GUID to compare
* Guid2 - GUID to compare
*
* RETURN: TRUE if Guid1 == Guid2
*
* DESCRIPTION: Compares two GUIDs
*
*****************************************************************************/
static BOOLEAN
AcpiEfiCompareGuid (
EFI_GUID *Guid1,
EFI_GUID *Guid2)
{
INT32 *g1;
INT32 *g2;
INT32 r;
g1 = (INT32 *) Guid1;
g2 = (INT32 *) Guid2;
r = g1[0] - g2[0];
r |= g1[1] - g2[1];
r |= g1[2] - g2[2];
r |= g1[3] - g2[3];
return (r ? FALSE : TRUE);
}
/******************************************************************************
*
* FUNCTION: AcpiEfiGetRsdpViaGuid
*
* PARAMETERS: None
*
* RETURN: RSDP address if found
*
* DESCRIPTION: Find RSDP address via EFI using specified GUID.
*
*****************************************************************************/
static ACPI_PHYSICAL_ADDRESS
AcpiEfiGetRsdpViaGuid (
EFI_GUID *Guid)
{
ACPI_PHYSICAL_ADDRESS Address = 0;
int i;
for (i = 0; i < ST->NumberOfTableEntries; i++)
{
if (AcpiEfiCompareGuid (&ST->ConfigurationTable[i].VendorGuid, Guid))
{
Address = ACPI_PTR_TO_PHYSADDR (
ST->ConfigurationTable[i].VendorTable);
break;
}
}
return (Address);
}
/******************************************************************************
*
* FUNCTION: AcpiOsGetRootPointer
*
* PARAMETERS: None
*
* RETURN: RSDP physical address
*
* DESCRIPTION: Gets the ACPI root pointer (RSDP)
*
*****************************************************************************/
ACPI_PHYSICAL_ADDRESS
AcpiOsGetRootPointer (
void)
{
ACPI_PHYSICAL_ADDRESS Address;
EFI_GUID Guid10 = ACPI_TABLE_GUID;
EFI_GUID Guid20 = ACPI_20_TABLE_GUID;
Address = AcpiEfiGetRsdpViaGuid (&Guid20);
if (!Address)
{
Address = AcpiEfiGetRsdpViaGuid (&Guid10);
}
return (Address);
}
/******************************************************************************
*
* FUNCTION: AcpiOsMapMemory
*
* PARAMETERS: where - Physical address of memory to be mapped
* length - How much memory to map
*
* RETURN: Pointer to mapped memory. Null on error.
*
* DESCRIPTION: Map physical memory into caller's address space
*
*****************************************************************************/
void *
AcpiOsMapMemory (
ACPI_PHYSICAL_ADDRESS where,
ACPI_SIZE length)
{
return (ACPI_TO_POINTER ((ACPI_SIZE) where));
}
/******************************************************************************
*
* FUNCTION: AcpiOsUnmapMemory
*
* PARAMETERS: where - Logical address of memory to be unmapped
* length - How much memory to unmap
*
* RETURN: None
*
* DESCRIPTION: Delete a previously created mapping. Where and Length must
* correspond to a previous mapping exactly.
*
*****************************************************************************/
void
AcpiOsUnmapMemory (
void *where,
ACPI_SIZE length)
{
return;
}
/******************************************************************************
*
* FUNCTION: Spinlock interfaces
*
* DESCRIPTION: No-op on single threaded BIOS
*
*****************************************************************************/
ACPI_STATUS
AcpiOsCreateLock (
ACPI_SPINLOCK *OutHandle)
{
return (AE_OK);
}
void
AcpiOsDeleteLock (
ACPI_SPINLOCK Handle)
{
}
ACPI_CPU_FLAGS
AcpiOsAcquireLock (
ACPI_SPINLOCK Handle)
{
return (0);
}
void
AcpiOsReleaseLock (
ACPI_SPINLOCK Handle,
ACPI_CPU_FLAGS Flags)
{
}
/******************************************************************************
*
* FUNCTION: AcpiOsAllocate
*
* PARAMETERS: Size - Amount to allocate, in bytes
*
* RETURN: Pointer to the new allocation. Null on error.
*
* DESCRIPTION: Allocate memory. Algorithm is dependent on the OS.
*
*****************************************************************************/
void *
AcpiOsAllocate (
ACPI_SIZE Size)
{
EFI_STATUS EfiStatus;
void *Mem;
EfiStatus = uefi_call_wrapper (BS->AllocatePool, 3,
EfiLoaderData, Size, &Mem);
if (EFI_ERROR (EfiStatus))
{
AcpiLogError ("EFI_BOOT_SERVICES->AllocatePool(EfiLoaderData) failure.\n");
return (NULL);
}
return (Mem);
}
#ifdef USE_NATIVE_ALLOCATE_ZEROED
/******************************************************************************
*
* FUNCTION: AcpiOsAllocateZeroed
*
* PARAMETERS: Size - Amount to allocate, in bytes
*
* RETURN: Pointer to the new allocation. Null on error.
*
* DESCRIPTION: Allocate and zero memory. Algorithm is dependent on the OS.
*
*****************************************************************************/
void *
AcpiOsAllocateZeroed (
ACPI_SIZE Size)
{
void *Mem;
Mem = AcpiOsAllocate (Size);
if (Mem)
{
memset (Mem, 0, Size);
}
return (Mem);
}
#endif
/******************************************************************************
*
* FUNCTION: AcpiOsFree
*
* PARAMETERS: Mem - Pointer to previously allocated memory
*
* RETURN: None
*
* DESCRIPTION: Free memory allocated via AcpiOsAllocate
*
*****************************************************************************/
void
AcpiOsFree (
void *Mem)
{
uefi_call_wrapper (BS->FreePool, 1, Mem);
}
int errno = 0;
/*******************************************************************************
*
* FUNCTION: AcpiOsOpenFile
* FUNCTION: fopen
*
* PARAMETERS: Path - File path
* Modes - File operation type
*
* RETURN: File descriptor
*
* DESCRIPTION: Open a file for reading (ACPI_FILE_READING) or/and writing
* (ACPI_FILE_WRITING).
* DESCRIPTION: Open a file for reading or/and writing.
*
******************************************************************************/
ACPI_FILE
AcpiOsOpenFile (
FILE *
fopen (
const char *Path,
UINT8 Modes)
const char *Modes)
{
EFI_STATUS EfiStatus = EFI_SUCCESS;
ACPI_EFI_STATUS EfiStatus = ACPI_EFI_SUCCESS;
UINT64 OpenModes;
EFI_FILE_HANDLE EfiFile = NULL;
ACPI_EFI_FILE_HANDLE EfiFile = NULL;
CHAR16 *Path16 = NULL;
CHAR16 *Pos16;
const char *Pos;
INTN Count, i;
BOOLEAN IsAppend = FALSE;
FILE *File = NULL;
if (!Path)
{
errno = EINVAL;
return (NULL);
}
/* Convert modes */
OpenModes = EFI_FILE_MODE_READ;
if (Modes & ACPI_FILE_WRITING)
/*
* Convert modes, EFI says the only 2 read/write modes are read-only,
* read+write. Thus set default mode as read-only.
*/
OpenModes = ACPI_EFI_FILE_MODE_READ;
switch (*Modes++)
{
OpenModes |= (EFI_FILE_MODE_WRITE | EFI_FILE_MODE_CREATE);
case 'r':
break;
case 'w':
OpenModes |= (ACPI_EFI_FILE_MODE_WRITE | ACPI_EFI_FILE_MODE_CREATE);
break;
case 'a':
OpenModes |= (ACPI_EFI_FILE_MODE_WRITE | ACPI_EFI_FILE_MODE_CREATE);
IsAppend = TRUE;
break;
default:
errno = EINVAL;
return (NULL);
}
for (; *Modes; Modes++)
{
switch (*Modes)
{
case '+':
OpenModes |= (ACPI_EFI_FILE_MODE_WRITE | ACPI_EFI_FILE_MODE_CREATE);
break;
case 'b':
case 't':
break;
case 'f':
default:
break;
}
}
/* Allocate path buffer */
@ -483,7 +252,8 @@ AcpiOsOpenFile (
Path16 = ACPI_ALLOCATE_ZEROED ((Count + 1) * sizeof (CHAR16));
if (!Path16)
{
EfiStatus = EFI_BAD_BUFFER_SIZE;
EfiStatus = ACPI_EFI_BAD_BUFFER_SIZE;
errno = ENOMEM;
goto ErrorExit;
}
Pos = Path;
@ -509,12 +279,19 @@ AcpiOsOpenFile (
EfiStatus = uefi_call_wrapper (AcpiGbl_EfiCurrentVolume->Open, 5,
AcpiGbl_EfiCurrentVolume, &EfiFile, Path16, OpenModes, 0);
if (EFI_ERROR (EfiStatus))
if (ACPI_EFI_ERROR (EfiStatus))
{
AcpiLogError ("EFI_FILE_HANDLE->Open() failure.\n");
fprintf (stderr, "EFI_FILE_HANDLE->Open() failure.\n");
errno = ENOENT;
goto ErrorExit;
}
File = (FILE *) EfiFile;
if (IsAppend)
{
fseek (File, 0, SEEK_END);
}
ErrorExit:
if (Path16)
@ -522,13 +299,13 @@ ErrorExit:
ACPI_FREE (Path16);
}
return ((ACPI_FILE) EfiFile);
return (File);
}
/*******************************************************************************
*
* FUNCTION: AcpiOsCloseFile
* FUNCTION: fclose
*
* PARAMETERS: File - File descriptor
*
@ -539,18 +316,17 @@ ErrorExit:
******************************************************************************/
void
AcpiOsCloseFile (
ACPI_FILE File)
fclose (
FILE *File)
{
EFI_FILE_HANDLE EfiFile;
ACPI_EFI_FILE_HANDLE EfiFile;
if (File == ACPI_FILE_OUT ||
File == ACPI_FILE_ERR)
if (File == stdout || File == stderr)
{
return;
}
EfiFile = (EFI_FILE_HANDLE) File;
EfiFile = (ACPI_EFI_FILE_HANDLE) File;
(void) uefi_call_wrapper (AcpiGbl_EfiCurrentVolume->Close, 1, EfiFile);
return;
@ -559,12 +335,12 @@ AcpiOsCloseFile (
/*******************************************************************************
*
* FUNCTION: AcpiOsReadFile
* FUNCTION: fread
*
* PARAMETERS: File - File descriptor
* Buffer - Data buffer
* PARAMETERS: Buffer - Data buffer
* Size - Data block size
* Count - Number of data blocks
* File - File descriptor
*
* RETURN: Size of successfully read buffer
*
@ -573,36 +349,37 @@ AcpiOsCloseFile (
******************************************************************************/
int
AcpiOsReadFile (
ACPI_FILE File,
fread (
void *Buffer,
ACPI_SIZE Size,
ACPI_SIZE Count)
ACPI_SIZE Count,
FILE *File)
{
int Length = -1;
EFI_FILE_HANDLE EfiFile;
ACPI_EFI_FILE_HANDLE EfiFile;
UINTN ReadSize;
EFI_STATUS EfiStatus;
ACPI_EFI_STATUS EfiStatus;
if (File == ACPI_FILE_OUT ||
File == ACPI_FILE_ERR)
if (File == stdout || File == stderr)
{
}
else
{
EfiFile = (EFI_FILE_HANDLE) File;
EfiFile = (ACPI_EFI_FILE_HANDLE) File;
if (!EfiFile)
{
errno = EINVAL;
goto ErrorExit;
}
ReadSize = Size * Count;
EfiStatus = uefi_call_wrapper (AcpiGbl_EfiCurrentVolume->Read, 3,
EfiFile, &ReadSize, Buffer);
if (EFI_ERROR (EfiStatus))
if (ACPI_EFI_ERROR (EfiStatus))
{
AcpiLogError ("EFI_FILE_HANDLE->Read() failure.\n");
fprintf (stderr, "EFI_FILE_HANDLE->Read() failure.\n");
errno = EIO;
goto ErrorExit;
}
Length = ReadSize;
@ -632,7 +409,7 @@ ErrorExit:
static CHAR16 *
AcpiEfiFlushFile (
ACPI_FILE File,
FILE *File,
CHAR16 *Begin,
CHAR16 *End,
CHAR16 *Pos,
@ -652,12 +429,12 @@ AcpiEfiFlushFile (
/*******************************************************************************
*
* FUNCTION: AcpiOsWriteFile
* FUNCTION: fwrite
*
* PARAMETERS: File - File descriptor
* Buffer - Data buffer
* PARAMETERS: Buffer - Data buffer
* Size - Data block size
* Count - Number of data blocks
* File - File descriptor
*
* RETURN: Size of successfully written buffer
*
@ -666,11 +443,11 @@ AcpiEfiFlushFile (
******************************************************************************/
int
AcpiOsWriteFile (
ACPI_FILE File,
fwrite (
void *Buffer,
ACPI_SIZE Size,
ACPI_SIZE Count)
ACPI_SIZE Count,
FILE *File)
{
int Length = -1;
CHAR16 String[ACPI_EFI_PRINT_LENGTH];
@ -678,13 +455,12 @@ AcpiOsWriteFile (
CHAR16 *End;
CHAR16 *Pos;
int i, j;
EFI_FILE_HANDLE EfiFile;
ACPI_EFI_FILE_HANDLE EfiFile;
UINTN WriteSize;
EFI_STATUS EfiStatus;
ACPI_EFI_STATUS EfiStatus;
if (File == ACPI_FILE_OUT ||
File == ACPI_FILE_ERR)
if (File == stdout || File == stderr)
{
Pos = String;
End = String + ACPI_EFI_PRINT_LENGTH - 1;
@ -711,18 +487,20 @@ AcpiOsWriteFile (
}
else
{
EfiFile = (EFI_FILE_HANDLE) File;
EfiFile = (ACPI_EFI_FILE_HANDLE) File;
if (!EfiFile)
{
errno = EINVAL;
goto ErrorExit;
}
WriteSize = Size * Count;
EfiStatus = uefi_call_wrapper (AcpiGbl_EfiCurrentVolume->Write, 3,
EfiFile, &WriteSize, Buffer);
if (EFI_ERROR (EfiStatus))
if (ACPI_EFI_ERROR (EfiStatus))
{
AcpiLogError ("EFI_FILE_HANDLE->Write() failure.\n");
fprintf (stderr, "EFI_FILE_HANDLE->Write() failure.\n");
errno = EIO;
goto ErrorExit;
}
Length = WriteSize;
@ -736,7 +514,7 @@ ErrorExit:
/*******************************************************************************
*
* FUNCTION: AcpiOsGetFileOffset
* FUNCTION: ftell
*
* PARAMETERS: File - File descriptor
*
@ -747,8 +525,8 @@ ErrorExit:
******************************************************************************/
long
AcpiOsGetFileOffset (
ACPI_FILE File)
ftell (
FILE *File)
{
long Offset = -1;
@ -759,7 +537,7 @@ AcpiOsGetFileOffset (
/*******************************************************************************
*
* FUNCTION: AcpiOsSetFileOffset
* FUNCTION: fseek
*
* PARAMETERS: File - File descriptor
* Offset - File offset
@ -771,84 +549,14 @@ AcpiOsGetFileOffset (
*
******************************************************************************/
ACPI_STATUS
AcpiOsSetFileOffset (
ACPI_FILE File,
int
fseek (
FILE *File,
long Offset,
UINT8 From)
int From)
{
return (AE_SUPPORT);
}
/******************************************************************************
*
* FUNCTION: AcpiOsPrintf
*
* PARAMETERS: Format, ... - Standard printf format
*
* RETURN: None
*
* DESCRIPTION: Formatted output.
*
*****************************************************************************/
void ACPI_INTERNAL_VAR_XFACE
AcpiOsPrintf (
const char *Format,
...)
{
va_list Args;
va_start (Args, Format);
AcpiOsVprintf (Format, Args);
va_end (Args);
}
/******************************************************************************
*
* FUNCTION: AcpiOsVprintf
*
* PARAMETERS: Format - Standard printf format
* Args - Argument list
*
* RETURN: None
*
* DESCRIPTION: Formatted output with arguments list pointer.
*
*****************************************************************************/
void
AcpiOsVprintf (
const char *Format,
va_list Args)
{
(void) AcpiUtFileVprintf (ACPI_FILE_OUT, Format, Args);
}
/******************************************************************************
*
* FUNCTION: AcpiOsInitialize
*
* PARAMETERS: None
*
* RETURN: Status
*
* DESCRIPTION: Initialize this module.
*
*****************************************************************************/
ACPI_STATUS
AcpiOsInitialize (
void)
{
return (AE_OK);
return (-1);
}
@ -861,13 +569,15 @@ AcpiOsInitialize (
* ArgcPtr - Return number of the arguments
* ArgvPtr - Return vector of the arguments
*
* RETURN: Status
* RETURN: Clibraray error code
* -EINVAL: invalid parameter
* EAGAIN: try again
*
* DESCRIPTION: Convert EFI arguments into C arguments.
*
*****************************************************************************/
static ACPI_STATUS
static int
AcpiEfiArgify (
char *String,
int *ArgcPtr,
@ -885,7 +595,8 @@ AcpiEfiArgify (
if (String == NULL)
{
return (AE_BAD_PARAMETER);
errno = EINVAL;
return (-EINVAL);
}
CopyBuffer = String;
@ -971,7 +682,12 @@ AcpiEfiArgify (
*ArgcPtr = Argc;
*ArgvPtr = Argv;
return ((MaxArgc < Argc) ? AE_NO_MEMORY : AE_OK);
if (MaxArgc < Argc)
{
errno = EAGAIN;
return (-ENOMEM);
}
return (0);
}
@ -986,13 +702,13 @@ AcpiEfiArgify (
* ArgvPtr - Return vector of the arguments
* BufferPtr - Buffer to contain the argument strings
*
* RETURN: Status
* RETURN: Clibrary error code
*
* DESCRIPTION: Convert EFI arguments into C arguments.
*
*****************************************************************************/
static ACPI_STATUS
static int
AcpiEfiConvertArgcv (
CHAR16 *LoadOptions,
UINT32 LoadOptionsSize,
@ -1000,7 +716,7 @@ AcpiEfiConvertArgcv (
char ***ArgvPtr,
char **BufferPtr)
{
ACPI_STATUS Status = AE_OK;
int Error = 0;
UINT32 Count = LoadOptionsSize / sizeof (CHAR16);
UINT32 i;
CHAR16 *From;
@ -1015,7 +731,8 @@ AcpiEfiConvertArgcv (
Buffer = ACPI_ALLOCATE_ZEROED (Count);
if (!Buffer)
{
Status = AE_NO_MEMORY;
errno = ENOMEM;
Error = -ENOMEM;
goto ErrorExit;
}
@ -1033,7 +750,8 @@ TryAgain:
Argv = ACPI_ALLOCATE_ZEROED (sizeof (char *) * (Argc + 1));
if (!Argv)
{
Status = AE_NO_MEMORY;
errno = ENOMEM;
Error = -ENOMEM;
goto ErrorExit;
}
}
@ -1055,18 +773,15 @@ TryAgain:
* AcpiEfiArgify(). The number of the strings are saved in Argc and the
* pointers of the strings are saved in Argv.
*/
Status = AcpiEfiArgify (Buffer, &Argc, &Argv);
if (ACPI_FAILURE (Status))
Error = AcpiEfiArgify (Buffer, &Argc, &Argv);
if (Error && errno == EAGAIN)
{
if (Status == AE_NO_MEMORY)
{
goto TryAgain;
}
goto TryAgain;
}
ErrorExit:
if (ACPI_FAILURE (Status))
if (Error)
{
ACPI_FREE (Buffer);
ACPI_FREE (Argv);
@ -1077,7 +792,7 @@ ErrorExit:
*ArgvPtr = Argv;
*BufferPtr = Buffer;
}
return (Status);
return (Error);
}
@ -1094,18 +809,18 @@ ErrorExit:
*
*****************************************************************************/
EFI_STATUS
ACPI_EFI_STATUS
efi_main (
EFI_HANDLE Image,
EFI_SYSTEM_TABLE *SystemTab)
ACPI_EFI_HANDLE Image,
ACPI_EFI_SYSTEM_TABLE *SystemTab)
{
EFI_LOADED_IMAGE *Info;
EFI_STATUS EfiStatus = EFI_SUCCESS;
ACPI_STATUS Status;
ACPI_EFI_LOADED_IMAGE *Info;
ACPI_EFI_STATUS EfiStatus = ACPI_EFI_SUCCESS;
int Error;
int argc;
char **argv = NULL;
char *OptBuffer = NULL;
EFI_FILE_IO_INTERFACE *Volume = NULL;
ACPI_EFI_FILE_IO_INTERFACE *Volume = NULL;
/* Initialize global variables */
@ -1117,32 +832,34 @@ efi_main (
EfiStatus = uefi_call_wrapper (BS->HandleProtocol, 3,
Image, &AcpiGbl_LoadedImageProtocol, ACPI_CAST_PTR (VOID, &Info));
if (EFI_ERROR (EfiStatus))
if (ACPI_EFI_ERROR (EfiStatus))
{
AcpiLogError ("EFI_BOOT_SERVICES->HandleProtocol(LoadedImageProtocol) failure.\n");
fprintf (stderr,
"EFI_BOOT_SERVICES->HandleProtocol(LoadedImageProtocol) failure.\n");
return (EfiStatus);
}
EfiStatus = uefi_call_wrapper (BS->HandleProtocol, 3,
Info->DeviceHandle, &AcpiGbl_FileSystemProtocol, (void **) &Volume);
if (EFI_ERROR (EfiStatus))
if (ACPI_EFI_ERROR (EfiStatus))
{
AcpiLogError ("EFI_BOOT_SERVICES->HandleProtocol(FileSystemProtocol) failure.\n");
fprintf (stderr,
"EFI_BOOT_SERVICES->HandleProtocol(FileSystemProtocol) failure.\n");
return (EfiStatus);
}
EfiStatus = uefi_call_wrapper (Volume->OpenVolume, 2,
Volume, &AcpiGbl_EfiCurrentVolume);
if (EFI_ERROR (EfiStatus))
if (ACPI_EFI_ERROR (EfiStatus))
{
AcpiLogError ("EFI_FILE_IO_INTERFACE->OpenVolume() failure.\n");
fprintf (stderr, "EFI_FILE_IO_INTERFACE->OpenVolume() failure.\n");
return (EfiStatus);
}
Status = AcpiEfiConvertArgcv (Info->LoadOptions,
Error = AcpiEfiConvertArgcv (Info->LoadOptions,
Info->LoadOptionsSize, &argc, &argv, &OptBuffer);
if (ACPI_FAILURE (Status))
if (Error)
{
EfiStatus = EFI_DEVICE_ERROR;
EfiStatus = ACPI_EFI_DEVICE_ERROR;
goto ErrorAlloc;
}
@ -1161,3 +878,23 @@ ErrorAlloc:
return (EfiStatus);
}
#ifdef _EDK2_EFI
struct _ACPI_EFI_SYSTEM_TABLE *ST;
struct _ACPI_EFI_BOOT_SERVICES *BS;
struct _ACPI_EFI_RUNTIME_SERVICES *RT;
EFI_STATUS
EFIAPI
UefiMain (
EFI_HANDLE Image,
EFI_SYSTEM_TABLE *SystemTab)
{
EFI_STATUS EfiStatus;
EfiStatus = (EFI_STATUS) efi_main (
(ACPI_EFI_HANDLE) Image, (ACPI_EFI_SYSTEM_TABLE *) SystemTab);
return (EfiStatus);
}
#endif

View File

@ -305,18 +305,7 @@ AcpiOsGetTableByName (
/* Not a main ACPI table, attempt to extract it from the RSDT/XSDT */
if (!Gbl_DumpCustomizedTables)
{
/* Attempt to get the table from the memory */
Status = OslGetTable (Signature, Instance, Table, Address);
}
else
{
/* Attempt to get the table from the static directory */
Status = AE_SUPPORT;
}
Status = OslGetTable (Signature, Instance, Table, Address);
return (Status);
}
@ -389,7 +378,7 @@ OslAddTableToList (
{
if (Instance)
{
AcpiLogError (
fprintf (stderr,
"%4.4s: Warning unmatched table instance %d, expected %d\n",
Signature, Instance, NextInstance);
}
@ -650,56 +639,47 @@ OslTableInitialize (
return (Status);
}
if (!Gbl_DumpCustomizedTables)
/* Add mandatory tables to global table list first */
Status = OslAddTableToList (ACPI_RSDP_NAME, 0);
if (ACPI_FAILURE (Status))
{
/* Add mandatory tables to global table list first */
return (Status);
}
Status = OslAddTableToList (ACPI_RSDP_NAME, 0);
if (ACPI_FAILURE (Status))
{
return (Status);
}
Status = OslAddTableToList (ACPI_SIG_RSDT, 0);
if (ACPI_FAILURE (Status))
{
return (Status);
}
Status = OslAddTableToList (ACPI_SIG_RSDT, 0);
if (ACPI_FAILURE (Status))
{
return (Status);
}
if (Gbl_Revision == 2)
{
Status = OslAddTableToList (ACPI_SIG_XSDT, 0);
if (ACPI_FAILURE (Status))
{
return (Status);
}
}
Status = OslAddTableToList (ACPI_SIG_DSDT, 0);
if (ACPI_FAILURE (Status))
{
return (Status);
}
Status = OslAddTableToList (ACPI_SIG_FACS, 0);
if (ACPI_FAILURE (Status))
{
return (Status);
}
/* Add all tables found in the memory */
Status = OslListTables ();
if (Gbl_Revision == 2)
{
Status = OslAddTableToList (ACPI_SIG_XSDT, 0);
if (ACPI_FAILURE (Status))
{
return (Status);
}
}
else
{
/* Add all tables found in the static directory */
Status = AE_SUPPORT;
Status = OslAddTableToList (ACPI_SIG_DSDT, 0);
if (ACPI_FAILURE (Status))
{
return (Status);
}
Status = OslAddTableToList (ACPI_SIG_FACS, 0);
if (ACPI_FAILURE (Status))
{
return (Status);
}
/* Add all tables found in the memory */
Status = OslListTables ();
if (ACPI_FAILURE (Status))
{
return (Status);
}
Gbl_TableListInitialized = TRUE;
@ -1034,7 +1014,7 @@ OslMapTable (
MappedTable = AcpiOsMapMemory (Address, sizeof (ACPI_TABLE_HEADER));
if (!MappedTable)
{
AcpiLogError ("Could not map table header at 0x%8.8X%8.8X\n",
fprintf (stderr, "Could not map table header at 0x%8.8X%8.8X\n",
ACPI_FORMAT_UINT64 (Address));
return (AE_BAD_ADDRESS);
}
@ -1070,7 +1050,7 @@ OslMapTable (
MappedTable = AcpiOsMapMemory (Address, Length);
if (!MappedTable)
{
AcpiLogError ("Could not map table at 0x%8.8X%8.8X length %8.8X\n",
fprintf (stderr, "Could not map table at 0x%8.8X%8.8X length %8.8X\n",
ACPI_FORMAT_UINT64 (Address), Length);
return (AE_INVALID_TABLE_LENGTH);
}

View File

@ -1,6 +1,6 @@
/******************************************************************************
*
* Module Name: oslibcfs - C library OSL for file I/O
* Module Name: osefixf - EFI OSL interfaces
*
*****************************************************************************/
@ -114,217 +114,358 @@
*****************************************************************************/
#include "acpi.h"
#include <stdio.h>
#include <stdarg.h>
#include "accommon.h"
#include "acapps.h"
#define _COMPONENT ACPI_OS_SERVICES
ACPI_MODULE_NAME ("oslibcfs")
ACPI_MODULE_NAME ("osefixf")
/*******************************************************************************
*
* FUNCTION: AcpiOsOpenFile
*
* PARAMETERS: Path - File path
* Modes - File operation type
*
* RETURN: File descriptor.
*
* DESCRIPTION: Open a file for reading (ACPI_FILE_READING) or/and writing
* (ACPI_FILE_WRITING).
*
******************************************************************************/
/* Local prototypes */
ACPI_FILE
AcpiOsOpenFile (
const char *Path,
UINT8 Modes)
static BOOLEAN
AcpiEfiCompareGuid (
ACPI_EFI_GUID *Guid1,
ACPI_EFI_GUID *Guid2);
static ACPI_PHYSICAL_ADDRESS
AcpiEfiGetRsdpViaGuid (
ACPI_EFI_GUID *Guid);
/******************************************************************************
*
* FUNCTION: AcpiEfiGetRsdpViaGuid
*
* PARAMETERS: Guid1 - GUID to compare
* Guid2 - GUID to compare
*
* RETURN: TRUE if Guid1 == Guid2
*
* DESCRIPTION: Compares two GUIDs
*
*****************************************************************************/
static BOOLEAN
AcpiEfiCompareGuid (
ACPI_EFI_GUID *Guid1,
ACPI_EFI_GUID *Guid2)
{
ACPI_FILE File;
UINT32 i = 0;
char ModesStr[4];
INT32 *g1;
INT32 *g2;
INT32 r;
if (Modes & ACPI_FILE_READING)
{
ModesStr[i++] = 'r';
}
if (Modes & ACPI_FILE_WRITING)
{
ModesStr[i++] = 'w';
}
g1 = (INT32 *) Guid1;
g2 = (INT32 *) Guid2;
if (Modes & ACPI_FILE_BINARY)
{
ModesStr[i++] = 'b';
}
r = g1[0] - g2[0];
r |= g1[1] - g2[1];
r |= g1[2] - g2[2];
r |= g1[3] - g2[3];
ModesStr[i++] = '\0';
File = fopen (Path, ModesStr);
if (!File)
{
perror ("Could not open file");
}
return (File);
return (r ? FALSE : TRUE);
}
/*******************************************************************************
/******************************************************************************
*
* FUNCTION: AcpiOsCloseFile
* FUNCTION: AcpiEfiGetRsdpViaGuid
*
* PARAMETERS: File - An open file descriptor
* PARAMETERS: None
*
* RETURN: None.
* RETURN: RSDP address if found
*
* DESCRIPTION: Close a file opened via AcpiOsOpenFile.
* DESCRIPTION: Find RSDP address via EFI using specified GUID.
*
******************************************************************************/
*****************************************************************************/
static ACPI_PHYSICAL_ADDRESS
AcpiEfiGetRsdpViaGuid (
ACPI_EFI_GUID *Guid)
{
ACPI_PHYSICAL_ADDRESS Address = 0;
int i;
for (i = 0; i < ST->NumberOfTableEntries; i++)
{
if (AcpiEfiCompareGuid (&ST->ConfigurationTable[i].VendorGuid, Guid))
{
Address = ACPI_PTR_TO_PHYSADDR (
ST->ConfigurationTable[i].VendorTable);
break;
}
}
return (Address);
}
/******************************************************************************
*
* FUNCTION: AcpiOsGetRootPointer
*
* PARAMETERS: None
*
* RETURN: RSDP physical address
*
* DESCRIPTION: Gets the ACPI root pointer (RSDP)
*
*****************************************************************************/
ACPI_PHYSICAL_ADDRESS
AcpiOsGetRootPointer (
void)
{
ACPI_PHYSICAL_ADDRESS Address;
ACPI_EFI_GUID Guid10 = ACPI_TABLE_GUID;
ACPI_EFI_GUID Guid20 = ACPI_20_TABLE_GUID;
Address = AcpiEfiGetRsdpViaGuid (&Guid20);
if (!Address)
{
Address = AcpiEfiGetRsdpViaGuid (&Guid10);
}
return (Address);
}
/******************************************************************************
*
* FUNCTION: AcpiOsMapMemory
*
* PARAMETERS: where - Physical address of memory to be mapped
* length - How much memory to map
*
* RETURN: Pointer to mapped memory. Null on error.
*
* DESCRIPTION: Map physical memory into caller's address space
*
*****************************************************************************/
void *
AcpiOsMapMemory (
ACPI_PHYSICAL_ADDRESS where,
ACPI_SIZE length)
{
return (ACPI_TO_POINTER ((ACPI_SIZE) where));
}
/******************************************************************************
*
* FUNCTION: AcpiOsUnmapMemory
*
* PARAMETERS: where - Logical address of memory to be unmapped
* length - How much memory to unmap
*
* RETURN: None
*
* DESCRIPTION: Delete a previously created mapping. Where and Length must
* correspond to a previous mapping exactly.
*
*****************************************************************************/
void
AcpiOsCloseFile (
ACPI_FILE File)
AcpiOsUnmapMemory (
void *where,
ACPI_SIZE length)
{
fclose (File);
return;
}
/*******************************************************************************
/******************************************************************************
*
* FUNCTION: AcpiOsReadFile
* FUNCTION: Spinlock interfaces
*
* PARAMETERS: File - An open file descriptor
* Buffer - Data buffer
* Size - Data block size
* Count - Number of data blocks
* DESCRIPTION: No-op on single threaded BIOS
*
* RETURN: Number of bytes actually read.
*
* DESCRIPTION: Read from a file.
*
******************************************************************************/
*****************************************************************************/
int
AcpiOsReadFile (
ACPI_FILE File,
void *Buffer,
ACPI_SIZE Size,
ACPI_SIZE Count)
ACPI_STATUS
AcpiOsCreateLock (
ACPI_SPINLOCK *OutHandle)
{
int Length;
return (AE_OK);
}
void
AcpiOsDeleteLock (
ACPI_SPINLOCK Handle)
{
}
ACPI_CPU_FLAGS
AcpiOsAcquireLock (
ACPI_SPINLOCK Handle)
{
return (0);
}
void
AcpiOsReleaseLock (
ACPI_SPINLOCK Handle,
ACPI_CPU_FLAGS Flags)
{
}
Length = fread (Buffer, Size, Count, File);
if (Length < 0)
/******************************************************************************
*
* FUNCTION: AcpiOsAllocate
*
* PARAMETERS: Size - Amount to allocate, in bytes
*
* RETURN: Pointer to the new allocation. Null on error.
*
* DESCRIPTION: Allocate memory. Algorithm is dependent on the OS.
*
*****************************************************************************/
void *
AcpiOsAllocate (
ACPI_SIZE Size)
{
ACPI_EFI_STATUS EfiStatus;
void *Mem;
EfiStatus = uefi_call_wrapper (BS->AllocatePool, 3,
AcpiEfiLoaderData, Size, &Mem);
if (ACPI_EFI_ERROR (EfiStatus))
{
perror ("Error reading file");
fprintf (stderr,
"EFI_BOOT_SERVICES->AllocatePool(EfiLoaderData) failure.\n");
return (NULL);
}
return (Length);
return (Mem);
}
/*******************************************************************************
#ifdef USE_NATIVE_ALLOCATE_ZEROED
/******************************************************************************
*
* FUNCTION: AcpiOsWriteFile
* FUNCTION: AcpiOsAllocateZeroed
*
* PARAMETERS: File - An open file descriptor
* Buffer - Data buffer
* Size - Data block size
* Count - Number of data blocks
* PARAMETERS: Size - Amount to allocate, in bytes
*
* RETURN: Number of bytes actually written.
* RETURN: Pointer to the new allocation. Null on error.
*
* DESCRIPTION: Write to a file.
* DESCRIPTION: Allocate and zero memory. Algorithm is dependent on the OS.
*
******************************************************************************/
*****************************************************************************/
int
AcpiOsWriteFile (
ACPI_FILE File,
void *Buffer,
ACPI_SIZE Size,
ACPI_SIZE Count)
void *
AcpiOsAllocateZeroed (
ACPI_SIZE Size)
{
int Length;
void *Mem;
Length = fwrite (Buffer, Size, Count, File);
if (Length < 0)
Mem = AcpiOsAllocate (Size);
if (Mem)
{
perror ("Error writing file");
memset (Mem, 0, Size);
}
return (Length);
return (Mem);
}
#endif
/*******************************************************************************
/******************************************************************************
*
* FUNCTION: AcpiOsGetFileOffset
* FUNCTION: AcpiOsFree
*
* PARAMETERS: File - An open file descriptor
* PARAMETERS: Mem - Pointer to previously allocated memory
*
* RETURN: Current file pointer position.
* RETURN: None
*
* DESCRIPTION: Get current file offset.
* DESCRIPTION: Free memory allocated via AcpiOsAllocate
*
******************************************************************************/
*****************************************************************************/
long
AcpiOsGetFileOffset (
ACPI_FILE File)
void
AcpiOsFree (
void *Mem)
{
long Offset;
Offset = ftell (File);
return (Offset);
uefi_call_wrapper (BS->FreePool, 1, Mem);
}
/*******************************************************************************
/******************************************************************************
*
* FUNCTION: AcpiOsSetFileOffset
* FUNCTION: AcpiOsPrintf
*
* PARAMETERS: File - An open file descriptor
* Offset - New file offset
* From - From begin/end of file
* PARAMETERS: Format, ... - Standard printf format
*
* RETURN: None
*
* DESCRIPTION: Formatted output.
*
*****************************************************************************/
void ACPI_INTERNAL_VAR_XFACE
AcpiOsPrintf (
const char *Format,
...)
{
va_list Args;
va_start (Args, Format);
AcpiOsVprintf (Format, Args);
va_end (Args);
}
/******************************************************************************
*
* FUNCTION: AcpiOsVprintf
*
* PARAMETERS: Format - Standard printf format
* Args - Argument list
*
* RETURN: None
*
* DESCRIPTION: Formatted output with arguments list pointer.
*
*****************************************************************************/
void
AcpiOsVprintf (
const char *Format,
va_list Args)
{
(void) vfprintf (ACPI_FILE_OUT, Format, Args);
}
/******************************************************************************
*
* FUNCTION: AcpiOsInitialize
*
* PARAMETERS: None
*
* RETURN: Status
*
* DESCRIPTION: Set current file offset.
* DESCRIPTION: Initialize this module.
*
******************************************************************************/
*****************************************************************************/
ACPI_STATUS
AcpiOsSetFileOffset (
ACPI_FILE File,
long Offset,
UINT8 From)
AcpiOsInitialize (
void)
{
int Ret = 0;
if (From == ACPI_FILE_BEGIN)
{
Ret = fseek (File, Offset, SEEK_SET);
}
if (From == ACPI_FILE_END)
{
Ret = fseek (File, Offset, SEEK_END);
}
if (Ret < 0)
{
return (AE_ERROR);
}
else
{
return (AE_OK);
}
return (AE_OK);
}

View File

@ -136,9 +136,6 @@
ACPI_MODULE_NAME ("osunixxf")
BOOLEAN AcpiGbl_DebugTimeout = FALSE;
/* Upcalls to AcpiExec */
void

View File

@ -172,9 +172,6 @@ ACPI_OS_SEMAPHORE_INFO AcpiGbl_Semaphores[ACPI_OS_MAX_SEMAPHORES];
#endif /* ACPI_SINGLE_THREADED */
BOOLEAN AcpiGbl_DebugTimeout = FALSE;
/******************************************************************************
*
* FUNCTION: AcpiOsTerminate

View File

@ -114,7 +114,6 @@
*****************************************************************************/
#include "acpibin.h"
#include "acapps.h"
ACPI_TABLE_HEADER Header1;

View File

@ -115,7 +115,6 @@
#define _DECLARE_GLOBALS
#include "acpibin.h"
#include "acapps.h"
/* Local prototypes */

View File

@ -115,10 +115,7 @@
#include "acpi.h"
#include "accommon.h"
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include "acapps.h"
#define DB_CONSOLE_OUTPUT 0x02
#define ACPI_DB_REDIRECTABLE_OUTPUT 0x01

View File

@ -127,12 +127,7 @@
#include "acpi.h"
#include "accommon.h"
#include "actables.h"
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/stat.h>
#include "acapps.h"
/* Globals */
@ -145,12 +140,6 @@ EXTERN ACPI_FILE INIT_GLOBAL (Gbl_OutputFile, NULL);
EXTERN char INIT_GLOBAL (*Gbl_OutputFilename, NULL);
EXTERN UINT64 INIT_GLOBAL (Gbl_RsdpBase, 0);
/* Globals required for use with ACPICA modules */
#ifdef _DECLARE_GLOBALS
UINT8 AcpiGbl_IntegerByteWidth = 8;
#endif
/* Action table used to defer requested options */
typedef struct ap_dump_action

View File

@ -148,7 +148,7 @@ ApIsValidHeader (
if (!AcpiUtValidNameseg (Table->Signature))
{
AcpiLogError ("Table signature (0x%8.8X) is invalid\n",
fprintf (stderr, "Table signature (0x%8.8X) is invalid\n",
*(UINT32 *) Table->Signature);
return (FALSE);
}
@ -157,7 +157,7 @@ ApIsValidHeader (
if (Table->Length < sizeof (ACPI_TABLE_HEADER))
{
AcpiLogError ("Table length (0x%8.8X) is invalid\n",
fprintf (stderr, "Table length (0x%8.8X) is invalid\n",
Table->Length);
return (FALSE);
}
@ -203,7 +203,7 @@ ApIsValidChecksum (
if (ACPI_FAILURE (Status))
{
AcpiLogError ("%4.4s: Warning: wrong checksum in table\n",
fprintf (stderr, "%4.4s: Warning: wrong checksum in table\n",
Table->Signature);
}
@ -295,13 +295,13 @@ ApDumpTableBuffer (
* Note: simplest to just always emit a 64-bit address. AcpiXtract
* utility can handle this.
*/
AcpiUtFilePrintf (Gbl_OutputFile, "%4.4s @ 0x%8.8X%8.8X\n",
fprintf (Gbl_OutputFile, "%4.4s @ 0x%8.8X%8.8X\n",
Table->Signature, ACPI_FORMAT_UINT64 (Address));
AcpiUtDumpBufferToFile (Gbl_OutputFile,
ACPI_CAST_PTR (UINT8, Table), TableLength,
DB_BYTE_DISPLAY, 0);
AcpiUtFilePrintf (Gbl_OutputFile, "\n");
fprintf (Gbl_OutputFile, "\n");
return (0);
}
@ -346,13 +346,13 @@ ApDumpAllTables (
}
else if (i == 0)
{
AcpiLogError ("Could not get ACPI tables, %s\n",
fprintf (stderr, "Could not get ACPI tables, %s\n",
AcpiFormatException (Status));
return (-1);
}
else
{
AcpiLogError ("Could not get ACPI table at index %u, %s\n",
fprintf (stderr, "Could not get ACPI table at index %u, %s\n",
i, AcpiFormatException (Status));
continue;
}
@ -402,7 +402,7 @@ ApDumpTableByAddress (
ACPI_MAX64_BYTE_WIDTH, &LongAddress);
if (ACPI_FAILURE (Status))
{
AcpiLogError ("%s: Could not convert to a physical address\n",
fprintf (stderr, "%s: Could not convert to a physical address\n",
AsciiAddress);
return (-1);
}
@ -411,7 +411,7 @@ ApDumpTableByAddress (
Status = AcpiOsGetTableByAddress (Address, &Table);
if (ACPI_FAILURE (Status))
{
AcpiLogError ("Could not get table at 0x%8.8X%8.8X, %s\n",
fprintf (stderr, "Could not get table at 0x%8.8X%8.8X, %s\n",
ACPI_FORMAT_UINT64 (Address),
AcpiFormatException (Status));
return (-1);
@ -450,7 +450,7 @@ ApDumpTableByName (
if (strlen (Signature) != ACPI_NAME_SIZE)
{
AcpiLogError (
fprintf (stderr,
"Invalid table signature [%s]: must be exactly 4 characters\n",
Signature);
return (-1);
@ -487,7 +487,7 @@ ApDumpTableByName (
return (0);
}
AcpiLogError (
fprintf (stderr,
"Could not get ACPI table with signature [%s], %s\n",
LocalSignature, AcpiFormatException (Status));
return (-1);
@ -539,7 +539,7 @@ ApDumpTableFromFile (
if (!AcpiUtValidNameseg (Table->Signature))
{
AcpiLogError (
fprintf (stderr,
"No valid ACPI signature was found in input file %s\n",
Pathname);
}
@ -548,7 +548,7 @@ ApDumpTableFromFile (
if (Table->Length > FileSize)
{
AcpiLogError (
fprintf (stderr,
"Table length (0x%X) is too large for input file (0x%X) %s\n",
Table->Length, FileSize, Pathname);
goto Exit;
@ -556,7 +556,7 @@ ApDumpTableFromFile (
if (Gbl_VerboseMode)
{
AcpiLogError (
fprintf (stderr,
"Input file: %s contains table [%4.4s], 0x%X (%u) bytes\n",
Pathname, Table->Signature, FileSize, FileSize);
}

View File

@ -114,7 +114,6 @@
*****************************************************************************/
#include "acpidump.h"
#include "acapps.h"
/* Local prototypes */
@ -146,7 +145,7 @@ ApIsExistingFile (
if (!stat (Pathname, &StatInfo))
{
AcpiLogError ("Target path already exists, overwrite? [y|n] ");
fprintf (stderr, "Target path already exists, overwrite? [y|n] ");
if (getchar () != 'y')
{
@ -188,10 +187,10 @@ ApOpenOutputFile (
/* Point stdout to the file */
File = AcpiOsOpenFile (Pathname, ACPI_FILE_WRITING);
File = fopen (Pathname, "w");
if (!File)
{
AcpiLogError ("Could not open output file: %s\n", Pathname);
fprintf (stderr, "Could not open output file: %s\n", Pathname);
return (-1);
}
@ -225,7 +224,7 @@ ApWriteToBinaryFile (
char Filename[ACPI_NAME_SIZE + 16];
char InstanceStr [16];
ACPI_FILE File;
size_t Actual;
ACPI_SIZE Actual;
UINT32 TableLength;
@ -254,7 +253,7 @@ ApWriteToBinaryFile (
if (Instance > 0)
{
AcpiUtSnprintf (InstanceStr, sizeof (InstanceStr), "%u", Instance);
snprintf (InstanceStr, sizeof (InstanceStr), "%u", Instance);
strcat (Filename, InstanceStr);
}
@ -262,30 +261,29 @@ ApWriteToBinaryFile (
if (Gbl_VerboseMode)
{
AcpiLogError (
fprintf (stderr,
"Writing [%4.4s] to binary file: %s 0x%X (%u) bytes\n",
Table->Signature, Filename, Table->Length, Table->Length);
}
/* Open the file and dump the entire table in binary mode */
File = AcpiOsOpenFile (Filename,
ACPI_FILE_WRITING | ACPI_FILE_BINARY);
File = fopen (Filename, "wb");
if (!File)
{
AcpiLogError ("Could not open output file: %s\n", Filename);
fprintf (stderr, "Could not open output file: %s\n", Filename);
return (-1);
}
Actual = AcpiOsWriteFile (File, Table, 1, TableLength);
Actual = fwrite (Table, 1, TableLength, File);
if (Actual != TableLength)
{
AcpiLogError ("Error writing binary output file: %s\n", Filename);
AcpiOsCloseFile (File);
fprintf (stderr, "Error writing binary output file: %s\n", Filename);
fclose (File);
return (-1);
}
AcpiOsCloseFile (File);
fclose (File);
return (0);
}
@ -311,15 +309,15 @@ ApGetTableFromFile (
ACPI_TABLE_HEADER *Buffer = NULL;
ACPI_FILE File;
UINT32 FileSize;
size_t Actual;
ACPI_SIZE Actual;
/* Must use binary mode */
File = AcpiOsOpenFile (Pathname, ACPI_FILE_READING | ACPI_FILE_BINARY);
File = fopen (Pathname, "rb");
if (!File)
{
AcpiLogError ("Could not open input file: %s\n", Pathname);
fprintf (stderr, "Could not open input file: %s\n", Pathname);
return (NULL);
}
@ -328,7 +326,7 @@ ApGetTableFromFile (
FileSize = CmGetFileSize (File);
if (FileSize == ACPI_UINT32_MAX)
{
AcpiLogError (
fprintf (stderr,
"Could not get input file size: %s\n", Pathname);
goto Cleanup;
}
@ -338,18 +336,17 @@ ApGetTableFromFile (
Buffer = ACPI_ALLOCATE_ZEROED (FileSize);
if (!Buffer)
{
AcpiLogError (
fprintf (stderr,
"Could not allocate file buffer of size: %u\n", FileSize);
goto Cleanup;
}
/* Read the entire file */
Actual = AcpiOsReadFile (File, Buffer, 1, FileSize);
Actual = fread (Buffer, 1, FileSize, File);
if (Actual != FileSize)
{
AcpiLogError (
"Could not read input file: %s\n", Pathname);
fprintf (stderr, "Could not read input file: %s\n", Pathname);
ACPI_FREE (Buffer);
Buffer = NULL;
goto Cleanup;
@ -358,6 +355,6 @@ ApGetTableFromFile (
*OutFileSize = FileSize;
Cleanup:
AcpiOsCloseFile (File);
fclose (File);
return (Buffer);
}

View File

@ -115,7 +115,6 @@
#define _DECLARE_GLOBALS
#include "acpidump.h"
#include "acapps.h"
/*
@ -233,7 +232,7 @@ ApInsertAction (
CurrentAction++;
if (CurrentAction > AP_MAX_ACTIONS)
{
AcpiLogError ("Too many table options (max %u)\n", AP_MAX_ACTIONS);
fprintf (stderr, "Too many table options (max %u)\n", AP_MAX_ACTIONS);
return (-1);
}
@ -287,7 +286,7 @@ ApDoOptions (
}
else
{
AcpiLogError ("%s: Cannot handle this switch, please use on|off\n",
fprintf (stderr, "%s: Cannot handle this switch, please use on|off\n",
AcpiGbl_Optarg);
return (-1);
}
@ -313,7 +312,7 @@ ApDoOptions (
ACPI_MAX64_BYTE_WIDTH, &Gbl_RsdpBase);
if (ACPI_FAILURE (Status))
{
AcpiLogError ("%s: Could not convert to a physical address\n",
fprintf (stderr, "%s: Could not convert to a physical address\n",
AcpiGbl_Optarg);
return (-1);
}
@ -344,7 +343,7 @@ ApDoOptions (
case 'z': /* Verbose mode */
Gbl_VerboseMode = TRUE;
AcpiLogError (ACPI_COMMON_SIGNON (AP_UTILITY_NAME));
fprintf (stderr, ACPI_COMMON_SIGNON (AP_UTILITY_NAME));
continue;
/*
@ -427,6 +426,7 @@ acpi_main (
ACPI_DEBUG_INITIALIZE (); /* For debug version only */
AcpiOsInitialize ();
Gbl_OutputFile = ACPI_FILE_OUT;
AcpiGbl_IntegerByteWidth = 8;
/* Process command line options */
@ -469,7 +469,7 @@ acpi_main (
default:
AcpiLogError ("Internal error, invalid action: 0x%X\n",
fprintf (stderr, "Internal error, invalid action: 0x%X\n",
Action->ToBeDone);
return (-1);
}
@ -487,11 +487,11 @@ acpi_main (
/* Summary for the output file */
FileSize = CmGetFileSize (Gbl_OutputFile);
AcpiLogError ("Output file %s contains 0x%X (%u) bytes\n\n",
fprintf (stderr, "Output file %s contains 0x%X (%u) bytes\n\n",
Gbl_OutputFilename, FileSize, FileSize);
}
AcpiOsCloseFile (Gbl_OutputFile);
fclose (Gbl_OutputFile);
}
return (Status);

View File

@ -131,11 +131,6 @@
#include "amlresrc.h"
#include "acapps.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
/*
* Debug Regions

View File

@ -158,7 +158,8 @@ AeOpenInitializationFile (
InitFile = fopen (Filename, "r");
if (!InitFile)
{
perror ("Could not open initialization file");
fprintf (stderr,
"Could not open initialization file: %s\n", Filename);
return (-1);
}

View File

@ -114,7 +114,6 @@
*****************************************************************************/
#include "aecommon.h"
#include "errno.h"
#define _COMPONENT ACPI_TOOLS
ACPI_MODULE_NAME ("aemain")
@ -131,7 +130,6 @@
* Windows: The setargv.obj module must be linked in to automatically
* expand wildcards.
*/
extern BOOLEAN AcpiGbl_DebugTimeout;
/* Local prototypes */

View File

@ -121,17 +121,11 @@
#include "accommon.h"
#include "acapps.h"
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <ctype.h>
#include <string.h>
#ifdef WIN32
#include <io.h>
#include <direct.h>
#endif
#include <errno.h>
typedef enum

View File

@ -115,10 +115,7 @@
#include "acpi.h"
#include "accommon.h"
#include <stdio.h>
#include <sys/stat.h>
#include <errno.h>
#include "acapps.h"
/* mkdir support */

View File

@ -114,7 +114,6 @@
*****************************************************************************/
#include "acpisrc.h"
#include "acapps.h"
/* Local prototypes */

View File

@ -114,7 +114,6 @@
*****************************************************************************/
#include "acpisrc.h"
#include "acapps.h"
/* Local prototypes */

View File

@ -114,7 +114,6 @@
*****************************************************************************/
#include "acpisrc.h"
#include "acapps.h"
/******************************************************************************