summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorZwane Mwaikambo <zwane@linuxpower.ca>2004-09-04 02:18:47 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-09-04 02:18:47 -0700
commitb3a9ee9e608306de8130f33374b447ea32edc430 (patch)
tree27404143ab276a085a5435bc20a0cf33780b2a47 /include
parent4eca1f9032684ed50bef1c22a6672e16b18b772a (diff)
[PATCH] out-of-line locks / i386
Signed-off-by: Zwane Mwaikambo <zwane@fsmlabs.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-i386/ptrace.h4
-rw-r--r--include/asm-i386/rwlock.h32
-rw-r--r--include/asm-i386/spinlock.h10
3 files changed, 18 insertions, 28 deletions
diff --git a/include/asm-i386/ptrace.h b/include/asm-i386/ptrace.h
index 0e6725c46a7b..2d673afe72f3 100644
--- a/include/asm-i386/ptrace.h
+++ b/include/asm-i386/ptrace.h
@@ -57,7 +57,11 @@ struct pt_regs {
#ifdef __KERNEL__
#define user_mode(regs) ((VM_MASK & (regs)->eflags) || (3 & (regs)->xcs))
#define instruction_pointer(regs) ((regs)->eip)
+#if defined(CONFIG_SMP) && defined(CONFIG_FRAME_POINTER)
+extern unsigned long profile_pc(struct pt_regs *regs);
+#else
#define profile_pc(regs) instruction_pointer(regs)
#endif
+#endif
#endif
diff --git a/include/asm-i386/rwlock.h b/include/asm-i386/rwlock.h
index 291091ddae4c..b57cc7afdf7e 100644
--- a/include/asm-i386/rwlock.h
+++ b/include/asm-i386/rwlock.h
@@ -22,25 +22,19 @@
#define __build_read_lock_ptr(rw, helper) \
asm volatile(LOCK "subl $1,(%0)\n\t" \
- "js 2f\n" \
+ "jns 1f\n" \
+ "call " helper "\n\t" \
"1:\n" \
- LOCK_SECTION_START("") \
- "2:\tcall " helper "\n\t" \
- "jmp 1b\n" \
- LOCK_SECTION_END \
::"a" (rw) : "memory")
#define __build_read_lock_const(rw, helper) \
asm volatile(LOCK "subl $1,%0\n\t" \
- "js 2f\n" \
- "1:\n" \
- LOCK_SECTION_START("") \
- "2:\tpushl %%eax\n\t" \
+ "jns 1f\n" \
+ "pushl %%eax\n\t" \
"leal %0,%%eax\n\t" \
"call " helper "\n\t" \
"popl %%eax\n\t" \
- "jmp 1b\n" \
- LOCK_SECTION_END \
+ "1:\n" \
:"=m" (*(volatile int *)rw) : : "memory")
#define __build_read_lock(rw, helper) do { \
@@ -52,25 +46,19 @@
#define __build_write_lock_ptr(rw, helper) \
asm volatile(LOCK "subl $" RW_LOCK_BIAS_STR ",(%0)\n\t" \
- "jnz 2f\n" \
+ "jz 1f\n" \
+ "call " helper "\n\t" \
"1:\n" \
- LOCK_SECTION_START("") \
- "2:\tcall " helper "\n\t" \
- "jmp 1b\n" \
- LOCK_SECTION_END \
::"a" (rw) : "memory")
#define __build_write_lock_const(rw, helper) \
asm volatile(LOCK "subl $" RW_LOCK_BIAS_STR ",%0\n\t" \
- "jnz 2f\n" \
- "1:\n" \
- LOCK_SECTION_START("") \
- "2:\tpushl %%eax\n\t" \
+ "jz 1f\n" \
+ "pushl %%eax\n\t" \
"leal %0,%%eax\n\t" \
"call " helper "\n\t" \
"popl %%eax\n\t" \
- "jmp 1b\n" \
- LOCK_SECTION_END \
+ "1:\n" \
:"=m" (*(volatile int *)rw) : : "memory")
#define __build_write_lock(rw, helper) do { \
diff --git a/include/asm-i386/spinlock.h b/include/asm-i386/spinlock.h
index d6dbfd469565..c189e1b9be4c 100644
--- a/include/asm-i386/spinlock.h
+++ b/include/asm-i386/spinlock.h
@@ -46,20 +46,18 @@ typedef struct {
#define spin_lock_string \
"\n1:\t" \
"lock ; decb %0\n\t" \
- "js 2f\n" \
- LOCK_SECTION_START("") \
+ "jns 3f\n" \
"2:\t" \
"rep;nop\n\t" \
"cmpb $0,%0\n\t" \
"jle 2b\n\t" \
"jmp 1b\n" \
- LOCK_SECTION_END
+ "3:\n\t"
#define spin_lock_string_flags \
"\n1:\t" \
"lock ; decb %0\n\t" \
- "js 2f\n\t" \
- LOCK_SECTION_START("") \
+ "jns 4f\n\t" \
"2:\t" \
"testl $0x200, %1\n\t" \
"jz 3f\n\t" \
@@ -70,7 +68,7 @@ typedef struct {
"jle 3b\n\t" \
"cli\n\t" \
"jmp 1b\n" \
- LOCK_SECTION_END
+ "4:\n\t"
/*
* This works. Despite all the confusion.