From 392357e9d2b62cfa56045db98356e404df069ed8 Mon Sep 17 00:00:00 2001 From: Tomoki Shirasawa Date: Wed, 13 Nov 2013 15:43:49 +0900 Subject: [PATCH] catch signal when before kernel init --- arch/x86/kernel/syscall.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/syscall.c b/arch/x86/kernel/syscall.c index 9e8fc49b..f4582f25 100644 --- a/arch/x86/kernel/syscall.c +++ b/arch/x86/kernel/syscall.c @@ -85,15 +85,21 @@ SYSCALL_DECLARE(rt_sigreturn) return proc->sigrc; } +extern struct x86_cpu_local_variables *locals; + void check_signal(unsigned long rc, unsigned long *regs) { - struct process *proc = cpu_local_var(current); + struct process *proc; struct k_sigaction *k; - int sig = proc->signal; + int sig; + if(locals == NULL) + return; + proc = cpu_local_var(current); if(proc == NULL || proc->pid == 0) return; + sig = proc->signal; proc->signal = 0; if(sig){