From c75aeaa65395952b9e58c0575fbbdb26fb6e60d5 Mon Sep 17 00:00:00 2001 From: chris Date: Sun, 16 Apr 2006 23:31:54 +0000 Subject: [PATCH] Use __insn_barrier() to prevent the compiler reordering splx/splraise relative to the code they're supposed to protect. --- sys/arch/arm/footbridge/footbridge_intr.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/arch/arm/footbridge/footbridge_intr.h b/sys/arch/arm/footbridge/footbridge_intr.h index a283d74a9de5..cd61f3309f9b 100644 --- a/sys/arch/arm/footbridge/footbridge_intr.h +++ b/sys/arch/arm/footbridge/footbridge_intr.h @@ -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. @@ -106,6 +106,9 @@ footbridge_splx(int newspl) extern void footbridge_do_pending(void); int oldirqstate, hwpend; + /* Don't let the compiler re-order this code with preceding code */ + __insn_barrier(); + current_spl_level = newspl; hwpend = (footbridge_ipending & ICU_INT_HWMASK) & ~newspl; @@ -130,6 +133,9 @@ footbridge_splraise(int ipl) old = current_spl_level; current_spl_level |= footbridge_imask[ipl]; + /* Don't let the compiler re-order this code with subsequent code */ + __insn_barrier(); + return (old); }