public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* PATCH 2.5.2.7: io.h cleanup and userspace nudge
@ 2002-01-04 17:47 Jeff Garzik
  2002-01-04 18:00 ` Dave Jones
  0 siblings, 1 reply; 16+ messages in thread
From: Jeff Garzik @ 2002-01-04 17:47 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Linux-Kernel list

[-- Attachment #1: Type: text/plain, Size: 852 bytes --]

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

[-- Attachment #2: trouble.patch --]
[-- Type: text/plain, Size: 1523 bytes --]

--- /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:"

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2002-01-04 23:28 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-01-04 17:47 PATCH 2.5.2.7: io.h cleanup and userspace nudge Jeff Garzik
2002-01-04 18:00 ` Dave Jones
2002-01-04 18:12   ` Jeff Garzik
2002-01-04 18:18     ` Dave Jones
2002-01-04 18:20       ` David Woodhouse
2002-01-04 18:39         ` Alan Cox
2002-01-04 18:46           ` including kernel headers (was Re: PATCH 2.5.2.7: io.h cleanup and userspace nudge) Jeff Garzik
2002-01-04 18:21       ` PATCH 2.5.2.7: io.h cleanup and userspace nudge Jeff Garzik
2002-01-04 18:24         ` Dave Jones
2002-01-04 18:31         ` Richard Gooch
2002-01-04 18:35           ` Jeff Garzik
2002-01-04 18:40           ` Dave Jones
2002-01-04 18:41             ` Richard Gooch
2002-01-04 19:16               ` Mike Castle
2002-01-04 23:28                 ` Reid Hekman
2002-01-04 18:19     ` Oliver Xymoron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox