Skip to content

Commit

Permalink
Add new external interface, AcpiUnloadTable
Browse files Browse the repository at this point in the history
Unload a table via the TableIndex.
  • Loading branch information
acpibob committed Sep 26, 2019
1 parent 98fc399 commit c69369c
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
39 changes: 39 additions & 0 deletions source/components/tables/tbxfload.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,3 +582,42 @@ AcpiUnloadParentTable (
}

ACPI_EXPORT_SYMBOL (AcpiUnloadParentTable)


/*******************************************************************************
*
* FUNCTION: AcpiUnloadTable
*
* PARAMETERS: TableIndex - Index as returned by AcpiLoadTable
*
* RETURN: Status
*
* DESCRIPTION: Via the TableIndex representing 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.
*
******************************************************************************/

ACPI_STATUS
AcpiUnloadTable (
UINT32 TableIndex)
{
ACPI_STATUS Status;


ACPI_FUNCTION_TRACE (AcpiUnloadTable);


if (TableIndex == 1)
{
/* TableIndex==1 means DSDT is the owner. DSDT cannot be unloaded */

return_ACPI_STATUS (AE_TYPE);
}

Status = AcpiTbUnloadTable (TableIndex);
return_ACPI_STATUS (Status);
}

ACPI_EXPORT_SYMBOL (AcpiUnloadTable)
5 changes: 5 additions & 0 deletions source/include/acpixf.h
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,11 @@ ACPI_STATUS
AcpiLoadTable (
ACPI_TABLE_HEADER *Table))

ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiUnloadTable (
UINT32 TableIndex))

ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiUnloadParentTable (
Expand Down

0 comments on commit c69369c

Please sign in to comment.