mirror of https://github.com/xemu-project/xemu.git
hw/char: riscv_htif: Drop useless assignment of memory region
struct HTIFState has 3 members for address space and memory region, and are initialized during htif_mm_init(). But they are actually useless. Drop them. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-Id: <20221229091828.1945072-4-bmeng@tinylab.org> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
bc9c3b1862
commit
dc68824641
|
@ -265,8 +265,8 @@ bool htif_uses_elf_symbols(void)
|
|||
return (address_symbol_set == 3) ? true : false;
|
||||
}
|
||||
|
||||
HTIFState *htif_mm_init(MemoryRegion *address_space, MemoryRegion *main_mem,
|
||||
CPURISCVState *env, Chardev *chr, uint64_t nonelf_base)
|
||||
HTIFState *htif_mm_init(MemoryRegion *address_space, CPURISCVState *env,
|
||||
Chardev *chr, uint64_t nonelf_base)
|
||||
{
|
||||
uint64_t base, size, tohost_offset, fromhost_offset;
|
||||
|
||||
|
@ -281,9 +281,6 @@ HTIFState *htif_mm_init(MemoryRegion *address_space, MemoryRegion *main_mem,
|
|||
fromhost_offset = fromhost_addr - base;
|
||||
|
||||
HTIFState *s = g_new0(HTIFState, 1);
|
||||
s->address_space = address_space;
|
||||
s->main_mem = main_mem;
|
||||
s->main_mem_ram_ptr = memory_region_get_ram_ptr(main_mem);
|
||||
s->env = env;
|
||||
s->tohost_offset = tohost_offset;
|
||||
s->fromhost_offset = fromhost_offset;
|
||||
|
|
|
@ -316,9 +316,8 @@ static void spike_board_init(MachineState *machine)
|
|||
fdt_load_addr);
|
||||
|
||||
/* initialize HTIF using symbols found in load_kernel */
|
||||
htif_mm_init(system_memory, mask_rom,
|
||||
&s->soc[0].harts[0].env, serial_hd(0),
|
||||
memmap[SPIKE_HTIF].base);
|
||||
htif_mm_init(system_memory, &s->soc[0].harts[0].env,
|
||||
serial_hd(0), memmap[SPIKE_HTIF].base);
|
||||
}
|
||||
|
||||
static void spike_machine_instance_init(Object *obj)
|
||||
|
|
|
@ -34,9 +34,6 @@ typedef struct HTIFState {
|
|||
hwaddr tohost_offset;
|
||||
hwaddr fromhost_offset;
|
||||
MemoryRegion mmio;
|
||||
MemoryRegion *address_space;
|
||||
MemoryRegion *main_mem;
|
||||
void *main_mem_ram_ptr;
|
||||
|
||||
CPURISCVState *env;
|
||||
CharBackend chr;
|
||||
|
@ -54,7 +51,7 @@ void htif_symbol_callback(const char *st_name, int st_info, uint64_t st_value,
|
|||
bool htif_uses_elf_symbols(void);
|
||||
|
||||
/* legacy pre qom */
|
||||
HTIFState *htif_mm_init(MemoryRegion *address_space, MemoryRegion *main_mem,
|
||||
CPURISCVState *env, Chardev *chr, uint64_t nonelf_base);
|
||||
HTIFState *htif_mm_init(MemoryRegion *address_space, CPURISCVState *env,
|
||||
Chardev *chr, uint64_t nonelf_base);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue