diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1998-03-17 22:05:47 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1998-03-17 22:05:47 +0000 |
commit | 27cfca1ec98e91261b1a5355d10a8996464b63af (patch) | |
tree | 8e895a53e372fa682b4c0a585b9377d67ed70d0e /include/asm-m68k/io.h | |
parent | 6a76fb7214c477ccf6582bd79c5b4ccc4f9c41b1 (diff) |
Look Ma' what I found on my harddisk ...
o New faster syscalls for 2.1.x, too
o Upgrade to 2.1.89.
Don't try to run this. It's flaky as hell. But feel free to debug ...
Diffstat (limited to 'include/asm-m68k/io.h')
-rw-r--r-- | include/asm-m68k/io.h | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/include/asm-m68k/io.h b/include/asm-m68k/io.h index a9d65f743..8cee601e6 100644 --- a/include/asm-m68k/io.h +++ b/include/asm-m68k/io.h @@ -3,15 +3,30 @@ #ifdef __KERNEL__ +#include <linux/config.h> /* CONFIG_ATARI, CONFIG_HADES */ +#include <asm/byteorder.h> + +#ifdef CONFIG_ATARI +#include <asm/atarihw.h> + +#define SLOW_DOWN_IO do { if (MACH_IS_ATARI) MFPDELAY(); } while (0) +#endif + /* * readX/writeX() are used to access memory mapped devices. On some * architectures the memory mapped IO stuff needs to be accessed * differently. On the m68k architecture, we just read/write the * memory location directly. */ -#define readb(addr) (*(volatile unsigned char *) (addr)) -#define readw(addr) (*(volatile unsigned short *) (addr)) -#define readl(addr) (*(volatile unsigned int *) (addr)) +/* ++roman: The assignments to temp. vars avoid that gcc sometimes generates + * two accesses to memory, which may be undesireable for some devices. + */ +#define readb(addr) \ + ({ unsigned char __v = (*(volatile unsigned char *) (addr)); __v; }) +#define readw(addr) \ + ({ unsigned short __v = (*(volatile unsigned short *) (addr)); __v; }) +#define readl(addr) \ + ({ unsigned int __v = (*(volatile unsigned int *) (addr)); __v; }) #define writeb(b,addr) ((*(volatile unsigned char *) (addr)) = (b)) #define writew(b,addr) ((*(volatile unsigned short *) (addr)) = (b)) @@ -44,10 +59,16 @@ extern inline void * phys_to_virt(unsigned long address) } /* - * IO bus memory addresses are 1:1 with the physical address + * IO bus memory addresses are 1:1 with the physical address, + * except on the PCI bus of the Hades. */ +#ifdef CONFIG_HADES +#define virt_to_bus(a) (virt_to_phys(a) + (MACH_IS_HADES ? 0x80000000 : 0)) +#define bus_to_virt(a) (phys_to_virt((a) - (MACH_IS_HADES ? 0x80000000 : 0))) +#else #define virt_to_bus virt_to_phys #define bus_to_virt phys_to_virt +#endif #endif /* __KERNEL__ */ |