[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 08/22] linux-user/riscv: initialise the TaskState heap/stack i
From: |
Alex Bennée |
Subject: |
[PATCH v2 08/22] linux-user/riscv: initialise the TaskState heap/stack info |
Date: |
Tue, 23 Mar 2021 16:52:54 +0000 |
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 <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210312102029.17017-5-alex.bennee@linaro.org>
Message-Id: <20210320133706.21475-9-alex.bennee@linaro.org>
---
linux-user/riscv/cpu_loop.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/linux-user/riscv/cpu_loop.c b/linux-user/riscv/cpu_loop.c
index 6767f941e8..74a9628dc9 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;
}
--
2.20.1
- [PATCH for 6.0 v2 00/22] fixes for rc1 pre-PR (kernel-doc, semihosting, testing), Alex Bennée, 2021/03/23
- [PATCH v2 01/22] scripts/kernel-doc: strip QEMU_ from function definitions, Alex Bennée, 2021/03/23
- [PATCH v2 02/22] docs/devel: include the plugin API information from the headers, Alex Bennée, 2021/03/23
- [PATCH v2 04/22] tools/virtiofsd: include --socket-group in help, Alex Bennée, 2021/03/23
- [PATCH v2 03/22] docs/devel: expand style section of memory management, Alex Bennée, 2021/03/23
- [PATCH v2 05/22] semihosting: move semihosting tests to multiarch, Alex Bennée, 2021/03/23
- [PATCH v2 07/22] semihosting/arm-compat-semi: don't use SET_ARG to report SYS_HEAPINFO, Alex Bennée, 2021/03/23
- [PATCH v2 08/22] linux-user/riscv: initialise the TaskState heap/stack info,
Alex Bennée <=
- [PATCH v2 06/22] semihosting/arm-compat-semi: unify GET/SET_ARG helpers, Alex Bennée, 2021/03/23
- [PATCH v2 13/22] utils: Tighter tests for qemu_strtosz, Alex Bennée, 2021/03/23
- [PATCH v2 12/22] cirrus.yml: Update the FreeBSD task to version 12.2, Alex Bennée, 2021/03/23
- [PATCH v2 09/22] tests/tcg: add HeapInfo checking to semihosting test, Alex Bennée, 2021/03/23
- [PATCH v2 11/22] configure: Don't use the __atomic_*_16 functions for testing 128-bit support, Alex Bennée, 2021/03/23
- [PATCH v2 10/22] gitlab-ci.yml: Merge the trace-backend testing into other jobs, Alex Bennée, 2021/03/23
- [PATCH v2 14/22] utils: Work around mingw strto*l bug with 0x, Alex Bennée, 2021/03/23