interrupt syscall of signal recieved process
This commit is contained in:
@ -143,7 +143,7 @@ SYSCALL_DECLARE(rt_sigreturn)
|
|||||||
|
|
||||||
extern struct cpu_local_var *clv;
|
extern struct cpu_local_var *clv;
|
||||||
extern unsigned long do_kill(int pid, int tid, int sig);
|
extern unsigned long do_kill(int pid, int tid, int sig);
|
||||||
extern void interrupt_syscall(int all);
|
extern void interrupt_syscall(int all, int pid);
|
||||||
extern int num_processors;
|
extern int num_processors;
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -370,7 +370,7 @@ do_kill(int pid, int tid, int sig)
|
|||||||
if(proc != tproc){
|
if(proc != tproc){
|
||||||
ihk_mc_interrupt_cpu(get_x86_cpu_local_variable(tproc->cpu_id)->apic_id, 0xd0);
|
ihk_mc_interrupt_cpu(get_x86_cpu_local_variable(tproc->cpu_id)->apic_id, 0xd0);
|
||||||
}
|
}
|
||||||
interrupt_syscall(1);
|
interrupt_syscall(1, tproc->pid);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -127,6 +127,8 @@ static void send_syscall(struct syscall_request *req, int cpu, int pid)
|
|||||||
/* XXX: is this really going to work if multiple processes
|
/* XXX: is this really going to work if multiple processes
|
||||||
* exit/receive signals at the same time?? */
|
* exit/receive signals at the same time?? */
|
||||||
cpu = num_processors;
|
cpu = num_processors;
|
||||||
|
if(req->number == __NR_kill)
|
||||||
|
pid = req->args[2];
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
scp = &get_cpu_local_var(cpu)->scp;
|
scp = &get_cpu_local_var(cpu)->scp;
|
||||||
@ -234,6 +236,7 @@ long syscall_generic_forwarding(int n, ihk_mc_user_context_t *ctx)
|
|||||||
SYSCALL_FOOTER;
|
SYSCALL_FOOTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
void sigchld_parent(struct process *parent, int status)
|
void sigchld_parent(struct process *parent, int status)
|
||||||
{
|
{
|
||||||
struct process *proc = cpu_local_var(current);
|
struct process *proc = cpu_local_var(current);
|
||||||
@ -275,6 +278,7 @@ void sigchld_parent(struct process *parent, int status)
|
|||||||
|
|
||||||
ihk_mc_spinlock_unlock(&parent->sigpendinglock, irqstate);
|
ihk_mc_spinlock_unlock(&parent->sigpendinglock, irqstate);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* From glibc: INLINE_SYSCALL (wait4, 4, pid, stat_loc, options, NULL);
|
* From glibc: INLINE_SYSCALL (wait4, 4, pid, stat_loc, options, NULL);
|
||||||
@ -438,13 +442,14 @@ terminate(int rc, int sig, ihk_mc_user_context_t *ctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
interrupt_syscall(int all)
|
interrupt_syscall(int all, int pid)
|
||||||
{
|
{
|
||||||
ihk_mc_user_context_t ctx;
|
ihk_mc_user_context_t ctx;
|
||||||
long lerror;
|
long lerror;
|
||||||
|
|
||||||
ihk_mc_syscall_arg0(&ctx) = all? -1: ihk_mc_get_processor_id();
|
ihk_mc_syscall_arg0(&ctx) = all? -1: ihk_mc_get_processor_id();
|
||||||
ihk_mc_syscall_arg1(&ctx) = 0;
|
ihk_mc_syscall_arg1(&ctx) = 0;
|
||||||
|
ihk_mc_syscall_arg2(&ctx) = pid;
|
||||||
|
|
||||||
lerror = syscall_generic_forwarding(__NR_kill, &ctx);
|
lerror = syscall_generic_forwarding(__NR_kill, &ctx);
|
||||||
if (lerror) {
|
if (lerror) {
|
||||||
|
|||||||
Reference in New Issue
Block a user