AcpiSupport.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. /** @file
  2. This protocol provides some basic services to support publishing ACPI system tables. The
  3. services handle many of the more mundane tasks that are required to publish a set of tables. The
  4. services will:
  5. - Generate common tables.
  6. - Update the table links.
  7. - Ensure that tables are properly aligned and use correct types of memory.
  8. - Update checksum values and IDs.
  9. - Complete the final installation of the tables.
  10. Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
  11. SPDX-License-Identifier: BSD-2-Clause-Patent
  12. @par Revision Reference:
  13. This Protocol is defined in Framework ACPI Specification.
  14. Version 0.9.
  15. **/
  16. #ifndef _ACPI_SUPPORT_PROTOCOL_H_
  17. #define _ACPI_SUPPORT_PROTOCOL_H_
  18. #include <Protocol/AcpiSystemDescriptionTable.h>
  19. typedef struct _EFI_ACPI_SUPPORT_PROTOCOL EFI_ACPI_SUPPORT_PROTOCOL;
  20. //
  21. // ACPI Support Protocol GUID
  22. //
  23. #define EFI_ACPI_SUPPORT_GUID \
  24. { \
  25. 0xdbff9d55, 0x89b7, 0x46da, {0xbd, 0xdf, 0x67, 0x7d, 0x3d, 0xc0, 0x24, 0x1d } \
  26. }
  27. //
  28. // Protocol Member Functions
  29. //
  30. /**
  31. Returns a requested ACPI table.
  32. @param This A pointer to the EFI_ACPI_SUPPORT_PROTOCOL instance.
  33. @param Index The zero-based index of the table to retrieve.
  34. @param Table The pointer for returning the table buffer.
  35. @param Version Updated with the ACPI versions to which this table belongs.
  36. @param Handle The pointer for identifying the table.
  37. @retval EFI_SUCCESS The function completed successfully.
  38. @retval EFI_NOT_FOUND The requested index is too large and a table was not found.
  39. **/
  40. typedef
  41. EFI_STATUS
  42. (EFIAPI *EFI_ACPI_GET_ACPI_TABLE)(
  43. IN EFI_ACPI_SUPPORT_PROTOCOL *This,
  44. IN INTN Index,
  45. OUT VOID **Table,
  46. OUT EFI_ACPI_TABLE_VERSION *Version,
  47. OUT UINTN *Handle
  48. );
  49. /**
  50. Used to add, remove, or update ACPI tables.
  51. @param This A pointer to the EFI_ACPI_SUPPORT_PROTOCOL instance.
  52. @param Table The pointer to the new table to add or update.
  53. @param Checksum If TRUE, indicates that the checksum should be
  54. calculated for this table.
  55. @param Version Indicates to which version(s) of ACPI the table should be added.
  56. @param Handle The pointer to the handle of the table to remove or update.
  57. @retval EFI_SUCCESS The function completed successfully.
  58. @retval EFI_INVALID_PARAMETER *Handle was zero and Table was NULL.
  59. @retval EFI_ABORTED Could not complete the desired action.
  60. **/
  61. typedef
  62. EFI_STATUS
  63. (EFIAPI *EFI_ACPI_SET_ACPI_TABLE)(
  64. IN EFI_ACPI_SUPPORT_PROTOCOL *This,
  65. IN VOID *Table OPTIONAL,
  66. IN BOOLEAN Checksum,
  67. IN EFI_ACPI_TABLE_VERSION Version,
  68. IN OUT UINTN *Handle
  69. );
  70. /**
  71. Causes one or more versions of the ACPI tables to be published in
  72. the EFI system configuration tables.
  73. The PublishTables() function installs the ACPI tables for the versions that are specified in
  74. Version. No tables are published for Version equal to EFI_ACPI_VERSION_NONE. Once
  75. published, tables will continue to be updated as tables are modified with
  76. EFI_ACPI_SUPPORT_PROTOCOL.SetAcpiTable().
  77. @param This A pointer to the EFI_ACPI_SUPPORT_PROTOCOL instance.
  78. @param Version Indicates to which version(s) of ACPI the table should be published.
  79. @retval EFI_SUCCESS The function completed successfully.
  80. @retval EFI_ABORTED An error occurred and the function could not complete successfully.
  81. **/
  82. typedef
  83. EFI_STATUS
  84. (EFIAPI *EFI_ACPI_PUBLISH_TABLES)(
  85. IN EFI_ACPI_SUPPORT_PROTOCOL *This,
  86. IN EFI_ACPI_TABLE_VERSION Version
  87. );
  88. //
  89. // ACPI Support Protocol
  90. //
  91. /**
  92. This protocol provides some basic services to support publishing ACPI system
  93. tables. The services handle many of the more mundane tasks that are required
  94. to publish a set of tables.
  95. **/
  96. struct _EFI_ACPI_SUPPORT_PROTOCOL {
  97. ///
  98. /// Returns a table specified by an index if it exists.
  99. ///
  100. EFI_ACPI_GET_ACPI_TABLE GetAcpiTable;
  101. ///
  102. /// Adds, removes, or updates ACPI tables.
  103. ///
  104. EFI_ACPI_SET_ACPI_TABLE SetAcpiTable;
  105. ///
  106. /// Publishes the ACPI tables.
  107. ///
  108. EFI_ACPI_PUBLISH_TABLES PublishTables;
  109. };
  110. //
  111. // Extern the GUID for protocol users.
  112. //
  113. extern EFI_GUID gEfiAcpiSupportProtocolGuid;
  114. #endif