diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2011-01-14 13:20:07 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2011-01-14 13:20:07 +0000 |
commit | 7977aca4b4b15662757e35623e69c246f00684eb (patch) | |
tree | 274989aa93cab8e1bfee70dd6618140d5f6c351a /sys | |
parent | 35f7bd696c550c677f2ff9b51d618109803b8640 (diff) |
Implement a function to broadcast IPIs to all running CPUs.
ok kettenis@ deraadt@ miod@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/hppa/hppa/ipi.c | 17 | ||||
-rw-r--r-- | sys/arch/hppa/include/intr.h | 3 |
2 files changed, 18 insertions, 2 deletions
diff --git a/sys/arch/hppa/hppa/ipi.c b/sys/arch/hppa/hppa/ipi.c index 60776162376..98f83751c61 100644 --- a/sys/arch/hppa/hppa/ipi.c +++ b/sys/arch/hppa/hppa/ipi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipi.c,v 1.3 2011/01/14 13:09:45 jsing Exp $ */ +/* $OpenBSD: ipi.c,v 1.4 2011/01/14 13:20:06 jsing Exp $ */ /* * Copyright (c) 2010 Joel Sing <jsing@openbsd.org> @@ -94,6 +94,21 @@ hppa_ipi_send(struct cpu_info *ci, u_long ipi) return 0; } +int +hppa_ipi_broadcast(u_long ipi) +{ + CPU_INFO_ITERATOR cii; + struct cpu_info *ci; + int count = 0; + + CPU_INFO_FOREACH(cii, ci) + if (ci != curcpu() && (ci->ci_flags & CPUF_RUNNING)) + if (hppa_ipi_send(ci, ipi)) + count++; + + return count; +} + void hppa_ipi_nop(void) { diff --git a/sys/arch/hppa/include/intr.h b/sys/arch/hppa/include/intr.h index aae95d7cf37..c721bea2d12 100644 --- a/sys/arch/hppa/include/intr.h +++ b/sys/arch/hppa/include/intr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.h,v 1.36 2011/01/14 13:09:45 jsing Exp $ */ +/* $OpenBSD: intr.h,v 1.37 2011/01/14 13:20:06 jsing Exp $ */ /* * Copyright (c) 2002-2004 Michael Shalayeff @@ -154,6 +154,7 @@ hppa_intr_enable(register_t eiem) #ifdef MULTIPROCESSOR void hppa_ipi_init(struct cpu_info *); int hppa_ipi_send(struct cpu_info *, u_long); +int hppa_ipi_broadcast(u_long); #endif #define setsoftast(p) (p->p_md.md_astpending = 1) |