lkml.org 
[lkml]   [2000]   [Nov]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
On Tue, Nov 14, 2000 at 05:44:42PM -0600, Timur Tabi wrote:
> ** Reply to message from Keith Owens <kaos@ocs.com.au> on Wed, 15 Nov 2000
> 10:41:42 +1100
>
>
> > __NO_VERSION__ must be defined before #include <module.h>.
>
> It is:
>
> #ifdef LINUX
> #ifndef __ENTRY_C__
> #define __NO_VERSION__
> #endif
> #include <linux/version.h>
> #include <linux/module.h>
> #include <linux/kernel.h>
> #include <linux/types.h>
>
> >Do it by hand.
>
> I don't know what you mean by that.
>


Module source should look like this:

single .c -> single .o

#include <linux/kernel.h>
#include <linux/module.h>

multiple .c -> single .o, main .c file (contains init_module(), etc.)

#include <linux/kernel.h>
#include <linux/module.h>

multiple .c -> single .o, secondary .c file

#include <linux/kernel.h>

multiple .c -> single .o, secondary .c file that requires module.h
for a particular purpose, such as EXPORT_SYMBOL()

#define __NO_VERSION__
#include <linux/kernel.h>
#include <linux/module.h>

Note that in most cases, you _don't_ need to include module.h.

Your Makefile should call gcc with '-D__KERNEL__ -DMODULE', as well
as other approprate flags.




dave...

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:45    [W:0.026 / U:11.820 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site