diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-21 19:50:56 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-21 19:50:56 -0400 |
commit | 8fbf3f30fe0700eff01d6ff8d058cd6f47d4da1b (patch) | |
tree | 0685cbd9de2eed30c7f8eaa870514f1559850b69 /include | |
parent | 28c10af712d875f85c3b8f70aa7a47b77be0f27d (diff) |
ide: <asm-sparc/ide_32.h>: use __raw_{read,write}w()
Use __raw_{read,write}w() in __ide_{in,out}sw().
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-sparc/ide_32.h | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/include/asm-sparc/ide_32.h b/include/asm-sparc/ide_32.h index afd1736ed480..81a00b60bcce 100644 --- a/include/asm-sparc/ide_32.h +++ b/include/asm-sparc/ide_32.h | |||
@@ -28,50 +28,40 @@ | |||
28 | #define __ide_mm_outsw __ide_outsw | 28 | #define __ide_mm_outsw __ide_outsw |
29 | #define __ide_mm_outsl __ide_outsl | 29 | #define __ide_mm_outsl __ide_outsl |
30 | 30 | ||
31 | static inline void __ide_insw(unsigned long port, | 31 | static inline void __ide_insw(void __iomem *port, void *dst, u32 count) |
32 | void *dst, | ||
33 | unsigned long count) | ||
34 | { | 32 | { |
35 | volatile unsigned short *data_port; | ||
36 | /* unsigned long end = (unsigned long)dst + (count << 1); */ /* P3 */ | 33 | /* unsigned long end = (unsigned long)dst + (count << 1); */ /* P3 */ |
37 | u16 *ps = dst; | 34 | u16 *ps = dst; |
38 | u32 *pi; | 35 | u32 *pi; |
39 | 36 | ||
40 | data_port = (volatile unsigned short *)port; | ||
41 | |||
42 | if(((unsigned long)ps) & 0x2) { | 37 | if(((unsigned long)ps) & 0x2) { |
43 | *ps++ = *data_port; | 38 | *ps++ = __raw_readw(port); |
44 | count--; | 39 | count--; |
45 | } | 40 | } |
46 | pi = (u32 *)ps; | 41 | pi = (u32 *)ps; |
47 | while(count >= 2) { | 42 | while(count >= 2) { |
48 | u32 w; | 43 | u32 w; |
49 | 44 | ||
50 | w = (*data_port) << 16; | 45 | w = __raw_readw(port) << 16; |
51 | w |= (*data_port); | 46 | w |= __raw_readw(port); |
52 | *pi++ = w; | 47 | *pi++ = w; |
53 | count -= 2; | 48 | count -= 2; |
54 | } | 49 | } |
55 | ps = (u16 *)pi; | 50 | ps = (u16 *)pi; |
56 | if(count) | 51 | if(count) |
57 | *ps++ = *data_port; | 52 | *ps++ = __raw_readw(port); |
58 | 53 | ||
59 | /* __flush_dcache_range((unsigned long)dst, end); */ /* P3 see hme */ | 54 | /* __flush_dcache_range((unsigned long)dst, end); */ /* P3 see hme */ |
60 | } | 55 | } |
61 | 56 | ||
62 | static inline void __ide_outsw(unsigned long port, | 57 | static inline void __ide_outsw(void __iomem *port, const void *src, u32 count) |
63 | const void *src, | ||
64 | unsigned long count) | ||
65 | { | 58 | { |
66 | volatile unsigned short *data_port; | ||
67 | /* unsigned long end = (unsigned long)src + (count << 1); */ | 59 | /* unsigned long end = (unsigned long)src + (count << 1); */ |
68 | const u16 *ps = src; | 60 | const u16 *ps = src; |
69 | const u32 *pi; | 61 | const u32 *pi; |
70 | 62 | ||
71 | data_port = (volatile unsigned short *)port; | ||
72 | |||
73 | if(((unsigned long)src) & 0x2) { | 63 | if(((unsigned long)src) & 0x2) { |
74 | *data_port = *ps++; | 64 | __raw_writew(*ps++, port); |
75 | count--; | 65 | count--; |
76 | } | 66 | } |
77 | pi = (const u32 *)ps; | 67 | pi = (const u32 *)ps; |
@@ -79,13 +69,13 @@ static inline void __ide_outsw(unsigned long port, | |||
79 | u32 w; | 69 | u32 w; |
80 | 70 | ||
81 | w = *pi++; | 71 | w = *pi++; |
82 | *data_port = (w >> 16); | 72 | __raw_writew((w >> 16), port); |
83 | *data_port = w; | 73 | __raw_writew(w, port); |
84 | count -= 2; | 74 | count -= 2; |
85 | } | 75 | } |
86 | ps = (const u16 *)pi; | 76 | ps = (const u16 *)pi; |
87 | if(count) | 77 | if(count) |
88 | *data_port = *ps; | 78 | __raw_writew(*ps, port); |
89 | 79 | ||
90 | /* __flush_dcache_range((unsigned long)src, end); */ /* P3 see hme */ | 80 | /* __flush_dcache_range((unsigned long)src, end); */ /* P3 see hme */ |
91 | } | 81 | } |