qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 2/2] Add support for Zipit Z2 machine


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v4 2/2] Add support for Zipit Z2 machine
Date: Fri, 24 Jun 2011 15:45:06 +0100

On 17 June 2011 11:04, Vasily Khoruzhick <address@hidden> wrote:
> Zipit Z2 is small PXA270 based handheld.
>
> Signed-off-by: Vasily Khoruzhick <address@hidden>

These patches are affected by the bug in current qemu master
which breaks cpu_physical_memory_map() so I haven't tested them yet.
Some minor nitpicks (nearly there now):

> +            if (z->cur_reg == 0x22 && val == 0x0000) {
> +                z->enabled = 1;
> +                printf("%s: LCD enabled\n", __func__);
> +            } else if (z->cur_reg == 0x10 && val == 0x0000) {
> +                z->enabled = 0;
> +                printf("%s: LCD disabled\n", __func__);
> +            }

Drop or use DPRINTF for these printfs, please.

> +            break;
> +        default:
> +            fprintf(stderr, "%s: unknown command!\n", __func__);

Ditto.

> +static VMStateDescription vmstate_zipit_lcd_state = {
> +    .name = "zipit-lcd",
> +    .version_id = 1,
> +    .minimum_version_id = 1,
> +    .minimum_version_id_old = 1,
> +    .fields = (VMStateField[]) {
> +        VMSTATE_INT32(enabled, ZipitLCD),
> +        VMSTATE_END_OF_LIST(),
> +    }
> +};

This is missing fields for selected, buf[] and cur_reg.

> +    if (s->len++ > 2) {
> +        fprintf(stderr, "%s: message too long (%i bytes)\n",
> +            __func__, s->len);
> +        return 1;
> +    }

DPRINTF.

> +    case I2C_START_RECV:
> +        if (s->len != 1) {
> +            fprintf(stderr, "%s: short message!?\n", __func__);
> +        }
> +        break;

Ditto.

> +static VMStateDescription vmstate_aer915_state = {
> +    .name = "aer915",
> +    .version_id = 1,
> +    .minimum_version_id = 1,
> +    .minimum_version_id_old = 1,
> +    .fields = (VMStateField[]) {
> +        VMSTATE_END_OF_LIST(),
> +    }
> +};

Missing fields for len and buf[].

Looks ok otherwise. (Patch 1 looks ok too.)

Have you tried vmload/vmsave, by the way? (I don't know if all the
devices the pxa2xx uses have save/load support implemented, it
would be interesting to check if you haven't already.)

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]