Messages in this thread Patch in this message | | | Date | Wed, 27 Jan 1999 10:56:39 +0100 (CET) | From | MOLNAR Ingo <> | Subject | Re: Big Fix for 2.2.1 |
| |
On Tue, 26 Jan 1999, Linus Torvalds wrote:
> ie the "legacy ISA region" is currently (for backwards compatibility > reasons) not required to be io-remapped. > > Look at various network drivers for example - your patches probably break > a noticeable number of them.
the attached patch works for me, but i guess it's definitely too ugly to live in the stock kernel. Anyway, if anyone wants to have non-power-2 -PAGE_OFFSET, this patch might help...
-- mingo
--- linux/include/asm-i386/io.h.orig Tue Jan 26 20:56:45 1999 +++ linux/include/asm-i386/io.h Wed Jan 27 10:55:16 1999 @@ -101,8 +101,46 @@ #include <linux/vmalloc.h> #include <asm/page.h> -#define __io_virt(x) ((void *)(PAGE_OFFSET | (unsigned long)(x))) -#define __io_phys(x) ((unsigned long)(x) & ~PAGE_OFFSET) +/* + * ISA IO legacy address space 0-1M + */ +#define __ISA_LIMIT 0x100000UL + +/* + * __io_virt() has to accept the 0-1M address space for legacy + * drivers. We will fix this in 2.3 to be an identity mapping. + */ +#define __io_virt(x) \ +({ void * __ret; \ + if ((unsigned long)x < __ISA_LIMIT) \ + /* \ + * In 2.3 we want to print a warning here \ + */ \ +__broken: \ + __ret = (void *)(PAGE_OFFSET + (unsigned long)(x)); \ + else { \ + if ((unsigned long)x < PAGE_OFFSET) \ + /* \ + * and here. (yes this gets triggered) \ + */ \ + goto __broken; \ + __ret = (void*) x; \ + } \ + __ret; \ +}) + +/* + * __io_phys() has no legacy uses. + */ +#define __io_phys(x) \ +({ unsigned long __ret; \ + if ((unsigned long)x < PAGE_OFFSET) \ + __ret = (unsigned long)(x); \ + else \ + __ret = (unsigned long)(x) - PAGE_OFFSET; \ + __ret; \ +}) + /* * Change virtual addresses to physical addresses and vv. * These are pretty trivial
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |