diff options
author | Matthew Wilcox <matthew@wil.cx> | 2008-03-07 21:55:58 -0500 |
---|---|---|
committer | Matthew Wilcox <willy@linux.intel.com> | 2008-04-17 10:42:34 -0400 |
commit | 64ac24e738823161693bf791f87adc802cf529ff (patch) | |
tree | 19c0b0cf314d4394ca580c05b86cdf874ce0a167 /arch/m68knommu/lib | |
parent | e48b3deee475134585eed03e7afebe4bf9e0dba9 (diff) |
Generic semaphore implementation
Semaphores are no longer performance-critical, so a generic C
implementation is better for maintainability, debuggability and
extensibility. Thanks to Peter Zijlstra for fixing the lockdep
warning. Thanks to Harvey Harrison for pointing out that the
unlikely() was unnecessary.
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/m68knommu/lib')
-rw-r--r-- | arch/m68knommu/lib/Makefile | 2 | ||||
-rw-r--r-- | arch/m68knommu/lib/semaphore.S | 66 |
2 files changed, 1 insertions, 67 deletions
diff --git a/arch/m68knommu/lib/Makefile b/arch/m68knommu/lib/Makefile index e051a791398..d94d709665a 100644 --- a/arch/m68knommu/lib/Makefile +++ b/arch/m68knommu/lib/Makefile | |||
@@ -4,4 +4,4 @@ | |||
4 | 4 | ||
5 | lib-y := ashldi3.o ashrdi3.o lshrdi3.o \ | 5 | lib-y := ashldi3.o ashrdi3.o lshrdi3.o \ |
6 | muldi3.o mulsi3.o divsi3.o udivsi3.o modsi3.o umodsi3.o \ | 6 | muldi3.o mulsi3.o divsi3.o udivsi3.o modsi3.o umodsi3.o \ |
7 | checksum.o semaphore.o memcpy.o memset.o delay.o | 7 | checksum.o memcpy.o memset.o delay.o |
diff --git a/arch/m68knommu/lib/semaphore.S b/arch/m68knommu/lib/semaphore.S deleted file mode 100644 index 87c74603437..00000000000 --- a/arch/m68knommu/lib/semaphore.S +++ /dev/null | |||
@@ -1,66 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/m68k/lib/semaphore.S | ||
3 | * | ||
4 | * Copyright (C) 1996 Linus Torvalds | ||
5 | * | ||
6 | * m68k version by Andreas Schwab | ||
7 | * | ||
8 | * MAR/1999 -- modified to support ColdFire (gerg@snapgear.com) | ||
9 | */ | ||
10 | |||
11 | #include <linux/linkage.h> | ||
12 | #include <asm/semaphore.h> | ||
13 | |||
14 | /* | ||
15 | * "down_failed" is called with the eventual return address | ||
16 | * in %a0, and the address of the semaphore in %a1. We need | ||
17 | * to increment the number of waiters on the semaphore, | ||
18 | * call "__down()", and then eventually return to try again. | ||
19 | */ | ||
20 | ENTRY(__down_failed) | ||
21 | #ifdef CONFIG_COLDFIRE | ||
22 | subl #12,%sp | ||
23 | moveml %a0/%d0/%d1,(%sp) | ||
24 | #else | ||
25 | moveml %a0/%d0/%d1,-(%sp) | ||
26 | #endif | ||
27 | movel %a1,-(%sp) | ||
28 | jbsr __down | ||
29 | movel (%sp)+,%a1 | ||
30 | movel (%sp)+,%d0 | ||
31 | movel (%sp)+,%d1 | ||
32 | rts | ||
33 | |||
34 | ENTRY(__down_failed_interruptible) | ||
35 | movel %a0,-(%sp) | ||
36 | movel %d1,-(%sp) | ||
37 | movel %a1,-(%sp) | ||
38 | jbsr __down_interruptible | ||
39 | movel (%sp)+,%a1 | ||
40 | movel (%sp)+,%d1 | ||
41 | rts | ||
42 | |||
43 | ENTRY(__up_wakeup) | ||
44 | #ifdef CONFIG_COLDFIRE | ||
45 | subl #12,%sp | ||
46 | moveml %a0/%d0/%d1,(%sp) | ||
47 | #else | ||
48 | moveml %a0/%d0/%d1,-(%sp) | ||
49 | #endif | ||
50 | movel %a1,-(%sp) | ||
51 | jbsr __up | ||
52 | movel (%sp)+,%a1 | ||
53 | movel (%sp)+,%d0 | ||
54 | movel (%sp)+,%d1 | ||
55 | rts | ||
56 | |||
57 | ENTRY(__down_failed_trylock) | ||
58 | movel %a0,-(%sp) | ||
59 | movel %d1,-(%sp) | ||
60 | movel %a1,-(%sp) | ||
61 | jbsr __down_trylock | ||
62 | movel (%sp)+,%a1 | ||
63 | movel (%sp)+,%d1 | ||
64 | movel (%sp)+,%a0 | ||
65 | rts | ||
66 | |||