mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
riscv: Pass RISCVHartArrayState by pointer
We were accidently passing RISCVHartArrayState by value instead of pointer. The type is 824 bytes long so let's correct that and pass it by pointer instead. Fixes: Coverity CID 1438099 Fixes: Coverity CID 1438100 Fixes: Coverity CID 1438101 Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Palmer Dabbelt <palmerdabbelt@google.com> Reviewed-by: Bin Meng <bin.meng@windriver.com> Message-id: f3e04424723e0e222769991896cc82308fd23f76.1610751609.git.alistair.francis@wdc.com
This commit is contained in:
parent
138ca49a82
commit
a8259b5323
5 changed files with 20 additions and 22 deletions
|
@ -466,7 +466,7 @@ static void sifive_u_machine_init(MachineState *machine)
|
|||
|
||||
/* create device tree */
|
||||
create_fdt(s, memmap, machine->ram_size, machine->kernel_cmdline,
|
||||
riscv_is_32bit(s->soc.u_cpus));
|
||||
riscv_is_32bit(&s->soc.u_cpus));
|
||||
|
||||
if (s->start_in_flash) {
|
||||
/*
|
||||
|
@ -495,7 +495,7 @@ static void sifive_u_machine_init(MachineState *machine)
|
|||
break;
|
||||
}
|
||||
|
||||
if (riscv_is_32bit(s->soc.u_cpus)) {
|
||||
if (riscv_is_32bit(&s->soc.u_cpus)) {
|
||||
firmware_end_addr = riscv_find_and_load_firmware(machine,
|
||||
"opensbi-riscv32-generic-fw_dynamic.bin",
|
||||
start_addr, NULL);
|
||||
|
@ -506,7 +506,7 @@ static void sifive_u_machine_init(MachineState *machine)
|
|||
}
|
||||
|
||||
if (machine->kernel_filename) {
|
||||
kernel_start_addr = riscv_calc_kernel_start_addr(s->soc.u_cpus,
|
||||
kernel_start_addr = riscv_calc_kernel_start_addr(&s->soc.u_cpus,
|
||||
firmware_end_addr);
|
||||
|
||||
kernel_entry = riscv_load_kernel(machine->kernel_filename,
|
||||
|
@ -533,7 +533,7 @@ static void sifive_u_machine_init(MachineState *machine)
|
|||
/* Compute the fdt load address in dram */
|
||||
fdt_load_addr = riscv_load_fdt(memmap[SIFIVE_U_DEV_DRAM].base,
|
||||
machine->ram_size, s->fdt);
|
||||
if (!riscv_is_32bit(s->soc.u_cpus)) {
|
||||
if (!riscv_is_32bit(&s->soc.u_cpus)) {
|
||||
start_addr_hi32 = (uint64_t)start_addr >> 32;
|
||||
}
|
||||
|
||||
|
@ -552,7 +552,7 @@ static void sifive_u_machine_init(MachineState *machine)
|
|||
0x00000000,
|
||||
/* fw_dyn: */
|
||||
};
|
||||
if (riscv_is_32bit(s->soc.u_cpus)) {
|
||||
if (riscv_is_32bit(&s->soc.u_cpus)) {
|
||||
reset_vec[4] = 0x0202a583; /* lw a1, 32(t0) */
|
||||
reset_vec[5] = 0x0182a283; /* lw t0, 24(t0) */
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue