tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: should gpio be moved to sys/dev from sys/sys?




Am 17.08.2009 um 18:58 schrieb Matt Thomas:


On Aug 17, 2009, at 9:49 AM, Thor Lancelot Simon wrote:

On Mon, Aug 17, 2009 at 06:45:56PM +0200, Marc Balmer wrote:

- device specific C header files should go to /usr/include/dev (thus
sys/dev in the src tree)
- system C header files (kernel data structures) should go to /usr/
include/sys (thus sys/sys in the src tree)

I agree with this -- except that I think few if any device specific
C header files should be exposed to userland at all.

A device which must exports things to userland (ioctls, defines) should only do so from a file which contain those parts only. Only this file may be placed under /usr/include. The driver should include said file to get access to those bits.

This is just following the simple rules of separating interface from implementation.

Having said that, given <sys/gpio.h> is already in netbsd 5, it's too late to move.

Actually I think sys/gpio.h is at the right place, but dev/keylock.h is not. dev/keylock.h should actually be split into two files, one containing the internal parts, dev/keylock.h, and one containing the public parts in sys/keylock.h

Until now the public parts are only a few #defines, but that might change. So we should define the proper place before it makes release.

Home | Main Index | Thread Index | Old Index