this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Update darlingserver and RPC signal handling

+18 -5
+11 -2
src/kernel/emulation/linux/signal/sigaction.c
··· 7 7 #include "sigexc.h" 8 8 #include <sys/errno.h> 9 9 10 + #include <darlingserver/rpc.h> 11 + 10 12 static int sigflags_bsd_to_linux(int flags); 11 13 static int sigflags_linux_to_bsd(int flags); 12 14 extern void sig_restorer(void); ··· 14 16 extern void* memcpy(void* dest, const void* src, __SIZE_TYPE__ len); 15 17 extern void* memset(void* dest, int v, __SIZE_TYPE__ len); 16 18 19 + static void handler_linux_to_bsd_wrapper(int linux_signum, struct linux_siginfo* info, void* ctxt); 17 20 18 21 // Libc uses only one trampoline 19 22 void (*sa_tramp)(void*, int, int, struct bsd_siginfo*, void*) = 0; ··· 50 53 if (nsa->sa_sigaction != SIG_DFL && nsa->sa_sigaction != SIG_IGN 51 54 && nsa->sa_sigaction != SIG_ERR) 52 55 { 53 - sa.sa_sigaction = &handler_linux_to_bsd; 56 + sa.sa_sigaction = &handler_linux_to_bsd_wrapper; 54 57 } 55 58 else 56 59 sa.sa_sigaction = (linux_sig_handler*) nsa->sa_sigaction; ··· 68 71 69 72 if (osa != NULL) 70 73 { 71 - if (olsa.sa_sigaction == handler_linux_to_bsd) 74 + if (olsa.sa_sigaction == handler_linux_to_bsd_wrapper) 72 75 osa->sa_sigaction = sig_handlers[linux_signum]; 73 76 else // values such as SIG_DFL 74 77 osa->sa_sigaction = (bsd_sig_handler*) olsa.sa_sigaction; ··· 231 234 #endif 232 235 233 236 } 237 + 238 + static void handler_linux_to_bsd_wrapper(int linux_signum, struct linux_siginfo* info, void* ctxt) { 239 + dserver_rpc_interrupt_enter(); 240 + handler_linux_to_bsd(linux_signum, info, ctxt); 241 + dserver_rpc_interrupt_exit(); 242 + }; 234 243 235 244 void handler_linux_to_bsd(int linux_signum, struct linux_siginfo* info, void* ctxt) 236 245 {
+7 -3
src/kernel/emulation/linux/signal/sigexc.c
··· 135 135 136 136 void sigrt_handler(int signum, struct linux_siginfo* info, void* ctxt) 137 137 { 138 + dserver_rpc_interrupt_enter(); 139 + 138 140 #if defined(__x86_64__) 139 141 x86_thread_state64_t tstate; 140 142 x86_float_state64_t fstate; ··· 155 157 lkm_call(NR_thread_suspended, &args); 156 158 157 159 state_from_kernel(ctxt, &args.state); 160 + 161 + dserver_rpc_interrupt_exit(); 158 162 } 159 163 160 164 ··· 222 226 223 227 void sigexc_handler(int linux_signum, struct linux_siginfo* info, struct linux_ucontext* ctxt) 224 228 { 225 - dserver_rpc_sigexc_enter(); 229 + dserver_rpc_interrupt_enter(); 226 230 227 231 kern_printf("sigexc_handler(%d, %p, %p)\n", linux_signum, info, ctxt); 228 232 ··· 259 263 state_to_kernel(ctxt, &state); 260 264 int ret = dserver_rpc_sigprocess(bsd_signum, linux_signum, info->si_pid, info->si_code, info->si_addr, &tstate, &fstate, &bsd_signum); 261 265 if (ret < 0) { 262 - __simple_printf("sigprocess failed internally: %d", ret); 266 + __simple_printf("sigprocess failed internally while processing Linux signal %d: %d", linux_signum, ret); 263 267 __simple_abort(); 264 268 } 265 269 state_from_kernel(ctxt, &state); ··· 320 324 kern_printf("sigexc: handler (%d) returning\n", linux_signum); 321 325 322 326 out: 323 - dserver_rpc_sigexc_exit(); 327 + dserver_rpc_interrupt_exit(); 324 328 } 325 329 326 330 #define DUMPREG(regname) kern_printf("sigexc: " #regname ": 0x%llx\n", regs->regname);