diff options
Diffstat (limited to 'include/asm-mips')
-rw-r--r-- | include/asm-mips/ide.h | 50 |
1 files changed, 46 insertions, 4 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 */ |