static void update_pam(PCII440FXState *d, uint32_t start, uint32_t end, int r,

                       PAMMemoryRegion *mem)

{

    if (mem->initialized) {

        memory_region_del_subregion(d->system_memory, &mem->mem);

        memory_region_destroy(&mem->mem);

    }



    //    printf("ISA mapping %08x-0x%08x: %d\n", start, end, r);

    switch(r) {

    case 3:

        /* RAM */

        memory_region_init_alias(&mem->mem, "pam-ram", d->ram_memory,

                                 start, end - start);

        break;

    case 1:

        /* ROM (XXX: not quite correct) */

        memory_region_init_alias(&mem->mem, "pam-rom", d->ram_memory,

                                 start, end - start);

        memory_region_set_readonly(&mem->mem, true);

        break;

    case 2:

    case 0:

        /* XXX: should distinguish read/write cases */

        memory_region_init_alias(&mem->mem, "pam-pci", d->pci_address_space,

                                 start, end - start);

        break;

    }

    memory_region_add_subregion_overlap(d->system_memory,

                                        start, &mem->mem, 1);

    mem->initialized = true;

}

static void update_pam(PCII440FXState *d, uint32_t start, uint32_t end, int r,

                       PAMMemoryRegion *mem)

{

    if (mem->initialized) {

        memory_region_del_subregion(d->system_memory, &mem->mem);

        memory_region_destroy(&mem->mem);

    }



    

    switch(r) {

    case 3:

        

        memory_region_init_alias(&mem->mem, "pam-ram", d->ram_memory,

                                 start, end - start);

        break;

    case 1:

        

        memory_region_init_alias(&mem->mem, "pam-rom", d->ram_memory,

                                 start, end - start);

        memory_region_set_readonly(&mem->mem, true);

        break;

    case 2:

    case 0:

        

        memory_region_init_alias(&mem->mem, "pam-pci", d->pci_address_space,

                                 start, end - start);

        break;

    }

    memory_region_add_subregion_overlap(d->system_memory,

                                        start, &mem->mem, 1);

    mem->initialized = true;

}

static void update_pam(PCII440FXState *d, uint32_t start, uint32_t end, int r,                        PAMMemoryRegion *mem)     if (mem->initialized) {         memory_region_del_subregion(d->system_memory, &mem->mem);         memory_region_destroy(&mem->mem);     switch(r) {     case 3:         memory_region_init_alias(&mem->mem, "pam-ram", d->ram_memory,                                  start, end - start);         break;     case 1:         memory_region_init_alias(&mem->mem, "pam-rom", d->ram_memory,                                  start, end - start);         memory_region_set_readonly(&mem->mem, true);         break;     case 2:     case 0:         memory_region_init_alias(&mem->mem, "pam-pci", d->pci_address_space,                                  start, end - start);         break;     memory_region_add_subregion_overlap(d->system_memory,                                         start, &mem->mem, 1);     mem->initialized = true;
static void FUNC_0(PCII440FXState *VAR_0, uint32_t VAR_1, uint32_t VAR_2, int VAR_3,

                       PAMMemoryRegion *VAR_4)

{

    if (VAR_4->initialized) {

        memory_region_del_subregion(VAR_0->system_memory, &VAR_4->VAR_4);

        memory_region_destroy(&VAR_4->VAR_4);

    }



    

    switch(VAR_3) {

    case 3:

        

        memory_region_init_alias(&VAR_4->VAR_4, "pam-ram", VAR_0->ram_memory,

                                 VAR_1, VAR_2 - VAR_1);

        break;

    case 1:

        

        memory_region_init_alias(&VAR_4->VAR_4, "pam-rom", VAR_0->ram_memory,

                                 VAR_1, VAR_2 - VAR_1);

        memory_region_set_readonly(&VAR_4->VAR_4, true);

        break;

    case 2:

    case 0:

        

        memory_region_init_alias(&VAR_4->VAR_4, "pam-pci", VAR_0->pci_address_space,

                                 VAR_1, VAR_2 - VAR_1);

        break;

    }

    memory_region_add_subregion_overlap(VAR_0->system_memory,

                                        VAR_1, &VAR_4->VAR_4, 1);

    VAR_4->initialized = true;

}

static void FUNC_0(PCII440FXState *VAR_0, uint32_t VAR_1, uint32_t VAR_2, int VAR_3,
PAMMemoryRegion *VAR_4)
{ if (VAR_4->initialized) { memory_region_del_subregion(VAR_0->system_memory, &VAR_4->VAR_4); memory_region_destroy(&VAR_4->VAR_4); } switch(VAR_3) { case 3:
memory_region_init_alias(&VAR_4->VAR_4, "pam-ram", VAR_0->ram_memory,
VAR_1, VAR_2 - VAR_1); break; case 1:
memory_region_init_alias(&VAR_4->VAR_4, "pam-rom", VAR_0->ram_memory,
VAR_1, VAR_2 - VAR_1); memory_region_set_readonly(&VAR_4->VAR_4, true); break; case 2:
case 0:
memory_region_init_alias(&VAR_4->VAR_4, "pam-pci", VAR_0->pci_address_space,
VAR_1, VAR_2 - VAR_1); break; } memory_region_add_subregion_overlap(VAR_0->system_memory,
VAR_1, &VAR_4->VAR_4, 1); VAR_4->initialized = true; }