static void pxa2xx_gpio_set(void *opaque, int line, int level)

{

    PXA2xxGPIOInfo *s = (PXA2xxGPIOInfo *) opaque;

    CPUState *cpu = CPU(s->cpu);

    int bank;

    uint32_t mask;



    if (line >= s->lines) {

        printf("%s: No GPIO pin %i\n", __FUNCTION__, line);

        return;

    }



    bank = line >> 5;

    mask = 1U << (line & 31);



    if (level) {

        s->status[bank] |= s->rising[bank] & mask &

                ~s->ilevel[bank] & ~s->dir[bank];

        s->ilevel[bank] |= mask;

    } else {

        s->status[bank] |= s->falling[bank] & mask &

                s->ilevel[bank] & ~s->dir[bank];

        s->ilevel[bank] &= ~mask;

    }



    if (s->status[bank] & mask)

        pxa2xx_gpio_irq_update(s);



    /* Wake-up GPIOs */

    if (cpu->halted && (mask & ~s->dir[bank] & pxa2xx_gpio_wake[bank])) {

        cpu_interrupt(cpu, CPU_INTERRUPT_EXITTB);

    }

}

static void pxa2xx_gpio_set(void *opaque, int line, int level)

{

    PXA2xxGPIOInfo *s = (PXA2xxGPIOInfo *) opaque;

    CPUState *cpu = CPU(s->cpu);

    int bank;

    uint32_t mask;



    if (line >= s->lines) {

        printf("%s: No GPIO pin %i\n", __FUNCTION__, line);

        return;

    }



    bank = line >> 5;

    mask = 1U << (line & 31);



    if (level) {

        s->status[bank] |= s->rising[bank] & mask &

                ~s->ilevel[bank] & ~s->dir[bank];

        s->ilevel[bank] |= mask;

    } else {

        s->status[bank] |= s->falling[bank] & mask &

                s->ilevel[bank] & ~s->dir[bank];

        s->ilevel[bank] &= ~mask;

    }



    if (s->status[bank] & mask)

        pxa2xx_gpio_irq_update(s);



    

    if (cpu->halted && (mask & ~s->dir[bank] & pxa2xx_gpio_wake[bank])) {

        cpu_interrupt(cpu, CPU_INTERRUPT_EXITTB);

    }

}

static void FUNC_0(void *VAR_0, int VAR_1, int VAR_2)

{

    PXA2xxGPIOInfo *s = (PXA2xxGPIOInfo *) VAR_0;

    CPUState *cpu = CPU(s->cpu);

    int VAR_3;

    uint32_t mask;



    if (VAR_1 >= s->lines) {

        printf("%s: No GPIO pin %i\n", __FUNCTION__, VAR_1);

        return;

    }



    VAR_3 = VAR_1 >> 5;

    mask = 1U << (VAR_1 & 31);



    if (VAR_2) {

        s->status[VAR_3] |= s->rising[VAR_3] & mask &

                ~s->ilevel[VAR_3] & ~s->dir[VAR_3];

        s->ilevel[VAR_3] |= mask;

    } else {

        s->status[VAR_3] |= s->falling[VAR_3] & mask &

                s->ilevel[VAR_3] & ~s->dir[VAR_3];

        s->ilevel[VAR_3] &= ~mask;

    }



    if (s->status[VAR_3] & mask)

        pxa2xx_gpio_irq_update(s);



    

    if (cpu->halted && (mask & ~s->dir[VAR_3] & pxa2xx_gpio_wake[VAR_3])) {

        cpu_interrupt(cpu, CPU_INTERRUPT_EXITTB);

    }

}

static void FUNC_0(void *VAR_0, int VAR_1, int VAR_2)
{ PXA2xxGPIOInfo *s = (PXA2xxGPIOInfo *) VAR_0; CPUState *cpu = CPU(s->cpu); int VAR_3; uint32_t mask; if (VAR_1 >= s->lines) { printf("%s: No GPIO pin %i\n", __FUNCTION__, VAR_1); return; } VAR_3 = VAR_1 >> 5; mask = 1U << (VAR_1 & 31); if (VAR_2) { s->status[VAR_3] |= s->rising[VAR_3] & mask &
~s->ilevel[VAR_3] & ~s->dir[VAR_3]; s->ilevel[VAR_3] |= mask; } else { s->status[VAR_3] |= s->falling[VAR_3] & mask &
s->ilevel[VAR_3] & ~s->dir[VAR_3]; s->ilevel[VAR_3] &= ~mask; } if (s->status[VAR_3] & mask)
pxa2xx_gpio_irq_update(s); if (cpu->halted && (mask & ~s->dir[VAR_3] & pxa2xx_gpio_wake[VAR_3])) { cpu_interrupt(cpu, CPU_INTERRUPT_EXITTB); } }