Subject: Re: broken LKM, modload and so on.
To: MAEKAWA Masahide <bishop@rr.iij4u.or.jp>
From: Bill Studenmund <wrstuden@netbsd.org>
List: current-users
Date: 09/12/2002 21:01:13
On Mon, 9 Sep 2002, MAEKAWA Masahide wrote:

> MAEKAWA Masahide <bishop@rr.iij4u.or.jp> wrote:
> >Jaromir Dolecek <jdolecek@netbsd.org> wrote:
> >>Please do NOT expose struct lkm_* to userland.
> >
> >How about attached one?
>
> I have slightly modified.
>
> Here is two types.
> base1.diff/sys1.diff and base2.diff/sys2.diff
>
> Type 1: base1 and sys1.diff
>      The major number is unsigned 12 bit value.
>      We can overload block/character majors into u_long variable and
>      can split to two majors.
>      These operations are wrapped by macros.
>
> Type 2: base2.diff and sys2.diff
>      The ``offset'' field is meaningful for LM_SYSCALL/LM_DEV.
>      So remove this field and add union priv data.
>      For LM_SYSCALL, define lmc_stat_syscall structure.
>      For LM_DEV, define lmc_stat_dev structure.
>      modload(8) call post script with
> 		3rd (syscall number) argument if LM_SYSCALL
> 		3rd (char major)/4th (block major) arguments if LM_DEV
> 		no more arguments if others.
>
> Which is better? type 1? type 2? I can't decide...

Go for type 1. Doesn't matter much, but it seems to make the
userland/kernel interface a bit cleaner.

Take care,

Bill