Module Name: src
Committed By: bouyer
Date: Mon May 18 18:23:47 UTC 2009
Modified Files:
src/sys/arch/sparc/include [netbsd-4-0]: psl.h
Log Message:
Pull up following revision(s) (requested by martin in ticket #1317):
sys/arch/sparc/include/psl.h: revision 1.45
Add memory clobbers to the inline assembler modifying/testing the %psr
register, to avoid the compiler reordering instructions out of critical
sections. Should fix PR port-sparc/41372.
To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.40.18.1 src/sys/arch/sparc/include/psl.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/sparc/include/psl.h
diff -u src/sys/arch/sparc/include/psl.h:1.40 src/sys/arch/sparc/include/psl.h:1.40.18.1
--- src/sys/arch/sparc/include/psl.h:1.40 Thu May 4 12:21:18 2006
+++ src/sys/arch/sparc/include/psl.h Mon May 18 18:23:47 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: psl.h,v 1.40 2006/05/04 12:21:18 yamt Exp $ */
+/* $NetBSD: psl.h,v 1.40.18.1 2009/05/18 18:23:47 bouyer Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -252,7 +252,7 @@
static __inline void
setpsr(int newpsr)
{
- __asm volatile("wr %0,0,%%psr" : : "r" (newpsr));
+ __asm volatile("wr %0,0,%%psr" : : "r" (newpsr) : "memory");
__asm volatile("nop; nop; nop");
}
@@ -266,7 +266,7 @@
* which gives us the same value as the old psr but with all
* the old PIL bits turned off.
*/
- __asm volatile("rd %%psr,%0" : "=r" (psr));
+ __asm volatile("rd %%psr,%0" : "=r" (psr) : : "memory");
oldipl = psr & PSR_PIL;
__asm volatile("wr %0,%1,%%psr" : : "r" (psr), "r" (oldipl));
@@ -291,7 +291,7 @@
psr &= ~oldipl; \
__asm volatile("wr %0,%1,%%psr" : : \
"r" (psr), "n" ((newipl) << 8)); \
- __asm volatile("nop; nop; nop"); \
+ __asm volatile("nop; nop; nop" : : : "memory"); \
}
_SPLSET(spllowersoftclock, IPL_SOFTCLOCK)
@@ -313,7 +313,7 @@
psr = (psr & ~oldipl) | newipl;
__asm volatile("wr %0,0,%%psr" : : "r" (psr));
- __asm volatile("nop; nop; nop");
+ __asm volatile("nop; nop; nop" : : : "memory");
return (oldipl);
}
@@ -334,7 +334,7 @@
{
int psr;
- __asm volatile("rd %%psr,%0" : "=r" (psr));
+ __asm volatile("rd %%psr,%0" : "=r" (psr) : : "memory");
__asm volatile("wr %0,%1,%%psr" : : \
"r" (psr & ~PSR_PIL), "rn" (newipl));
__asm volatile("nop; nop; nop");