diff options
author | Dave Kleikamp <shaggy@austin.ibm.com> | 2005-07-19 14:46:53 -0400 |
---|---|---|
committer | Dave Kleikamp <shaggy@austin.ibm.com> | 2005-07-19 14:46:53 -0400 |
commit | 21d1ee8b375bcd180f1d6b8ccbb8d8f938596310 (patch) | |
tree | 2e82b65c16a4aaa88eeb7dd9f47f2d1c418e77d0 /arch/arm/lib | |
parent | 3d9b1cdd2455017c6aa25bc2442092b81438981f (diff) | |
parent | f60f700876cd51de9de69f3a3c865d95e287a24d (diff) |
Merge with /home/shaggy/git/linus-clean/
Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
Diffstat (limited to 'arch/arm/lib')
-rw-r--r-- | arch/arm/lib/bitops.h | 31 | ||||
-rw-r--r-- | arch/arm/lib/io-shark.c | 70 |
2 files changed, 31 insertions, 70 deletions
diff --git a/arch/arm/lib/bitops.h b/arch/arm/lib/bitops.h index 4a83ab6cd565..6976e60e47cb 100644 --- a/arch/arm/lib/bitops.h +++ b/arch/arm/lib/bitops.h | |||
@@ -1,3 +1,33 @@ | |||
1 | #if __LINUX_ARM_ARCH__ >= 6 | ||
2 | .macro bitop, instr | ||
3 | mov r2, #1 | ||
4 | and r3, r0, #7 @ Get bit offset | ||
5 | add r1, r1, r0, lsr #3 @ Get byte offset | ||
6 | mov r3, r2, lsl r3 | ||
7 | 1: ldrexb r2, [r1] | ||
8 | \instr r2, r2, r3 | ||
9 | strexb r0, r2, [r1] | ||
10 | cmpne r0, #0 | ||
11 | bne 1b | ||
12 | mov pc, lr | ||
13 | .endm | ||
14 | |||
15 | .macro testop, instr, store | ||
16 | and r3, r0, #7 @ Get bit offset | ||
17 | mov r2, #1 | ||
18 | add r1, r1, r0, lsr #3 @ Get byte offset | ||
19 | mov r3, r2, lsl r3 @ create mask | ||
20 | 1: ldrexb r2, [r1] | ||
21 | ands r0, r2, r3 @ save old value of bit | ||
22 | \instr ip, r2, r3 @ toggle bit | ||
23 | strexb r2, ip, [r1] | ||
24 | cmp r2, #0 | ||
25 | bne 1b | ||
26 | cmp r0, #0 | ||
27 | movne r0, #1 | ||
28 | 2: mov pc, lr | ||
29 | .endm | ||
30 | #else | ||
1 | .macro bitop, instr | 31 | .macro bitop, instr |
2 | and r2, r0, #7 | 32 | and r2, r0, #7 |
3 | mov r3, #1 | 33 | mov r3, #1 |
@@ -31,3 +61,4 @@ | |||
31 | moveq r0, #0 | 61 | moveq r0, #0 |
32 | mov pc, lr | 62 | mov pc, lr |
33 | .endm | 63 | .endm |
64 | #endif | ||
diff --git a/arch/arm/lib/io-shark.c b/arch/arm/lib/io-shark.c index 108d4573e970..824253948f51 100644 --- a/arch/arm/lib/io-shark.c +++ b/arch/arm/lib/io-shark.c | |||
@@ -11,73 +11,3 @@ | |||
11 | * it under the terms of the GNU General Public License version 2 as | 11 | * it under the terms of the GNU General Public License version 2 as |
12 | * published by the Free Software Foundation. | 12 | * published by the Free Software Foundation. |
13 | */ | 13 | */ |
14 | #include <linux/kernel.h> | ||
15 | |||
16 | #include <asm/io.h> | ||
17 | |||
18 | void print_warning(void) | ||
19 | { | ||
20 | printk(KERN_WARNING "ins?/outs? not implemented on this architecture\n"); | ||
21 | } | ||
22 | |||
23 | void insl(unsigned int port, void *to, int len) | ||
24 | { | ||
25 | print_warning(); | ||
26 | } | ||
27 | |||
28 | void insb(unsigned int port, void *to, int len) | ||
29 | { | ||
30 | print_warning(); | ||
31 | } | ||
32 | |||
33 | void outsl(unsigned int port, const void *from, int len) | ||
34 | { | ||
35 | print_warning(); | ||
36 | } | ||
37 | |||
38 | void outsb(unsigned int port, const void *from, int len) | ||
39 | { | ||
40 | print_warning(); | ||
41 | } | ||
42 | |||
43 | /* these should be in assembler again */ | ||
44 | |||
45 | /* | ||
46 | * Purpose: read a block of data from a hardware register to memory. | ||
47 | * Proto : insw(int from_port, void *to, int len_in_words); | ||
48 | * Proto : inswb(int from_port, void *to, int len_in_bytes); | ||
49 | * Notes : increment to | ||
50 | */ | ||
51 | |||
52 | void insw(unsigned int port, void *to, int len) | ||
53 | { | ||
54 | int i; | ||
55 | |||
56 | for (i = 0; i < len; i++) | ||
57 | ((unsigned short *) to)[i] = inw(port); | ||
58 | } | ||
59 | |||
60 | void inswb(unsigned int port, void *to, int len) | ||
61 | { | ||
62 | insw(port, to, len >> 2); | ||
63 | } | ||
64 | |||
65 | /* | ||
66 | * Purpose: write a block of data from memory to a hardware register. | ||
67 | * Proto : outsw(int to_reg, void *from, int len_in_words); | ||
68 | * Proto : outswb(int to_reg, void *from, int len_in_bytes); | ||
69 | * Notes : increments from | ||
70 | */ | ||
71 | |||
72 | void outsw(unsigned int port, const void *from, int len) | ||
73 | { | ||
74 | int i; | ||
75 | |||
76 | for (i = 0; i < len; i++) | ||
77 | outw(((unsigned short *) from)[i], port); | ||
78 | } | ||
79 | |||
80 | void outswb(unsigned int port, const void *from, int len) | ||
81 | { | ||
82 | outsw(port, from, len >> 2); | ||
83 | } | ||