2
0

pci-bridge.c 926 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * QEMU ACPI PCI bridge
  3. *
  4. * Copyright (c) 2023 Red Hat, Inc.
  5. *
  6. * Author:
  7. * Igor Mammedov <imammedo@redhat.com>
  8. *
  9. * SPDX-License-Identifier: GPL-2.0-or-later
  10. *
  11. * This work is licensed under the terms of the GNU GPL, version 2 or later.
  12. * See the COPYING file in the top-level directory.
  13. */
  14. #include "qemu/osdep.h"
  15. #include "hw/acpi/pci.h"
  16. #include "hw/pci/pci_bridge.h"
  17. #include "hw/acpi/pcihp.h"
  18. void build_pci_bridge_aml(AcpiDevAmlIf *adev, Aml *scope)
  19. {
  20. PCIBridge *br = PCI_BRIDGE(adev);
  21. if (!DEVICE(br)->hotplugged) {
  22. PCIBus *sec_bus = pci_bridge_get_sec_bus(br);
  23. build_append_pci_bus_devices(scope, sec_bus);
  24. /*
  25. * generate hotplug slots descriptors if
  26. * bridge has ACPI PCI hotplug attached,
  27. */
  28. if (object_property_find(OBJECT(sec_bus), ACPI_PCIHP_PROP_BSEL)) {
  29. build_append_pcihp_slots(scope, sec_bus);
  30. }
  31. }
  32. }