2000-10-28 05:01:06 +00:00
|
|
|
/******************************************************************************
|
|
|
|
*
|
|
|
|
* Module Name: tbinstal - ACPI table installation and removal
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
|
|
|
|
2011-01-13 16:12:34 +00:00
|
|
|
/*
|
2013-01-17 21:32:03 +00:00
|
|
|
* Copyright (C) 2000 - 2013, Intel Corp.
|
2000-12-21 06:56:46 +00:00
|
|
|
* All rights reserved.
|
2000-10-28 05:01:06 +00:00
|
|
|
*
|
2011-01-13 16:12:34 +00:00
|
|
|
* 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.
|
|
|
|
*/
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
#define __TBINSTAL_C__
|
|
|
|
|
2009-06-01 19:24:26 +00:00
|
|
|
#include "acpi.h"
|
2009-06-01 21:02:40 +00:00
|
|
|
#include "accommon.h"
|
2009-06-01 19:24:26 +00:00
|
|
|
#include "acnamesp.h"
|
|
|
|
#include "actables.h"
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
|
2001-05-29 19:52:40 +00:00
|
|
|
#define _COMPONENT ACPI_TABLES
|
2002-02-23 05:10:40 +00:00
|
|
|
ACPI_MODULE_NAME ("tbinstal")
|
|
|
|
|
2005-11-01 22:11:18 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
/******************************************************************************
|
2002-02-23 05:10:40 +00:00
|
|
|
*
|
2007-03-22 17:24:05 +00:00
|
|
|
* FUNCTION: AcpiTbVerifyTable
|
2002-02-23 05:10:40 +00:00
|
|
|
*
|
2007-03-22 17:24:05 +00:00
|
|
|
* PARAMETERS: TableDesc - table
|
2002-02-23 05:10:40 +00:00
|
|
|
*
|
|
|
|
* RETURN: Status
|
|
|
|
*
|
2007-03-22 17:24:05 +00:00
|
|
|
* DESCRIPTION: this function is called to verify and map table
|
2002-02-23 05:10:40 +00:00
|
|
|
*
|
2007-03-22 17:24:05 +00:00
|
|
|
*****************************************************************************/
|
2002-02-23 05:10:40 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
ACPI_STATUS
|
|
|
|
AcpiTbVerifyTable (
|
|
|
|
ACPI_TABLE_DESC *TableDesc)
|
2002-02-23 05:10:40 +00:00
|
|
|
{
|
2007-03-22 17:24:05 +00:00
|
|
|
ACPI_STATUS Status = AE_OK;
|
2002-02-23 05:10:40 +00:00
|
|
|
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
ACPI_FUNCTION_TRACE (TbVerifyTable);
|
2002-02-23 05:10:40 +00:00
|
|
|
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
/* Map the table if necessary */
|
2005-11-01 22:11:18 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
if (!TableDesc->Pointer)
|
2002-02-23 05:10:40 +00:00
|
|
|
{
|
2007-03-22 17:24:05 +00:00
|
|
|
if ((TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK) ==
|
|
|
|
ACPI_TABLE_ORIGIN_MAPPED)
|
2002-07-30 19:33:39 +00:00
|
|
|
{
|
2009-06-01 21:02:40 +00:00
|
|
|
TableDesc->Pointer = AcpiOsMapMemory (
|
|
|
|
TableDesc->Address, TableDesc->Length);
|
2002-07-30 19:33:39 +00:00
|
|
|
}
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
if (!TableDesc->Pointer)
|
2002-02-23 05:10:40 +00:00
|
|
|
{
|
2007-03-22 17:24:05 +00:00
|
|
|
return_ACPI_STATUS (AE_NO_MEMORY);
|
|
|
|
}
|
|
|
|
}
|
2002-02-23 05:10:40 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
/* FACS is the odd table, has no standard ACPI header and no checksum */
|
2002-02-23 05:10:40 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
if (!ACPI_COMPARE_NAME (&TableDesc->Signature, ACPI_SIG_FACS))
|
|
|
|
{
|
|
|
|
/* Always calculate checksum, ignore bad checksum if requested */
|
2002-02-23 05:10:40 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
Status = AcpiTbVerifyChecksum (TableDesc->Pointer, TableDesc->Length);
|
2002-02-23 05:10:40 +00:00
|
|
|
}
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
return_ACPI_STATUS (Status);
|
2002-02-23 05:10:40 +00:00
|
|
|
}
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
*
|
2007-03-22 17:24:05 +00:00
|
|
|
* FUNCTION: AcpiTbAddTable
|
2000-10-28 05:01:06 +00:00
|
|
|
*
|
2007-03-22 17:24:05 +00:00
|
|
|
* PARAMETERS: TableDesc - Table descriptor
|
|
|
|
* TableIndex - Where the table index is returned
|
2000-10-28 05:01:06 +00:00
|
|
|
*
|
|
|
|
* RETURN: Status
|
|
|
|
*
|
2009-06-01 21:02:40 +00:00
|
|
|
* DESCRIPTION: This function is called to add an ACPI table. It is used to
|
|
|
|
* dynamically load tables via the Load and LoadTable AML
|
|
|
|
* operators.
|
2000-10-28 05:01:06 +00:00
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
ACPI_STATUS
|
2007-03-22 17:24:05 +00:00
|
|
|
AcpiTbAddTable (
|
|
|
|
ACPI_TABLE_DESC *TableDesc,
|
2009-06-01 21:02:40 +00:00
|
|
|
UINT32 *TableIndex)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
2009-06-01 21:02:40 +00:00
|
|
|
UINT32 i;
|
2007-03-22 17:24:05 +00:00
|
|
|
ACPI_STATUS Status = AE_OK;
|
2005-11-01 22:11:18 +00:00
|
|
|
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
ACPI_FUNCTION_TRACE (TbAddTable);
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
if (!TableDesc->Pointer)
|
2002-02-23 05:10:40 +00:00
|
|
|
{
|
2007-03-22 17:24:05 +00:00
|
|
|
Status = AcpiTbVerifyTable (TableDesc);
|
|
|
|
if (ACPI_FAILURE (Status) || !TableDesc->Pointer)
|
|
|
|
{
|
|
|
|
return_ACPI_STATUS (Status);
|
|
|
|
}
|
2002-02-23 05:10:40 +00:00
|
|
|
}
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2009-06-01 21:02:40 +00:00
|
|
|
/*
|
2011-05-31 17:33:30 +00:00
|
|
|
* Validate the incoming table signature.
|
|
|
|
*
|
|
|
|
* 1) Originally, we checked the table signature for "SSDT" or "PSDT".
|
|
|
|
* 2) We added support for OEMx tables, signature "OEM".
|
|
|
|
* 3) Valid tables were encountered with a null signature, so we just
|
|
|
|
* gave up on validating the signature, (05/2008).
|
|
|
|
* 4) We encountered non-AML tables such as the MADT, which caused
|
|
|
|
* interpreter errors and kernel faults. So now, we once again allow
|
|
|
|
* only "SSDT", "OEMx", and now, also a null signature. (05/2011).
|
2009-06-01 21:02:40 +00:00
|
|
|
*/
|
2011-05-31 17:33:30 +00:00
|
|
|
if ((TableDesc->Pointer->Signature[0] != 0x00) &&
|
|
|
|
(!ACPI_COMPARE_NAME (TableDesc->Pointer->Signature, ACPI_SIG_SSDT)) &&
|
|
|
|
(ACPI_STRNCMP (TableDesc->Pointer->Signature, "OEM", 3)))
|
|
|
|
{
|
2012-07-11 16:51:47 +00:00
|
|
|
ACPI_BIOS_ERROR ((AE_INFO,
|
|
|
|
"Table has invalid signature [%4.4s] (0x%8.8X), "
|
|
|
|
"must be SSDT or OEMx",
|
2013-05-17 23:13:40 +00:00
|
|
|
AcpiUtValidAcpiName (TableDesc->Pointer->Signature) ?
|
2011-05-31 17:33:30 +00:00
|
|
|
TableDesc->Pointer->Signature : "????",
|
|
|
|
*(UINT32 *) TableDesc->Pointer->Signature));
|
|
|
|
|
|
|
|
return_ACPI_STATUS (AE_BAD_SIGNATURE);
|
|
|
|
}
|
2005-11-01 22:11:18 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
(void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
/* Check if table is already registered */
|
|
|
|
|
2010-04-28 21:50:57 +00:00
|
|
|
for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i)
|
2002-07-30 19:33:39 +00:00
|
|
|
{
|
2007-03-22 17:24:05 +00:00
|
|
|
if (!AcpiGbl_RootTableList.Tables[i].Pointer)
|
|
|
|
{
|
|
|
|
Status = AcpiTbVerifyTable (&AcpiGbl_RootTableList.Tables[i]);
|
2009-06-01 21:02:40 +00:00
|
|
|
if (ACPI_FAILURE (Status) ||
|
|
|
|
!AcpiGbl_RootTableList.Tables[i].Pointer)
|
2007-03-22 17:24:05 +00:00
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-06-01 21:02:40 +00:00
|
|
|
/*
|
|
|
|
* Check for a table match on the entire table length,
|
|
|
|
* not just the header.
|
|
|
|
*/
|
|
|
|
if (TableDesc->Length != AcpiGbl_RootTableList.Tables[i].Length)
|
2007-03-22 17:24:05 +00:00
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2009-06-01 21:02:40 +00:00
|
|
|
if (ACPI_MEMCMP (TableDesc->Pointer,
|
|
|
|
AcpiGbl_RootTableList.Tables[i].Pointer,
|
|
|
|
AcpiGbl_RootTableList.Tables[i].Length))
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
2007-03-22 17:24:05 +00:00
|
|
|
|
2009-06-01 21:02:40 +00:00
|
|
|
/*
|
|
|
|
* Note: the current mechanism does not unregister a table if it is
|
|
|
|
* dynamically unloaded. The related namespace entries are deleted,
|
|
|
|
* but the table remains in the root table list.
|
|
|
|
*
|
|
|
|
* The assumption here is that the number of different tables that
|
|
|
|
* will be loaded is actually small, and there is minimal overhead
|
|
|
|
* in just keeping the table in case it is needed again.
|
|
|
|
*
|
|
|
|
* If this assumption changes in the future (perhaps on large
|
|
|
|
* machines with many table load/unload operations), tables will
|
|
|
|
* need to be unregistered when they are unloaded, and slots in the
|
|
|
|
* root table list should be reused when empty.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Table is already registered.
|
|
|
|
* We can delete the table that was passed as a parameter.
|
|
|
|
*/
|
2007-03-22 17:24:05 +00:00
|
|
|
AcpiTbDeleteTable (TableDesc);
|
|
|
|
*TableIndex = i;
|
2009-06-01 21:02:40 +00:00
|
|
|
|
|
|
|
if (AcpiGbl_RootTableList.Tables[i].Flags & ACPI_TABLE_IS_LOADED)
|
|
|
|
{
|
|
|
|
/* Table is still loaded, this is an error */
|
|
|
|
|
|
|
|
Status = AE_ALREADY_EXISTS;
|
|
|
|
goto Release;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Table was unloaded, allow it to be reloaded */
|
|
|
|
|
|
|
|
TableDesc->Pointer = AcpiGbl_RootTableList.Tables[i].Pointer;
|
|
|
|
TableDesc->Address = AcpiGbl_RootTableList.Tables[i].Address;
|
|
|
|
Status = AE_OK;
|
|
|
|
goto PrintHeader;
|
|
|
|
}
|
2002-07-30 19:33:39 +00:00
|
|
|
}
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
/*
|
2009-06-01 21:02:40 +00:00
|
|
|
* ACPI Table Override:
|
|
|
|
* Allow the host to override dynamically loaded tables.
|
2012-02-16 00:24:10 +00:00
|
|
|
* NOTE: the table is fully mapped at this point, and the mapping will
|
|
|
|
* be deleted by TbTableOverride if the table is actually overridden.
|
2007-03-22 17:24:05 +00:00
|
|
|
*/
|
2012-02-16 00:24:10 +00:00
|
|
|
(void) AcpiTbTableOverride (TableDesc->Pointer, TableDesc);
|
2009-06-01 21:02:40 +00:00
|
|
|
|
|
|
|
/* Add the table to the global root table list */
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
Status = AcpiTbStoreTable (TableDesc->Address, TableDesc->Pointer,
|
|
|
|
TableDesc->Length, TableDesc->Flags, TableIndex);
|
|
|
|
if (ACPI_FAILURE (Status))
|
|
|
|
{
|
|
|
|
goto Release;
|
|
|
|
}
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2009-06-01 21:02:40 +00:00
|
|
|
PrintHeader:
|
2007-03-22 17:24:05 +00:00
|
|
|
AcpiTbPrintTableHeader (TableDesc->Address, TableDesc->Pointer);
|
2005-11-01 22:11:18 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
Release:
|
2002-02-23 05:10:40 +00:00
|
|
|
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
|
2000-10-28 05:01:06 +00:00
|
|
|
return_ACPI_STATUS (Status);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-02-16 00:24:10 +00:00
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: AcpiTbTableOverride
|
|
|
|
*
|
|
|
|
* PARAMETERS: TableHeader - Header for the original table
|
|
|
|
* TableDesc - Table descriptor initialized for the
|
|
|
|
* original table. May or may not be mapped.
|
|
|
|
*
|
|
|
|
* RETURN: Pointer to the entire new table. NULL if table not overridden.
|
|
|
|
* If overridden, installs the new table within the input table
|
|
|
|
* descriptor.
|
|
|
|
*
|
|
|
|
* DESCRIPTION: Attempt table override by calling the OSL override functions.
|
|
|
|
* Note: If the table is overridden, then the entire new table
|
|
|
|
* is mapped and returned by this function.
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
ACPI_TABLE_HEADER *
|
|
|
|
AcpiTbTableOverride (
|
|
|
|
ACPI_TABLE_HEADER *TableHeader,
|
|
|
|
ACPI_TABLE_DESC *TableDesc)
|
|
|
|
{
|
|
|
|
ACPI_STATUS Status;
|
|
|
|
ACPI_TABLE_HEADER *NewTable = NULL;
|
|
|
|
ACPI_PHYSICAL_ADDRESS NewAddress = 0;
|
|
|
|
UINT32 NewTableLength = 0;
|
|
|
|
UINT8 NewFlags;
|
|
|
|
char *OverrideType;
|
|
|
|
|
|
|
|
|
|
|
|
/* (1) Attempt logical override (returns a logical address) */
|
|
|
|
|
|
|
|
Status = AcpiOsTableOverride (TableHeader, &NewTable);
|
|
|
|
if (ACPI_SUCCESS (Status) && NewTable)
|
|
|
|
{
|
|
|
|
NewAddress = ACPI_PTR_TO_PHYSADDR (NewTable);
|
|
|
|
NewTableLength = NewTable->Length;
|
|
|
|
NewFlags = ACPI_TABLE_ORIGIN_OVERRIDE;
|
|
|
|
OverrideType = "Logical";
|
|
|
|
goto FinishOverride;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* (2) Attempt physical override (returns a physical address) */
|
|
|
|
|
|
|
|
Status = AcpiOsPhysicalTableOverride (TableHeader,
|
|
|
|
&NewAddress, &NewTableLength);
|
|
|
|
if (ACPI_SUCCESS (Status) && NewAddress && NewTableLength)
|
|
|
|
{
|
|
|
|
/* Map the entire new table */
|
|
|
|
|
|
|
|
NewTable = AcpiOsMapMemory (NewAddress, NewTableLength);
|
|
|
|
if (!NewTable)
|
|
|
|
{
|
|
|
|
ACPI_EXCEPTION ((AE_INFO, AE_NO_MEMORY,
|
|
|
|
"%4.4s %p Attempted physical table override failed",
|
|
|
|
TableHeader->Signature,
|
|
|
|
ACPI_CAST_PTR (void, TableDesc->Address)));
|
|
|
|
return (NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
OverrideType = "Physical";
|
|
|
|
NewFlags = ACPI_TABLE_ORIGIN_MAPPED;
|
|
|
|
goto FinishOverride;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (NULL); /* There was no override */
|
|
|
|
|
|
|
|
|
|
|
|
FinishOverride:
|
|
|
|
|
|
|
|
ACPI_INFO ((AE_INFO,
|
|
|
|
"%4.4s %p %s table override, new table: %p",
|
|
|
|
TableHeader->Signature,
|
|
|
|
ACPI_CAST_PTR (void, TableDesc->Address),
|
|
|
|
OverrideType, NewTable));
|
|
|
|
|
|
|
|
/* We can now unmap/delete the original table (if fully mapped) */
|
|
|
|
|
|
|
|
AcpiTbDeleteTable (TableDesc);
|
|
|
|
|
|
|
|
/* Setup descriptor for the new table */
|
|
|
|
|
|
|
|
TableDesc->Address = NewAddress;
|
|
|
|
TableDesc->Pointer = NewTable;
|
|
|
|
TableDesc->Length = NewTableLength;
|
|
|
|
TableDesc->Flags = NewFlags;
|
|
|
|
|
|
|
|
return (NewTable);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-10-28 05:01:06 +00:00
|
|
|
/*******************************************************************************
|
|
|
|
*
|
2007-03-22 17:24:05 +00:00
|
|
|
* FUNCTION: AcpiTbResizeRootTableList
|
2000-10-28 05:01:06 +00:00
|
|
|
*
|
2007-03-22 17:24:05 +00:00
|
|
|
* PARAMETERS: None
|
2000-10-28 05:01:06 +00:00
|
|
|
*
|
|
|
|
* RETURN: Status
|
|
|
|
*
|
2007-03-22 17:24:05 +00:00
|
|
|
* DESCRIPTION: Expand the size of global table array
|
2000-10-28 05:01:06 +00:00
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
ACPI_STATUS
|
2007-03-22 17:24:05 +00:00
|
|
|
AcpiTbResizeRootTableList (
|
|
|
|
void)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
2007-03-22 17:24:05 +00:00
|
|
|
ACPI_TABLE_DESC *Tables;
|
2012-09-14 22:53:11 +00:00
|
|
|
UINT32 TableCount;
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
ACPI_FUNCTION_TRACE (TbResizeRootTableList);
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
/* AllowResize flag is a parameter to AcpiInitializeTables */
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
if (!(AcpiGbl_RootTableList.Flags & ACPI_ROOT_ALLOW_RESIZE))
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
2007-03-22 17:24:05 +00:00
|
|
|
ACPI_ERROR ((AE_INFO, "Resize of Root Table Array is not allowed"));
|
|
|
|
return_ACPI_STATUS (AE_SUPPORT);
|
2000-10-28 05:01:06 +00:00
|
|
|
}
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
/* Increase the Table Array size */
|
|
|
|
|
2012-09-14 22:53:11 +00:00
|
|
|
if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED)
|
|
|
|
{
|
|
|
|
TableCount = AcpiGbl_RootTableList.MaxTableCount;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
TableCount = AcpiGbl_RootTableList.CurrentTableCount;
|
|
|
|
}
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
Tables = ACPI_ALLOCATE_ZEROED (
|
2012-09-14 22:53:11 +00:00
|
|
|
((ACPI_SIZE) TableCount + ACPI_ROOT_TABLE_SIZE_INCREMENT) *
|
2009-06-01 21:02:40 +00:00
|
|
|
sizeof (ACPI_TABLE_DESC));
|
2007-03-22 17:24:05 +00:00
|
|
|
if (!Tables)
|
2002-06-30 17:50:46 +00:00
|
|
|
{
|
2007-03-22 17:24:05 +00:00
|
|
|
ACPI_ERROR ((AE_INFO, "Could not allocate new root table array"));
|
|
|
|
return_ACPI_STATUS (AE_NO_MEMORY);
|
2002-06-30 17:50:46 +00:00
|
|
|
}
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
/* Copy and free the previous table array */
|
|
|
|
|
|
|
|
if (AcpiGbl_RootTableList.Tables)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
2007-03-22 17:24:05 +00:00
|
|
|
ACPI_MEMCPY (Tables, AcpiGbl_RootTableList.Tables,
|
2012-09-14 22:53:11 +00:00
|
|
|
(ACPI_SIZE) TableCount * sizeof (ACPI_TABLE_DESC));
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED)
|
|
|
|
{
|
|
|
|
ACPI_FREE (AcpiGbl_RootTableList.Tables);
|
|
|
|
}
|
|
|
|
}
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
AcpiGbl_RootTableList.Tables = Tables;
|
2012-09-14 22:53:11 +00:00
|
|
|
AcpiGbl_RootTableList.MaxTableCount =
|
|
|
|
TableCount + ACPI_ROOT_TABLE_SIZE_INCREMENT;
|
|
|
|
AcpiGbl_RootTableList.Flags |= ACPI_ROOT_ORIGIN_ALLOCATED;
|
2002-06-30 17:50:46 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
return_ACPI_STATUS (AE_OK);
|
2000-10-28 05:01:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
*
|
2007-03-22 17:24:05 +00:00
|
|
|
* FUNCTION: AcpiTbStoreTable
|
2000-10-28 05:01:06 +00:00
|
|
|
*
|
2007-03-22 17:24:05 +00:00
|
|
|
* PARAMETERS: Address - Table address
|
|
|
|
* Table - Table header
|
|
|
|
* Length - Table length
|
|
|
|
* Flags - flags
|
2000-10-28 05:01:06 +00:00
|
|
|
*
|
2007-03-22 17:24:05 +00:00
|
|
|
* RETURN: Status and table index.
|
2000-10-28 05:01:06 +00:00
|
|
|
*
|
2007-03-22 17:24:05 +00:00
|
|
|
* DESCRIPTION: Add an ACPI table to the global table list
|
2000-10-28 05:01:06 +00:00
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
ACPI_STATUS
|
2007-03-22 17:24:05 +00:00
|
|
|
AcpiTbStoreTable (
|
|
|
|
ACPI_PHYSICAL_ADDRESS Address,
|
|
|
|
ACPI_TABLE_HEADER *Table,
|
|
|
|
UINT32 Length,
|
|
|
|
UINT8 Flags,
|
2009-06-01 21:02:40 +00:00
|
|
|
UINT32 *TableIndex)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
2010-04-28 21:50:57 +00:00
|
|
|
ACPI_STATUS Status;
|
|
|
|
ACPI_TABLE_DESC *NewTable;
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2003-07-13 22:44:13 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
/* Ensure that there is room for the table in the Root Table List */
|
2003-07-13 22:44:13 +00:00
|
|
|
|
2010-04-28 21:50:57 +00:00
|
|
|
if (AcpiGbl_RootTableList.CurrentTableCount >=
|
|
|
|
AcpiGbl_RootTableList.MaxTableCount)
|
2003-07-13 22:44:13 +00:00
|
|
|
{
|
2007-03-22 17:24:05 +00:00
|
|
|
Status = AcpiTbResizeRootTableList();
|
|
|
|
if (ACPI_FAILURE (Status))
|
|
|
|
{
|
|
|
|
return (Status);
|
|
|
|
}
|
2003-07-13 22:44:13 +00:00
|
|
|
}
|
|
|
|
|
2010-04-28 21:50:57 +00:00
|
|
|
NewTable = &AcpiGbl_RootTableList.Tables[AcpiGbl_RootTableList.CurrentTableCount];
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
/* Initialize added table */
|
2005-11-01 22:11:18 +00:00
|
|
|
|
2010-04-28 21:50:57 +00:00
|
|
|
NewTable->Address = Address;
|
|
|
|
NewTable->Pointer = Table;
|
|
|
|
NewTable->Length = Length;
|
|
|
|
NewTable->OwnerId = 0;
|
|
|
|
NewTable->Flags = Flags;
|
2005-11-01 22:11:18 +00:00
|
|
|
|
2010-04-28 21:50:57 +00:00
|
|
|
ACPI_MOVE_32_TO_32 (&NewTable->Signature, Table->Signature);
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2010-04-28 21:50:57 +00:00
|
|
|
*TableIndex = AcpiGbl_RootTableList.CurrentTableCount;
|
|
|
|
AcpiGbl_RootTableList.CurrentTableCount++;
|
|
|
|
return (AE_OK);
|
2007-03-22 17:24:05 +00:00
|
|
|
}
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: AcpiTbDeleteTable
|
|
|
|
*
|
|
|
|
* PARAMETERS: TableIndex - Table index
|
|
|
|
*
|
|
|
|
* RETURN: None
|
|
|
|
*
|
|
|
|
* DESCRIPTION: Delete one internal ACPI table
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
2003-12-09 02:45:16 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
void
|
|
|
|
AcpiTbDeleteTable (
|
|
|
|
ACPI_TABLE_DESC *TableDesc)
|
|
|
|
{
|
2003-12-09 02:45:16 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
/* Table must be mapped or allocated */
|
2003-12-09 02:45:16 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
if (!TableDesc->Pointer)
|
|
|
|
{
|
|
|
|
return;
|
2003-12-09 02:45:16 +00:00
|
|
|
}
|
2003-07-13 22:44:13 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
switch (TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
2007-03-22 17:24:05 +00:00
|
|
|
case ACPI_TABLE_ORIGIN_MAPPED:
|
2013-05-17 23:13:40 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
AcpiOsUnmapMemory (TableDesc->Pointer, TableDesc->Length);
|
|
|
|
break;
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
case ACPI_TABLE_ORIGIN_ALLOCATED:
|
2013-05-17 23:13:40 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
ACPI_FREE (TableDesc->Pointer);
|
|
|
|
break;
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2012-03-20 18:17:33 +00:00
|
|
|
/* Not mapped or allocated, there is nothing we can do */
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
default:
|
2013-05-17 23:13:40 +00:00
|
|
|
|
2012-03-20 18:17:33 +00:00
|
|
|
return;
|
2007-03-22 17:24:05 +00:00
|
|
|
}
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
TableDesc->Pointer = NULL;
|
2000-10-28 05:01:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
*
|
2007-03-22 17:24:05 +00:00
|
|
|
* FUNCTION: AcpiTbTerminate
|
2000-10-28 05:01:06 +00:00
|
|
|
*
|
2007-03-22 17:24:05 +00:00
|
|
|
* PARAMETERS: None
|
2000-10-28 05:01:06 +00:00
|
|
|
*
|
2007-03-22 17:24:05 +00:00
|
|
|
* RETURN: None
|
2000-10-28 05:01:06 +00:00
|
|
|
*
|
|
|
|
* DESCRIPTION: Delete all internal ACPI tables
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
void
|
2007-03-22 17:24:05 +00:00
|
|
|
AcpiTbTerminate (
|
2005-11-01 22:11:18 +00:00
|
|
|
void)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
2009-06-01 21:02:40 +00:00
|
|
|
UINT32 i;
|
2007-03-22 17:24:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
ACPI_FUNCTION_TRACE (TbTerminate);
|
|
|
|
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
(void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
|
|
|
|
|
|
|
|
/* Delete the individual tables */
|
|
|
|
|
2010-04-28 21:50:57 +00:00
|
|
|
for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++)
|
2007-03-22 17:24:05 +00:00
|
|
|
{
|
|
|
|
AcpiTbDeleteTable (&AcpiGbl_RootTableList.Tables[i]);
|
|
|
|
}
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
/*
|
2007-03-22 17:24:05 +00:00
|
|
|
* Delete the root table array if allocated locally. Array cannot be
|
|
|
|
* mapped, so we don't need to check for that flag.
|
2000-10-28 05:01:06 +00:00
|
|
|
*/
|
2007-03-22 17:24:05 +00:00
|
|
|
if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
2007-03-22 17:24:05 +00:00
|
|
|
ACPI_FREE (AcpiGbl_RootTableList.Tables);
|
2000-10-28 05:01:06 +00:00
|
|
|
}
|
2007-03-22 17:24:05 +00:00
|
|
|
|
|
|
|
AcpiGbl_RootTableList.Tables = NULL;
|
|
|
|
AcpiGbl_RootTableList.Flags = 0;
|
2010-04-28 21:50:57 +00:00
|
|
|
AcpiGbl_RootTableList.CurrentTableCount = 0;
|
2007-03-22 17:24:05 +00:00
|
|
|
|
|
|
|
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "ACPI Tables freed\n"));
|
|
|
|
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
|
2012-10-19 18:47:57 +00:00
|
|
|
|
|
|
|
return_VOID;
|
2000-10-28 05:01:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
*
|
2007-03-22 17:24:05 +00:00
|
|
|
* FUNCTION: AcpiTbDeleteNamespaceByOwner
|
2000-10-28 05:01:06 +00:00
|
|
|
*
|
2007-03-22 17:24:05 +00:00
|
|
|
* PARAMETERS: TableIndex - Table index
|
2000-10-28 05:01:06 +00:00
|
|
|
*
|
2009-06-01 21:02:40 +00:00
|
|
|
* RETURN: Status
|
2000-10-28 05:01:06 +00:00
|
|
|
*
|
2007-03-22 17:24:05 +00:00
|
|
|
* DESCRIPTION: Delete all namespace objects created when this table was loaded.
|
2000-10-28 05:01:06 +00:00
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
2009-06-01 21:02:40 +00:00
|
|
|
ACPI_STATUS
|
2007-03-22 17:24:05 +00:00
|
|
|
AcpiTbDeleteNamespaceByOwner (
|
2009-06-01 21:02:40 +00:00
|
|
|
UINT32 TableIndex)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
2007-03-22 17:24:05 +00:00
|
|
|
ACPI_OWNER_ID OwnerId;
|
2009-06-01 21:02:40 +00:00
|
|
|
ACPI_STATUS Status;
|
2002-02-23 05:10:40 +00:00
|
|
|
|
2003-07-13 22:44:13 +00:00
|
|
|
|
2009-06-01 21:02:40 +00:00
|
|
|
ACPI_FUNCTION_TRACE (TbDeleteNamespaceByOwner);
|
|
|
|
|
|
|
|
|
|
|
|
Status = AcpiUtAcquireMutex (ACPI_MTX_TABLES);
|
|
|
|
if (ACPI_FAILURE (Status))
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
2009-06-01 21:02:40 +00:00
|
|
|
return_ACPI_STATUS (Status);
|
2000-10-28 05:01:06 +00:00
|
|
|
}
|
2009-06-01 21:02:40 +00:00
|
|
|
|
2010-04-28 21:50:57 +00:00
|
|
|
if (TableIndex >= AcpiGbl_RootTableList.CurrentTableCount)
|
2002-02-23 05:10:40 +00:00
|
|
|
{
|
2009-06-01 21:02:40 +00:00
|
|
|
/* The table index does not exist */
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
|
2009-06-01 21:02:40 +00:00
|
|
|
return_ACPI_STATUS (AE_NOT_EXIST);
|
2002-02-23 05:10:40 +00:00
|
|
|
}
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2009-06-01 21:02:40 +00:00
|
|
|
/* Get the owner ID for this table, used to delete namespace nodes */
|
|
|
|
|
|
|
|
OwnerId = AcpiGbl_RootTableList.Tables[TableIndex].OwnerId;
|
2007-03-22 17:24:05 +00:00
|
|
|
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
|
2009-06-01 21:02:40 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Need to acquire the namespace writer lock to prevent interference
|
|
|
|
* with any concurrent namespace walks. The interpreter must be
|
|
|
|
* released during the deletion since the acquisition of the deletion
|
|
|
|
* lock may block, and also since the execution of a namespace walk
|
|
|
|
* must be allowed to use the interpreter.
|
|
|
|
*/
|
|
|
|
(void) AcpiUtReleaseMutex (ACPI_MTX_INTERPRETER);
|
|
|
|
Status = AcpiUtAcquireWriteLock (&AcpiGbl_NamespaceRwLock);
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
AcpiNsDeleteNamespaceByOwner (OwnerId);
|
2009-06-01 21:02:40 +00:00
|
|
|
if (ACPI_FAILURE (Status))
|
|
|
|
{
|
|
|
|
return_ACPI_STATUS (Status);
|
|
|
|
}
|
|
|
|
|
|
|
|
AcpiUtReleaseWriteLock (&AcpiGbl_NamespaceRwLock);
|
|
|
|
|
|
|
|
Status = AcpiUtAcquireMutex (ACPI_MTX_INTERPRETER);
|
|
|
|
return_ACPI_STATUS (Status);
|
2007-03-22 17:24:05 +00:00
|
|
|
}
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: AcpiTbAllocateOwnerId
|
|
|
|
*
|
|
|
|
* PARAMETERS: TableIndex - Table index
|
|
|
|
*
|
|
|
|
* RETURN: Status
|
|
|
|
*
|
|
|
|
* DESCRIPTION: Allocates OwnerId in TableDesc
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
ACPI_STATUS
|
|
|
|
AcpiTbAllocateOwnerId (
|
2009-06-01 21:02:40 +00:00
|
|
|
UINT32 TableIndex)
|
2007-03-22 17:24:05 +00:00
|
|
|
{
|
|
|
|
ACPI_STATUS Status = AE_BAD_PARAMETER;
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
ACPI_FUNCTION_TRACE (TbAllocateOwnerId);
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
(void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
|
2010-04-28 21:50:57 +00:00
|
|
|
if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
2007-03-22 17:24:05 +00:00
|
|
|
Status = AcpiUtAllocateOwnerId
|
|
|
|
(&(AcpiGbl_RootTableList.Tables[TableIndex].OwnerId));
|
2000-10-28 05:01:06 +00:00
|
|
|
}
|
|
|
|
|
2003-07-13 22:44:13 +00:00
|
|
|
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
|
2007-03-22 17:24:05 +00:00
|
|
|
return_ACPI_STATUS (Status);
|
2000-10-28 05:01:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
*
|
2007-03-22 17:24:05 +00:00
|
|
|
* FUNCTION: AcpiTbReleaseOwnerId
|
2000-10-28 05:01:06 +00:00
|
|
|
*
|
2007-03-22 17:24:05 +00:00
|
|
|
* PARAMETERS: TableIndex - Table index
|
2000-10-28 05:01:06 +00:00
|
|
|
*
|
2007-03-22 17:24:05 +00:00
|
|
|
* RETURN: Status
|
2000-10-28 05:01:06 +00:00
|
|
|
*
|
2007-03-22 17:24:05 +00:00
|
|
|
* DESCRIPTION: Releases OwnerId in TableDesc
|
2000-10-28 05:01:06 +00:00
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
ACPI_STATUS
|
|
|
|
AcpiTbReleaseOwnerId (
|
2009-06-01 21:02:40 +00:00
|
|
|
UINT32 TableIndex)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
2007-03-22 17:24:05 +00:00
|
|
|
ACPI_STATUS Status = AE_BAD_PARAMETER;
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2003-07-13 22:44:13 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
ACPI_FUNCTION_TRACE (TbReleaseOwnerId);
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
(void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
|
2010-04-28 21:50:57 +00:00
|
|
|
if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
|
2003-07-13 22:44:13 +00:00
|
|
|
{
|
2009-06-01 21:02:40 +00:00
|
|
|
AcpiUtReleaseOwnerId (
|
|
|
|
&(AcpiGbl_RootTableList.Tables[TableIndex].OwnerId));
|
2007-03-22 17:24:05 +00:00
|
|
|
Status = AE_OK;
|
2000-10-28 05:01:06 +00:00
|
|
|
}
|
2007-03-22 17:24:05 +00:00
|
|
|
|
|
|
|
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
|
|
|
|
return_ACPI_STATUS (Status);
|
2000-10-28 05:01:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
*
|
2007-03-22 17:24:05 +00:00
|
|
|
* FUNCTION: AcpiTbGetOwnerId
|
2000-10-28 05:01:06 +00:00
|
|
|
*
|
2007-03-22 17:24:05 +00:00
|
|
|
* PARAMETERS: TableIndex - Table index
|
|
|
|
* OwnerId - Where the table OwnerId is returned
|
2000-10-28 05:01:06 +00:00
|
|
|
*
|
2007-03-22 17:24:05 +00:00
|
|
|
* RETURN: Status
|
2000-10-28 05:01:06 +00:00
|
|
|
*
|
2007-03-22 17:24:05 +00:00
|
|
|
* DESCRIPTION: returns OwnerId for the ACPI table
|
2000-10-28 05:01:06 +00:00
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
ACPI_STATUS
|
|
|
|
AcpiTbGetOwnerId (
|
2009-06-01 21:02:40 +00:00
|
|
|
UINT32 TableIndex,
|
2007-03-22 17:24:05 +00:00
|
|
|
ACPI_OWNER_ID *OwnerId)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
2007-03-22 17:24:05 +00:00
|
|
|
ACPI_STATUS Status = AE_BAD_PARAMETER;
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
ACPI_FUNCTION_TRACE (TbGetOwnerId);
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
(void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
|
2010-04-28 21:50:57 +00:00
|
|
|
if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
2007-03-22 17:24:05 +00:00
|
|
|
*OwnerId = AcpiGbl_RootTableList.Tables[TableIndex].OwnerId;
|
|
|
|
Status = AE_OK;
|
2000-10-28 05:01:06 +00:00
|
|
|
}
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
|
|
|
|
return_ACPI_STATUS (Status);
|
|
|
|
}
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2003-07-13 22:44:13 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: AcpiTbIsTableLoaded
|
|
|
|
*
|
|
|
|
* PARAMETERS: TableIndex - Table index
|
|
|
|
*
|
|
|
|
* RETURN: Table Loaded Flag
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
BOOLEAN
|
|
|
|
AcpiTbIsTableLoaded (
|
2009-06-01 21:02:40 +00:00
|
|
|
UINT32 TableIndex)
|
2007-03-22 17:24:05 +00:00
|
|
|
{
|
|
|
|
BOOLEAN IsLoaded = FALSE;
|
|
|
|
|
|
|
|
|
|
|
|
(void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
|
2010-04-28 21:50:57 +00:00
|
|
|
if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
2007-03-22 17:24:05 +00:00
|
|
|
IsLoaded = (BOOLEAN)
|
2009-06-01 21:02:40 +00:00
|
|
|
(AcpiGbl_RootTableList.Tables[TableIndex].Flags &
|
|
|
|
ACPI_TABLE_IS_LOADED);
|
2000-10-28 05:01:06 +00:00
|
|
|
}
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
|
|
|
|
return (IsLoaded);
|
|
|
|
}
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: AcpiTbSetTableLoadedFlag
|
|
|
|
*
|
|
|
|
* PARAMETERS: TableIndex - Table index
|
|
|
|
* IsLoaded - TRUE if table is loaded, FALSE otherwise
|
|
|
|
*
|
|
|
|
* RETURN: None
|
|
|
|
*
|
|
|
|
* DESCRIPTION: Sets the table loaded flag to either TRUE or FALSE.
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
void
|
|
|
|
AcpiTbSetTableLoadedFlag (
|
2009-06-01 21:02:40 +00:00
|
|
|
UINT32 TableIndex,
|
2007-03-22 17:24:05 +00:00
|
|
|
BOOLEAN IsLoaded)
|
|
|
|
{
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
(void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
|
2010-04-28 21:50:57 +00:00
|
|
|
if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
|
2007-03-22 17:24:05 +00:00
|
|
|
{
|
|
|
|
if (IsLoaded)
|
|
|
|
{
|
2009-06-01 21:02:40 +00:00
|
|
|
AcpiGbl_RootTableList.Tables[TableIndex].Flags |=
|
|
|
|
ACPI_TABLE_IS_LOADED;
|
2007-03-22 17:24:05 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-06-01 21:02:40 +00:00
|
|
|
AcpiGbl_RootTableList.Tables[TableIndex].Flags &=
|
|
|
|
~ACPI_TABLE_IS_LOADED;
|
2007-03-22 17:24:05 +00:00
|
|
|
}
|
|
|
|
}
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
|
2000-10-28 05:01:06 +00:00
|
|
|
}
|