SsdtPcieSupportLib.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /** @file
  2. Ssdt PCIe Support Library
  3. Copyright (c) 2021 - 2022, Arm Limited. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef SSDT_PCIE_SUPPORT_LIB_H_
  7. #define SSDT_PCIE_SUPPORT_LIB_H_
  8. #pragma pack(1)
  9. /** Structure used to map integer to an index.
  10. */
  11. typedef struct MappingTable {
  12. /// Mapping table.
  13. /// Contains the Index <-> integer mapping
  14. UINT32 *Table;
  15. /// Last used index of the Table.
  16. /// Bound by MaxIndex.
  17. UINT32 LastIndex;
  18. /// Number of entries in the Table.
  19. UINT32 MaxIndex;
  20. } MAPPING_TABLE;
  21. #pragma pack()
  22. /** Add an _OSC template method to the PciNode.
  23. The _OSC method is provided as an AML blob. The blob is
  24. parsed and attached at the end of the PciNode list of variable elements.
  25. @param [in] PciInfo Pci device information.
  26. @param [in, out] PciNode Pci node to amend.
  27. @retval EFI_SUCCESS The function completed successfully.
  28. @retval EFI_INVALID_PARAMETER Invalid parameter.
  29. @retval EFI_OUT_OF_RESOURCES Could not allocate memory.
  30. **/
  31. EFI_STATUS
  32. EFIAPI
  33. AddOscMethod (
  34. IN CONST CM_ARM_PCI_CONFIG_SPACE_INFO *PciInfo,
  35. IN OUT AML_OBJECT_NODE_HANDLE PciNode
  36. );
  37. /** Generate Pci slots devices.
  38. PCI Firmware Specification - Revision 3.3,
  39. s4.8 "Generic ACPI PCI Slot Description" requests to describe the PCI slot
  40. used. It should be possible to enumerate them, but this is additional
  41. information.
  42. @param [in] PciInfo Pci device information.
  43. @param [in] MappingTable The mapping table structure.
  44. @param [in, out] PciNode Pci node to amend.
  45. @retval EFI_SUCCESS Success.
  46. @retval EFI_INVALID_PARAMETER Invalid parameter.
  47. @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
  48. **/
  49. EFI_STATUS
  50. EFIAPI
  51. GeneratePciSlots (
  52. IN CONST CM_ARM_PCI_CONFIG_SPACE_INFO *PciInfo,
  53. IN CONST MAPPING_TABLE *MappingTable,
  54. IN OUT AML_OBJECT_NODE_HANDLE PciNode
  55. );
  56. #endif // SSDT_PCIE_SUPPORT_LIB_H_