patch-2.4.21 linux-2.4.21/include/asm-ppc/spinlock.h
Next file: linux-2.4.21/include/asm-ppc/stat.h
Previous file: linux-2.4.21/include/asm-ppc/softirq.h
Back to the patch index
Back to the overall index
- Lines: 101
- Date:
2003-06-13 07:51:38.000000000 -0700
- Orig file:
linux-2.4.20/include/asm-ppc/spinlock.h
- Orig date:
2002-11-28 15:53:15.000000000 -0800
diff -urN linux-2.4.20/include/asm-ppc/spinlock.h linux-2.4.21/include/asm-ppc/spinlock.h
@@ -1,10 +1,8 @@
-/*
- * BK Id: %F% %I% %G% %U% %#%
- */
#ifndef __ASM_SPINLOCK_H
#define __ASM_SPINLOCK_H
#include <asm/system.h>
+#include <asm/processor.h>
#if defined(CONFIG_DEBUG_SPINLOCK)
#define SPINLOCK_DEBUG 1
@@ -54,14 +52,15 @@
unsigned long tmp;
__asm__ __volatile__(
- "b 1f # spin_lock\n\
+ "b 1f # spin_lock\n\
2: lwzx %0,0,%1\n\
cmpwi 0,%0,0\n\
bne+ 2b\n\
1: lwarx %0,0,%1\n\
cmpwi 0,%0,0\n\
- bne- 2b\n\
- stwcx. %2,0,%1\n\
+ bne- 2b\n"
+ PPC405_ERR77(0,%1)
+" stwcx. %2,0,%1\n\
bne- 2b\n\
isync"
: "=&r"(tmp)
@@ -124,15 +123,16 @@
unsigned int tmp;
__asm__ __volatile__(
- "b 2f # read_lock\n\
-1: lwzx %0,0,%1\n\
- cmpwi 0,%0,0\n\
- blt+ 1b\n\
-2: lwarx %0,0,%1\n\
- addic. %0,%0,1\n\
- ble- 1b\n\
- stwcx. %0,0,%1\n\
- bne- 2b\n\
+ "b 2f # read_lock\n\
+1: lwzx %0,0,%1\n\
+ cmpwi 0,%0,0\n\
+ blt+ 1b\n\
+2: lwarx %0,0,%1\n\
+ addic. %0,%0,1\n\
+ ble- 1b\n"
+ PPC405_ERR77(0,%1)
+" stwcx. %0,0,%1\n\
+ bne- 2b\n\
isync"
: "=&r"(tmp)
: "r"(&rw->lock)
@@ -144,11 +144,12 @@
unsigned int tmp;
__asm__ __volatile__(
- "eieio # read_unlock\n\
-1: lwarx %0,0,%1\n\
- addic %0,%0,-1\n\
- stwcx. %0,0,%1\n\
- bne- 1b"
+ "eieio # read_unlock\n\
+1: lwarx %0,0,%1\n\
+ addic %0,%0,-1\n"
+ PPC405_ERR77(0,%1)
+" stwcx. %0,0,%1\n\
+ bne- 1b"
: "=&r"(tmp)
: "r"(&rw->lock)
: "cr0", "memory");
@@ -159,15 +160,16 @@
unsigned int tmp;
__asm__ __volatile__(
- "b 2f # write_lock\n\
-1: lwzx %0,0,%1\n\
- cmpwi 0,%0,0\n\
- bne+ 1b\n\
-2: lwarx %0,0,%1\n\
- cmpwi 0,%0,0\n\
- bne- 1b\n\
- stwcx. %2,0,%1\n\
- bne- 2b\n\
+ "b 2f # write_lock\n\
+1: lwzx %0,0,%1\n\
+ cmpwi 0,%0,0\n\
+ bne+ 1b\n\
+2: lwarx %0,0,%1\n\
+ cmpwi 0,%0,0\n\
+ bne- 1b\n"
+ PPC405_ERR77(0,%1)
+" stwcx. %2,0,%1\n\
+ bne- 2b\n\
isync"
: "=&r"(tmp)
: "r"(&rw->lock), "r"(-1)
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)