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

Re: kernel modules - big problems



On Thu, Jul 03, 2003 at 12:39:41PM +0200, Michael Svetlik wrote:
> On Thursday 03 July 2003 12:19, Arjan van de Ven wrote:
> > On Thu, 2003-07-03 at 11:16, Michael Svetlik wrote:
> > > You need to declare the preprocessor #define's __KERNEL__, MODULE and
> > > MODVERSIONS.
> >
> > like heck you don't!
> > Never ever do that in .c files!
> 
> Oops. Why not ?

it's something the build infrastructure provides/has to provide.
if you do #define MODULE you also prevent it from ever being used as built
in etc etc
> In a single file, like that hello ?


> Does gcc hook on __KERNEL__ ?

the Makefile does
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/