kernel: add missing support of simple signal handler for riscv64
Change-Id: Iab9d09344a99013b381b64d5438ded0a083b3a52 Reviewed-on: https://review.haiku-os.org/c/haiku/+/5202 Reviewed-by: Rene Gollent <rene@gollent.com> Reviewed-by: waddlesplash <waddlesplash@gmail.com> Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
This commit is contained in:
parent
0c729c2291
commit
16e80b04a7
@ -18,15 +18,17 @@
|
||||
|
||||
extern "C" void arch_user_thread_exit();
|
||||
|
||||
typedef void (*SignalHandler)(int signal, siginfo_t* signalInfo,
|
||||
ucontext_t* ctx);
|
||||
|
||||
|
||||
extern "C" void
|
||||
extern "C" void __attribute__((noreturn))
|
||||
arch_user_signal_handler(signal_frame_data* data)
|
||||
{
|
||||
SignalHandler handler = (SignalHandler)data->handler;
|
||||
handler(data->info.si_signo, &data->info, &data->context);
|
||||
if (data->siginfo_handler) {
|
||||
auto handler = (void (*)(int, siginfo_t*, void*, void*))data->handler;
|
||||
handler(data->info.si_signo, &data->info, &data->context, data->user_data);
|
||||
} else {
|
||||
auto handler = (void (*)(int, void*, vregs*))data->handler;
|
||||
handler(data->info.si_signo, data->user_data, &data->context.uc_mcontext);
|
||||
}
|
||||
|
||||
#define TO_STRING_LITERAL_HELPER(number) #number
|
||||
#define TO_STRING_LITERAL(number) TO_STRING_LITERAL_HELPER(number)
|
||||
@ -41,6 +43,8 @@ arch_user_signal_handler(signal_frame_data* data)
|
||||
|
||||
#undef TO_STRING_LITERAL_HELPER
|
||||
#undef TO_STRING_LITERAL
|
||||
|
||||
__builtin_unreachable();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user