aboutsummaryrefslogtreecommitdiff
path: root/hw/sparc64/sun4u.c
diff options
context:
space:
mode:
authorChuck Zmudzinski <brchuckz@aol.com>2023-03-15 10:26:19 -0400
committerMichael S. Tsirkin <mst@redhat.com>2023-04-21 04:25:52 -0400
commitb93fe7f2ca9aea5ef74db5881aabecd7b1c234ed (patch)
tree4d99b895885926fc3df70522b76d08e65b2dad16 /hw/sparc64/sun4u.c
parent0259dd3e6ffe35145068ddc1bfb5c3ec06b33f48 (diff)
downloadqemu-b93fe7f2ca9aea5ef74db5881aabecd7b1c234ed.zip
qemu-b93fe7f2ca9aea5ef74db5881aabecd7b1c234ed.tar.gz
qemu-b93fe7f2ca9aea5ef74db5881aabecd7b1c234ed.tar.bz2
pci: avoid accessing slot_reserved_mask directly outside of pci.c
This patch provides accessor functions as replacements for direct access to slot_reserved_mask according to the comment at the top of include/hw/pci/pci_bus.h which advises that data structures for PCIBus should not be directly accessed but instead be accessed using accessor functions in pci.h. Three accessor functions can conveniently replace all direct accesses of slot_reserved_mask. With this patch, the new accessor functions are used in hw/sparc64/sun4u.c and hw/xen/xen_pt.c and pci_bus.h is removed from the included header files of the same two files. No functional change intended. Signed-off-by: Chuck Zmudzinski <brchuckz@aol.com> Message-Id: <b1b7f134883cbc83e455abbe5ee225c71aa0e8d0.1678888385.git.brchuckz@aol.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> [sun4u]
Diffstat (limited to 'hw/sparc64/sun4u.c')
-rw-r--r--hw/sparc64/sun4u.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index a25e951..eae7589 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -31,7 +31,6 @@
#include "hw/irq.h"
#include "hw/pci/pci.h"
#include "hw/pci/pci_bridge.h"
-#include "hw/pci/pci_bus.h"
#include "hw/pci/pci_host.h"
#include "hw/qdev-properties.h"
#include "hw/pci-host/sabre.h"
@@ -608,9 +607,9 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
/* Only in-built Simba APBs can exist on the root bus, slot 0 on busA is
reserved (leaving no slots free after on-board devices) however slots
0-3 are free on busB */
- pci_bus->slot_reserved_mask = 0xfffffffc;
- pci_busA->slot_reserved_mask = 0xfffffff1;
- pci_busB->slot_reserved_mask = 0xfffffff0;
+ pci_bus_set_slot_reserved_mask(pci_bus, 0xfffffffc);
+ pci_bus_set_slot_reserved_mask(pci_busA, 0xfffffff1);
+ pci_bus_set_slot_reserved_mask(pci_busB, 0xfffffff0);
ebus = pci_new_multifunction(PCI_DEVFN(1, 0), true, TYPE_EBUS);
qdev_prop_set_uint64(DEVICE(ebus), "console-serial-base",