diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2001-02-21 20:02:35 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2001-02-21 20:02:35 +0000 |
commit | 0745ae02074998ac6cbaac67454e220b5fb8c3c7 (patch) | |
tree | e23b894fc00515cd159f9ee2f5c54970f6cef4f5 | |
parent | c626fc12478b064e81285ae763d1b7656f9e7561 (diff) |
Handle IDE ports correctly for CONFIG_SWAP_IO_SPACE on big endian.
From Carsten with mods by me.
-rw-r--r-- | include/asm-mips/ide.h | 50 | ||||
-rw-r--r-- | include/asm-mips64/ide.h | 50 |
2 files changed, 92 insertions, 8 deletions
diff --git a/include/asm-mips/ide.h b/include/asm-mips/ide.h index ed20997b1..c6e39ec26 100644 --- a/include/asm-mips/ide.h +++ b/include/asm-mips/ide.h @@ -8,10 +8,6 @@ * Copyright (C) 1994-1996 Linus Torvalds & authors */ -/* - * This file contains the MIPS architecture specific IDE code. - */ - #ifndef __ASM_IDE_H #define __ASM_IDE_H @@ -129,6 +125,52 @@ static __inline__ void ide_release_region(ide_ioreg_t from, ide_ops->ide_release_region(from, extent); } + +#if defined(CONFIG_SWAP_IO_SPACE) && defined(__MIPSEB__) + +#ifdef insl +#undef insl +#endif +#ifdef outsl +#undef outsl +#endif +#ifdef insw +#undef insw +#endif +#ifdef outsw +#undef outsw +#endif + +#define insw(p,a,c) \ +do { \ + unsigned short *ptr = (unsigned short *)(a); \ + unsigned int i = (c); \ + while (i--) \ + *ptr++ = inw(p); \ +} while (0) +#define insl(p,a,c) \ +do { \ + unsigned long *ptr = (unsigned long *)(a); \ + unsigned int i = (c); \ + while (i--) \ + *ptr++ = inl(p); \ +} while (0) +#define outsw(p,a,c) \ +do { \ + unsigned short *ptr = (unsigned short *)(a); \ + unsigned int i = (c); \ + while (i--) \ + outw(*ptr++, (p)); \ +} while (0) +#define outsl(p,a,c) { \ + unsigned long *ptr = (unsigned long *)(a); \ + unsigned int i = (c); \ + while (i--) \ + outl(*ptr++, (p)); \ +} while (0) + +#endif /* defined(CONFIG_SWAP_IO_SPACE) && defined(__MIPSEB__) */ + /* * The following are not needed for the non-m68k ports */ diff --git a/include/asm-mips64/ide.h b/include/asm-mips64/ide.h index ed20997b1..c6e39ec26 100644 --- a/include/asm-mips64/ide.h +++ b/include/asm-mips64/ide.h @@ -8,10 +8,6 @@ * Copyright (C) 1994-1996 Linus Torvalds & authors */ -/* - * This file contains the MIPS architecture specific IDE code. - */ - #ifndef __ASM_IDE_H #define __ASM_IDE_H @@ -129,6 +125,52 @@ static __inline__ void ide_release_region(ide_ioreg_t from, ide_ops->ide_release_region(from, extent); } + +#if defined(CONFIG_SWAP_IO_SPACE) && defined(__MIPSEB__) + +#ifdef insl +#undef insl +#endif +#ifdef outsl +#undef outsl +#endif +#ifdef insw +#undef insw +#endif +#ifdef outsw +#undef outsw +#endif + +#define insw(p,a,c) \ +do { \ + unsigned short *ptr = (unsigned short *)(a); \ + unsigned int i = (c); \ + while (i--) \ + *ptr++ = inw(p); \ +} while (0) +#define insl(p,a,c) \ +do { \ + unsigned long *ptr = (unsigned long *)(a); \ + unsigned int i = (c); \ + while (i--) \ + *ptr++ = inl(p); \ +} while (0) +#define outsw(p,a,c) \ +do { \ + unsigned short *ptr = (unsigned short *)(a); \ + unsigned int i = (c); \ + while (i--) \ + outw(*ptr++, (p)); \ +} while (0) +#define outsl(p,a,c) { \ + unsigned long *ptr = (unsigned long *)(a); \ + unsigned int i = (c); \ + while (i--) \ + outl(*ptr++, (p)); \ +} while (0) + +#endif /* defined(CONFIG_SWAP_IO_SPACE) && defined(__MIPSEB__) */ + /* * The following are not needed for the non-m68k ports */ |