static void pxa2xx_pm_write(void *opaque, hwaddr addr,

                            uint64_t value, unsigned size)

{

    PXA2xxState *s = (PXA2xxState *) opaque;



    switch (addr) {

    case PMCR:

        /* Clear the write-one-to-clear bits... */

        s->pm_regs[addr >> 2] &= ~(value & 0x2a);

        /* ...and set the plain r/w bits */

        s->pm_regs[addr >> 2] &= ~0x15;

        s->pm_regs[addr >> 2] |= value & 0x15;

        break;



    case PSSR:	/* Read-clean registers */

    case RCSR:

    case PKSR:

        s->pm_regs[addr >> 2] &= ~value;

        break;



    default:	/* Read-write registers */

        if (!(addr & 3)) {

            s->pm_regs[addr >> 2] = value;

            break;

        }



        printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr);

        break;

    }

}

static void pxa2xx_pm_write(void *opaque, hwaddr addr,

                            uint64_t value, unsigned size)

{

    PXA2xxState *s = (PXA2xxState *) opaque;



    switch (addr) {

    case PMCR:

        

        s->pm_regs[addr >> 2] &= ~(value & 0x2a);

        

        s->pm_regs[addr >> 2] &= ~0x15;

        s->pm_regs[addr >> 2] |= value & 0x15;

        break;



    case PSSR:	

    case RCSR:

    case PKSR:

        s->pm_regs[addr >> 2] &= ~value;

        break;



    default:	

        if (!(addr & 3)) {

            s->pm_regs[addr >> 2] = value;

            break;

        }



        printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr);

        break;

    }

}

static void FUNC_0(void *VAR_0, hwaddr VAR_1,

                            uint64_t VAR_2, unsigned VAR_3)

{

    PXA2xxState *s = (PXA2xxState *) VAR_0;



    switch (VAR_1) {

    case PMCR:

        

        s->pm_regs[VAR_1 >> 2] &= ~(VAR_2 & 0x2a);

        

        s->pm_regs[VAR_1 >> 2] &= ~0x15;

        s->pm_regs[VAR_1 >> 2] |= VAR_2 & 0x15;

        break;



    case PSSR:	

    case RCSR:

    case PKSR:

        s->pm_regs[VAR_1 >> 2] &= ~VAR_2;

        break;



    default:	

        if (!(VAR_1 & 3)) {

            s->pm_regs[VAR_1 >> 2] = VAR_2;

            break;

        }



        printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, VAR_1);

        break;

    }

}

static void FUNC_0(void *VAR_0, hwaddr VAR_1,
uint64_t VAR_2, unsigned VAR_3)
{ PXA2xxState *s = (PXA2xxState *) VAR_0; switch (VAR_1) { case PMCR:
s->pm_regs[VAR_1 >> 2] &= ~(VAR_2 & 0x2a); s->pm_regs[VAR_1 >> 2] &= ~0x15; s->pm_regs[VAR_1 >> 2] |= VAR_2 & 0x15; break; case PSSR:
case RCSR:
case PKSR:
s->pm_regs[VAR_1 >> 2] &= ~VAR_2; break; default:
if (!(VAR_1 & 3)) { s->pm_regs[VAR_1 >> 2] = VAR_2; break; } printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, VAR_1); break; } }