static void pl050_write(void *opaque, hwaddr offset,

                        uint64_t value, unsigned size)

{

    pl050_state *s = (pl050_state *)opaque;

    switch (offset >> 2) {

    case 0: /* KMICR */

        s->cr = value;

        pl050_update(s, s->pending);

        /* ??? Need to implement the enable/disable bit.  */

        break;

    case 2: /* KMIDATA */

        /* ??? This should toggle the TX interrupt line.  */

        /* ??? This means kbd/mouse can block each other.  */

        if (s->is_mouse) {

            ps2_write_mouse(s->dev, value);

        } else {

            ps2_write_keyboard(s->dev, value);

        }

        break;

    case 3: /* KMICLKDIV */

        s->clk = value;

        return;

    default:

        hw_error("pl050_write: Bad offset %x\n", (int)offset);

    }

}

static void pl050_write(void *opaque, hwaddr offset,

                        uint64_t value, unsigned size)

{

    pl050_state *s = (pl050_state *)opaque;

    switch (offset >> 2) {

    case 0: 

        s->cr = value;

        pl050_update(s, s->pending);

        

        break;

    case 2: 

        

        

        if (s->is_mouse) {

            ps2_write_mouse(s->dev, value);

        } else {

            ps2_write_keyboard(s->dev, value);

        }

        break;

    case 3: 

        s->clk = value;

        return;

    default:

        hw_error("pl050_write: Bad offset %x\n", (int)offset);

    }

}

static void FUNC_0(void *VAR_0, hwaddr VAR_1,

                        uint64_t VAR_2, unsigned VAR_3)

{

    pl050_state *s = (pl050_state *)VAR_0;

    switch (VAR_1 >> 2) {

    case 0: 

        s->cr = VAR_2;

        pl050_update(s, s->pending);

        

        break;

    case 2: 

        

        

        if (s->is_mouse) {

            ps2_write_mouse(s->dev, VAR_2);

        } else {

            ps2_write_keyboard(s->dev, VAR_2);

        }

        break;

    case 3: 

        s->clk = VAR_2;

        return;

    default:

        hw_error("FUNC_0: Bad VAR_1 %x\n", (int)VAR_1);

    }

}

static void FUNC_0(void *VAR_0, hwaddr VAR_1,
uint64_t VAR_2, unsigned VAR_3)
{ pl050_state *s = (pl050_state *)VAR_0; switch (VAR_1 >> 2) { case 0:
s->cr = VAR_2; pl050_update(s, s->pending); break; case 2:
if (s->is_mouse) { ps2_write_mouse(s->dev, VAR_2); } else { ps2_write_keyboard(s->dev, VAR_2); } break; case 3:
s->clk = VAR_2; return; default:
hw_error("FUNC_0: Bad VAR_1 %x\n", (int)VAR_1); } }