Le mer 11/06/2003 à 20:45, Muli Ben-Yehuda a écrit : > On Wed, Jun 11, 2003 at 11:11:02AM +0200, chgans@tuxfamily.org wrote: > > > But how does the compiler know that this call is to be done with "asmlinkage" > > (regparm(...)) technique? > > This is a good question, that I've struggled with in the past. I don't > have a definitive answer, but I can tell you two things: > > 1. Declaring the function pointer as asmlinkage causes some gcc > versions to croak. I use gcc-2.96 on redhat 7.2, and i'vent any problem since now > > 2. The compiler empirically always does the right thing. This *might* be > because passing parameters in registers is an optimization, and the > compiler will not optimize function calls through a function pointer. > > If you find a definitive answer, I'd like to know. nothing definitive..... with struct { int my_var; /**** asmlinkage at the end ****/ void (*my_function)(void) asmlinkage; } my_struct; this way i have the correct behavour, but as all the function i use this way have no args, i don't see differrence with or without asmlinkage in the struct. thanks. christian > > Thanks, > muli. -- Gagneraud Christian <chgans@tuxfamily.org> -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/