Skip to content

Commit

Permalink
[POWERPC] Merge iSeries i/o operations with the rest
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stephen Rothwell authored and Paul Mackerras committed Sep 22, 2006
1 parent 7da8a2e commit caf8132
Show file tree
Hide file tree
Showing 4 changed files with 319 additions and 183 deletions.
14 changes: 14 additions & 0 deletions arch/powerpc/kernel/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,16 @@
#include <linux/module.h>

#include <asm/io.h>
#include <asm/firmware.h>
#include <asm/bug.h>

void _insb(volatile u8 __iomem *port, void *buf, long count)
{
u8 *tbuf = buf;
u8 tmp;

BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));

if (unlikely(count <= 0))
return;
asm volatile("sync");
Expand All @@ -44,6 +48,8 @@ void _outsb(volatile u8 __iomem *port, const void *buf, long count)
{
const u8 *tbuf = buf;

BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));

if (unlikely(count <= 0))
return;
asm volatile("sync");
Expand All @@ -59,6 +65,8 @@ void _insw_ns(volatile u16 __iomem *port, void *buf, long count)
u16 *tbuf = buf;
u16 tmp;

BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));

if (unlikely(count <= 0))
return;
asm volatile("sync");
Expand All @@ -75,6 +83,8 @@ void _outsw_ns(volatile u16 __iomem *port, const void *buf, long count)
{
const u16 *tbuf = buf;

BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));

if (unlikely(count <= 0))
return;
asm volatile("sync");
Expand All @@ -90,6 +100,8 @@ void _insl_ns(volatile u32 __iomem *port, void *buf, long count)
u32 *tbuf = buf;
u32 tmp;

BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));

if (unlikely(count <= 0))
return;
asm volatile("sync");
Expand All @@ -106,6 +118,8 @@ void _outsl_ns(volatile u32 __iomem *port, const void *buf, long count)
{
const u32 *tbuf = buf;

BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));

if (unlikely(count <= 0))
return;
asm volatile("sync");
Expand Down
Loading

0 comments on commit caf8132

Please sign in to comment.