Skip to content

Commit

Permalink
Make CPURead/WriteFunc structure 'const'
Browse files Browse the repository at this point in the history
Signed-off-by: Blue Swirl <[email protected]>
  • Loading branch information
blueswirl committed Aug 25, 2009
1 parent fa31af0 commit d60efc6
Show file tree
Hide file tree
Showing 144 changed files with 1,552 additions and 554 deletions.
4 changes: 2 additions & 2 deletions cpu-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ void *qemu_get_ram_ptr(ram_addr_t addr);
/* This should not be used by devices. */
ram_addr_t qemu_ram_addr_from_host(void *ptr);

int cpu_register_io_memory(CPUReadMemoryFunc **mem_read,
CPUWriteMemoryFunc **mem_write,
int cpu_register_io_memory(CPUReadMemoryFunc * const *mem_read,
CPUWriteMemoryFunc * const *mem_write,
void *opaque);
void cpu_unregister_io_memory(int table_address);

Expand Down
28 changes: 14 additions & 14 deletions exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ static int tb_phys_invalidate_count;
#define SUBPAGE_IDX(addr) ((addr) & ~TARGET_PAGE_MASK)
typedef struct subpage_t {
target_phys_addr_t base;
CPUReadMemoryFunc **mem_read[TARGET_PAGE_SIZE][4];
CPUWriteMemoryFunc **mem_write[TARGET_PAGE_SIZE][4];
CPUReadMemoryFunc * const *mem_read[TARGET_PAGE_SIZE][4];
CPUWriteMemoryFunc * const *mem_write[TARGET_PAGE_SIZE][4];
void *opaque[TARGET_PAGE_SIZE][2][4];
ram_addr_t region_offset[TARGET_PAGE_SIZE][2][4];
} subpage_t;
Expand Down Expand Up @@ -2550,13 +2550,13 @@ static void unassigned_mem_writel(void *opaque, target_phys_addr_t addr, uint32_
#endif
}

static CPUReadMemoryFunc *unassigned_mem_read[3] = {
static CPUReadMemoryFunc * const unassigned_mem_read[3] = {
unassigned_mem_readb,
unassigned_mem_readw,
unassigned_mem_readl,
};

static CPUWriteMemoryFunc *unassigned_mem_write[3] = {
static CPUWriteMemoryFunc * const unassigned_mem_write[3] = {
unassigned_mem_writeb,
unassigned_mem_writew,
unassigned_mem_writel,
Expand Down Expand Up @@ -2622,13 +2622,13 @@ static void notdirty_mem_writel(void *opaque, target_phys_addr_t ram_addr,
tlb_set_dirty(cpu_single_env, cpu_single_env->mem_io_vaddr);
}

static CPUReadMemoryFunc *error_mem_read[3] = {
static CPUReadMemoryFunc * const error_mem_read[3] = {
NULL, /* never used */
NULL, /* never used */
NULL, /* never used */
};

static CPUWriteMemoryFunc *notdirty_mem_write[3] = {
static CPUWriteMemoryFunc * const notdirty_mem_write[3] = {
notdirty_mem_writeb,
notdirty_mem_writew,
notdirty_mem_writel,
Expand Down Expand Up @@ -2721,13 +2721,13 @@ static void watch_mem_writel(void *opaque, target_phys_addr_t addr,
stl_phys(addr, val);
}

static CPUReadMemoryFunc *watch_mem_read[3] = {
static CPUReadMemoryFunc * const watch_mem_read[3] = {
watch_mem_readb,
watch_mem_readw,
watch_mem_readl,
};

static CPUWriteMemoryFunc *watch_mem_write[3] = {
static CPUWriteMemoryFunc * const watch_mem_write[3] = {
watch_mem_writeb,
watch_mem_writew,
watch_mem_writel,
Expand Down Expand Up @@ -2819,13 +2819,13 @@ static void subpage_writel (void *opaque,
subpage_writelen(opaque, addr, value, 2);
}

static CPUReadMemoryFunc *subpage_read[] = {
static CPUReadMemoryFunc * const subpage_read[] = {
&subpage_readb,
&subpage_readw,
&subpage_readl,
};

static CPUWriteMemoryFunc *subpage_write[] = {
static CPUWriteMemoryFunc * const subpage_write[] = {
&subpage_writeb,
&subpage_writew,
&subpage_writel,
Expand Down Expand Up @@ -2906,8 +2906,8 @@ static int get_free_io_mem_idx(void)
value can be used with cpu_register_physical_memory(). (-1) is
returned if error. */
static int cpu_register_io_memory_fixed(int io_index,
CPUReadMemoryFunc **mem_read,
CPUWriteMemoryFunc **mem_write,
CPUReadMemoryFunc * const *mem_read,
CPUWriteMemoryFunc * const *mem_write,
void *opaque)
{
int i, subwidth = 0;
Expand All @@ -2932,8 +2932,8 @@ static int cpu_register_io_memory_fixed(int io_index,
return (io_index << IO_MEM_SHIFT) | subwidth;
}

int cpu_register_io_memory(CPUReadMemoryFunc **mem_read,
CPUWriteMemoryFunc **mem_write,
int cpu_register_io_memory(CPUReadMemoryFunc * const *mem_read,
CPUWriteMemoryFunc * const *mem_write,
void *opaque)
{
return cpu_register_io_memory_fixed(0, mem_read, mem_write, opaque);
Expand Down
16 changes: 8 additions & 8 deletions hw/apb_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ static uint32_t pci_apb_config_readl (void *opaque,
return val;
}

static CPUWriteMemoryFunc *pci_apb_config_write[] = {
static CPUWriteMemoryFunc * const pci_apb_config_write[] = {
&pci_apb_config_writel,
&pci_apb_config_writel,
&pci_apb_config_writel,
};

static CPUReadMemoryFunc *pci_apb_config_read[] = {
static CPUReadMemoryFunc * const pci_apb_config_read[] = {
&pci_apb_config_readl,
&pci_apb_config_readl,
&pci_apb_config_readl,
Expand Down Expand Up @@ -124,25 +124,25 @@ static uint32_t apb_config_readl (void *opaque,
return val;
}

static CPUWriteMemoryFunc *apb_config_write[] = {
static CPUWriteMemoryFunc * const apb_config_write[] = {
&apb_config_writel,
&apb_config_writel,
&apb_config_writel,
};

static CPUReadMemoryFunc *apb_config_read[] = {
static CPUReadMemoryFunc * const apb_config_read[] = {
&apb_config_readl,
&apb_config_readl,
&apb_config_readl,
};

static CPUWriteMemoryFunc *pci_apb_write[] = {
static CPUWriteMemoryFunc * const pci_apb_write[] = {
&pci_host_data_writeb,
&pci_host_data_writew,
&pci_host_data_writel,
};

static CPUReadMemoryFunc *pci_apb_read[] = {
static CPUReadMemoryFunc * const pci_apb_read[] = {
&pci_host_data_readb,
&pci_host_data_readw,
&pci_host_data_readl,
Expand Down Expand Up @@ -190,13 +190,13 @@ static uint32_t pci_apb_ioreadl (void *opaque, target_phys_addr_t addr)
return val;
}

static CPUWriteMemoryFunc *pci_apb_iowrite[] = {
static CPUWriteMemoryFunc * const pci_apb_iowrite[] = {
&pci_apb_iowriteb,
&pci_apb_iowritew,
&pci_apb_iowritel,
};

static CPUReadMemoryFunc *pci_apb_ioread[] = {
static CPUReadMemoryFunc * const pci_apb_ioread[] = {
&pci_apb_ioreadb,
&pci_apb_ioreadw,
&pci_apb_ioreadl,
Expand Down
4 changes: 2 additions & 2 deletions hw/apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -957,13 +957,13 @@ static void apic_reset(void *opaque)
cpu_synchronize_state(s->cpu_env, 1);
}

static CPUReadMemoryFunc *apic_mem_read[3] = {
static CPUReadMemoryFunc * const apic_mem_read[3] = {
apic_mem_readb,
apic_mem_readw,
apic_mem_readl,
};

static CPUWriteMemoryFunc *apic_mem_write[3] = {
static CPUWriteMemoryFunc * const apic_mem_write[3] = {
apic_mem_writeb,
apic_mem_writew,
apic_mem_writel,
Expand Down
4 changes: 2 additions & 2 deletions hw/arm_gic.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,13 +558,13 @@ static void gic_dist_writel(void *opaque, target_phys_addr_t offset,
gic_dist_writew(opaque, offset + 2, value >> 16);
}

static CPUReadMemoryFunc *gic_dist_readfn[] = {
static CPUReadMemoryFunc * const gic_dist_readfn[] = {
gic_dist_readb,
gic_dist_readw,
gic_dist_readl
};

static CPUWriteMemoryFunc *gic_dist_writefn[] = {
static CPUWriteMemoryFunc * const gic_dist_writefn[] = {
gic_dist_writeb,
gic_dist_writew,
gic_dist_writel
Expand Down
4 changes: 2 additions & 2 deletions hw/arm_sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,13 @@ static void arm_sysctl_write(void *opaque, target_phys_addr_t offset,
}
}

static CPUReadMemoryFunc *arm_sysctl_readfn[] = {
static CPUReadMemoryFunc * const arm_sysctl_readfn[] = {
arm_sysctl_read,
arm_sysctl_read,
arm_sysctl_read
};

static CPUWriteMemoryFunc *arm_sysctl_writefn[] = {
static CPUWriteMemoryFunc * const arm_sysctl_writefn[] = {
arm_sysctl_write,
arm_sysctl_write,
arm_sysctl_write
Expand Down
8 changes: 4 additions & 4 deletions hw/arm_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,13 @@ static void sp804_write(void *opaque, target_phys_addr_t offset,
}
}

static CPUReadMemoryFunc *sp804_readfn[] = {
static CPUReadMemoryFunc * const sp804_readfn[] = {
sp804_read,
sp804_read,
sp804_read
};

static CPUWriteMemoryFunc *sp804_writefn[] = {
static CPUWriteMemoryFunc * const sp804_writefn[] = {
sp804_write,
sp804_write,
sp804_write
Expand Down Expand Up @@ -311,13 +311,13 @@ static void icp_pit_write(void *opaque, target_phys_addr_t offset,
}


static CPUReadMemoryFunc *icp_pit_readfn[] = {
static CPUReadMemoryFunc * const icp_pit_readfn[] = {
icp_pit_read,
icp_pit_read,
icp_pit_read
};

static CPUWriteMemoryFunc *icp_pit_writefn[] = {
static CPUWriteMemoryFunc * const icp_pit_writefn[] = {
icp_pit_write,
icp_pit_write,
icp_pit_write
Expand Down
4 changes: 2 additions & 2 deletions hw/armv7m.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ static void bitband_writel(void *opaque, target_phys_addr_t offset,
cpu_physical_memory_write(addr, (uint8_t *)&v, 4);
}

static CPUReadMemoryFunc *bitband_readfn[] = {
static CPUReadMemoryFunc * const bitband_readfn[] = {
bitband_readb,
bitband_readw,
bitband_readl
};

static CPUWriteMemoryFunc *bitband_writefn[] = {
static CPUWriteMemoryFunc * const bitband_writefn[] = {
bitband_writeb,
bitband_writew,
bitband_writel
Expand Down
8 changes: 4 additions & 4 deletions hw/axis_dev88.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ nand_writel (void *opaque, target_phys_addr_t addr, uint32_t value)
s->rdy = rdy;
}

static CPUReadMemoryFunc *nand_read[] = {
static CPUReadMemoryFunc * const nand_read[] = {
&nand_readl,
&nand_readl,
&nand_readl,
};

static CPUWriteMemoryFunc *nand_write[] = {
static CPUWriteMemoryFunc * const nand_write[] = {
&nand_writel,
&nand_writel,
&nand_writel,
Expand Down Expand Up @@ -226,12 +226,12 @@ static void gpio_writel (void *opaque, target_phys_addr_t addr, uint32_t value)
}
}

static CPUReadMemoryFunc *gpio_read[] = {
static CPUReadMemoryFunc * const gpio_read[] = {
NULL, NULL,
&gpio_readl,
};

static CPUWriteMemoryFunc *gpio_write[] = {
static CPUWriteMemoryFunc * const gpio_write[] = {
NULL, NULL,
&gpio_writel,
};
Expand Down
16 changes: 8 additions & 8 deletions hw/cirrus_vga.c
Original file line number Diff line number Diff line change
Expand Up @@ -2156,13 +2156,13 @@ static void cirrus_vga_mem_writel(void *opaque, target_phys_addr_t addr, uint32_
#endif
}

static CPUReadMemoryFunc *cirrus_vga_mem_read[3] = {
static CPUReadMemoryFunc * const cirrus_vga_mem_read[3] = {
cirrus_vga_mem_readb,
cirrus_vga_mem_readw,
cirrus_vga_mem_readl,
};

static CPUWriteMemoryFunc *cirrus_vga_mem_write[3] = {
static CPUWriteMemoryFunc * const cirrus_vga_mem_write[3] = {
cirrus_vga_mem_writeb,
cirrus_vga_mem_writew,
cirrus_vga_mem_writel,
Expand Down Expand Up @@ -2472,13 +2472,13 @@ static void cirrus_linear_writel(void *opaque, target_phys_addr_t addr,
}


static CPUReadMemoryFunc *cirrus_linear_read[3] = {
static CPUReadMemoryFunc * const cirrus_linear_read[3] = {
cirrus_linear_readb,
cirrus_linear_readw,
cirrus_linear_readl,
};

static CPUWriteMemoryFunc *cirrus_linear_write[3] = {
static CPUWriteMemoryFunc * const cirrus_linear_write[3] = {
cirrus_linear_writeb,
cirrus_linear_writew,
cirrus_linear_writel,
Expand Down Expand Up @@ -2573,13 +2573,13 @@ static void cirrus_linear_bitblt_writel(void *opaque, target_phys_addr_t addr,
}


static CPUReadMemoryFunc *cirrus_linear_bitblt_read[3] = {
static CPUReadMemoryFunc * const cirrus_linear_bitblt_read[3] = {
cirrus_linear_bitblt_readb,
cirrus_linear_bitblt_readw,
cirrus_linear_bitblt_readl,
};

static CPUWriteMemoryFunc *cirrus_linear_bitblt_write[3] = {
static CPUWriteMemoryFunc * const cirrus_linear_bitblt_write[3] = {
cirrus_linear_bitblt_writeb,
cirrus_linear_bitblt_writew,
cirrus_linear_bitblt_writel,
Expand Down Expand Up @@ -3003,13 +3003,13 @@ static void cirrus_mmio_writel(void *opaque, target_phys_addr_t addr,
}


static CPUReadMemoryFunc *cirrus_mmio_read[3] = {
static CPUReadMemoryFunc * const cirrus_mmio_read[3] = {
cirrus_mmio_readb,
cirrus_mmio_readw,
cirrus_mmio_readl,
};

static CPUWriteMemoryFunc *cirrus_mmio_write[3] = {
static CPUWriteMemoryFunc * const cirrus_mmio_write[3] = {
cirrus_mmio_writeb,
cirrus_mmio_writew,
cirrus_mmio_writel,
Expand Down
4 changes: 2 additions & 2 deletions hw/cs4231.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,13 @@ static void cs_mem_writel(void *opaque, target_phys_addr_t addr, uint32_t val)
}
}

static CPUReadMemoryFunc *cs_mem_read[3] = {
static CPUReadMemoryFunc * const cs_mem_read[3] = {
cs_mem_readl,
cs_mem_readl,
cs_mem_readl,
};

static CPUWriteMemoryFunc *cs_mem_write[3] = {
static CPUWriteMemoryFunc * const cs_mem_write[3] = {
cs_mem_writel,
cs_mem_writel,
cs_mem_writel,
Expand Down
4 changes: 2 additions & 2 deletions hw/cuda.c
Original file line number Diff line number Diff line change
Expand Up @@ -630,13 +630,13 @@ static uint32_t cuda_readl (void *opaque, target_phys_addr_t addr)
return 0;
}

static CPUWriteMemoryFunc *cuda_write[] = {
static CPUWriteMemoryFunc * const cuda_write[] = {
&cuda_writeb,
&cuda_writew,
&cuda_writel,
};

static CPUReadMemoryFunc *cuda_read[] = {
static CPUReadMemoryFunc * const cuda_read[] = {
&cuda_readb,
&cuda_readw,
&cuda_readl,
Expand Down
Loading

0 comments on commit d60efc6

Please sign in to comment.