[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [PATCH v4 2/7] raven: implement non-contiguous I/O region
From: |
Andreas Färber |
Subject: |
Re: [Qemu-ppc] [PATCH v4 2/7] raven: implement non-contiguous I/O region |
Date: |
Thu, 20 Mar 2014 00:22:09 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
Am 17.03.2014 23:00, schrieb Hervé Poussineau:
> +static uint64_t raven_io_read(void *opaque, hwaddr addr,
> + unsigned int size)
> +{
> + PREPPCIState *s = opaque;
> + uint8_t buf[4];
> +
> + addr = raven_io_address(s, addr);
> + address_space_read(&s->pci_io_as, addr, buf, size);
> +
> + if (size == 1) {
> + return buf[0];
> + } else if (size == 2) {
> + return lduw_p(buf);
> + } else if (size == 4) {
> + return ldl_p(buf);
> + } else {
> + assert(false);
> + }
> +}
> +
> +static void raven_io_write(void *opaque, hwaddr addr,
> + uint64_t val, unsigned int size)
> +{
> + PREPPCIState *s = opaque;
> + uint8_t buf[4];
> +
> + addr = raven_io_address(s, addr);
> +
> + if (size == 1) {
> + buf[0] = val;
> + } else if (size == 2) {
> + stw_p(buf, val);
> + } else if (size == 4) {
> + stl_p(buf, val);
> + } else {
> + assert(false);
Replacing these two with g_assert_not_reached().
Regards,
Andreas
- [Qemu-ppc] [PATCH v4 0/7] prep: improve Raven PCI host emulation, Hervé Poussineau, 2014/03/17
- [Qemu-ppc] [PATCH v4 2/7] raven: implement non-contiguous I/O region, Hervé Poussineau, 2014/03/17
- Re: [Qemu-ppc] [PATCH v4 2/7] raven: implement non-contiguous I/O region,
Andreas Färber <=
- [Qemu-ppc] [PATCH v4 1/7] raven: rename intack region to pci_intack, Hervé Poussineau, 2014/03/17
- [Qemu-ppc] [PATCH v4 3/7] raven: set a correct PCI I/O memory region, Hervé Poussineau, 2014/03/17
- [Qemu-ppc] [PATCH v4 4/7] raven: set a correct PCI memory region, Hervé Poussineau, 2014/03/17
- [Qemu-ppc] [PATCH v4 5/7] raven: add PCI bus mastering address space, Hervé Poussineau, 2014/03/17
- [Qemu-ppc] [PATCH v4 6/7] raven: fix PCI bus accesses with size > 1, Hervé Poussineau, 2014/03/17
- [Qemu-ppc] [PATCH v4 7/7] raven: use raven_ for all function prefixes, Hervé Poussineau, 2014/03/17