kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* EXPORT_SYMBOL and rebinding functions
@ 2014-06-03  3:29 Peter Tosh
  2014-06-03  3:57 ` Greg KH
  2014-06-03 13:03 ` Valdis.Kletnieks at vt.edu
  0 siblings, 2 replies; 8+ messages in thread
From: Peter Tosh @ 2014-06-03  3:29 UTC (permalink / raw)
  To: kernelnewbies

Hey guys,

I have a module which defines a specific print function, and another
module that uses said function. From the first module I have used
EXPORT_SYMBOL(function_1). From within the second module I would like to
rebind that function to another printing function, and once I'm
finished, rebind it back to the original function.

So in theory the pseudo-code would look something like this

module_1.c

function_1()
{
	do some stuff
}

my_print_function = function_1

EXPORT_SYMBOL(my_print_function)

module_2.c



function_t()
{
	doing different stuff
}

placeholder = my_print_function
my_print_fuction = function_2

<do some other stuff>

my_print_function = placeholder

<END OF CODE>

My question is: Is this the correct way of doing this? Or will this
cause issues?

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-06-03 13:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-03  3:29 EXPORT_SYMBOL and rebinding functions Peter Tosh
2014-06-03  3:57 ` Greg KH
2014-06-03  4:19   ` Peter Tosh
2014-06-03  4:47     ` Greg KH
2014-06-03  5:10       ` Peter Tosh
2014-06-03  5:21         ` Greg KH
2014-06-03  8:57           ` AYAN KUMAR HALDER
2014-06-03 13:03 ` Valdis.Kletnieks at vt.edu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).