[lkml]   [2002]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    SubjectPATCH io.h cleanup and userspace nudge
    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 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 /* __KERNEL__ */

    #define __SLOW_DOWN_IO "\njmp 1f\n1:\tjmp 1f\n1:"
     \ /
      Last update: 2005-03-22 13:18    [W:0.055 / U:86.360 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site