/******************************************************************************
*
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2016, Intel Corp.
* All rights reserved.
*
* 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.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* 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 MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES.
*/
#define EXPORT_ACPI_INTERFACES
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
#include "actables.h"
#include "acevents.h"
ACPI_MODULE_NAME ("tbxfload")
/*******************************************************************************
*
* FUNCTION: AcpiLoadTables
*
* PARAMETERS: None
*
* RETURN: Status
*
*
******************************************************************************/
void)
{
/*
* Install the default operation region handlers. These are the
* handlers that are defined by the ACPI specification to be
* "always accessible" -- namely, SystemMemory, SystemIO, and
* PCI_Config. This also means that no _REG methods need to be
* run for these address spaces. We need to have these handlers
* installed before any AML code can be executed, especially any
* module-level code (11/2015).
* Note that we allow OSPMs to install their own region handlers
* between AcpiInitializeSubsystem() and AcpiLoadTables() to use
* their customized default region handlers.
*/
if (ACPI_FAILURE (Status))
{
}
/* Load the namespace from the tables */
Status = AcpiTbLoadNamespace ();
/* Don't let single failures abort the load */
if (Status == AE_CTRL_TERMINATE)
{
}
if (ACPI_FAILURE (Status))
{
"While loading namespace from ACPI tables"));
}
{
/*
* Initialize the objects that remain uninitialized. This
* runs the executable AML that may be part of the
* declaration of these objects:
* OperationRegions, BufferFields, Buffers, and Packages.
*/
if (ACPI_FAILURE (Status))
{
}
}
}
/*******************************************************************************
*
* FUNCTION: AcpiTbLoadNamespace
*
* PARAMETERS: None
*
* RETURN: Status
*
*
******************************************************************************/
void)
{
UINT32 i;
(void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
/*
* Load the namespace. The DSDT is required, but any SSDT and
* PSDT tables are optional. Verify the DSDT.
*/
{
goto UnlockAndExit;
}
/*
* Save the DSDT pointer for simple access. This is the mapped memory
* address. We must take care here because the address of the .Tables
* array can change dynamically as tables are loaded at run-time. Note:
* .Pointer field is not validated until after call to AcpiTbValidateTable.
*/
/*
* Optionally copy the entire DSDT to local memory (instead of simply
* mapping it.) There are some BIOSs that corrupt or replace the original
* DSDT, creating the need for this option. Default is FALSE, do not copy
* the DSDT.
*/
{
if (NewDsdt)
{
}
}
/*
* Save the original DSDT header for detection of table corruption
*/
sizeof (ACPI_TABLE_HEADER));
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
/* Load and parse tables */
if (ACPI_FAILURE (Status))
{
TablesFailed++;
}
else
{
TablesLoaded++;
}
/* Load any SSDT or PSDT tables. Note: Loop leaves tables locked */
(void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i)
{
{
continue;
}
/* Ignore errors while loading tables, get as many as possible */
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
if (ACPI_FAILURE (Status))
{
TablesFailed++;
"Table [%4.4s:%8.8s] (id FF) - Table namespace load failed\n\n",
}
else
{
TablesLoaded++;
}
(void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
}
if (!TablesFailed)
{
ACPI_INFO ((
"%u ACPI AML tables successfully acquired and loaded\n",
TablesLoaded));
}
else
{
"%u table load failures, %u successful",
/* Indicate at least one failure */
}
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
}
/*******************************************************************************
*
* FUNCTION: AcpiInstallTable
*
* PARAMETERS: Address - Address of the ACPI table to be installed.
* Physical - Whether the address is a physical table
* address or not
*
* RETURN: Status
*
* DESCRIPTION: Dynamically install an ACPI table.
* Note: This function should only be invoked after
* AcpiInitializeTables() and before AcpiLoadTables().
*
******************************************************************************/
{
if (Physical)
{
}
else
{
}
}
/*******************************************************************************
*
* FUNCTION: AcpiLoadTable
*
* PARAMETERS: Table - Pointer to a buffer containing the ACPI
* table to be loaded.
*
* RETURN: Status
*
* DESCRIPTION: Dynamically load an ACPI table from the caller's buffer. Must
* be a valid ACPI table with a valid ACPI table header.
* Note1: Mainly intended to support hotplug addition of SSDTs.
* Note2: Does not copy the incoming table. User is responsible
* to ensure that the table is not deleted or unmapped.
*
******************************************************************************/
{
/* Parameter validation */
if (!Table)
{
}
/* Must acquire the interpreter lock during this operation */
if (ACPI_FAILURE (Status))
{
}
/* Install the table and load it into the namespace */
ACPI_INFO (("Host-directed Dynamic ACPI Table Load:"));
(void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
&TableIndex);
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
if (ACPI_FAILURE (Status))
{
goto UnlockAndExit;
}
/*
* Note: Now table is "INSTALLED", it must be validated before
* using.
*/
if (ACPI_FAILURE (Status))
{
goto UnlockAndExit;
}
/* Invoke table handler if present */
if (AcpiGbl_TableHandler)
{
}
(void) AcpiUtReleaseMutex (ACPI_MTX_INTERPRETER);
}
/*******************************************************************************
*
* FUNCTION: AcpiUnloadParentTable
*
* PARAMETERS: Object - Handle to any namespace object owned by
* the table to be unloaded
*
* RETURN: Status
*
* DESCRIPTION: Via any namespace object within an SSDT or OEMx table, unloads
* the table and deletes all namespace objects associated with
* that table. Unloading of the DSDT is not allowed.
* Note: Mainly intended to support hotplug removal of SSDTs.
*
******************************************************************************/
{
UINT32 i;
/* Parameter validation */
if (!Object)
{
}
/*
* The node OwnerId is currently the same as the parent table ID.
* However, this could change in the future.
*/
if (!OwnerId)
{
/* OwnerId==0 means DSDT is the owner. DSDT cannot be unloaded */
}
/* Must acquire the interpreter lock during this operation */
if (ACPI_FAILURE (Status))
{
}
/* Find the table in the global table list */
for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++)
{
{
continue;
}
/*
* Allow unload of SSDT and OEMx tables only. Do not allow unload
* of the DSDT. No other types of tables should get here, since
* only these types can contain AML and thus are the only types
* that can create namespace objects.
*/
if (ACPI_COMPARE_NAME (
{
break;
}
/* Ensure the table is actually loaded */
if (!AcpiTbIsTableLoaded (i))
{
break;
}
/* Invoke table handler if present */
if (AcpiGbl_TableHandler)
{
}
/*
* Delete all namespace objects owned by this table. Note that
* these objects can appear anywhere in the namespace by virtue
* of the AML "Scope" operator. Thus, we need to track ownership
* by an ID, not simply a position within the hierarchy.
*/
if (ACPI_FAILURE (Status))
{
break;
}
Status = AcpiTbReleaseOwnerId (i);
break;
}
(void) AcpiUtReleaseMutex (ACPI_MTX_INTERPRETER);
}