Home | History | Annotate | Line # | Download | only in include
actables.h revision 1.17
      1   1.1    jruoho /******************************************************************************
      2   1.1    jruoho  *
      3   1.1    jruoho  * Name: actables.h - ACPI table management
      4   1.1    jruoho  *
      5   1.1    jruoho  *****************************************************************************/
      6   1.1    jruoho 
      7   1.3    jruoho /*
      8  1.17  christos  * Copyright (C) 2000 - 2022, Intel Corp.
      9   1.1    jruoho  * All rights reserved.
     10   1.1    jruoho  *
     11   1.3    jruoho  * Redistribution and use in source and binary forms, with or without
     12   1.3    jruoho  * modification, are permitted provided that the following conditions
     13   1.3    jruoho  * are met:
     14   1.3    jruoho  * 1. Redistributions of source code must retain the above copyright
     15   1.3    jruoho  *    notice, this list of conditions, and the following disclaimer,
     16   1.3    jruoho  *    without modification.
     17   1.3    jruoho  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
     18   1.3    jruoho  *    substantially similar to the "NO WARRANTY" disclaimer below
     19   1.3    jruoho  *    ("Disclaimer") and any redistribution must be conditioned upon
     20   1.3    jruoho  *    including a substantially similar Disclaimer requirement for further
     21   1.3    jruoho  *    binary redistribution.
     22   1.3    jruoho  * 3. Neither the names of the above-listed copyright holders nor the names
     23   1.3    jruoho  *    of any contributors may be used to endorse or promote products derived
     24   1.3    jruoho  *    from this software without specific prior written permission.
     25   1.3    jruoho  *
     26   1.3    jruoho  * Alternatively, this software may be distributed under the terms of the
     27   1.3    jruoho  * GNU General Public License ("GPL") version 2 as published by the Free
     28   1.3    jruoho  * Software Foundation.
     29   1.3    jruoho  *
     30   1.3    jruoho  * NO WARRANTY
     31   1.3    jruoho  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     32   1.3    jruoho  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     33  1.15  christos  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     34   1.3    jruoho  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     35   1.3    jruoho  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     36   1.3    jruoho  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     37   1.3    jruoho  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     38   1.3    jruoho  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     39   1.3    jruoho  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
     40   1.3    jruoho  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     41   1.3    jruoho  * POSSIBILITY OF SUCH DAMAGES.
     42   1.3    jruoho  */
     43   1.1    jruoho 
     44   1.1    jruoho #ifndef __ACTABLES_H__
     45   1.1    jruoho #define __ACTABLES_H__
     46   1.1    jruoho 
     47   1.1    jruoho 
     48   1.1    jruoho ACPI_STATUS
     49   1.1    jruoho AcpiAllocateRootTable (
     50   1.1    jruoho     UINT32                  InitialTableCount);
     51   1.1    jruoho 
     52   1.1    jruoho /*
     53   1.4  christos  * tbxfroot - Root pointer utilities
     54   1.4  christos  */
     55   1.5  christos UINT32
     56   1.5  christos AcpiTbGetRsdpLength (
     57   1.5  christos     ACPI_TABLE_RSDP         *Rsdp);
     58   1.5  christos 
     59   1.4  christos ACPI_STATUS
     60   1.4  christos AcpiTbValidateRsdp (
     61   1.4  christos     ACPI_TABLE_RSDP         *Rsdp);
     62   1.4  christos 
     63   1.4  christos UINT8 *
     64   1.4  christos AcpiTbScanMemoryForRsdp (
     65   1.4  christos     UINT8                   *StartAddress,
     66   1.4  christos     UINT32                  Length);
     67   1.4  christos 
     68   1.4  christos 
     69   1.4  christos /*
     70   1.5  christos  * tbdata - table data structure management
     71   1.5  christos  */
     72   1.5  christos ACPI_STATUS
     73   1.6  christos AcpiTbGetNextTableDescriptor (
     74   1.6  christos     UINT32                  *TableIndex,
     75   1.6  christos     ACPI_TABLE_DESC         **TableDesc);
     76   1.5  christos 
     77   1.5  christos void
     78   1.5  christos AcpiTbInitTableDescriptor (
     79   1.5  christos     ACPI_TABLE_DESC         *TableDesc,
     80   1.5  christos     ACPI_PHYSICAL_ADDRESS   Address,
     81   1.5  christos     UINT8                   Flags,
     82   1.5  christos     ACPI_TABLE_HEADER       *Table);
     83   1.5  christos 
     84   1.5  christos ACPI_STATUS
     85   1.5  christos AcpiTbAcquireTempTable (
     86   1.5  christos     ACPI_TABLE_DESC         *TableDesc,
     87   1.5  christos     ACPI_PHYSICAL_ADDRESS   Address,
     88  1.16  christos     UINT8                   Flags,
     89  1.16  christos     ACPI_TABLE_HEADER       *Table);
     90   1.5  christos 
     91   1.5  christos void
     92   1.5  christos AcpiTbReleaseTempTable (
     93   1.5  christos     ACPI_TABLE_DESC         *TableDesc);
     94   1.5  christos 
     95   1.5  christos ACPI_STATUS
     96   1.5  christos AcpiTbValidateTempTable (
     97   1.5  christos     ACPI_TABLE_DESC         *TableDesc);
     98   1.5  christos 
     99   1.5  christos ACPI_STATUS
    100   1.5  christos AcpiTbVerifyTempTable (
    101   1.5  christos     ACPI_TABLE_DESC         *TableDesc,
    102  1.11  christos     const char              *Signature,
    103  1.11  christos     UINT32                  *TableIndex);
    104   1.5  christos 
    105   1.5  christos BOOLEAN
    106   1.5  christos AcpiTbIsTableLoaded (
    107   1.5  christos     UINT32                  TableIndex);
    108   1.5  christos 
    109   1.5  christos void
    110   1.5  christos AcpiTbSetTableLoadedFlag (
    111   1.5  christos     UINT32                  TableIndex,
    112   1.5  christos     BOOLEAN                 IsLoaded);
    113   1.5  christos 
    114   1.5  christos 
    115   1.5  christos /*
    116   1.1    jruoho  * tbfadt - FADT parse/convert/validate
    117   1.1    jruoho  */
    118   1.1    jruoho void
    119   1.1    jruoho AcpiTbParseFadt (
    120   1.7  christos     void);
    121   1.1    jruoho 
    122   1.1    jruoho void
    123   1.1    jruoho AcpiTbCreateLocalFadt (
    124   1.1    jruoho     ACPI_TABLE_HEADER       *Table,
    125   1.1    jruoho     UINT32                  Length);
    126   1.1    jruoho 
    127   1.1    jruoho 
    128   1.1    jruoho /*
    129   1.1    jruoho  * tbfind - find ACPI table
    130   1.1    jruoho  */
    131   1.1    jruoho ACPI_STATUS
    132   1.1    jruoho AcpiTbFindTable (
    133   1.1    jruoho     char                    *Signature,
    134   1.1    jruoho     char                    *OemId,
    135   1.1    jruoho     char                    *OemTableId,
    136   1.1    jruoho     UINT32                  *TableIndex);
    137   1.1    jruoho 
    138   1.1    jruoho 
    139   1.1    jruoho /*
    140   1.1    jruoho  * tbinstal - Table removal and deletion
    141   1.1    jruoho  */
    142   1.1    jruoho ACPI_STATUS
    143   1.1    jruoho AcpiTbResizeRootTableList (
    144   1.1    jruoho     void);
    145   1.1    jruoho 
    146   1.1    jruoho ACPI_STATUS
    147   1.5  christos AcpiTbValidateTable (
    148   1.1    jruoho     ACPI_TABLE_DESC         *TableDesc);
    149   1.1    jruoho 
    150   1.5  christos void
    151   1.5  christos AcpiTbInvalidateTable (
    152   1.4  christos     ACPI_TABLE_DESC         *TableDesc);
    153   1.4  christos 
    154   1.5  christos void
    155   1.5  christos AcpiTbOverrideTable (
    156   1.5  christos     ACPI_TABLE_DESC         *OldTableDesc);
    157   1.5  christos 
    158   1.1    jruoho ACPI_STATUS
    159   1.5  christos AcpiTbAcquireTable (
    160   1.1    jruoho     ACPI_TABLE_DESC         *TableDesc,
    161   1.5  christos     ACPI_TABLE_HEADER       **TablePtr,
    162   1.5  christos     UINT32                  *TableLength,
    163   1.5  christos     UINT8                   *TableFlags);
    164   1.5  christos 
    165   1.5  christos void
    166   1.5  christos AcpiTbReleaseTable (
    167   1.5  christos     ACPI_TABLE_HEADER       *Table,
    168   1.5  christos     UINT32                  TableLength,
    169   1.5  christos     UINT8                   TableFlags);
    170   1.5  christos 
    171   1.5  christos ACPI_STATUS
    172   1.5  christos AcpiTbInstallStandardTable (
    173   1.5  christos     ACPI_PHYSICAL_ADDRESS   Address,
    174   1.5  christos     UINT8                   Flags,
    175  1.16  christos     ACPI_TABLE_HEADER       *Table,
    176   1.5  christos     BOOLEAN                 Reload,
    177   1.5  christos     BOOLEAN                 Override,
    178   1.1    jruoho     UINT32                  *TableIndex);
    179   1.1    jruoho 
    180   1.1    jruoho void
    181   1.5  christos AcpiTbUninstallTable (
    182   1.1    jruoho     ACPI_TABLE_DESC        *TableDesc);
    183   1.1    jruoho 
    184   1.9  christos ACPI_STATUS
    185   1.9  christos AcpiTbLoadTable (
    186   1.9  christos     UINT32                  TableIndex,
    187   1.9  christos     ACPI_NAMESPACE_NODE     *ParentNode);
    188   1.9  christos 
    189   1.9  christos ACPI_STATUS
    190   1.9  christos AcpiTbInstallAndLoadTable (
    191   1.9  christos     ACPI_PHYSICAL_ADDRESS   Address,
    192   1.9  christos     UINT8                   Flags,
    193  1.16  christos     ACPI_TABLE_HEADER       *Table,
    194   1.9  christos     BOOLEAN                 Override,
    195   1.9  christos     UINT32                  *TableIndex);
    196   1.9  christos 
    197  1.10  christos ACPI_STATUS
    198  1.10  christos AcpiTbUnloadTable (
    199  1.10  christos     UINT32                  TableIndex);
    200  1.10  christos 
    201   1.1    jruoho void
    202  1.11  christos AcpiTbNotifyTable (
    203  1.11  christos     UINT32                          Event,
    204  1.11  christos     void                            *Table);
    205  1.11  christos 
    206  1.11  christos void
    207   1.1    jruoho AcpiTbTerminate (
    208   1.1    jruoho     void);
    209   1.1    jruoho 
    210   1.1    jruoho ACPI_STATUS
    211   1.1    jruoho AcpiTbDeleteNamespaceByOwner (
    212   1.1    jruoho     UINT32                  TableIndex);
    213   1.1    jruoho 
    214   1.1    jruoho ACPI_STATUS
    215   1.1    jruoho AcpiTbAllocateOwnerId (
    216   1.1    jruoho     UINT32                  TableIndex);
    217   1.1    jruoho 
    218   1.1    jruoho ACPI_STATUS
    219   1.1    jruoho AcpiTbReleaseOwnerId (
    220   1.1    jruoho     UINT32                  TableIndex);
    221   1.1    jruoho 
    222   1.1    jruoho ACPI_STATUS
    223   1.1    jruoho AcpiTbGetOwnerId (
    224   1.1    jruoho     UINT32                  TableIndex,
    225   1.1    jruoho     ACPI_OWNER_ID           *OwnerId);
    226   1.1    jruoho 
    227   1.1    jruoho 
    228   1.1    jruoho /*
    229   1.1    jruoho  * tbutils - table manager utilities
    230   1.1    jruoho  */
    231   1.1    jruoho ACPI_STATUS
    232   1.1    jruoho AcpiTbInitializeFacs (
    233   1.1    jruoho     void);
    234   1.1    jruoho 
    235   1.1    jruoho void
    236   1.1    jruoho AcpiTbPrintTableHeader(
    237   1.1    jruoho     ACPI_PHYSICAL_ADDRESS   Address,
    238   1.1    jruoho     ACPI_TABLE_HEADER       *Header);
    239   1.1    jruoho 
    240   1.1    jruoho UINT8
    241   1.1    jruoho AcpiTbChecksum (
    242   1.1    jruoho     UINT8                   *Buffer,
    243   1.1    jruoho     UINT32                  Length);
    244   1.1    jruoho 
    245   1.1    jruoho ACPI_STATUS
    246   1.1    jruoho AcpiTbVerifyChecksum (
    247   1.1    jruoho     ACPI_TABLE_HEADER       *Table,
    248   1.1    jruoho     UINT32                  Length);
    249   1.1    jruoho 
    250   1.1    jruoho void
    251   1.1    jruoho AcpiTbCheckDsdtHeader (
    252   1.1    jruoho     void);
    253   1.1    jruoho 
    254   1.1    jruoho ACPI_TABLE_HEADER *
    255   1.1    jruoho AcpiTbCopyDsdt (
    256   1.1    jruoho     UINT32                  TableIndex);
    257   1.1    jruoho 
    258   1.1    jruoho void
    259   1.5  christos AcpiTbInstallTableWithOverride (
    260   1.5  christos     ACPI_TABLE_DESC         *NewTableDesc,
    261   1.7  christos     BOOLEAN                 Override,
    262   1.7  christos     UINT32                  *TableIndex);
    263   1.5  christos 
    264   1.5  christos ACPI_STATUS
    265   1.1    jruoho AcpiTbParseRootTable (
    266   1.1    jruoho     ACPI_PHYSICAL_ADDRESS   RsdpAddress);
    267   1.1    jruoho 
    268  1.10  christos ACPI_STATUS
    269  1.10  christos AcpiTbGetTable (
    270  1.10  christos     ACPI_TABLE_DESC        *TableDesc,
    271  1.10  christos     ACPI_TABLE_HEADER      **OutTable);
    272  1.10  christos 
    273  1.10  christos void
    274  1.10  christos AcpiTbPutTable (
    275  1.10  christos     ACPI_TABLE_DESC        *TableDesc);
    276  1.10  christos 
    277   1.7  christos 
    278   1.7  christos /*
    279   1.7  christos  * tbxfload
    280   1.7  christos  */
    281   1.7  christos ACPI_STATUS
    282   1.7  christos AcpiTbLoadNamespace (
    283   1.7  christos     void);
    284   1.7  christos 
    285   1.1    jruoho #endif /* __ACTABLES_H__ */
    286