public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bart Trojanowski <bart@jukie.net>
To: Anthony Chee <anthony.chee@polyu.edu.hk>, linux-kernel@vger.kernel.org
Cc: kbuild-devel@vger.kernel.org, kernelnewbies@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: undefined reference
Date: Mon, 25 Mar 2002 16:45:35 -0500	[thread overview]
Message-ID: <20020325164535.A5144@jukie.net> (raw)
In-Reply-To: <004501c1d34f$32bda110$0100a8c0@winxp>

[-- Attachment #1: Type: text/plain, Size: 801 bytes --]

* Anthony Chee <anthony.chee@polyu.edu.hk> [020324 11:17]:
> I am now developing a module. This module need communicate with the kernel.
> So I exported a function func(), by using EXPORT_SYMBOL(func). In the header
> file, I set "extern int func()".
<snip>

The problem you face is that the kernel needs to know where foo is to
generate a the bytecode that calls it.  Here is a better scenario...

You expose an interface in the kernel such as

	typedef void (*func_t)(int);
	void register_func ( func_t func );
	EXPORT_SYMBOL (register_func);

Then in your modules you call 'register_func' and that will pass the
function in question to the kernel.  The kernel can then do whatever it
wants to that pointer (like call it).

B.

-- 
				WebSig: http://www.jukie.net/~bart/sig/

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

  reply	other threads:[~2002-03-25 21:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-24 16:16 undefined reference Anthony Chee
2002-03-25 21:45 ` Bart Trojanowski [this message]
2002-03-26  4:17   ` Anthony Chee
2002-03-26  5:49     ` Keith Owens
2002-03-30 14:19       ` Anthony Chee

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=20020325164535.A5144@jukie.net \
    --to=bart@jukie.net \
    --cc=anthony.chee@polyu.edu.hk \
    --cc=kbuild-devel@vger.kernel.org \
    --cc=kernelnewbies@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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