static void qpci_spapr_io_writew(QPCIBus *bus, void *addr, uint16_t value)

{

    QPCIBusSPAPR *s = container_of(bus, QPCIBusSPAPR, bus);

    uint64_t port = (uintptr_t)addr;

    value = bswap16(value);

    if (port < s->pio.size) {

        writew(s->pio_cpu_base + port, value);

    } else {

        writew(s->mmio_cpu_base + port, value);

    }

}

static void qpci_spapr_io_writew(QPCIBus *bus, void *addr, uint16_t value)

{

    QPCIBusSPAPR *s = container_of(bus, QPCIBusSPAPR, bus);

    uint64_t port = (uintptr_t)addr;

    value = bswap16(value);

    if (port < s->pio.size) {

        writew(s->pio_cpu_base + port, value);

    } else {

        writew(s->mmio_cpu_base + port, value);

    }

}

static void FUNC_0(QPCIBus *VAR_0, void *VAR_1, uint16_t VAR_2)

{

    QPCIBusSPAPR *s = container_of(VAR_0, QPCIBusSPAPR, VAR_0);

    uint64_t port = (uintptr_t)VAR_1;

    VAR_2 = bswap16(VAR_2);

    if (port < s->pio.size) {

        writew(s->pio_cpu_base + port, VAR_2);

    } else {

        writew(s->mmio_cpu_base + port, VAR_2);

    }

}

static void FUNC_0(QPCIBus *VAR_0, void *VAR_1, uint16_t VAR_2)
{ QPCIBusSPAPR *s = container_of(VAR_0, QPCIBusSPAPR, VAR_0); uint64_t port = (uintptr_t)VAR_1; VAR_2 = bswap16(VAR_2); if (port < s->pio.size) { writew(s->pio_cpu_base + port, VAR_2); } else { writew(s->mmio_cpu_base + port, VAR_2); } }