From: Alex Bennée Date: Tue, 23 Mar 2021 16:52:54 +0000 (+0000) Subject: linux-user/riscv: initialise the TaskState heap/stack info X-Git-Tag: v6.0.0-rc0~1^2~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7967d1da7af01c49661241c47708caa6dec78adb;p=thirdparty%2Fqemu.git linux-user/riscv: initialise the TaskState heap/stack info Arguably the target_cpu_copy_regs function for each architecture is misnamed as a number of the architectures also take the opportunity to fill out the TaskState structure. This could arguably be factored out into common code but that would require a wider audit of the architectures. For now just replicate for riscv so we can correctly report semihosting information for SYS_HEAPINFO. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Acked-by: Alistair Francis Message-Id: <20210323165308.15244-9-alex.bennee@linaro.org> --- diff --git a/linux-user/riscv/cpu_loop.c b/linux-user/riscv/cpu_loop.c index 6767f941e8f..74a9628dc9b 100644 --- a/linux-user/riscv/cpu_loop.c +++ b/linux-user/riscv/cpu_loop.c @@ -135,4 +135,9 @@ void target_cpu_copy_regs(CPUArchState *env, struct target_pt_regs *regs) error_report("Incompatible ELF: RVE cpu requires RVE ABI binary"); exit(EXIT_FAILURE); } + + ts->stack_base = info->start_stack; + ts->heap_base = info->brk; + /* This will be filled in on the first SYS_HEAPINFO call. */ + ts->heap_limit = 0; }