diff options
| author | Richard Henderson <richard.henderson@linaro.org> | 2025-08-02 10:12:01 +1000 |
|---|---|---|
| committer | Richard Henderson <richard.henderson@linaro.org> | 2025-08-28 06:39:25 +1000 |
| commit | 05c84cf8df23b8dc81317ee0cea748e6199637f4 (patch) | |
| tree | 3c90af9fc7704c9943a7942fd37e393f216bf05e /semihosting/arm-compat-semi.c | |
| parent | 5fc03d4e28258fdf6a926a59c6b5e1edc23e6d5d (diff) | |
| download | focaccia-qemu-05c84cf8df23b8dc81317ee0cea748e6199637f4.tar.gz focaccia-qemu-05c84cf8df23b8dc81317ee0cea748e6199637f4.zip | |
semihosting: Retrieve stack top from image_info
Remove the write-once field TaskState.stack_base, and use the same value from struct image_info. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'semihosting/arm-compat-semi.c')
| -rw-r--r-- | semihosting/arm-compat-semi.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c index 86e5260e50..bc04b02eba 100644 --- a/semihosting/arm-compat-semi.c +++ b/semihosting/arm-compat-semi.c @@ -696,7 +696,11 @@ void do_common_semihosting(CPUState *cs) retvals[0] = ts->heap_base; retvals[1] = ts->heap_limit; - retvals[2] = ts->stack_base; + /* + * Note that semihosting is *not* thread aware. + * Always return the stack base of the main thread. + */ + retvals[2] = ts->info->start_stack; retvals[3] = 0; /* Stack limit. */ #else retvals[0] = info.heapbase; /* Heap Base */ |