[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 08/14] linux-user/riscv: initialise the TaskState heap/stack i
From: |
Alex Bennée |
Subject: |
[PATCH v1 08/14] linux-user/riscv: initialise the TaskState heap/stack info |
Date: |
Sat, 20 Mar 2021 13:37:00 +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>
Message-Id: <20210312102029.17017-5-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 v1 00/14] fixes for rc1 (kernel-doc, semihosting, testing), Alex Bennée, 2021/03/20
- [PATCH v1 01/14] scripts/kernel-doc: strip QEMU_ from function definitions, Alex Bennée, 2021/03/20
- [PATCH v1 08/14] linux-user/riscv: initialise the TaskState heap/stack info,
Alex Bennée <=
- [PATCH v1 02/14] docs/devel: include the plugin API information from the headers, Alex Bennée, 2021/03/20
- [PATCH v1 05/14] semihosting: move semihosting tests to multiarch, Alex Bennée, 2021/03/20
- [PATCH v1 04/14] tools/virtiofsd: include --socket-group in help, Alex Bennée, 2021/03/20
- [PATCH v1 03/14] docs/devel: expand style section of memory management, Alex Bennée, 2021/03/20
- [PATCH v1 07/14] semihosting/arm-compat-semi: don't use SET_ARG to report SYS_HEAPINFO, Alex Bennée, 2021/03/20
- [PATCH v1 11/14] configure: Don't use the __atomic_*_16 functions for testing 128-bit support, Alex Bennée, 2021/03/20