linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] don't export fb.h internal structure to userland
@ 2003-11-04  5:03 GOTO Masanori
  2003-11-05 15:55 ` GOTO Masanori
  0 siblings, 1 reply; 2+ messages in thread
From: GOTO Masanori @ 2003-11-04  5:03 UTC (permalink / raw)
  To: linux-fbdev-devel; +Cc: gotom

Hi,

This patch fixes not to compile with linux/fb.h:

	> cat fb.c
	#include <linux/fb.h>
	int main() {}
	> gcc fb.c
	In file included from /usr/include/linux/timer.h:5,
	                 from /usr/include/linux/workqueue.h:8,
	                 from /usr/include/linux/fb.h:5,
	                 from fb.c:1:
	/usr/include/linux/list.h:576:2: warning: #warning "don't include kernel headers in userspace"
	In file included from /usr/include/linux/timer.h:6,
	                 from /usr/include/linux/workqueue.h:8,
	                 from /usr/include/linux/fb.h:5,
	                 from fb.c:1:
	...

This sample program worked in kernel 2.4.  Actually this problem is
occured by (1) including workqueue.h, and (2) struct fb_pixmap has
spinlock_t.  This patch fixes with (1) move workqueue.h to internal of
__KERNEL__, (2) also move struct fb_pixmap to internal of __KERNEL__.
Now fb.h don't export kernel internal structure to userland.

Please apply it.

Regards,
-- gotom

--- include/linux/fb.h	2003-06-23 03:32:39.000000000 +0900
+++ include/linux/fb.h.new	2003-11-04 13:50:12.000000000 +0900
@@ -2,7 +2,6 @@
 #define _LINUX_FB_H
 
 #include <linux/tty.h>
-#include <linux/workqueue.h>
 #include <asm/types.h>
 #include <asm/io.h>
 
@@ -331,23 +330,11 @@
 #define FB_PIXMAP_IO      4     /* memory is iomapped       */
 #define FB_PIXMAP_SYNC    256   /* set if GPU can DMA       */
 
-struct fb_pixmap {
-        __u8  *addr;                      /* pointer to memory             */  
-	__u32 size;                       /* size of buffer in bytes       */
-	__u32 offset;                     /* current offset to buffer      */
-	__u32 buf_align;                  /* byte alignment of each bitmap */
-	__u32 scan_align;                 /* alignment per scanline        */
-	__u32 flags;                      /* see FB_PIXMAP_*               */
-					  /* access methods                */
-	void (*outbuf)(u8 *dst, u8 *addr, unsigned int size); 
-	u8   (*inbuf) (u8 *addr);
-	spinlock_t lock;                  /* spinlock                      */
-	atomic_t count;
-};
 #ifdef __KERNEL__
 
 #include <linux/fs.h>
 #include <linux/init.h>
+#include <linux/workqueue.h>
 
 struct fb_info;
 struct vm_area_struct;
@@ -395,6 +382,20 @@
     int (*fb_mmap)(struct fb_info *info, struct file *file, struct vm_area_struct *vma);
 };
 
+struct fb_pixmap {
+        __u8  *addr;                      /* pointer to memory             */  
+	__u32 size;                       /* size of buffer in bytes       */
+	__u32 offset;                     /* current offset to buffer      */
+	__u32 buf_align;                  /* byte alignment of each bitmap */
+	__u32 scan_align;                 /* alignment per scanline        */
+	__u32 flags;                      /* see FB_PIXMAP_*               */
+					  /* access methods                */
+	void (*outbuf)(u8 *dst, u8 *addr, unsigned int size); 
+	u8 (*inbuf) (u8 *addr);
+	spinlock_t lock;                  /* spinlock                      */
+	atomic_t count;
+};
+
 struct fb_info {
    int node;
    int flags;


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/

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

* Re: [PATCH] don't export fb.h internal structure to userland
  2003-11-04  5:03 [PATCH] don't export fb.h internal structure to userland GOTO Masanori
@ 2003-11-05 15:55 ` GOTO Masanori
  0 siblings, 0 replies; 2+ messages in thread
From: GOTO Masanori @ 2003-11-05 15:55 UTC (permalink / raw)
  To: linux-fbdev-devel; +Cc: gotom, dan

Hi,

This patch one more fix for linux/fb.h, to move asm/io.h into
__KERNEL__.  It should also be internal of __KERNEL__.  This patch can
be applied after my previous linux/fb.h patch is applied.

All my 3 patches are reported by debian package build (because the
latest debian unstable distribution /usr/include/linux/* uses the
latest linux kernel headers), and many userland applications currently
can't build.  So please apply these patches for your tree.

This patch from Daniel Jacobowitz <dan@debian.org>.

Regards,
-- gotom


--- include/linux/fb.h	2003-11-04 14:15:30.000000000 +0900
+++ include/linux/fb.h	2003-11-06 00:38:53.000000000 +0900
@@ -3,7 +3,6 @@
 
 #include <linux/tty.h>
 #include <asm/types.h>
-#include <asm/io.h>
 
 /* Definitions of frame buffers						*/
 
@@ -335,6 +334,7 @@
 #include <linux/fs.h>
 #include <linux/init.h>
 #include <linux/workqueue.h>
+#include <asm/io.h>
 
 struct fb_info;
 struct vm_area_struct;


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/

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

end of thread, other threads:[~2003-11-05 16:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-04  5:03 [PATCH] don't export fb.h internal structure to userland GOTO Masanori
2003-11-05 15:55 ` GOTO Masanori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).