What is asmlinkage ?
htmldeveloper at gmail.com
Fri Jan 11 05:06:21 EST 2013
It is defined in include/linux/linkage.h. And more info here:
Part of it quoted below - ultimately it falls on GCC feature ("
The CPP_ASMLINKAGE __attribute__((regparm(0))) Macro
asmlinkage macro defines as:
#define CPP_ASMLINKAGE __attribute__((regparm(0))) which defines as:
#define extern "C" __attribute__((regparm(0)))
This is used in the system call interface where C library routines enter
the kernel after setting up their arguments and executing the trap instruction
(INT 80) to enter the kernel. The "asmlinkage" tag really should read "C
GCC takes a i386 specific __attribute__((regparm(0))) that causes
the compiler to pass integer data type arguments in the stack instead of
using regesters. Functions that take a variable number of arguments will
continue to be passed all of their arguments on the stack.
On Fri, Jan 11, 2013 at 2:56 PM, Rajat Sharma <fs.rajat at gmail.com> wrote:
> > it is defined even in much earlier release:
> There seems to be no definition for arm here too. I literally meant
> definition as '#define asmlinkage' not the usage of it. For arm it is none
> so default defined in include/linux/linkage.h is used which is nothing
> special and just extern 'C' declaration to avoid garbled naming of C++
> linkage, thats it.
> On Fri, Jan 11, 2013 at 12:00 PM, Peter Teoh <htmldeveloper at gmail.com>wrote:
>> On Fri, Jan 11, 2013 at 1:35 PM, Rajat Sharma <fs.rajat at gmail.com> wrote:
>>> > asmlinkage is defined for almost all arch:
>>> > grep asmlinkage arch/arm/*/* and u got the answer.
>>> I didn't see a definition of macro atleast in linux source I was
>>> browsing (3.2.0), Could you please point out to any one you have found.
>> it is defined even in much earlier release:
>> for example, and every arch possible has a use of it.
>> Peter Teoh
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Kernelnewbies