diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2002-12-11 06:56:22 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2002-12-11 06:56:22 +0000 |
commit | 6fd178c3b5e9c4b3c161604293d7ddea2e442960 (patch) | |
tree | 915010c4b5de722f7890259ff451ce06a9c1d133 /sys/arch/sparc/include | |
parent | 73d916d4f6e56a740725e2125bd32666181f1c20 (diff) |
Added paranoia to make sure that gcc doesn't reorder spl* inlines.
Diffstat (limited to 'sys/arch/sparc/include')
-rw-r--r-- | sys/arch/sparc/include/psl.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/arch/sparc/include/psl.h b/sys/arch/sparc/include/psl.h index c724cfa20df..2e01768bfc6 100644 --- a/sys/arch/sparc/include/psl.h +++ b/sys/arch/sparc/include/psl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: psl.h,v 1.16 2002/11/11 05:04:44 miod Exp $ */ +/* $OpenBSD: psl.h,v 1.17 2002/12/11 06:56:21 art Exp $ */ /* $NetBSD: psl.h,v 1.12 1997/03/10 21:49:11 pk Exp $ */ /* @@ -195,6 +195,7 @@ static __inline int name() \ __asm __volatile("wr %0,%1,%%psr" : : \ "r" (psr), "n" ((newipl) << 8)); \ __asm __volatile("nop; nop; nop"); \ + __asm __volatile("":::"memory"); /* protect from reordering */ \ return (oldipl); \ } /* A non-priority-decreasing version of SPL */ @@ -211,6 +212,7 @@ static __inline int name() \ __asm __volatile("wr %0,%1,%%psr" : : \ "r" (psr), "n" ((newipl) << 8)); \ __asm __volatile("nop; nop; nop"); \ + __asm __volatile("":::"memory"); /* protect from reordering */ \ return (oldipl); \ } @@ -240,6 +242,7 @@ static __inline int splhigh() __asm __volatile("wr %0,0,%%psr" : : "r" (psr | PSR_PIL)); __asm __volatile("and %1,%2,%0; nop; nop" : "=r" (oldipl) : \ "r" (psr), "n" (PSR_PIL)); + __asm __volatile("":::"memory"); /* protect from reordering */ return (oldipl); } @@ -249,6 +252,7 @@ static __inline void splx(newipl) { int psr; + __asm __volatile("":::"memory"); /* protect from reordering */ __asm __volatile("rd %%psr,%0" : "=r" (psr)); __asm __volatile("wr %0,%1,%%psr" : : \ "r" (psr & ~PSR_PIL), "rn" (newipl)); |