Gagneraud Christian | 9 May 2002 02:38
Favicon

Re: pointer to an asmlinkage function

Le mer 11/06/2003 à 20:45, Muli Ben-Yehuda a écrit :
> On Wed, Jun 11, 2003 at 11:11:02AM +0200, chgans <at> 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
(Continue reading)


Gmane