[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v1 1/2] pl330: initial version
From: |
Kirill Batuzov |
Subject: |
Re: [Qemu-devel] [PATCH v1 1/2] pl330: initial version |
Date: |
Thu, 29 Mar 2012 18:29:46 +0400 (MSK) |
User-agent: |
Alpine 2.02 (DEB 1266 2009-07-14) |
On Thu, 29 Mar 2012, Peter A. G. Crosthwaite wrote:
> Device model for Primecell PL330 dma controller.
>
> Signed-off-by: Peter A. G. Crosthwaite <address@hidden>
> ---
Signed-off-by: Kirill Batuzov <address@hidden>
> +static int PL330Fifo_get(PL330Fifo *s, uint8_t *buf, int len, uint8_t tag)
> +{
> + int i, ret;
> + int old_s, old_t;
> +
> + old_s = s->s;
> + old_t = s->t;
> + for (i = 0; i < len; i++) {
> + if (s->t != s->s && s->tag[s->s] == tag) {
> + buf[i] = s->buf[s->s];
> + s->s = PL330Fifo_inc(s->s, s->buf_size);
> + } else {
> + /* Rollback transaction */
> + ret = (s->t == s->s) ? ret = PL330FIFO_STALL : PL330FIFO_ERR;
Minor issue - double assignement of ret in this line.
> + s->s = old_s;
> + s->t = old_t;
> + return ret;
> + }
> + }
> + return PL330FIFO_OK;
> +}
--
Kirill Batuzov