From a702c889d5ba36bc8af16e146db2f994855a68e8 Mon Sep 17 00:00:00 2001 From: gkoehler Date: Tue, 1 Sep 2020 20:06:50 +0000 Subject: Fix signotify() for powerpc64 bsd.mp Copy signotify() from amd64, so that if proc *p is on another cpu, then signotify(p) notifies the correct cpu. ok kettenis@ --- sys/arch/powerpc64/include/cpu.h | 7 +++---- sys/arch/powerpc64/powerpc64/machdep.c | 13 ++++++++++++- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'sys/arch/powerpc64') diff --git a/sys/arch/powerpc64/include/cpu.h b/sys/arch/powerpc64/include/cpu.h index 2c716378f66..2fbf638ba3f 100644 --- a/sys/arch/powerpc64/include/cpu.h +++ b/sys/arch/powerpc64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.24 2020/08/23 10:07:51 kettenis Exp $ */ +/* $OpenBSD: cpu.h,v 1.25 2020/09/01 20:06:49 gkoehler Exp $ */ /* * Copyright (c) 2020 Mark Kettenis @@ -154,9 +154,10 @@ void cpu_startclock(void); #define aston(p) ((p)->p_md.md_astpending = 1) #define need_proftick(p) aston(p) +void signotify(struct proc *); + #define cpu_unidle(ci) #define CPU_BUSY_CYCLE() do {} while (0) -#define signotify(p) setsoftast() #define curpcb curcpu()->ci_curpcb @@ -184,8 +185,6 @@ void need_resched(struct cpu_info *); void delay(u_int); #define DELAY(x) delay(x) -#define setsoftast() aston(curcpu()->ci_curproc) - #define PROC_STACK(p) ((p)->p_md.md_regs->fixreg[1]) #define PROC_PC(p) ((p)->p_md.md_regs->srr0) diff --git a/sys/arch/powerpc64/powerpc64/machdep.c b/sys/arch/powerpc64/powerpc64/machdep.c index 58f894c7a0d..c4635cb6a9e 100644 --- a/sys/arch/powerpc64/powerpc64/machdep.c +++ b/sys/arch/powerpc64/powerpc64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.58 2020/08/25 17:49:58 kettenis Exp $ */ +/* $OpenBSD: machdep.c,v 1.59 2020/09/01 20:06:49 gkoehler Exp $ */ /* * Copyright (c) 2020 Mark Kettenis @@ -874,6 +874,17 @@ sys_sigreturn(struct proc *p, void *v, register_t *retval) return EJUSTRETURN; } +/* + * Notify the current process (p) that it has a signal pending, + * process as soon as possible. + */ +void +signotify(struct proc *p) +{ + aston(p); + cpu_kick(p->p_cpu); +} + void cpu_switchto_asm(struct proc *, struct proc *); void -- cgit v1.2.3