lkml.org 
[lkml]   [2004]   [Nov]   [26]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
FromKyle Moffett <>
SubjectRe: [RFC] Splitting kernel headers and deprecating __KERNEL__
DateFri, 26 Nov 2004 22:07:18 -0500
On Nov 25, 2004, at 10:13, David Howells wrote:
> We've been discussing splitting the kernel headers into userspace API 
> headers
> and kernel internal headers and deprecating the __KERNEL__ macro. This 
> will
> permit a cleaner interface between the kernel and userspace; and one 
> that's
> easier to keep up to date.

Yay!!! Finally!!!

> 	NEW DIRECTORY		DIRECTORY SHADOWED
> 	=============		==================
> 	include/user/		include/linux/
> 	include/user-*/		include/asm-*/

How about include/abi for the platform-independent headers and 
include/arch-*
for the platform-specific headers?  Then include/arch would be 
symlinked to the
correct arch-* directory.

>      Note that this doesn't take account of the other directories under
>      include/, but I don't think they're relevant.

Perhaps such directories should either be broken out into 
abi/foo<->linux/foo
pieces, or put into their own top-level directories.

>  (2) Take each file from the shadowed directory. If it has any 
> userspace
>      relevant stuff, then:
[...snip...]

Something like this would warn about incorrect uses of the linux/ 
headers, yet
still allow for a period of backwards compatibility.  Once such period 
has passed,
then linux/* would not even be installed, only abi/* and arch/*
include/linux/foo.h:
#ifndef _LINUX_FOO_H
#define _LINUX_FOO_H 1

#ifndef __KERNEL__
# warning "Directly including <kernel/foo.h> is deprecated!!!"
# warning "Please change your program to include <abi/foo.h> instead!!!"
#endif

#include <abi/foo.h>

#ifdef __KERNEL__
/* Old __KERNEL__ contents of include/linux/foo.h */
#endif
#endif /* not _LINUX_FOO_H */

include/abi/foo.h:
#ifndef _ABI_FOO_H
#define_ABI_FOO_H 1

#include <abi/bar.h>
#include <arch/baz.h>

/* Old non-__KERNEL__ contents of include/linux/foo.h */
#endif /* not _ABI_FOO_H */
Cheers,
Kyle Moffett

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCM/CS/IT/U d- s++: a17 C++++>$ UB/L/X/*++++(+)>$ P+++(++++)>$
L++++(+++) E W++(+) N+++(++) o? K? w--- O? M++ V? PS+() PE+(-) Y+
PGP+++ t+(+++) 5 X R? tv-(--) b++++(++) DI+ D+ G e->++++$ h!*()>++$ r  
!y?(-)
------END GEEK CODE BLOCK------

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

\
 
 \ /
  Last update: 2005-03-22 14:08    [from the cache]
©2003-2008