128c506b8Sjruoho /****************************************************************************** 228c506b8Sjruoho * 328c506b8Sjruoho * Name: actables.h - ACPI table management 428c506b8Sjruoho * 528c506b8Sjruoho *****************************************************************************/ 628c506b8Sjruoho 7159c4e26Sjruoho /* 8*2c7d7e3cSchristos * Copyright (C) 2000 - 2023, Intel Corp. 928c506b8Sjruoho * All rights reserved. 1028c506b8Sjruoho * 11159c4e26Sjruoho * Redistribution and use in source and binary forms, with or without 12159c4e26Sjruoho * modification, are permitted provided that the following conditions 13159c4e26Sjruoho * are met: 14159c4e26Sjruoho * 1. Redistributions of source code must retain the above copyright 15159c4e26Sjruoho * notice, this list of conditions, and the following disclaimer, 16159c4e26Sjruoho * without modification. 17159c4e26Sjruoho * 2. Redistributions in binary form must reproduce at minimum a disclaimer 18159c4e26Sjruoho * substantially similar to the "NO WARRANTY" disclaimer below 19159c4e26Sjruoho * ("Disclaimer") and any redistribution must be conditioned upon 20159c4e26Sjruoho * including a substantially similar Disclaimer requirement for further 21159c4e26Sjruoho * binary redistribution. 22159c4e26Sjruoho * 3. Neither the names of the above-listed copyright holders nor the names 23159c4e26Sjruoho * of any contributors may be used to endorse or promote products derived 24159c4e26Sjruoho * from this software without specific prior written permission. 2528c506b8Sjruoho * 26159c4e26Sjruoho * Alternatively, this software may be distributed under the terms of the 27159c4e26Sjruoho * GNU General Public License ("GPL") version 2 as published by the Free 28159c4e26Sjruoho * Software Foundation. 2928c506b8Sjruoho * 30159c4e26Sjruoho * NO WARRANTY 31159c4e26Sjruoho * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 32159c4e26Sjruoho * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 3398244dcfSchristos * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 34159c4e26Sjruoho * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 35159c4e26Sjruoho * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 36159c4e26Sjruoho * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 37159c4e26Sjruoho * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 38159c4e26Sjruoho * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 39159c4e26Sjruoho * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 40159c4e26Sjruoho * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 41159c4e26Sjruoho * POSSIBILITY OF SUCH DAMAGES. 42159c4e26Sjruoho */ 4328c506b8Sjruoho 4428c506b8Sjruoho #ifndef __ACTABLES_H__ 4528c506b8Sjruoho #define __ACTABLES_H__ 4628c506b8Sjruoho 4728c506b8Sjruoho 4828c506b8Sjruoho ACPI_STATUS 4928c506b8Sjruoho AcpiAllocateRootTable ( 5028c506b8Sjruoho UINT32 InitialTableCount); 5128c506b8Sjruoho 5228c506b8Sjruoho /* 53a2c051a9Schristos * tbxfroot - Root pointer utilities 54a2c051a9Schristos */ 55414ef032Schristos UINT32 56414ef032Schristos AcpiTbGetRsdpLength ( 57414ef032Schristos ACPI_TABLE_RSDP *Rsdp); 58414ef032Schristos 59a2c051a9Schristos ACPI_STATUS 60a2c051a9Schristos AcpiTbValidateRsdp ( 61a2c051a9Schristos ACPI_TABLE_RSDP *Rsdp); 62a2c051a9Schristos 63a2c051a9Schristos UINT8 * 64a2c051a9Schristos AcpiTbScanMemoryForRsdp ( 65a2c051a9Schristos UINT8 *StartAddress, 66a2c051a9Schristos UINT32 Length); 67a2c051a9Schristos 68a2c051a9Schristos 69a2c051a9Schristos /* 70414ef032Schristos * tbdata - table data structure management 71414ef032Schristos */ 72414ef032Schristos ACPI_STATUS 73cb2bd8f0Schristos AcpiTbGetNextTableDescriptor ( 74cb2bd8f0Schristos UINT32 *TableIndex, 75cb2bd8f0Schristos ACPI_TABLE_DESC **TableDesc); 76414ef032Schristos 77414ef032Schristos void 78414ef032Schristos AcpiTbInitTableDescriptor ( 79414ef032Schristos ACPI_TABLE_DESC *TableDesc, 80414ef032Schristos ACPI_PHYSICAL_ADDRESS Address, 81414ef032Schristos UINT8 Flags, 82414ef032Schristos ACPI_TABLE_HEADER *Table); 83414ef032Schristos 84414ef032Schristos ACPI_STATUS 85414ef032Schristos AcpiTbAcquireTempTable ( 86414ef032Schristos ACPI_TABLE_DESC *TableDesc, 87414ef032Schristos ACPI_PHYSICAL_ADDRESS Address, 88a43dcd2aSchristos UINT8 Flags, 89a43dcd2aSchristos ACPI_TABLE_HEADER *Table); 90414ef032Schristos 91414ef032Schristos void 92414ef032Schristos AcpiTbReleaseTempTable ( 93414ef032Schristos ACPI_TABLE_DESC *TableDesc); 94414ef032Schristos 95414ef032Schristos ACPI_STATUS 96414ef032Schristos AcpiTbValidateTempTable ( 97414ef032Schristos ACPI_TABLE_DESC *TableDesc); 98414ef032Schristos 99414ef032Schristos ACPI_STATUS 100414ef032Schristos AcpiTbVerifyTempTable ( 101414ef032Schristos ACPI_TABLE_DESC *TableDesc, 102ae01dbf5Schristos const char *Signature, 103ae01dbf5Schristos UINT32 *TableIndex); 104414ef032Schristos 105414ef032Schristos BOOLEAN 106414ef032Schristos AcpiTbIsTableLoaded ( 107414ef032Schristos UINT32 TableIndex); 108414ef032Schristos 109414ef032Schristos void 110414ef032Schristos AcpiTbSetTableLoadedFlag ( 111414ef032Schristos UINT32 TableIndex, 112414ef032Schristos BOOLEAN IsLoaded); 113414ef032Schristos 114414ef032Schristos 115414ef032Schristos /* 11628c506b8Sjruoho * tbfadt - FADT parse/convert/validate 11728c506b8Sjruoho */ 11828c506b8Sjruoho void 11928c506b8Sjruoho AcpiTbParseFadt ( 12081bd9c9cSchristos void); 12128c506b8Sjruoho 12228c506b8Sjruoho void 12328c506b8Sjruoho AcpiTbCreateLocalFadt ( 12428c506b8Sjruoho ACPI_TABLE_HEADER *Table, 12528c506b8Sjruoho UINT32 Length); 12628c506b8Sjruoho 12728c506b8Sjruoho 12828c506b8Sjruoho /* 12928c506b8Sjruoho * tbfind - find ACPI table 13028c506b8Sjruoho */ 13128c506b8Sjruoho ACPI_STATUS 13228c506b8Sjruoho AcpiTbFindTable ( 13328c506b8Sjruoho char *Signature, 13428c506b8Sjruoho char *OemId, 13528c506b8Sjruoho char *OemTableId, 13628c506b8Sjruoho UINT32 *TableIndex); 13728c506b8Sjruoho 13828c506b8Sjruoho 13928c506b8Sjruoho /* 14028c506b8Sjruoho * tbinstal - Table removal and deletion 14128c506b8Sjruoho */ 14228c506b8Sjruoho ACPI_STATUS 14328c506b8Sjruoho AcpiTbResizeRootTableList ( 14428c506b8Sjruoho void); 14528c506b8Sjruoho 14628c506b8Sjruoho ACPI_STATUS 147414ef032Schristos AcpiTbValidateTable ( 14828c506b8Sjruoho ACPI_TABLE_DESC *TableDesc); 14928c506b8Sjruoho 150414ef032Schristos void 151414ef032Schristos AcpiTbInvalidateTable ( 152a2c051a9Schristos ACPI_TABLE_DESC *TableDesc); 153a2c051a9Schristos 154414ef032Schristos void 155414ef032Schristos AcpiTbOverrideTable ( 156414ef032Schristos ACPI_TABLE_DESC *OldTableDesc); 157414ef032Schristos 15828c506b8Sjruoho ACPI_STATUS 159414ef032Schristos AcpiTbAcquireTable ( 16028c506b8Sjruoho ACPI_TABLE_DESC *TableDesc, 161414ef032Schristos ACPI_TABLE_HEADER **TablePtr, 162414ef032Schristos UINT32 *TableLength, 163414ef032Schristos UINT8 *TableFlags); 164414ef032Schristos 165414ef032Schristos void 166414ef032Schristos AcpiTbReleaseTable ( 167414ef032Schristos ACPI_TABLE_HEADER *Table, 168414ef032Schristos UINT32 TableLength, 169414ef032Schristos UINT8 TableFlags); 170414ef032Schristos 171414ef032Schristos ACPI_STATUS 172414ef032Schristos AcpiTbInstallStandardTable ( 173414ef032Schristos ACPI_PHYSICAL_ADDRESS Address, 174414ef032Schristos UINT8 Flags, 175a43dcd2aSchristos ACPI_TABLE_HEADER *Table, 176414ef032Schristos BOOLEAN Reload, 177414ef032Schristos BOOLEAN Override, 17828c506b8Sjruoho UINT32 *TableIndex); 17928c506b8Sjruoho 18028c506b8Sjruoho void 181414ef032Schristos AcpiTbUninstallTable ( 18228c506b8Sjruoho ACPI_TABLE_DESC *TableDesc); 18328c506b8Sjruoho 18447dc3895Schristos ACPI_STATUS 18547dc3895Schristos AcpiTbLoadTable ( 18647dc3895Schristos UINT32 TableIndex, 18747dc3895Schristos ACPI_NAMESPACE_NODE *ParentNode); 18847dc3895Schristos 18947dc3895Schristos ACPI_STATUS 19047dc3895Schristos AcpiTbInstallAndLoadTable ( 19147dc3895Schristos ACPI_PHYSICAL_ADDRESS Address, 19247dc3895Schristos UINT8 Flags, 193a43dcd2aSchristos ACPI_TABLE_HEADER *Table, 19447dc3895Schristos BOOLEAN Override, 19547dc3895Schristos UINT32 *TableIndex); 19647dc3895Schristos 197660602a8Schristos ACPI_STATUS 198660602a8Schristos AcpiTbUnloadTable ( 199660602a8Schristos UINT32 TableIndex); 200660602a8Schristos 20128c506b8Sjruoho void 202ae01dbf5Schristos AcpiTbNotifyTable ( 203ae01dbf5Schristos UINT32 Event, 204ae01dbf5Schristos void *Table); 205ae01dbf5Schristos 206ae01dbf5Schristos void 20728c506b8Sjruoho AcpiTbTerminate ( 20828c506b8Sjruoho void); 20928c506b8Sjruoho 21028c506b8Sjruoho ACPI_STATUS 21128c506b8Sjruoho AcpiTbDeleteNamespaceByOwner ( 21228c506b8Sjruoho UINT32 TableIndex); 21328c506b8Sjruoho 21428c506b8Sjruoho ACPI_STATUS 21528c506b8Sjruoho AcpiTbAllocateOwnerId ( 21628c506b8Sjruoho UINT32 TableIndex); 21728c506b8Sjruoho 21828c506b8Sjruoho ACPI_STATUS 21928c506b8Sjruoho AcpiTbReleaseOwnerId ( 22028c506b8Sjruoho UINT32 TableIndex); 22128c506b8Sjruoho 22228c506b8Sjruoho ACPI_STATUS 22328c506b8Sjruoho AcpiTbGetOwnerId ( 22428c506b8Sjruoho UINT32 TableIndex, 22528c506b8Sjruoho ACPI_OWNER_ID *OwnerId); 22628c506b8Sjruoho 22728c506b8Sjruoho 22828c506b8Sjruoho /* 22928c506b8Sjruoho * tbutils - table manager utilities 23028c506b8Sjruoho */ 23128c506b8Sjruoho ACPI_STATUS 23228c506b8Sjruoho AcpiTbInitializeFacs ( 23328c506b8Sjruoho void); 23428c506b8Sjruoho 23528c506b8Sjruoho void 23628c506b8Sjruoho AcpiTbPrintTableHeader( 23728c506b8Sjruoho ACPI_PHYSICAL_ADDRESS Address, 23828c506b8Sjruoho ACPI_TABLE_HEADER *Header); 23928c506b8Sjruoho 24028c506b8Sjruoho void 24128c506b8Sjruoho AcpiTbCheckDsdtHeader ( 24228c506b8Sjruoho void); 24328c506b8Sjruoho 24428c506b8Sjruoho ACPI_TABLE_HEADER * 24528c506b8Sjruoho AcpiTbCopyDsdt ( 24628c506b8Sjruoho UINT32 TableIndex); 24728c506b8Sjruoho 24828c506b8Sjruoho void 249414ef032Schristos AcpiTbInstallTableWithOverride ( 250414ef032Schristos ACPI_TABLE_DESC *NewTableDesc, 25181bd9c9cSchristos BOOLEAN Override, 25281bd9c9cSchristos UINT32 *TableIndex); 253414ef032Schristos 254414ef032Schristos ACPI_STATUS 25528c506b8Sjruoho AcpiTbParseRootTable ( 25628c506b8Sjruoho ACPI_PHYSICAL_ADDRESS RsdpAddress); 25728c506b8Sjruoho 258660602a8Schristos ACPI_STATUS 259660602a8Schristos AcpiTbGetTable ( 260660602a8Schristos ACPI_TABLE_DESC *TableDesc, 261660602a8Schristos ACPI_TABLE_HEADER **OutTable); 262660602a8Schristos 263660602a8Schristos void 264660602a8Schristos AcpiTbPutTable ( 265660602a8Schristos ACPI_TABLE_DESC *TableDesc); 266660602a8Schristos 26781bd9c9cSchristos 26881bd9c9cSchristos /* 26981bd9c9cSchristos * tbxfload 27081bd9c9cSchristos */ 27181bd9c9cSchristos ACPI_STATUS 27281bd9c9cSchristos AcpiTbLoadNamespace ( 27381bd9c9cSchristos void); 27481bd9c9cSchristos 27528c506b8Sjruoho #endif /* __ACTABLES_H__ */ 276