* Wrap IPI sending in splclock(), since an interrupt at IPL_CLOCK or lower
may cause IPIs. * Make broadcast IPIs go through x86_ipi() as well, so that they wait for the APIC to be ready too. From Stephan Uphoff.
This commit is contained in:
parent
b77a9f1e15
commit
ae8c299425
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ipi.c,v 1.5 2004/02/13 11:36:20 wiz Exp $ */
|
||||
/* $NetBSD: ipi.c,v 1.6 2005/01/13 00:08:22 fvdl Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||
|
@ -39,7 +39,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: ipi.c,v 1.5 2004/02/13 11:36:20 wiz Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ipi.c,v 1.6 2005/01/13 00:08:22 fvdl Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/device.h>
|
||||
|
@ -74,20 +74,11 @@ x86_send_ipi(struct cpu_info *ci, int ipimask)
|
|||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
x86_self_ipi (int vector)
|
||||
{
|
||||
i82489_writereg(LAPIC_ICRLO,
|
||||
vector | LAPIC_DLMODE_FIXED | LAPIC_LVL_ASSERT | LAPIC_DEST_SELF);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
x86_broadcast_ipi (int ipimask)
|
||||
{
|
||||
struct cpu_info *ci, *self = curcpu();
|
||||
int count = 0;
|
||||
|
||||
CPU_INFO_ITERATOR cii;
|
||||
|
||||
for (CPU_INFO_FOREACH(cii, ci)) {
|
||||
|
@ -101,9 +92,7 @@ x86_broadcast_ipi (int ipimask)
|
|||
if (!count)
|
||||
return;
|
||||
|
||||
i82489_writereg(LAPIC_ICRLO,
|
||||
LAPIC_IPI_VECTOR | LAPIC_DLMODE_FIXED | LAPIC_LVL_ASSERT |
|
||||
LAPIC_DEST_ALLEXCL);
|
||||
x86_ipi(LAPIC_IPI_VECTOR, LAPIC_DEST_ALLEXCL, LAPIC_DLMODE_FIXED);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: lapic.c,v 1.10 2004/07/01 13:00:39 yamt Exp $ */
|
||||
/* $NetBSD: lapic.c,v 1.11 2005/01/13 00:08:22 fvdl Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||
|
@ -39,7 +39,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: lapic.c,v 1.10 2004/07/01 13:00:39 yamt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: lapic.c,v 1.11 2005/01/13 00:08:22 fvdl Exp $");
|
||||
|
||||
#include "opt_ddb.h"
|
||||
#include "opt_multiprocessor.h"
|
||||
|
@ -485,7 +485,9 @@ int
|
|||
x86_ipi(vec,target,dl)
|
||||
int vec,target,dl;
|
||||
{
|
||||
int result;
|
||||
int result, s;
|
||||
|
||||
s = splclock();
|
||||
|
||||
i82489_icr_wait();
|
||||
|
||||
|
@ -499,6 +501,8 @@ x86_ipi(vec,target,dl)
|
|||
|
||||
result = (i82489_readreg(LAPIC_ICRLO) & LAPIC_DLSTAT_BUSY) ? EBUSY : 0;
|
||||
|
||||
splx(s);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue