4Front,
On Mon, 29 May 2006, 4Front Technologies wrote:
>
> How about external modules that have a kernel dependant part and kernel
> independant part?. Kernel independant part could live in a separate tree and
> has its own makefiles.
>
> But regparm requires that ALL parts linked into the module need to have
> regparm defined. So it's another headache to write makefiles for the kernel
> independant part to figure out if the distro support regparm or not.
They way I approached it was to get CFLAGS for compiling both the kernel
dependent part and kernel independent part.
The interface exported from the kernel dependent part to the indepdent part
have the regparms attribute explicity pinned on exported symbols (e.g. on
supporting architectures either to __attribute__((__regparm__(3))) or
__attribute__((__regparm(0)))). LiS uses regparm(0) for binary compatible
(kernel independent) STREAMS modules for historical reasons. Linux
Fast-STREAMS uses regparm(3).
Taking a similar approach, make all your kernel dependent part exported
function (and function pointer) symbols "fastcall" and then forget about the
compiler flag. If you access regular kernel symbols, you, of course, do not
have this choice.
It would have been nice if the kernel would set the regparms on all exported
symbols, but external modules was really just an afterthought.
The autoconf approach that I take does not use kbuild, primarily because of
the inherent separation between kernel depedent part and independent part
for STREAMS (STREAMS subsystem is kernel dependent, STREAMS modules attempt
to be somewhat kernel independent and use an SVR4.2 ABI).
The autoconf/automake makefiles handle the building of both. And, of course,
they nicely handle building all the othter GNU/Linux things like user space
programs built on the same definitions, manual pages, etc.
--brian
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]