PciHostBridge.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /** @file
  2. Header file of PciHostBridgeLib.
  3. Copyright (C) 2016, Red Hat, Inc.
  4. Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
  5. This program and the accompanying materials are licensed and made available
  6. under the terms and conditions of the BSD License which accompanies this
  7. distribution. The full text of the license may be found at
  8. http://opensource.org/licenses/bsd-license.php.
  9. THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
  10. WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
  11. **/
  12. #ifndef _PCI_HOST_BRIDGE_H
  13. #define _PCI_HOST_BRIDGE_H
  14. typedef struct {
  15. ACPI_HID_DEVICE_PATH AcpiDevicePath;
  16. EFI_DEVICE_PATH_PROTOCOL EndDevicePath;
  17. } CB_PCI_ROOT_BRIDGE_DEVICE_PATH;
  18. PCI_ROOT_BRIDGE *
  19. ScanForRootBridges (
  20. UINTN *NumberOfRootBridges
  21. );
  22. /**
  23. Initialize a PCI_ROOT_BRIDGE structure.
  24. @param[in] Supports Supported attributes.
  25. @param[in] Attributes Initial attributes.
  26. @param[in] AllocAttributes Allocation attributes.
  27. @param[in] RootBusNumber The bus number to store in RootBus.
  28. @param[in] MaxSubBusNumber The inclusive maximum bus number that can be
  29. assigned to any subordinate bus found behind any
  30. PCI bridge hanging off this root bus.
  31. The caller is responsible for ensuring that
  32. RootBusNumber <= MaxSubBusNumber. If
  33. RootBusNumber equals MaxSubBusNumber, then the
  34. root bus has no room for subordinate buses.
  35. @param[in] Io IO aperture.
  36. @param[in] Mem MMIO aperture.
  37. @param[in] MemAbove4G MMIO aperture above 4G.
  38. @param[in] PMem Prefetchable MMIO aperture.
  39. @param[in] PMemAbove4G Prefetchable MMIO aperture above 4G.
  40. @param[out] RootBus The PCI_ROOT_BRIDGE structure (allocated by the
  41. caller) that should be filled in by this
  42. function.
  43. @retval EFI_SUCCESS Initialization successful. A device path
  44. consisting of an ACPI device path node, with
  45. UID = RootBusNumber, has been allocated and
  46. linked into RootBus.
  47. @retval EFI_OUT_OF_RESOURCES Memory allocation failed.
  48. **/
  49. EFI_STATUS
  50. InitRootBridge (
  51. IN UINT64 Supports,
  52. IN UINT64 Attributes,
  53. IN UINT64 AllocAttributes,
  54. IN UINT8 RootBusNumber,
  55. IN UINT8 MaxSubBusNumber,
  56. IN PCI_ROOT_BRIDGE_APERTURE *Io,
  57. IN PCI_ROOT_BRIDGE_APERTURE *Mem,
  58. IN PCI_ROOT_BRIDGE_APERTURE *MemAbove4G,
  59. IN PCI_ROOT_BRIDGE_APERTURE *PMem,
  60. IN PCI_ROOT_BRIDGE_APERTURE *PMemAbove4G,
  61. OUT PCI_ROOT_BRIDGE *RootBus
  62. );
  63. #endif