diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2008-07-27 17:00:59 -0400 |
---|---|---|
committer | Sam Ravnborg <sam@ravnborg.org> | 2008-07-27 17:00:59 -0400 |
commit | a439fe51a1f8eb087c22dd24d69cebae4a3addac (patch) | |
tree | e32d1fa97a220ab598d8ab364205817c5bf2bd6f /include/asm-sparc/smpprim.h | |
parent | 837b41b5de356aa67abb2cadb5eef3efc7776f91 (diff) |
sparc, sparc64: use arch/sparc/include
The majority of this patch was created by the following script:
***
ASM=arch/sparc/include/asm
mkdir -p $ASM
git mv include/asm-sparc64/ftrace.h $ASM
git rm include/asm-sparc64/*
git mv include/asm-sparc/* $ASM
sed -ie 's/asm-sparc64/asm/g' $ASM/*
sed -ie 's/asm-sparc/asm/g' $ASM/*
***
The rest was an update of the top-level Makefile to use sparc
for header files when sparc64 is being build.
And a small fixlet to pick up the correct unistd.h from
sparc64 code.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'include/asm-sparc/smpprim.h')
-rw-r--r-- | include/asm-sparc/smpprim.h | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/include/asm-sparc/smpprim.h b/include/asm-sparc/smpprim.h deleted file mode 100644 index eb849d862c64..000000000000 --- a/include/asm-sparc/smpprim.h +++ /dev/null | |||
@@ -1,54 +0,0 @@ | |||
1 | /* | ||
2 | * smpprim.h: SMP locking primitives on the Sparc | ||
3 | * | ||
4 | * God knows we won't be actually using this code for some time | ||
5 | * but I thought I'd write it since I knew how. | ||
6 | * | ||
7 | * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) | ||
8 | */ | ||
9 | |||
10 | #ifndef __SPARC_SMPPRIM_H | ||
11 | #define __SPARC_SMPPRIM_H | ||
12 | |||
13 | /* Test and set the unsigned byte at ADDR to 1. Returns the previous | ||
14 | * value. On the Sparc we use the ldstub instruction since it is | ||
15 | * atomic. | ||
16 | */ | ||
17 | |||
18 | static inline __volatile__ char test_and_set(void *addr) | ||
19 | { | ||
20 | char state = 0; | ||
21 | |||
22 | __asm__ __volatile__("ldstub [%0], %1 ! test_and_set\n\t" | ||
23 | "=r" (addr), "=r" (state) : | ||
24 | "0" (addr), "1" (state) : "memory"); | ||
25 | |||
26 | return state; | ||
27 | } | ||
28 | |||
29 | /* Initialize a spin-lock. */ | ||
30 | static inline __volatile__ smp_initlock(void *spinlock) | ||
31 | { | ||
32 | /* Unset the lock. */ | ||
33 | *((unsigned char *) spinlock) = 0; | ||
34 | |||
35 | return; | ||
36 | } | ||
37 | |||
38 | /* This routine spins until it acquires the lock at ADDR. */ | ||
39 | static inline __volatile__ smp_lock(void *addr) | ||
40 | { | ||
41 | while(test_and_set(addr) == 0xff) | ||
42 | ; | ||
43 | |||
44 | /* We now have the lock */ | ||
45 | return; | ||
46 | } | ||
47 | |||
48 | /* This routine releases the lock at ADDR. */ | ||
49 | static inline __volatile__ smp_unlock(void *addr) | ||
50 | { | ||
51 | *((unsigned char *) addr) = 0; | ||
52 | } | ||
53 | |||
54 | #endif /* !(__SPARC_SMPPRIM_H) */ | ||