From: David Schleef <ds@stm.lbl.gov>
To: Timur Tabi <ttabi@interactivesi.com>
Cc: Keith Owens <kaos@ocs.com.au>,
Linux Kernel Mailing list <linux-kernel@vger.kernel.org>
Subject: Re: "couldn't find the kernel version the module was compiled for" - help!
Date: Tue, 14 Nov 2000 16:41:48 -0800 [thread overview]
Message-ID: <20001114164148.A13061@stm.lbl.gov> (raw)
In-Reply-To: <12388.974245302@ocs3.ocs-net> <20001115001445Z129170-521+233@vger.kernel.org>
In-Reply-To: <20001115001445Z129170-521+233@vger.kernel.org>; from ttabi@interactivesi.com on Tue, Nov 14, 2000 at 05:44:42PM -0600
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/
next prev parent reply other threads:[~2000-11-15 1:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-11-14 23:41 "couldn't find the kernel version the module was compiled for" - help! Keith Owens
2000-11-14 23:44 ` Timur Tabi
2000-11-15 0:41 ` David Schleef [this message]
-- strict thread matches above, loose matches on Subject: below --
2000-11-14 21:58 Timur Tabi
2000-11-14 22:31 ` Steven Walter
2000-11-14 22:51 ` Timur Tabi
2000-11-14 23:31 ` Keith Owens
2000-11-14 23:35 ` Timur Tabi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20001114164148.A13061@stm.lbl.gov \
--to=ds@stm.lbl.gov \
--cc=ds@schleef.org \
--cc=kaos@ocs.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=ttabi@interactivesi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox