2000-11-22 21:17:50

by L A Walsh

[permalink] [raw]
Subject: include conventions /usr/include/linux/sys ?

Linus has mentioned a desire to move kernel internal interfaces into
a separate kernel include directory. In creating some code, I'm wondering
what the name of this should/will be. Does it follow that convention
would point toward a linux/sys directory?
-l

--
L A Walsh | Trust Technology, Core Linux, SGI
[email protected] | Voice/Vmail: (650) 933-5338


2000-11-22 21:30:12

by Arjan van de Ven

[permalink] [raw]
Subject: Re: include conventions /usr/include/linux/sys ?

In article <[email protected]> you wrote:
> Linus has mentioned a desire to move kernel internal interfaces into
> a separate kernel include directory. In creating some code, I'm wondering
> what the name of this should/will be. Does it follow that convention
> would point toward a linux/sys directory?

I would vote for

include/linux - exported interfaces
include/kernel - kernel internal interfaces
include/asm - kernel internal/archspecific interfaces

Greetings,
Arjan van de Ven

2000-11-22 23:06:41

by H. Peter Anvin

[permalink] [raw]
Subject: Re: include conventions /usr/include/linux/sys ?

Followup to: <[email protected]>
By author: "LA Walsh" <[email protected]>
In newsgroup: linux.dev.kernel
>
> Linus has mentioned a desire to move kernel internal interfaces into
> a separate kernel include directory. In creating some code, I'm wondering
> what the name of this should/will be. Does it follow that convention
> would point toward a linux/sys directory?
>

I suggested include/kernel and include/arch with include/linux and
include/asm being reserved for the kernel interfaces (ioctl and their
structures mostly.)

-hpa
--
<[email protected]> at work, <[email protected]> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt

2000-11-23 01:44:49

by Andi Kleen

[permalink] [raw]
Subject: Re: include conventions /usr/include/linux/sys ?

On Wed, Nov 22, 2000 at 02:35:43PM -0800, H. Peter Anvin wrote:
> Followup to: <[email protected]>
> By author: "LA Walsh" <[email protected]>
> In newsgroup: linux.dev.kernel
> >
> > Linus has mentioned a desire to move kernel internal interfaces into
> > a separate kernel include directory. In creating some code, I'm wondering
> > what the name of this should/will be. Does it follow that convention
> > would point toward a linux/sys directory?
> >
>
> I suggested include/kernel and include/arch with include/linux and
> include/asm being reserved for the kernel interfaces (ioctl and their
> structures mostly.)

It would also be useful to put *32 structures for 32->64bit conversion
in there (to prepare for a generic 32->64bit conversion layer in 2.5)


-Andi

2000-11-23 08:12:05

by Mitchell Blank Jr

[permalink] [raw]
Subject: Re: include conventions /usr/include/linux/sys ?

H. Peter Anvin wrote:
> I suggested include/kernel and include/arch with include/linux and
> include/asm being reserved for the kernel interfaces (ioctl and their
> structures mostly.)

That sounds good. One other refinement I would like to see is that
architecture specific but always present header files don't get used
directly in architecture-independant .c flies. Some common examples of
this are <asm/io.h> and <asm/uaccess.h> The problem is that often there
is some code that is identical between some or all of the archs. Then
one of two things happen:
* The code gets duplicated in many *.h files with all the bad things that
comde duplication causes - especially since they're all under seperate
maintainership
* We have a big ugly conversion like what happened with 'asm/spinlock.h' ->
'linux/spinlock.h'

If we only have arch-independant *.c files only include things out of
<kernel/*> (which may, of course, include things in <arch/*>) we can
avoid these conversions in the future and promote code reuse between the
architectures.

Also we should probably consider implementing a reasonalbe hierarchy to
the proposed <kernel/*.h> directory - for instance <kernel/bus/pci.h>.

-Mitch