From mboxrd@z Thu Jan 1 00:00:00 1970 From: GOTO Masanori Subject: [PATCH] don't export fb.h internal structure to userland Date: Tue, 04 Nov 2003 14:03:46 +0900 Sender: linux-fbdev-devel-admin@lists.sourceforge.net Message-ID: <80n0bc913h.wl@oris.opensource.jp> Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Return-path: Received: from sc8-sf-mx2-b.sourceforge.net ([10.3.1.12] helo=sc8-sf-mx2.sourceforge.net) by sc8-sf-list1.sourceforge.net with esmtp (Cipher TLSv1:DES-CBC3-SHA:168) (Exim 3.31-VA-mm2 #1 (Debian)) id 1AGtM5-0008SQ-00 for ; Mon, 03 Nov 2003 21:03:49 -0800 Received: from oris.opensource.jp ([218.44.239.77] ident=postfix) by sc8-sf-mx2.sourceforge.net with esmtp (Exim 4.24) id 1AGtM4-0007GV-U4 for linux-fbdev-devel@lists.sourceforge.net; Mon, 03 Nov 2003 21:03:49 -0800 Errors-To: linux-fbdev-devel-admin@lists.sourceforge.net List-Help: List-Post: List-Subscribe: , List-Id: List-Unsubscribe: , List-Archive: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-fbdev-devel@lists.sourceforge.net Cc: gotom@debian.or.jp Hi, This patch fixes not to compile with linux/fb.h: > cat fb.c #include 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 -#include #include #include @@ -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 #include +#include 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/