Re: Symbols exported by modules

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

 



Seth-

Thanks for the quick reply.  Is what you're alluding to the
inter_module_(un)register and inter_module_put/get functions?  That's
the approach that I've been using.  However, the comments in module.h
suggest that these indirect routines should be used sparingly. 

Is there another way to get at the symbol bindings from the kernel more
efficiently (if they are loaded)?  Or is the only other way to implement
a file interface and create a device that reads and writes to the
module?

Thanks-
Shan

On Wed, 2003-06-25 at 14:33, Seth Arnold wrote:
> On Wed, Jun 25, 2003 at 02:23:42PM -0400, Shan Sinha wrote:
> > If I write a loadable kernel module that has some functions I want to
> > export to the kernel, how do I call them from the kernel?
> 
> Function pointers, and an in-kernel function to register the function
> pointers. Then, your module's init code registers function pointers, the
> module's exit code sets them back to no-ops, or NULL, or something like
> that. (If you use NULL, then your call sites in the kernel's networking
> paths should probably do something like: if (*fp) fp(args);)
> 
> -- 
> "Soon everyone will have an SUV, making roads obsolete and saving
> millions in highway costs." -- Mo Rocca


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



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux