PATCH 2.5.2.7: io.h cleanup and userspace nudge

From: Jeff Garzik (jgarzik@mandrakesoft.com)
Date: Fri Jan 04 2002 - 12:47:27 EST


As we are now in 2.5.x series I figured it might be a good time to push
this out... The patch removes __KERNEL__ ifdefs from [only] io.h as a
nudge to userspace that they should not be including kernel headers.

MDK, RedHat, Caldera, and other distros already distribute a subset of
[sanitized?] kernel headers for glibc, so there is plenty of time to
notice and deal with any breakage this causes in userspace [which IMHO
should not have been including kernel headers in the first place...]

Finally, the patch includes a cosmetic cleanup to use standard
u8/u16/u32 types for {read,write}[bwl], similar to patches already
applied for sparc64, alpha, and other arches during 2.4.x series.

        Jeff

-- 
Jeff Garzik      | Only so many songs can be sung
Building 1024    | with two lips, two lungs, and one tongue.
MandrakeSoft     |         - nomeansno

--- /spare/tmp/linux-2.5.2-pre7/include/asm-i386/io.h Sun Dec 16 18:43:31 2001 +++ linux_2_5/include/asm-i386/io.h Fri Jan 4 12:32:07 2002 @@ -41,8 +41,6 @@ #define XQUAD_PORTIO_BASE 0xfe400000 #define XQUAD_PORTIO_LEN 0x40000 /* 256k per quad. Only remapping 1st */ -#ifdef __KERNEL__ - #include <linux/vmalloc.h> /* @@ -108,16 +106,16 @@ * memory location directly. */ -#define readb(addr) (*(volatile unsigned char *) __io_virt(addr)) -#define readw(addr) (*(volatile unsigned short *) __io_virt(addr)) -#define readl(addr) (*(volatile unsigned int *) __io_virt(addr)) +#define readb(addr) (*(volatile u8 *) __io_virt(addr)) +#define readw(addr) (*(volatile u16 *) __io_virt(addr)) +#define readl(addr) (*(volatile u32 *) __io_virt(addr)) #define __raw_readb readb #define __raw_readw readw #define __raw_readl readl -#define writeb(b,addr) (*(volatile unsigned char *) __io_virt(addr) = (b)) -#define writew(b,addr) (*(volatile unsigned short *) __io_virt(addr) = (b)) -#define writel(b,addr) (*(volatile unsigned int *) __io_virt(addr) = (b)) +#define writeb(b,addr) (*(volatile u8 *) __io_virt(addr) = (b)) +#define writew(b,addr) (*(volatile u16 *) __io_virt(addr) = (b)) +#define writel(b,addr) (*(volatile u32 *) __io_virt(addr) = (b)) #define __raw_writeb writeb #define __raw_writew writew #define __raw_writel writel @@ -215,8 +213,6 @@ #define flush_write_buffers() #endif - -#endif /* __KERNEL__ */ #ifdef SLOW_IO_BY_JUMPING #define __SLOW_DOWN_IO "\njmp 1f\n1:\tjmp 1f\n1:"

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jan 07 2002 - 21:00:25 EST