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


Reply via email to