Home | History | Annotate | Download | only in Protocol
      1 /** @file
      2   The file provides the protocol to install or remove an ACPI
      3   table from a platform.
      4 
      5   Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
      6   This program and the accompanying materials
      7   are licensed and made available under the terms and conditions of the BSD License
      8   which accompanies this distribution.  The full text of the license may be found at
      9   http://opensource.org/licenses/bsd-license.php
     10 
     11   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     12   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     13 
     14 **/
     15 
     16 #ifndef __ACPI_TABLE_H___
     17 #define __ACPI_TABLE_H___
     18 
     19 #define EFI_ACPI_TABLE_PROTOCOL_GUID \
     20   { 0xffe06bdd, 0x6107, 0x46a6, { 0x7b, 0xb2, 0x5a, 0x9c, 0x7e, 0xc5, 0x27, 0x5c }}
     21 
     22 
     23 typedef struct _EFI_ACPI_TABLE_PROTOCOL EFI_ACPI_TABLE_PROTOCOL;
     24 
     25 /**
     26 
     27   The InstallAcpiTable() function allows a caller to install an
     28   ACPI table. When successful, the table will be linked by the
     29   RSDT/XSDT. AcpiTableBuffer specifies the table to be installed.
     30   InstallAcpiTable() will make a copy of the table and insert the
     31   copy into the RSDT/XSDT. InstallAcpiTable() must insert the new
     32   table at the end of the RSDT/XSDT. To prevent namespace
     33   collision, ACPI tables may be created using UEFI ACPI table
     34   format. If this protocol is used to install a table with a
     35   signature already present in the system, the new table will not
     36   replace the existing table. It is a platform implementation
     37   decision to add a new table with a signature matching an
     38   existing table or disallow duplicate table signatures and
     39   return EFI_ACCESS_DENIED. On successful output, TableKey is
     40   initialized with a unique key. Its value may be used in a
     41   subsequent call to UninstallAcpiTable to remove an ACPI table.
     42   If an EFI application is running at the time of this call, the
     43   relevant EFI_CONFIGURATION_TABLE pointer to the RSDT is no
     44   longer considered valid.
     45 
     46 
     47   @param This                 A pointer to a EFI_ACPI_TABLE_PROTOCOL.
     48 
     49   @param AcpiTableBuffer      A pointer to a buffer containing the
     50                               ACPI table to be installed.
     51 
     52   @param AcpiTableBufferSize  Specifies the size, in bytes, of
     53                               the AcpiTableBuffer buffer.
     54 
     55 
     56   @param TableKey             Returns a key to refer to the ACPI table.
     57 
     58   @retval EFI_SUCCESS           The table was successfully inserted
     59 
     60   @retval EFI_INVALID_PARAMETER Either AcpiTableBuffer is NULL,
     61                                 TableKey is NULL, or
     62                                 AcpiTableBufferSize and the size
     63                                 field embedded in the ACPI table
     64                                 pointed to by AcpiTableBuffer
     65                                 are not in sync.
     66 
     67   @retval EFI_OUT_OF_RESOURCES  Insufficient resources exist to
     68                                 complete the request.
     69   @retval EFI_ACCESS_DENIED     The table signature matches a table already
     70                                 present in the system and platform policy
     71                                 does not allow duplicate tables of this type.
     72 
     73 **/
     74 typedef
     75 EFI_STATUS
     76 (EFIAPI *EFI_ACPI_TABLE_INSTALL_ACPI_TABLE)(
     77   IN   EFI_ACPI_TABLE_PROTOCOL       *This,
     78   IN   VOID                          *AcpiTableBuffer,
     79   IN   UINTN                         AcpiTableBufferSize,
     80   OUT  UINTN                         *TableKey
     81 );
     82 
     83 
     84 /**
     85 
     86   The UninstallAcpiTable() function allows a caller to remove an
     87   ACPI table. The routine will remove its reference from the
     88   RSDT/XSDT. A table is referenced by the TableKey parameter
     89   returned from a prior call to InstallAcpiTable(). If an EFI
     90   application is running at the time of this call, the relevant
     91   EFI_CONFIGURATION_TABLE pointer to the RSDT is no longer
     92   considered valid.
     93 
     94   @param This                   A pointer to a EFI_ACPI_TABLE_PROTOCOL.
     95 
     96   @param TableKey               Specifies the table to uninstall. The key was
     97                                 returned from InstallAcpiTable().
     98 
     99   @retval EFI_SUCCESS           The table was successfully inserted
    100 
    101   @retval EFI_NOT_FOUND         TableKey does not refer to a valid key
    102                                 for a table entry.
    103 
    104   @retval EFI_OUT_OF_RESOURCES  Insufficient resources exist to
    105                                 complete the request.
    106 
    107 **/
    108 typedef
    109 EFI_STATUS
    110 (EFIAPI *EFI_ACPI_TABLE_UNINSTALL_ACPI_TABLE)(
    111   IN  EFI_ACPI_TABLE_PROTOCOL       *This,
    112   IN  UINTN                         TableKey
    113 );
    114 
    115 ///
    116 /// The EFI_ACPI_TABLE_PROTOCOL provides the ability for a component
    117 /// to install and uninstall ACPI tables from a platform.
    118 ///
    119 struct _EFI_ACPI_TABLE_PROTOCOL {
    120   EFI_ACPI_TABLE_INSTALL_ACPI_TABLE   InstallAcpiTable;
    121   EFI_ACPI_TABLE_UNINSTALL_ACPI_TABLE UninstallAcpiTable;
    122 };
    123 
    124 extern EFI_GUID gEfiAcpiTableProtocolGuid;
    125 
    126 #endif
    127 
    128