Import ACPICA 20200528.

This commit is contained in:
Jung-uk Kim 2020-05-28 21:01:08 +00:00
parent a95d9dd0e2
commit 93207c1c89
19 changed files with 110 additions and 1774 deletions

View File

@ -1,9 +1,62 @@
----------------------------------------
28 May 2020. Summary of changes for version 20200528:
1) ACPICA kernel-resident subsystem:
Removed old/obsolete Visual Studio files which were used to build the
Windows versions of the ACPICA tools. Since we have moved to Visual
Studio 2017, we are no longer supporting Visual Studio 2006 and 2009
project files. The new subdirectory and solution file are located at:
acpica/generate/msvc2017/AcpiComponents.sln
2) iASL Compiler/Disassembler and ACPICA tools:
iASL: added support for a new OperationRegion Address Space (subtype):
PlatformRtMechanism. Support for this new keyword is being released for
early prototyping. It will appear in the next release of the ACPI
specification.
iASL: do not optimize the NameString parameter of the CondRefOf operator.
In the previous iASL compiler release, the NameString parameter of the
CondRefOf was optimized. There is evidence that some implementations of
the AML interpreter do not perform the recursive search-to-parent search
during the execution of the CondRefOf operator. Therefore, the CondRefOf
operator behaves differently when the NameString parameter is a single
name segment (a NameSeg) as opposed to a full NamePath (starting at the
root scope) or a NameString containing parent prefixes.
iASL: Prevent an inadvertent remark message. This change prevents a
remark if within a control method the following exist:
1) An Operation Region is defined, and
2) A Field operator is defined that refers to the region.
This happens because at the top level, the Field operator does not
actually create a new named object, it simply references the operation
region.
Removed support for the acpinames utility. The acpinames was a simple
utility used to populate and display the ACPI namespace without executing
any AML code. However, ACPICA now supports executable opcodes outside of
control methods. This means that executable AML opcodes such as If and
Store opcodes need to be executed during table load. Therefore, acpinames
would need to be updated to match the same behavior as the acpiexec
utility and since acpiexec can already dump the entire namespace (via the
'namespace' command), we no longer have the need to maintain acpinames.
In order to dump the contents of the ACPI namepsace using acpiexec,
execute the following command from the command line:
acpiexec -b "n" [aml files]
----------------------------------------
30 April 2020. Summary of changes for version 20200430:
1) ACPICA kernel-resident subsystem:
Cleaned up the coding style of a couple of global variables

View File

@ -217,7 +217,6 @@ generate_source_package ()
mkdir $TEMP_DIR/generate/unix/acpiexamples
mkdir $TEMP_DIR/generate/unix/acpiexec
mkdir $TEMP_DIR/generate/unix/acpihelp
mkdir $TEMP_DIR/generate/unix/acpinames
mkdir $TEMP_DIR/generate/unix/acpisrc
mkdir $TEMP_DIR/generate/unix/acpixtract
mkdir $TEMP_DIR/generate/unix/iasl
@ -264,7 +263,6 @@ generate_source_package ()
cp generate/unix/acpiexamples/Makefile $TEMP_DIR/generate/unix/acpiexamples
cp generate/unix/acpiexec/Makefile $TEMP_DIR/generate/unix/acpiexec
cp generate/unix/acpihelp/Makefile $TEMP_DIR/generate/unix/acpihelp
cp generate/unix/acpinames/Makefile $TEMP_DIR/generate/unix/acpinames
cp generate/unix/acpisrc/Makefile $TEMP_DIR/generate/unix/acpisrc
cp generate/unix/acpixtract/Makefile $TEMP_DIR/generate/unix/acpixtract
cp generate/unix/iasl/Makefile $TEMP_DIR/generate/unix/iasl
@ -295,11 +293,13 @@ generate_source_package ()
# Windows-specific activities
#
# Copy project files for MS Visual Studio 2008 (VC++ 9.0)
# Copy project files for MS Visual Studio 2017
mkdir $TEMP_DIR/generate/msvc9
cp -r generate/msvc9/*.sln $TEMP_DIR/generate/msvc9/
cp -r generate/msvc9/*.vcproj $TEMP_DIR/generate/msvc9/
mkdir $TEMP_DIR/generate/msvc2017
cp -r generate/msvc2017/*.sln $TEMP_DIR/generate/msvc2017/
cp -r generate/msvc2017/*.dsp $TEMP_DIR/generate/msvc2017/
cp -r generate/msvc2017/*.dsw $TEMP_DIR/generate/msvc2017/
cp -r generate/msvc2017/*.vcxproj $TEMP_DIR/generate/msvc2017/
build_windows_package
fi
@ -412,7 +412,6 @@ generate_binary_package()
cp libraries/acpidump.exe $TEMP_DIR
cp libraries/acpiexec.exe $TEMP_DIR
cp libraries/acpihelp.exe $TEMP_DIR
cp libraries/acpinames.exe $TEMP_DIR
cp libraries/acpisrc.exe $TEMP_DIR
cp libraries/acpixtract.exe $TEMP_DIR
cp libraries/iasl.exe $TEMP_DIR

View File

@ -2,8 +2,8 @@
# Makefile.config
#
# Common configuration and setup file to generate the ACPICA tools and
# utilities: the iASL compiler, acpiexec, acpihelp, acpinames, acpisrc,
# acpixtract, acpibin.
# utilities: the iASL compiler, acpiexec, acpihelp, acpisrc, acpixtract,
# acpibin.
#
# This file is included by the individual makefiles for each tool.
#
@ -33,7 +33,7 @@
# not be necessary to change it.
#
.SUFFIXES :
PROGS = acpibin acpidump acpiexamples acpiexec acpihelp acpinames acpisrc acpixtract iasl
PROGS = acpibin acpidump acpiexamples acpiexec acpihelp acpisrc acpixtract iasl
ACPI_HOST ?= _CYGWIN
CC ?= gcc
@ -129,7 +129,6 @@ ACPIDUMP = $(ACPICA_TOOLS)/acpidump
ACPIEXAMPLES = $(ACPICA_TOOLS)/examples
ACPIEXEC = $(ACPICA_TOOLS)/acpiexec
ACPIHELP = $(ACPICA_TOOLS)/acpihelp
ACPINAMES = $(ACPICA_TOOLS)/acpinames
ACPISRC = $(ACPICA_TOOLS)/acpisrc
ACPIXTRACT = $(ACPICA_TOOLS)/acpixtract
ASL_COMPILER = $(ACPICA_SRC)/compiler

View File

@ -1,178 +0,0 @@
#
# acpinames - Load ACPI table and dump namespace. This is a subset
# of the AcpiExec functionality, it is intended to demonstrate
# the configurability of ACPICA.
#
#
# Note: This makefile is intended to be used from within the native
# ACPICA directory structure, from under generate/unix. It specifically
# places all object files in a generate/unix subdirectory, not within
# the various ACPICA source directories. This prevents collisions
# between different compilations of the same source file with different
# compile options, and prevents pollution of the source code.
#
include ../Makefile.config
FINAL_PROG = ../$(BINDIR)/acpinames
PROG = $(OBJDIR)/acpinames
#
# Search paths for source files
#
vpath %.c \
$(ACPINAMES)\
$(ACPICA_DISPATCHER)\
$(ACPICA_EVENTS)\
$(ACPICA_EXECUTER)\
$(ACPICA_HARDWARE)\
$(ACPICA_NAMESPACE)\
$(ACPICA_PARSER)\
$(ACPICA_TABLES)\
$(ACPICA_UTILITIES)\
$(ACPICA_COMMON)\
$(ACPICA_OSL)
HEADERS = \
$(wildcard $(ACPINAMES)/*.h)
OBJECTS = \
$(OBJDIR)/acfileio.o\
$(OBJDIR)/anmain.o\
$(OBJDIR)/anstubs.o\
$(OBJDIR)/antables.o\
$(OBJDIR)/cmfsize.o\
$(OBJDIR)/dscontrol.o\
$(OBJDIR)/dsdebug.o\
$(OBJDIR)/dsfield.o\
$(OBJDIR)/dsinit.o\
$(OBJDIR)/dsmethod.o\
$(OBJDIR)/dsmthdat.o\
$(OBJDIR)/dsobject.o\
$(OBJDIR)/dsopcode.o\
$(OBJDIR)/dspkginit.o\
$(OBJDIR)/dsutils.o\
$(OBJDIR)/dswexec.o\
$(OBJDIR)/dswload.o\
$(OBJDIR)/dswload2.o\
$(OBJDIR)/dswscope.o\
$(OBJDIR)/dswstate.o\
$(OBJDIR)/evhandler.o\
$(OBJDIR)/evmisc.o\
$(OBJDIR)/evregion.o\
$(OBJDIR)/evrgnini.o\
$(OBJDIR)/evxfregn.o\
$(OBJDIR)/exconcat.o\
$(OBJDIR)/exconfig.o\
$(OBJDIR)/exconvrt.o\
$(OBJDIR)/excreate.o\
$(OBJDIR)/exdump.o\
$(OBJDIR)/exfield.o\
$(OBJDIR)/exfldio.o\
$(OBJDIR)/exmisc.o\
$(OBJDIR)/exmutex.o\
$(OBJDIR)/exnames.o\
$(OBJDIR)/exoparg1.o\
$(OBJDIR)/exoparg2.o\
$(OBJDIR)/exoparg3.o\
$(OBJDIR)/exoparg6.o\
$(OBJDIR)/exprep.o\
$(OBJDIR)/exregion.o\
$(OBJDIR)/exresnte.o\
$(OBJDIR)/exresolv.o\
$(OBJDIR)/exresop.o\
$(OBJDIR)/exserial.o\
$(OBJDIR)/exstore.o\
$(OBJDIR)/exstoren.o\
$(OBJDIR)/exstorob.o\
$(OBJDIR)/exsystem.o\
$(OBJDIR)/exutils.o\
$(OBJDIR)/getopt.o\
$(OBJDIR)/hwpci.o\
$(OBJDIR)/hwvalid.o\
$(OBJDIR)/nsaccess.o\
$(OBJDIR)/nsalloc.o\
$(OBJDIR)/nsarguments.o\
$(OBJDIR)/nsconvert.o\
$(OBJDIR)/nsdump.o\
$(OBJDIR)/nseval.o\
$(OBJDIR)/nsinit.o\
$(OBJDIR)/nsload.o\
$(OBJDIR)/nsnames.o\
$(OBJDIR)/nsobject.o\
$(OBJDIR)/nsparse.o\
$(OBJDIR)/nspredef.o\
$(OBJDIR)/nsprepkg.o\
$(OBJDIR)/nsrepair.o\
$(OBJDIR)/nsrepair2.o\
$(OBJDIR)/nssearch.o\
$(OBJDIR)/nsutils.o\
$(OBJDIR)/nswalk.o\
$(OBJDIR)/nsxfeval.o\
$(OBJDIR)/nsxfname.o\
$(OBJDIR)/nsxfobj.o\
$(OBJDIR)/osunixxf.o\
$(OBJDIR)/psargs.o\
$(OBJDIR)/psloop.o\
$(OBJDIR)/psobject.o\
$(OBJDIR)/psopcode.o\
$(OBJDIR)/psopinfo.o\
$(OBJDIR)/psparse.o\
$(OBJDIR)/psscope.o\
$(OBJDIR)/pstree.o\
$(OBJDIR)/psutils.o\
$(OBJDIR)/pswalk.o\
$(OBJDIR)/psxface.o\
$(OBJDIR)/tbdata.o\
$(OBJDIR)/tbfadt.o\
$(OBJDIR)/tbfind.o\
$(OBJDIR)/tbinstal.o\
$(OBJDIR)/tbprint.o\
$(OBJDIR)/tbutils.o\
$(OBJDIR)/tbxface.o\
$(OBJDIR)/tbxfload.o\
$(OBJDIR)/tbxfroot.o\
$(OBJDIR)/utaddress.o\
$(OBJDIR)/utalloc.o\
$(OBJDIR)/utascii.o\
$(OBJDIR)/utbuffer.o\
$(OBJDIR)/utcache.o\
$(OBJDIR)/utcopy.o\
$(OBJDIR)/utdebug.o\
$(OBJDIR)/utdecode.o\
$(OBJDIR)/utdelete.o\
$(OBJDIR)/uterror.o\
$(OBJDIR)/uteval.o\
$(OBJDIR)/utexcep.o\
$(OBJDIR)/utglobal.o\
$(OBJDIR)/uthex.o\
$(OBJDIR)/utids.o\
$(OBJDIR)/utinit.o\
$(OBJDIR)/utlock.o\
$(OBJDIR)/utmath.o\
$(OBJDIR)/utmisc.o\
$(OBJDIR)/utmutex.o\
$(OBJDIR)/utnonansi.o\
$(OBJDIR)/utobject.o\
$(OBJDIR)/utosi.o\
$(OBJDIR)/utownerid.o\
$(OBJDIR)/utpredef.o\
$(OBJDIR)/utresrc.o\
$(OBJDIR)/utstate.o\
$(OBJDIR)/utstring.o\
$(OBJDIR)/utstrsuppt.o\
$(OBJDIR)/utstrtoul64.o\
$(OBJDIR)/utxface.o\
$(OBJDIR)/utxferror.o\
$(OBJDIR)/utxfinit.o
#
# Flags specific to acpinames utility
#
CFLAGS += \
-DACPI_NAMES_APP\
-I$(ACPINAMES)
#
# Common Rules
#
include ../Makefile.rules

View File

@ -693,6 +693,7 @@ NamePathTail [.]{NameSeg}
"GeneralPurposeIo" { count (0); return (PARSEOP_REGIONSPACE_GPIO); } /* ACPI 5.0 */
"GenericSerialBus" { count (0); return (PARSEOP_REGIONSPACE_GSBUS); } /* ACPI 5.0 */
"PCC" { count (0); return (PARSEOP_REGIONSPACE_PCC); } /* ACPI 5.0 */
"PlatformRtMechanism" { count (0); return (PARSEOP_REGIONSPACE_PRM); }
"FFixedHW" { count (0); return (PARSEOP_REGIONSPACE_FFIXEDHW); }
/* ResourceTypeKeyword: Resource Usage - Resource Descriptors */

View File

@ -394,6 +394,7 @@ RegionSpaceKeyword
| PARSEOP_REGIONSPACE_GPIO {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_GPIO);}
| PARSEOP_REGIONSPACE_GSBUS {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_GSBUS);}
| PARSEOP_REGIONSPACE_PCC {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_PCC);}
| PARSEOP_REGIONSPACE_PRM {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_PRM);}
| PARSEOP_REGIONSPACE_FFIXEDHW {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_FFIXEDHW);}
;

View File

@ -485,6 +485,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
/* REGIONSPACE_PCC */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_PLATFORM_COMM, 0, 0),
/* REGIONSPACE_PCI */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_PCI_CONFIG, 0, 0),
/* REGIONSPACE_PCIBAR */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_PCI_BAR_TARGET, 0, 0),
/* REGIONSPACE_PRM */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_PLATFORM_RT, 0, 0),
/* REGIONSPACE_SMBUS */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_SMBUS, 0, 0),
/* REGISTER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* RELEASE */ OP_TABLE_ENTRY (AML_RELEASE_OP, 0, 0, 0),

View File

@ -724,7 +724,7 @@ MtCheckNamedObjectInMethod (
}
OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode);
if (OpInfo->Class == AML_CLASS_NAMED_OBJECT)
if ((OpInfo->Class == AML_CLASS_NAMED_OBJECT) && (Op->Asl.AmlOpcode != AML_FIELD_OP))
{
/*
* 1) Mark the method as a method that creates named objects.
@ -739,6 +739,9 @@ MtCheckNamedObjectInMethod (
* Reason: If a thread blocks within the method for any reason, and
* another thread enters the method, the method will fail because
* an attempt will be made to create the same object twice.
*
* Note: The Field opcode is disallowed here because Field() does not
* create a new named object.
*/
ExternalPath = AcpiNsGetNormalizedPathname (MethodInfo->Op->Asl.Node, TRUE);

View File

@ -422,6 +422,7 @@ NoEcho('
%token <i> PARSEOP_REGIONSPACE_PCC
%token <i> PARSEOP_REGIONSPACE_PCI
%token <i> PARSEOP_REGIONSPACE_PCIBAR
%token <i> PARSEOP_REGIONSPACE_PRM
%token <i> PARSEOP_REGIONSPACE_SMBUS
%token <i> PARSEOP_REGISTER
%token <i> PARSEOP_RELEASE

View File

@ -821,9 +821,24 @@ XfNamespaceLocateBegin (
Node->Flags |= ANOBJ_IS_REFERENCED;
}
/* Attempt to optimize the NamePath */
OptOptimizeNamePath (Op, OpInfo->Flags, WalkState, Path, Node);
/*
* Attempt to optimize the NamePath
*
* One special case: CondRefOf operator - not all AML interpreter
* implementations expect optimized namepaths as a parameter to this
* operator. They require relative name paths with prefix operators or
* namepaths starting with the root scope.
*
* Other AML interpreter implementations do not perform the namespace
* search that starts at the current scope and recursively searching the
* parent scope until the root scope. The lack of search is only known to
* occur for the namestring parameter for the CondRefOf operator.
*/
if ((Op->Asl.Parent) &&
(Op->Asl.Parent->Asl.ParseOpcode != PARSEOP_CONDREFOF))
{
OptOptimizeNamePath (Op, OpInfo->Flags, WalkState, Path, Node);
}
/*
* 1) Dereference an alias (A name reference that is an alias)

View File

@ -204,6 +204,8 @@ static ACPI_ADR_SPACE_TYPE AcpiGbl_SpaceIdList[] =
ACPI_ADR_SPACE_IPMI,
ACPI_ADR_SPACE_GPIO,
ACPI_ADR_SPACE_GSBUS,
ACPI_ADR_SPACE_PLATFORM_COMM,
ACPI_ADR_SPACE_PLATFORM_RT,
ACPI_ADR_SPACE_DATA_TABLE,
ACPI_ADR_SPACE_FIXED_HARDWARE
};

View File

@ -214,17 +214,18 @@ const UINT8 AcpiGbl_NsProperties[ACPI_NUM_NS_TYPES] =
const char *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS] =
{
"SystemMemory", /* 0x00 */
"SystemIO", /* 0x01 */
"PCI_Config", /* 0x02 */
"EmbeddedControl", /* 0x03 */
"SMBus", /* 0x04 */
"SystemCMOS", /* 0x05 */
"PCIBARTarget", /* 0x06 */
"IPMI", /* 0x07 */
"GeneralPurposeIo", /* 0x08 */
"GenericSerialBus", /* 0x09 */
"PCC" /* 0x0A */
"SystemMemory", /* 0x00 */
"SystemIO", /* 0x01 */
"PCI_Config", /* 0x02 */
"EmbeddedControl", /* 0x03 */
"SMBus", /* 0x04 */
"SystemCMOS", /* 0x05 */
"PCIBARTarget", /* 0x06 */
"IPMI", /* 0x07 */
"GeneralPurposeIo", /* 0x08 */
"GenericSerialBus", /* 0x09 */
"PCC", /* 0x0A */
"PlatformRtMechanism" /* 0x0B */
};

View File

@ -154,7 +154,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
#define ACPI_CA_VERSION 0x20200430
#define ACPI_CA_VERSION 0x20200528
#include "acconfig.h"
#include "actypes.h"

View File

@ -968,8 +968,9 @@ typedef UINT8 ACPI_ADR_SPACE_TYPE;
#define ACPI_ADR_SPACE_GPIO (ACPI_ADR_SPACE_TYPE) 8
#define ACPI_ADR_SPACE_GSBUS (ACPI_ADR_SPACE_TYPE) 9
#define ACPI_ADR_SPACE_PLATFORM_COMM (ACPI_ADR_SPACE_TYPE) 10
#define ACPI_ADR_SPACE_PLATFORM_RT (ACPI_ADR_SPACE_TYPE) 11
#define ACPI_NUM_PREDEFINED_REGIONS 11
#define ACPI_NUM_PREDEFINED_REGIONS 12
/*
* Special Address Spaces

View File

@ -192,7 +192,6 @@ static ACPI_STATUS
OslReadTableFromFile (
char *Filename,
ACPI_SIZE FileOffset,
char *Signature,
ACPI_TABLE_HEADER **Table);
static ACPI_STATUS
@ -1490,8 +1489,6 @@ OslTableNameFromFile (
*
* PARAMETERS: Filename - File that contains the desired table
* FileOffset - Offset of the table in file
* Signature - Optional ACPI Signature for desired table.
* A null terminated 4-character string.
* Table - Where a pointer to the table is returned
*
* RETURN: Status; Table buffer is returned if AE_OK.
@ -1504,7 +1501,6 @@ static ACPI_STATUS
OslReadTableFromFile (
char *Filename,
ACPI_SIZE FileOffset,
char *Signature,
ACPI_TABLE_HEADER **Table)
{
FILE *TableFile;
@ -1536,6 +1532,8 @@ OslReadTableFromFile (
goto Exit;
}
#ifdef ACPI_OBSOLETE_FUNCTIONS
/* If signature is specified, it must match the table */
if (Signature)
@ -1557,6 +1555,7 @@ OslReadTableFromFile (
goto Exit;
}
}
#endif
TableLength = ApGetTableLength (&Header);
if (TableLength == 0)
@ -1688,7 +1687,7 @@ OslGetCustomizedTable (
/* There is no physical address saved for customized tables, use zero */
*Address = 0;
Status = OslReadTableFromFile (TableFilename, 0, NULL, Table);
Status = OslReadTableFromFile (TableFilename, 0, Table);
return (Status);
}

View File

@ -1,174 +0,0 @@
/******************************************************************************
*
* Module Name: acpinames.h - Common include for AcpiNames utility
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp.
* All rights reserved.
*
* 2. License
*
* 2.1. This is your license from Intel Corp. under its intellectual property
* rights. You may have additional license terms from the party that provided
* you this software, covering your right to use that party's intellectual
* property rights.
*
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
* copy of the source code appearing in this file ("Covered Code") an
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
* base code distributed originally by Intel ("Original Intel Code") to copy,
* make derivatives, distribute, use and display any portion of the Covered
* Code in any form, with the right to sublicense such rights; and
*
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
* license (with the right to sublicense), under only those claims of Intel
* patents that are infringed by the Original Intel Code, to make, use, sell,
* offer to sell, and import the Covered Code and derivative works thereof
* solely to the minimum extent necessary to exercise the above copyright
* license, and in no event shall the patent license extend to any additions
* to or modifications of the Original Intel Code. No other license or right
* is granted directly or by implication, estoppel or otherwise;
*
* The above copyright and patent license is granted only if the following
* conditions are met:
*
* 3. Conditions
*
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
* Redistribution of source code of any substantial portion of the Covered
* Code or modification with rights to further distribute source must include
* the above Copyright Notice, the above License, this list of Conditions,
* and the following Disclaimer and Export Compliance provision. In addition,
* Licensee must cause all Covered Code to which Licensee contributes to
* contain a file documenting the changes Licensee made to create that Covered
* Code and the date of any change. Licensee must include in that file the
* documentation of any changes made by any predecessor Licensee. Licensee
* must include a prominent statement that the modification is derived,
* directly or indirectly, from Original Intel Code.
*
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
* Redistribution of source code of any substantial portion of the Covered
* Code or modification without rights to further distribute source must
* include the following Disclaimer and Export Compliance provision in the
* documentation and/or other materials provided with distribution. In
* addition, Licensee may not authorize further sublicense of source of any
* portion of the Covered Code, and must include terms to the effect that the
* license from Licensee to its licensee is limited to the intellectual
* property embodied in the software Licensee provides to its licensee, and
* not to intellectual property embodied in modifications its licensee may
* make.
*
* 3.3. Redistribution of Executable. Redistribution in executable form of any
* substantial portion of the Covered Code or modification must reproduce the
* above Copyright Notice, and the following Disclaimer and Export Compliance
* provision in the documentation and/or other materials provided with the
* distribution.
*
* 3.4. Intel retains all right, title, and interest in and to the Original
* Intel Code.
*
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
* Intel shall be used in advertising or otherwise to promote the sale, use or
* other dealings in products derived from or relating to the Covered Code
* without prior written authorization from Intel.
*
* 4. Disclaimer and Export Compliance
*
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
* PARTICULAR PURPOSE.
*
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
* LIMITED REMEDY.
*
* 4.3. Licensee shall not export, either directly or indirectly, any of this
* software or system incorporating such software without first obtaining any
* required license or other approval from the U. S. Department of Commerce or
* any other agency or department of the United States Government. In the
* event Licensee exports any such software from the United States or
* re-exports any such software from a foreign destination, Licensee shall
* ensure that the distribution and export/re-export of the software is in
* compliance with all laws, regulations, orders, or other restrictions of the
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
* any of its subsidiaries will export/re-export any technical data, process,
* software, or service, directly or indirectly, to any country for which the
* United States government or any agency thereof requires an export license,
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#ifndef _ACPINAMES_H
#define _ACPINAMES_H
#include "acpi.h"
#include "accommon.h"
#include "acapps.h"
#include "acutils.h"
#include "acnamesp.h"
#include "actables.h"
#include "acinterp.h"
#include <stdio.h>
#define ACPI_MAX_INIT_TABLES (32)
extern BOOLEAN AcpiGbl_NsLoadOnly;
ACPI_STATUS
AnBuildLocalTables (
ACPI_NEW_TABLE_DESC *TableList);
#endif

View File

@ -1,416 +0,0 @@
/******************************************************************************
*
* Module Name: anmain - Main routine for the AcpiNames utility
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp.
* All rights reserved.
*
* 2. License
*
* 2.1. This is your license from Intel Corp. under its intellectual property
* rights. You may have additional license terms from the party that provided
* you this software, covering your right to use that party's intellectual
* property rights.
*
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
* copy of the source code appearing in this file ("Covered Code") an
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
* base code distributed originally by Intel ("Original Intel Code") to copy,
* make derivatives, distribute, use and display any portion of the Covered
* Code in any form, with the right to sublicense such rights; and
*
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
* license (with the right to sublicense), under only those claims of Intel
* patents that are infringed by the Original Intel Code, to make, use, sell,
* offer to sell, and import the Covered Code and derivative works thereof
* solely to the minimum extent necessary to exercise the above copyright
* license, and in no event shall the patent license extend to any additions
* to or modifications of the Original Intel Code. No other license or right
* is granted directly or by implication, estoppel or otherwise;
*
* The above copyright and patent license is granted only if the following
* conditions are met:
*
* 3. Conditions
*
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
* Redistribution of source code of any substantial portion of the Covered
* Code or modification with rights to further distribute source must include
* the above Copyright Notice, the above License, this list of Conditions,
* and the following Disclaimer and Export Compliance provision. In addition,
* Licensee must cause all Covered Code to which Licensee contributes to
* contain a file documenting the changes Licensee made to create that Covered
* Code and the date of any change. Licensee must include in that file the
* documentation of any changes made by any predecessor Licensee. Licensee
* must include a prominent statement that the modification is derived,
* directly or indirectly, from Original Intel Code.
*
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
* Redistribution of source code of any substantial portion of the Covered
* Code or modification without rights to further distribute source must
* include the following Disclaimer and Export Compliance provision in the
* documentation and/or other materials provided with distribution. In
* addition, Licensee may not authorize further sublicense of source of any
* portion of the Covered Code, and must include terms to the effect that the
* license from Licensee to its licensee is limited to the intellectual
* property embodied in the software Licensee provides to its licensee, and
* not to intellectual property embodied in modifications its licensee may
* make.
*
* 3.3. Redistribution of Executable. Redistribution in executable form of any
* substantial portion of the Covered Code or modification must reproduce the
* above Copyright Notice, and the following Disclaimer and Export Compliance
* provision in the documentation and/or other materials provided with the
* distribution.
*
* 3.4. Intel retains all right, title, and interest in and to the Original
* Intel Code.
*
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
* Intel shall be used in advertising or otherwise to promote the sale, use or
* other dealings in products derived from or relating to the Covered Code
* without prior written authorization from Intel.
*
* 4. Disclaimer and Export Compliance
*
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
* PARTICULAR PURPOSE.
*
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
* LIMITED REMEDY.
*
* 4.3. Licensee shall not export, either directly or indirectly, any of this
* software or system incorporating such software without first obtaining any
* required license or other approval from the U. S. Department of Commerce or
* any other agency or department of the United States Government. In the
* event Licensee exports any such software from the United States or
* re-exports any such software from a foreign destination, Licensee shall
* ensure that the distribution and export/re-export of the software is in
* compliance with all laws, regulations, orders, or other restrictions of the
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
* any of its subsidiaries will export/re-export any technical data, process,
* software, or service, directly or indirectly, to any country for which the
* United States government or any agency thereof requires an export license,
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpinames.h"
#include "actables.h"
#include "errno.h"
#define _COMPONENT ACPI_TOOLS
ACPI_MODULE_NAME ("anmain")
/* Local prototypes */
static int
AnDumpEntireNamespace (
ACPI_NEW_TABLE_DESC *ListHead);
/*
* Main routine for the ACPI user-space namespace utility.
*
* Portability note: The utility depends upon the host for command-line
* wildcard support - it is not implemented locally. For example:
*
* Linux/Unix systems: Shell expands wildcards automatically.
*
* Windows: The setargv.obj module must be linked in to automatically
* expand wildcards.
*/
BOOLEAN AcpiGbl_NsLoadOnly = FALSE;
#define AN_UTILITY_NAME "ACPI Namespace Dump Utility"
#define AN_SUPPORTED_OPTIONS "?hlv^x:"
/******************************************************************************
*
* FUNCTION: usage
*
* PARAMETERS: None
*
* RETURN: None
*
* DESCRIPTION: Print a usage message
*
*****************************************************************************/
static void
usage (
void)
{
ACPI_USAGE_HEADER ("AcpiNames [options] AMLfile");
ACPI_OPTION ("-?", "Display this message");
ACPI_OPTION ("-l", "Load namespace only, no display");
ACPI_OPTION ("-v", "Display version information");
ACPI_OPTION ("-vd", "Display build date and time");
ACPI_OPTION ("-x <DebugLevel>", "Debug output level");
}
/******************************************************************************
*
* FUNCTION: main
*
* PARAMETERS: argc, argv
*
* RETURN: Status (pass/fail)
*
* DESCRIPTION: Main routine for NsDump utility
*
*****************************************************************************/
int ACPI_SYSTEM_XFACE
main (
int argc,
char **argv)
{
ACPI_NEW_TABLE_DESC *ListHead = NULL;
ACPI_STATUS Status;
int j;
ACPI_DEBUG_INITIALIZE (); /* For debug version only */
/* Init debug globals and ACPICA */
AcpiDbgLevel = ACPI_NORMAL_DEFAULT | ACPI_LV_TABLES;
AcpiDbgLayer = 0xFFFFFFFF;
/* Set flags so that the interpreter is not used */
Status = AcpiInitializeSubsystem ();
ACPI_CHECK_OK (AcpiInitializeSubsystem, Status);
if (ACPI_FAILURE (Status))
{
return (-1);
}
printf (ACPI_COMMON_SIGNON (AN_UTILITY_NAME));
if (argc < 2)
{
usage ();
return (0);
}
/* Get the command line options */
while ((j = AcpiGetopt (argc, argv, AN_SUPPORTED_OPTIONS)) != ACPI_OPT_END) switch(j)
{
case 'l':
AcpiGbl_NsLoadOnly = TRUE;
break;
case 'v':
switch (AcpiGbl_Optarg[0])
{
case '^': /* -v: (Version): signon already emitted, just exit */
exit (0);
case 'd':
printf (ACPI_COMMON_BUILD_TIME);
return (0);
default:
printf ("Unknown option: -v%s\n", AcpiGbl_Optarg);
return (-1);
}
break;
case 'x':
AcpiDbgLevel = strtoul (AcpiGbl_Optarg, NULL, 0);
printf ("Debug Level: 0x%8.8X\n", AcpiDbgLevel);
break;
case '?':
case 'h':
default:
usage();
return (0);
}
/* Get each of the ACPI table files on the command line */
while (argv[AcpiGbl_Optind])
{
/* Get all ACPI AML tables in this file */
Status = AcGetAllTablesFromFile (argv[AcpiGbl_Optind],
ACPI_GET_ALL_TABLES, &ListHead);
if (ACPI_FAILURE (Status))
{
return (-1);
}
AcpiGbl_Optind++;
}
printf ("\n");
/*
* The next argument is the filename for the DSDT or SSDT.
* Open the file, build namespace and dump it.
*/
return (AnDumpEntireNamespace (ListHead));
}
/******************************************************************************
*
* FUNCTION: AnDumpEntireNamespace
*
* PARAMETERS: AmlFilename - Filename for DSDT or SSDT AML table
*
* RETURN: Status (pass/fail)
*
* DESCRIPTION: Build an ACPI namespace for the input AML table, and dump the
* formatted namespace contents.
*
*****************************************************************************/
static int
AnDumpEntireNamespace (
ACPI_NEW_TABLE_DESC *ListHead)
{
ACPI_STATUS Status;
ACPI_HANDLE Handle;
/*
* Build a local XSDT with all tables. Normally, here is where the
* RSDP search is performed to find the ACPI tables
*/
Status = AnBuildLocalTables (ListHead);
if (ACPI_FAILURE (Status))
{
return (-1);
}
/* Initialize table manager, get XSDT */
Status = AcpiInitializeTables (NULL, ACPI_MAX_INIT_TABLES, TRUE);
if (ACPI_FAILURE (Status))
{
printf ("**** Could not initialize ACPI table manager, %s\n",
AcpiFormatException (Status));
return (-1);
}
/* Build the namespace from the tables */
Status = AcpiLoadTables ();
if (Status == AE_CTRL_TERMINATE)
{
/* At least one table load failed -- terminate with error */
return (-1);
}
if (ACPI_FAILURE (Status))
{
printf ("**** While creating namespace, %s\n",
AcpiFormatException (Status));
return (-1);
}
if (AcpiGbl_NsLoadOnly)
{
printf ("**** Namespace successfully loaded\n");
return (0);
}
/*
* NOTE:
* We don't need to do any further ACPICA initialization, since we don't
* have any hardware, nor is the interpreter configured.
*
* Namely, we don't need these calls:
* AcpiEnableSubsystem
* AcpiInitializeObjects
*/
/*
* Perform a namespace walk to dump the contents
*/
AcpiOsPrintf ("\nACPI Namespace:\n");
AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY,
ACPI_UINT32_MAX, ACPI_OWNER_ID_MAX, AcpiGbl_RootNode);
/* Example: get a handle to the _GPE scope */
Status = AcpiGetHandle (NULL, "\\_GPE", &Handle);
ACPI_CHECK_OK (AcpiGetHandle, Status);
AcDeleteTableList (ListHead);
return (0);
}

View File

@ -1,508 +0,0 @@
/******************************************************************************
*
* Module Name: anstubs - Stub routines for the AcpiNames utility
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp.
* All rights reserved.
*
* 2. License
*
* 2.1. This is your license from Intel Corp. under its intellectual property
* rights. You may have additional license terms from the party that provided
* you this software, covering your right to use that party's intellectual
* property rights.
*
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
* copy of the source code appearing in this file ("Covered Code") an
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
* base code distributed originally by Intel ("Original Intel Code") to copy,
* make derivatives, distribute, use and display any portion of the Covered
* Code in any form, with the right to sublicense such rights; and
*
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
* license (with the right to sublicense), under only those claims of Intel
* patents that are infringed by the Original Intel Code, to make, use, sell,
* offer to sell, and import the Covered Code and derivative works thereof
* solely to the minimum extent necessary to exercise the above copyright
* license, and in no event shall the patent license extend to any additions
* to or modifications of the Original Intel Code. No other license or right
* is granted directly or by implication, estoppel or otherwise;
*
* The above copyright and patent license is granted only if the following
* conditions are met:
*
* 3. Conditions
*
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
* Redistribution of source code of any substantial portion of the Covered
* Code or modification with rights to further distribute source must include
* the above Copyright Notice, the above License, this list of Conditions,
* and the following Disclaimer and Export Compliance provision. In addition,
* Licensee must cause all Covered Code to which Licensee contributes to
* contain a file documenting the changes Licensee made to create that Covered
* Code and the date of any change. Licensee must include in that file the
* documentation of any changes made by any predecessor Licensee. Licensee
* must include a prominent statement that the modification is derived,
* directly or indirectly, from Original Intel Code.
*
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
* Redistribution of source code of any substantial portion of the Covered
* Code or modification without rights to further distribute source must
* include the following Disclaimer and Export Compliance provision in the
* documentation and/or other materials provided with distribution. In
* addition, Licensee may not authorize further sublicense of source of any
* portion of the Covered Code, and must include terms to the effect that the
* license from Licensee to its licensee is limited to the intellectual
* property embodied in the software Licensee provides to its licensee, and
* not to intellectual property embodied in modifications its licensee may
* make.
*
* 3.3. Redistribution of Executable. Redistribution in executable form of any
* substantial portion of the Covered Code or modification must reproduce the
* above Copyright Notice, and the following Disclaimer and Export Compliance
* provision in the documentation and/or other materials provided with the
* distribution.
*
* 3.4. Intel retains all right, title, and interest in and to the Original
* Intel Code.
*
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
* Intel shall be used in advertising or otherwise to promote the sale, use or
* other dealings in products derived from or relating to the Covered Code
* without prior written authorization from Intel.
*
* 4. Disclaimer and Export Compliance
*
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
* PARTICULAR PURPOSE.
*
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
* LIMITED REMEDY.
*
* 4.3. Licensee shall not export, either directly or indirectly, any of this
* software or system incorporating such software without first obtaining any
* required license or other approval from the U. S. Department of Commerce or
* any other agency or department of the United States Government. In the
* event Licensee exports any such software from the United States or
* re-exports any such software from a foreign destination, Licensee shall
* ensure that the distribution and export/re-export of the software is in
* compliance with all laws, regulations, orders, or other restrictions of the
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
* any of its subsidiaries will export/re-export any technical data, process,
* software, or service, directly or indirectly, to any country for which the
* United States government or any agency thereof requires an export license,
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpinames.h"
#include <acutils.h>
#include <acevents.h>
#include <acdispat.h>
#define _COMPONENT ACPI_TOOLS
ACPI_MODULE_NAME ("anstubs")
/******************************************************************************
*
* DESCRIPTION: Stubs used to facilitate linkage of the NsDump utility.
*
*****************************************************************************/
/* Utilities */
#ifdef ACPI_OBSOLETE_FUNCTIONS
ACPI_STATUS
AcpiUtCopyIobjectToEobject (
ACPI_OPERAND_OBJECT *Obj,
ACPI_BUFFER *RetBuffer)
{
ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED,
"Stubbed function"));
return (AE_NOT_IMPLEMENTED);
}
ACPI_STATUS
AcpiUtCopyEobjectToIobject (
ACPI_OBJECT *Obj,
ACPI_OPERAND_OBJECT **InternalObj)
{
ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED,
"Stubbed function"));
return (AE_NOT_IMPLEMENTED);
}
ACPI_STATUS
AcpiUtCopyIobjectToIobject (
ACPI_OPERAND_OBJECT *SourceDesc,
ACPI_OPERAND_OBJECT **DestDesc,
ACPI_WALK_STATE *WalkState)
{
ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED,
"Stubbed function"));
return (AE_NOT_IMPLEMENTED);
}
#endif
/* Hardware */
UINT32
AcpiHwGetMode (
void)
{
return (0);
}
/* Event manager */
#ifdef ACPI_OBSOLETE_FUNCTIONS
ACPI_STATUS
AcpiEvInstallRegionHandlers (
void)
{
return (AE_OK);
}
ACPI_STATUS
AcpiEvInitializeOpRegions (
void)
{
return (AE_OK);
}
ACPI_STATUS
AcpiEvInitializeRegion (
ACPI_OPERAND_OBJECT *RegionObj)
{
return (AE_OK);
}
#endif
ACPI_STATUS
AcpiEvInstallXruptHandlers (
void)
{
return (AE_OK);
}
ACPI_STATUS
AcpiEvInitializeEvents (
void)
{
return (AE_OK);
}
/* AML Interpreter */
#ifdef ACPI_OBSOLETE_FUNCTIONS
ACPI_STATUS
AcpiExReadDataFromField (
ACPI_WALK_STATE *WalkState,
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_OPERAND_OBJECT **RetBufferDesc)
{
ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED,
"Stubbed function"));
return (AE_NOT_IMPLEMENTED);
}
ACPI_STATUS
AcpiExWriteDataToField (
ACPI_OPERAND_OBJECT *SourceDesc,
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_OPERAND_OBJECT **ResultDesc)
{
ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED,
"Stubbed function"));
return (AE_NOT_IMPLEMENTED);
}
ACPI_STATUS
AcpiExStoreObjectToNode (
ACPI_OPERAND_OBJECT *SourceDesc,
ACPI_NAMESPACE_NODE *Node,
ACPI_WALK_STATE *WalkState,
UINT8 ImplicitConversion)
{
ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED,
"Stubbed function"));
return (AE_NOT_IMPLEMENTED);
}
/* Namespace manager */
ACPI_STATUS
AcpiNsEvaluate (
ACPI_EVALUATE_INFO *Info)
{
ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED,
"Stubbed function"));
return (AE_NOT_IMPLEMENTED);
}
#endif
void
AcpiExDoDebugObject (
ACPI_OPERAND_OBJECT *SourceDesc,
UINT32 Level,
UINT32 Index)
{
return;
}
void
AcpiExStartTraceMethod (
ACPI_NAMESPACE_NODE *MethodNode,
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_WALK_STATE *WalkState)
{
return;
}
void
AcpiExStopTraceMethod (
ACPI_NAMESPACE_NODE *MethodNode,
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_WALK_STATE *WalkState)
{
return;
}
void
AcpiExStartTraceOpcode (
ACPI_PARSE_OBJECT *Op,
ACPI_WALK_STATE *WalkState)
{
return;
}
void
AcpiExStopTraceOpcode (
ACPI_PARSE_OBJECT *Op,
ACPI_WALK_STATE *WalkState)
{
return;
}
void
AcpiExTracePoint (
ACPI_TRACE_EVENT_TYPE Type,
BOOLEAN Begin,
UINT8 *Aml,
char *Pathname)
{
return;
}
/* Dispatcher */
#ifdef ACPI_OBSOLETE_FUNCTIONS
ACPI_STATUS
AcpiDsAutoSerializeMethod (
ACPI_NAMESPACE_NODE *Node,
ACPI_OPERAND_OBJECT *ObjDesc)
{
return (AE_OK);
}
ACPI_STATUS
AcpiDsInitializeRegion (
ACPI_HANDLE ObjHandle)
{
return (AE_OK);
}
ACPI_STATUS
AcpiDsCallControlMethod (
ACPI_THREAD_STATE *Thread,
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op)
{
ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED,
"Stubbed function"));
return (AE_NOT_IMPLEMENTED);
}
ACPI_STATUS
AcpiDsRestartControlMethod (
ACPI_WALK_STATE *WalkState,
ACPI_OPERAND_OBJECT *ReturnDesc)
{
ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED,
"Stubbed function"));
return (AE_NOT_IMPLEMENTED);
}
void
AcpiDsTerminateControlMethod (
ACPI_OPERAND_OBJECT *MethodDesc,
ACPI_WALK_STATE *WalkState)
{
}
ACPI_STATUS
AcpiDsMethodError (
ACPI_STATUS Status,
ACPI_WALK_STATE *WalkState)
{
ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED,
"Stubbed function"));
return (AE_NOT_IMPLEMENTED);
}
ACPI_STATUS
AcpiDsBeginMethodExecution (
ACPI_NAMESPACE_NODE *MethodNode,
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_WALK_STATE *WalkState)
{
ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED,
"Stubbed function"));
return (AE_NOT_IMPLEMENTED);
}
ACPI_STATUS
AcpiDsGetPredicateValue (
ACPI_WALK_STATE *WalkState,
ACPI_OPERAND_OBJECT *ResultObj)
{
ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED,
"Stubbed function"));
return (AE_NOT_IMPLEMENTED);
}
#endif
ACPI_STATUS
AcpiDsGetBufferFieldArguments (
ACPI_OPERAND_OBJECT *ObjDesc)
{
return (AE_OK);
}
ACPI_STATUS
AcpiDsGetBankFieldArguments (
ACPI_OPERAND_OBJECT *ObjDesc)
{
return (AE_OK);
}
ACPI_STATUS
AcpiDsGetRegionArguments (
ACPI_OPERAND_OBJECT *RgnDesc)
{
return (AE_OK);
}
ACPI_STATUS
AcpiDsGetBufferArguments (
ACPI_OPERAND_OBJECT *ObjDesc)
{
return (AE_OK);
}
ACPI_STATUS
AcpiDsGetPackageArguments (
ACPI_OPERAND_OBJECT *ObjDesc)
{
return (AE_OK);
}
#ifdef ACPI_OBSOLETE_FUNCTIONS
ACPI_STATUS
AcpiDsExecBeginOp (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT **OutOp)
{
ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED,
"Stubbed function"));
return (AE_NOT_IMPLEMENTED);
}
ACPI_STATUS
AcpiDsExecEndOp (
ACPI_WALK_STATE *State)
{
ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED,
"Stubbed function"));
return (AE_NOT_IMPLEMENTED);
}
#endif

View File

@ -1,464 +0,0 @@
/******************************************************************************
*
* Module Name: antables - ACPI table setup/install for AcpiNames utility
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp.
* All rights reserved.
*
* 2. License
*
* 2.1. This is your license from Intel Corp. under its intellectual property
* rights. You may have additional license terms from the party that provided
* you this software, covering your right to use that party's intellectual
* property rights.
*
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
* copy of the source code appearing in this file ("Covered Code") an
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
* base code distributed originally by Intel ("Original Intel Code") to copy,
* make derivatives, distribute, use and display any portion of the Covered
* Code in any form, with the right to sublicense such rights; and
*
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
* license (with the right to sublicense), under only those claims of Intel
* patents that are infringed by the Original Intel Code, to make, use, sell,
* offer to sell, and import the Covered Code and derivative works thereof
* solely to the minimum extent necessary to exercise the above copyright
* license, and in no event shall the patent license extend to any additions
* to or modifications of the Original Intel Code. No other license or right
* is granted directly or by implication, estoppel or otherwise;
*
* The above copyright and patent license is granted only if the following
* conditions are met:
*
* 3. Conditions
*
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
* Redistribution of source code of any substantial portion of the Covered
* Code or modification with rights to further distribute source must include
* the above Copyright Notice, the above License, this list of Conditions,
* and the following Disclaimer and Export Compliance provision. In addition,
* Licensee must cause all Covered Code to which Licensee contributes to
* contain a file documenting the changes Licensee made to create that Covered
* Code and the date of any change. Licensee must include in that file the
* documentation of any changes made by any predecessor Licensee. Licensee
* must include a prominent statement that the modification is derived,
* directly or indirectly, from Original Intel Code.
*
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
* Redistribution of source code of any substantial portion of the Covered
* Code or modification without rights to further distribute source must
* include the following Disclaimer and Export Compliance provision in the
* documentation and/or other materials provided with distribution. In
* addition, Licensee may not authorize further sublicense of source of any
* portion of the Covered Code, and must include terms to the effect that the
* license from Licensee to its licensee is limited to the intellectual
* property embodied in the software Licensee provides to its licensee, and
* not to intellectual property embodied in modifications its licensee may
* make.
*
* 3.3. Redistribution of Executable. Redistribution in executable form of any
* substantial portion of the Covered Code or modification must reproduce the
* above Copyright Notice, and the following Disclaimer and Export Compliance
* provision in the documentation and/or other materials provided with the
* distribution.
*
* 3.4. Intel retains all right, title, and interest in and to the Original
* Intel Code.
*
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
* Intel shall be used in advertising or otherwise to promote the sale, use or
* other dealings in products derived from or relating to the Covered Code
* without prior written authorization from Intel.
*
* 4. Disclaimer and Export Compliance
*
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
* PARTICULAR PURPOSE.
*
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
* LIMITED REMEDY.
*
* 4.3. Licensee shall not export, either directly or indirectly, any of this
* software or system incorporating such software without first obtaining any
* required license or other approval from the U. S. Department of Commerce or
* any other agency or department of the United States Government. In the
* event Licensee exports any such software from the United States or
* re-exports any such software from a foreign destination, Licensee shall
* ensure that the distribution and export/re-export of the software is in
* compliance with all laws, regulations, orders, or other restrictions of the
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
* any of its subsidiaries will export/re-export any technical data, process,
* software, or service, directly or indirectly, to any country for which the
* United States government or any agency thereof requires an export license,
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpinames.h"
#define _COMPONENT ACPI_TOOLS
ACPI_MODULE_NAME ("antables")
/* Local prototypes */
static void
AnInitializeTableHeader (
ACPI_TABLE_HEADER *Header,
char *Signature,
UINT32 Length);
/* Non-AML tables that are constructed locally and installed */
static ACPI_TABLE_RSDP LocalRSDP;
static ACPI_TABLE_FACS LocalFACS;
/*
* We need a local FADT so that the hardware subcomponent will function,
* even though the underlying OSD HW access functions don't do anything.
*/
static ACPI_TABLE_FADT LocalFADT;
/*
* Use XSDT so that both 32- and 64-bit versions of this utility will
* function automatically.
*/
static ACPI_TABLE_XSDT *LocalXSDT;
#define BASE_XSDT_TABLES 1
#define BASE_XSDT_SIZE (sizeof (ACPI_TABLE_XSDT) + \
((BASE_XSDT_TABLES -1) * sizeof (UINT64)))
/******************************************************************************
*
* FUNCTION: AnInitializeTableHeader
*
* PARAMETERS: Header - A valid standard ACPI table header
* Signature - Signature to insert
* Length - Length of the table
*
* RETURN: None. Header is modified.
*
* DESCRIPTION: Initialize the table header for a local ACPI table.
*
*****************************************************************************/
static void
AnInitializeTableHeader (
ACPI_TABLE_HEADER *Header,
char *Signature,
UINT32 Length)
{
ACPI_COPY_NAMESEG (Header->Signature, Signature);
Header->Length = Length;
Header->OemRevision = 0x1001;
memcpy (Header->OemId, "Intel ", ACPI_OEM_ID_SIZE);
memcpy (Header->OemTableId, "AcpiExec", ACPI_OEM_TABLE_ID_SIZE);
ACPI_COPY_NAMESEG (Header->AslCompilerId, "INTL");
Header->AslCompilerRevision = ACPI_CA_VERSION;
/* Set the checksum, must set to zero first */
Header->Checksum = 0;
Header->Checksum = (UINT8) -AcpiTbChecksum (
(void *) Header, Header->Length);
}
/******************************************************************************
*
* FUNCTION: AnBuildLocalTables
*
* PARAMETERS: TableCount - Number of tables on the command line
* TableList - List of actual tables from files
*
* RETURN: Status
*
* DESCRIPTION: Build a complete ACPI table chain, with a local RSDP, XSDT,
* FADT, FACS, and the input DSDT/SSDT.
*
*****************************************************************************/
ACPI_STATUS
AnBuildLocalTables (
ACPI_NEW_TABLE_DESC *TableList)
{
UINT32 TableCount = 0;
ACPI_PHYSICAL_ADDRESS DsdtAddress = 0;
UINT32 XsdtSize;
ACPI_NEW_TABLE_DESC *NextTable;
UINT32 NextIndex;
ACPI_TABLE_FADT *ExternalFadt = NULL;
/*
* Update the table count. For the DSDT, it is not put into the XSDT.
* For the FADT, this table is already accounted for since we usually
* install a local FADT.
*/
NextTable = TableList;
while (NextTable)
{
if (!ACPI_COMPARE_NAMESEG (NextTable->Table->Signature, ACPI_SIG_DSDT) &&
!ACPI_COMPARE_NAMESEG (NextTable->Table->Signature, ACPI_SIG_FADT))
{
TableCount++;
}
NextTable = NextTable->Next;
}
XsdtSize = BASE_XSDT_SIZE + (TableCount * sizeof (UINT64));
/* Build an XSDT */
LocalXSDT = AcpiOsAllocate (XsdtSize);
if (!LocalXSDT)
{
return (AE_NO_MEMORY);
}
memset (LocalXSDT, 0, XsdtSize);
LocalXSDT->TableOffsetEntry[0] = ACPI_PTR_TO_PHYSADDR (&LocalFADT);
/*
* Install the user tables. The DSDT must be installed in the FADT.
* All other tables are installed directly into the XSDT.
*
* Note: The tables are loaded in reverse order from the incoming
* input, which makes it match the command line order.
*/
NextIndex = BASE_XSDT_TABLES;
NextTable = TableList;
while (NextTable)
{
/*
* Incoming DSDT or FADT are special cases. All other tables are
* just immediately installed into the XSDT.
*/
if (ACPI_COMPARE_NAMESEG (NextTable->Table->Signature, ACPI_SIG_DSDT))
{
if (DsdtAddress)
{
printf ("Already found a DSDT, only one allowed\n");
return (AE_ALREADY_EXISTS);
}
/* The incoming user table is a DSDT */
DsdtAddress = ACPI_PTR_TO_PHYSADDR (NextTable->Table);
}
else if (ACPI_COMPARE_NAMESEG (NextTable->Table->Signature, ACPI_SIG_FADT))
{
ExternalFadt =
ACPI_CAST_PTR (ACPI_TABLE_FADT, NextTable->Table);
LocalXSDT->TableOffsetEntry[0] =
ACPI_PTR_TO_PHYSADDR (NextTable->Table);
}
else
{
/* Install the table in the XSDT */
LocalXSDT->TableOffsetEntry[TableCount - NextIndex + 1] =
ACPI_PTR_TO_PHYSADDR (NextTable->Table);
NextIndex++;
}
NextTable = NextTable->Next;
}
/* Build an RSDP. Contains a valid XSDT only, no RSDT */
memset (&LocalRSDP, 0, sizeof (ACPI_TABLE_RSDP));
ACPI_MAKE_RSDP_SIG (LocalRSDP.Signature);
memcpy (LocalRSDP.OemId, "Intel", 6);
LocalRSDP.Revision = 2;
LocalRSDP.XsdtPhysicalAddress = ACPI_PTR_TO_PHYSADDR (LocalXSDT);
LocalRSDP.Length = sizeof (ACPI_TABLE_XSDT);
/* Set checksums for both XSDT and RSDP */
AnInitializeTableHeader ((void *) LocalXSDT, ACPI_SIG_XSDT, XsdtSize);
LocalRSDP.Checksum = 0;
LocalRSDP.Checksum = (UINT8) -AcpiTbChecksum (
(void *) &LocalRSDP, ACPI_RSDP_CHECKSUM_LENGTH);
if (!DsdtAddress)
{
return (AE_SUPPORT);
}
/*
* Build an FADT. There are two options for the FADT:
* 1) Incoming external FADT specified on the command line
* 2) A fully featured local FADT
*/
memset (&LocalFADT, 0, sizeof (ACPI_TABLE_FADT));
if (ExternalFadt)
{
/*
* Use the external FADT, but we must update the DSDT/FACS
* addresses as well as the checksum
*/
ExternalFadt->Dsdt = (UINT32) DsdtAddress;
ExternalFadt->Facs = ACPI_PTR_TO_PHYSADDR (&LocalFACS);
/*
* If there room in the FADT for the XDsdt and XFacs 64-bit
* pointers, use them.
*/
if (ExternalFadt->Header.Length > ACPI_PTR_DIFF (
&ExternalFadt->XDsdt, ExternalFadt))
{
ExternalFadt->Dsdt = 0;
ExternalFadt->Facs = 0;
ExternalFadt->XDsdt = DsdtAddress;
ExternalFadt->XFacs = ACPI_PTR_TO_PHYSADDR (&LocalFACS);
}
/* Complete the external FADT with the checksum */
ExternalFadt->Header.Checksum = 0;
ExternalFadt->Header.Checksum = (UINT8) -AcpiTbChecksum (
(void *) ExternalFadt, ExternalFadt->Header.Length);
}
else
{
/*
* Build a local FADT so we can test the hardware/event init
*/
LocalFADT.Header.Revision = 5;
/* Setup FADT header and DSDT/FACS addresses */
LocalFADT.Dsdt = 0;
LocalFADT.Facs = 0;
LocalFADT.XDsdt = DsdtAddress;
LocalFADT.XFacs = ACPI_PTR_TO_PHYSADDR (&LocalFACS);
/* Miscellaneous FADT fields */
LocalFADT.Gpe0BlockLength = 16;
LocalFADT.Gpe0Block = 0x00001234;
LocalFADT.Gpe1BlockLength = 6;
LocalFADT.Gpe1Block = 0x00005678;
LocalFADT.Gpe1Base = 96;
LocalFADT.Pm1EventLength = 4;
LocalFADT.Pm1aEventBlock = 0x00001aaa;
LocalFADT.Pm1bEventBlock = 0x00001bbb;
LocalFADT.Pm1ControlLength = 2;
LocalFADT.Pm1aControlBlock = 0xB0;
LocalFADT.PmTimerLength = 4;
LocalFADT.PmTimerBlock = 0xA0;
LocalFADT.Pm2ControlBlock = 0xC0;
LocalFADT.Pm2ControlLength = 1;
/* Setup one example X-64 field */
LocalFADT.XPm1bEventBlock.SpaceId = ACPI_ADR_SPACE_SYSTEM_IO;
LocalFADT.XPm1bEventBlock.Address = LocalFADT.Pm1bEventBlock;
LocalFADT.XPm1bEventBlock.BitWidth = (UINT8)
ACPI_MUL_8 (LocalFADT.Pm1EventLength);
}
AnInitializeTableHeader ((void *) &LocalFADT,
ACPI_SIG_FADT, sizeof (ACPI_TABLE_FADT));
/* Build a FACS */
memset (&LocalFACS, 0, sizeof (ACPI_TABLE_FACS));
ACPI_COPY_NAMESEG (LocalFACS.Signature, ACPI_SIG_FACS);
LocalFACS.Length = sizeof (ACPI_TABLE_FACS);
LocalFACS.GlobalLock = 0x11AA0011;
return (AE_OK);
}
/******************************************************************************
*
* FUNCTION: AcpiOsGetRootPointer
*
* PARAMETERS: None
*
* RETURN: Address of the RSDP
*
* DESCRIPTION: Return a local RSDP, used to dynamically load tables via the
* standard ACPI mechanism.
*
*****************************************************************************/
ACPI_PHYSICAL_ADDRESS
AcpiOsGetRootPointer (
void)
{
return (ACPI_PTR_TO_PHYSADDR (&LocalRSDP));
}