Copy code from iq80321 / ixp425:

Use __insn_barrier() to prevent the compiler reordering splx/splraise
relative to the code they're supposed to protect.
This commit is contained in:
he 2004-01-13 23:18:54 +00:00
parent 45e487aa97
commit 9730086e9d

View File

@ -1,4 +1,4 @@
/* $NetBSD: iq80310_intr.h,v 1.2 2002/10/09 00:03:42 thorpej Exp $ */
/* $NetBSD: iq80310_intr.h,v 1.3 2004/01/13 23:18:54 he Exp $ */
/*
* Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@ -78,6 +78,9 @@ iq80310_splraise(int ipl)
old = current_spl_level;
current_spl_level |= iq80310_imask[ipl];
/* Don't let the compiler re-order this code with subsequent code */
__insn_barrier();
return (old);
}
@ -88,6 +91,9 @@ iq80310_splx(int new)
extern __volatile int current_spl_level;
int old;
/* Don't let the compiler re-order this code with preceding code */
__insn_barrier();
old = current_spl_level;
current_spl_level = new;