kernel/arch/riscv64: fix crash on userland thread exit

Set first stack frame return address to
<commpage>commpage_thread_exit, so it will be called
when thread entry point returns.

Change-Id: Ide5cde8d4501eb7241e03ff4052174e984e78870
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4493
Reviewed-by: Alex von Gluck IV <[email protected]>
This commit is contained in:
X512
2021-10-11 17:38:20 +00:00
committed by Alex von Gluck IV
parent 812397ffd9
commit 5ab0674c38
3 changed files with 30 additions and 19 deletions
@@ -10,9 +10,7 @@
# error Must not be included directly. Include <commpage_defs.h> instead!
#endif
#define COMMPAGE_ENTRY_RISCV64_SIGNAL_HANDLER \
(COMMPAGE_ENTRY_FIRST_ARCH_SPECIFIC + 0)
#define COMMPAGE_ENTRY_RISCV64_SIGNAL_THREAD_EXIT \
(COMMPAGE_ENTRY_FIRST_ARCH_SPECIFIC + 1)
#define COMMPAGE_ENTRY_RISCV64_SIGNAL_HANDLER (COMMPAGE_ENTRY_FIRST_ARCH_SPECIFIC + 0)
#define COMMPAGE_ENTRY_RISCV64_THREAD_EXIT (COMMPAGE_ENTRY_FIRST_ARCH_SPECIFIC + 1)
#endif /* _SYSTEM_ARCH_RISCV64_COMMPAGE_DEFS_H */