aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/io.c
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2006-09-21 04:00:00 -0400
committerPaul Mackerras <paulus@samba.org>2006-09-22 01:19:58 -0400
commitcaf81329c39b5c48f6cc0d78fa159b5a587e37f9 (patch)
tree7cf6afe7a14e2a9d1cc962895b61d8cb24e71793 /arch/powerpc/kernel/io.c
parent7da8a2e5c1fd2ee513fdeac8d13c4f3623838fd0 (diff)
[POWERPC] Merge iSeries i/o operations with the rest
This patch changes the io operations so that they are out of line if CONFIG_PPC_ISERIES is set and includes a firmware feature check in that case. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/io.c')
-rw-r--r--arch/powerpc/kernel/io.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/io.c b/arch/powerpc/kernel/io.c
index 80a3209acef4..e98180686b35 100644
--- a/arch/powerpc/kernel/io.c
+++ b/arch/powerpc/kernel/io.c
@@ -22,12 +22,16 @@
22#include <linux/module.h> 22#include <linux/module.h>
23 23
24#include <asm/io.h> 24#include <asm/io.h>
25#include <asm/firmware.h>
26#include <asm/bug.h>
25 27
26void _insb(volatile u8 __iomem *port, void *buf, long count) 28void _insb(volatile u8 __iomem *port, void *buf, long count)
27{ 29{
28 u8 *tbuf = buf; 30 u8 *tbuf = buf;
29 u8 tmp; 31 u8 tmp;
30 32
33 BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
34
31 if (unlikely(count <= 0)) 35 if (unlikely(count <= 0))
32 return; 36 return;
33 asm volatile("sync"); 37 asm volatile("sync");
@@ -44,6 +48,8 @@ void _outsb(volatile u8 __iomem *port, const void *buf, long count)
44{ 48{
45 const u8 *tbuf = buf; 49 const u8 *tbuf = buf;
46 50
51 BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
52
47 if (unlikely(count <= 0)) 53 if (unlikely(count <= 0))
48 return; 54 return;
49 asm volatile("sync"); 55 asm volatile("sync");
@@ -59,6 +65,8 @@ void _insw_ns(volatile u16 __iomem *port, void *buf, long count)
59 u16 *tbuf = buf; 65 u16 *tbuf = buf;
60 u16 tmp; 66 u16 tmp;
61 67
68 BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
69
62 if (unlikely(count <= 0)) 70 if (unlikely(count <= 0))
63 return; 71 return;
64 asm volatile("sync"); 72 asm volatile("sync");
@@ -75,6 +83,8 @@ void _outsw_ns(volatile u16 __iomem *port, const void *buf, long count)
75{ 83{
76 const u16 *tbuf = buf; 84 const u16 *tbuf = buf;
77 85
86 BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
87
78 if (unlikely(count <= 0)) 88 if (unlikely(count <= 0))
79 return; 89 return;
80 asm volatile("sync"); 90 asm volatile("sync");
@@ -90,6 +100,8 @@ void _insl_ns(volatile u32 __iomem *port, void *buf, long count)
90 u32 *tbuf = buf; 100 u32 *tbuf = buf;
91 u32 tmp; 101 u32 tmp;
92 102
103 BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
104
93 if (unlikely(count <= 0)) 105 if (unlikely(count <= 0))
94 return; 106 return;
95 asm volatile("sync"); 107 asm volatile("sync");
@@ -106,6 +118,8 @@ void _outsl_ns(volatile u32 __iomem *port, const void *buf, long count)
106{ 118{
107 const u32 *tbuf = buf; 119 const u32 *tbuf = buf;
108 120
121 BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
122
109 if (unlikely(count <= 0)) 123 if (unlikely(count <= 0))
110 return; 124 return;
111 asm volatile("sync"); 125 asm volatile("sync");