@@ -1133,7 +1133,7 @@ static int intel_hda_init(PCIDevice *pci)
d->name = object_get_typename(OBJECT(d));
- pci_config_set_interrupt_pin(conf, 1);
+ pci_set_byte(conf + PCI_INTERRUPT_PIN, 1);
/* HDCTL off 0x40 bit 0 selects signaling mode (1-HDA, 0 - Ac97) 18.1.19 */
conf[0x40] = 0x01;
@@ -76,7 +76,7 @@ static int ich9_smbus_initfn(PCIDevice *d)
ICH9SMBState *s = ICH9_SMB_DEVICE(d);
/* TODO? D31IP.SMIP in chipset configuration space */
- pci_config_set_interrupt_pin(d->config, 0x01); /* interrupt pin 1 */
+ pci_set_byte(d->config + PCI_INTERRUPT_PIN, 0x01); /* interrupt pin 1 */
pci_set_byte(d->config + ICH9_SMB_HOSTC, 0);
/* TODO bar0, bar1: 64bit BAR support*/
@@ -111,7 +111,7 @@ static int pci_ich9_ahci_init(PCIDevice *dev)
dev->config[PCI_CACHE_LINE_SIZE] = 0x08; /* Cache line size */
dev->config[PCI_LATENCY_TIMER] = 0x00; /* Latency timer */
- pci_config_set_interrupt_pin(dev->config, 1);
+ pci_set_byte(dev->config + PCI_INTERRUPT_PIN, 1);
/* XXX Software should program this register */
dev->config[0x90] = 1 << 6; /* Address Map Register - AHCI mode */
@@ -73,7 +73,7 @@ static int i82378_initfn(PCIDevice *pci)
pci_set_word(pci_conf + PCI_STATUS,
PCI_STATUS_DEVSEL_MEDIUM);
- pci_config_set_interrupt_pin(pci_conf, 1); /* interrupt pin 0 */
+ pci_set_byte(pci_conf + PCI_INTERRUPT_PIN, 1); /* interrupt pin 0 */
isabus = isa_bus_new(dev, pci_address_space_io(pci));
@@ -747,7 +747,7 @@ static int pci_ivshmem_init(PCIDevice *dev)
pci_conf = dev->config;
pci_conf[PCI_COMMAND] = PCI_COMMAND_IO | PCI_COMMAND_MEMORY;
- pci_config_set_interrupt_pin(pci_conf, 1);
+ pci_set_byte(pci_conf + PCI_INTERRUPT_PIN, 1);
s->shm_fd = 0;
@@ -561,7 +561,7 @@ static int vfio_enable_intx(VFIODevice *vdev)
vfio_disable_interrupts(vdev);
vdev->intx.pin = pin - 1; /* Pin A (1) -> irq[0] */
- pci_config_set_interrupt_pin(vdev->pdev.config, pin);
+ pci_set_byte(vdev->pdev.config + PCI_INTERRUPT_PIN, pin);
#ifdef CONFIG_KVM
/*
@@ -1077,7 +1077,7 @@ pvscsi_init(PCIDevice *pci_dev)
pci_dev->config[PCI_LATENCY_TIMER] = 0xff;
/* Interrupt pin A */
- pci_config_set_interrupt_pin(pci_dev->config, 1);
+ pci_set_byte(pci_dev->config + PCI_INTERRUPT_PIN, 1);
memory_region_init_io(&s->io_space, OBJECT(s), &pvscsi_ops, s,
"pvscsi-io", PVSCSI_MEM_SPACE_SIZE);
@@ -1202,7 +1202,7 @@ static int usb_uhci_common_initfn(PCIDevice *dev)
/* TODO: reset value should be 0. */
pci_conf[USB_SBRN] = USB_RELEASE_1; // release number
- pci_config_set_interrupt_pin(pci_conf, u->info.irq_pin + 1);
+ pci_set_byte(pci_conf + PCI_INTERRUPT_PIN, u->info.irq_pin + 1);
if (s->masterbus) {
USBPort *ports[NB_PORTS];
@@ -461,12 +461,6 @@ pci_get_quad(const uint8_t *config)
return le64_to_cpup((const uint64_t *)config);
}
-static inline void
-pci_config_set_interrupt_pin(uint8_t *pci_config, uint8_t val)
-{
- pci_set_byte(&pci_config[PCI_INTERRUPT_PIN], val);
-}
-
/*
* helper functions to do bit mask operation on configuration space.
* Just to set bit, use test-and-set and discard returned value.
See also commit 'pci: remove pci_config_set_vendor_id'. Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> --- hw/audio/intel-hda.c | 2 +- hw/i2c/smbus_ich9.c | 2 +- hw/ide/ich.c | 2 +- hw/isa/i82378.c | 2 +- hw/misc/ivshmem.c | 2 +- hw/misc/vfio.c | 2 +- hw/scsi/vmw_pvscsi.c | 2 +- hw/usb/hcd-uhci.c | 2 +- include/hw/pci/pci.h | 6 ------ 9 files changed, 8 insertions(+), 14 deletions(-)