avoid races in mp_save_{fpu,vec}_proc() where the other CPU

dumps the state out from under us.
This commit is contained in:
chs 2002-08-06 06:16:04 +00:00
parent 301f1ebf31
commit ef0d8145a7
1 changed files with 7 additions and 1 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.117 2002/07/28 07:07:46 chs Exp $ */ /* $NetBSD: machdep.c,v 1.118 2002/08/06 06:16:04 chs Exp $ */
/* /*
* Copyright (C) 1995, 1996 Wolfgang Solfrank. * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -697,6 +697,9 @@ mp_save_fpu_proc(p)
*/ */
fpcpu = pcb->pcb_fpcpu; fpcpu = pcb->pcb_fpcpu;
if (fpcpu == NULL) {
return;
}
macppc_send_ipi(fpcpu, MACPPC_IPI_FLUSH_FPU); macppc_send_ipi(fpcpu, MACPPC_IPI_FLUSH_FPU);
/* Wait for flush. */ /* Wait for flush. */
@ -737,6 +740,9 @@ mp_save_vec_proc(p)
*/ */
veccpu = pcb->pcb_veccpu; veccpu = pcb->pcb_veccpu;
if (veccpu == NULL) {
return;
}
macppc_send_ipi(veccpu, MACPPC_IPI_FLUSH_VEC); macppc_send_ipi(veccpu, MACPPC_IPI_FLUSH_VEC);
/* Wait for flush. */ /* Wait for flush. */