Use __insn_barrier() to prevent the compiler reordering splx/splraise
relative to the code they're supposed to protect.
This commit is contained in:
parent
94c889ba30
commit
c75aeaa653
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: footbridge_intr.h,v 1.7 2006/01/01 14:24:33 yamt Exp $ */
|
/* $NetBSD: footbridge_intr.h,v 1.8 2006/04/16 23:31:54 chris Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2002 Wasabi Systems, Inc.
|
* Copyright (c) 2001, 2002 Wasabi Systems, Inc.
|
||||||
@ -106,6 +106,9 @@ footbridge_splx(int newspl)
|
|||||||
extern void footbridge_do_pending(void);
|
extern void footbridge_do_pending(void);
|
||||||
int oldirqstate, hwpend;
|
int oldirqstate, hwpend;
|
||||||
|
|
||||||
|
/* Don't let the compiler re-order this code with preceding code */
|
||||||
|
__insn_barrier();
|
||||||
|
|
||||||
current_spl_level = newspl;
|
current_spl_level = newspl;
|
||||||
|
|
||||||
hwpend = (footbridge_ipending & ICU_INT_HWMASK) & ~newspl;
|
hwpend = (footbridge_ipending & ICU_INT_HWMASK) & ~newspl;
|
||||||
@ -130,6 +133,9 @@ footbridge_splraise(int ipl)
|
|||||||
old = current_spl_level;
|
old = current_spl_level;
|
||||||
current_spl_level |= footbridge_imask[ipl];
|
current_spl_level |= footbridge_imask[ipl];
|
||||||
|
|
||||||
|
/* Don't let the compiler re-order this code with subsequent code */
|
||||||
|
__insn_barrier();
|
||||||
|
|
||||||
return (old);
|
return (old);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user