<div>It is defined in include/linux/linkage.h. And more info here:</div><div><br></div><a href="http://pix.cs.olemiss.edu/csci523/kernelidioms">http://pix.cs.olemiss.edu/csci523/kernelidioms</a><div><br></div><div>Part of it quoted below - ultimately it falls on GCC feature ("<span style="white-space:pre-wrap">__attribute__((regparm(0)))"):</span></div>
<div><pre style="word-wrap:break-word;white-space:pre-wrap">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
language linkage."
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.
</pre><div><br></div><br><div class="gmail_quote">On Fri, Jan 11, 2013 at 2:56 PM, Rajat Sharma <span dir="ltr"><<a href="mailto:fs.rajat@gmail.com" target="_blank">fs.rajat@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="im"><div><br></div><div>> it is defined even in much earlier release:</div><div><a href="http://lxr.free-electrons.com/ident?v=2.6.32;i=asmlinkage" target="_blank">http://lxr.free-electrons.com/ident?v=2.6.32;i=asmlinkage</a></div>
<div><br></div></div><div>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.<span class="HOEnZb"><font color="#888888"><br>
<br></font></span></div><span class="HOEnZb"><font color="#888888"><div>-Rajat<br></div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jan 11, 2013 at 12:00 PM, Peter Teoh <span dir="ltr"><<a href="mailto:htmldeveloper@gmail.com" target="_blank">htmldeveloper@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><br><div class="gmail_quote"><div>On Fri, Jan 11, 2013 at 1:35 PM, Rajat Sharma <span dir="ltr"><<a href="mailto:fs.rajat@gmail.com" target="_blank">fs.rajat@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div>> asmlinkage is defined for almost all arch:<div></div><div>> grep asmlinkage arch/arm/*/* and u got the answer.<br><br></div></div><div>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.<br>
</div></div></blockquote><div><br></div></div><div>it is defined even in much earlier release:</div><div><br></div><div><a href="http://lxr.free-electrons.com/ident?v=2.6.32;i=asmlinkage" target="_blank">http://lxr.free-electrons.com/ident?v=2.6.32;i=asmlinkage</a></div>
<div><br></div><div>for example, and every arch possible has a use of it.</div><span><font color="#888888"><div> </div></font></span></div><span><font color="#888888">-- <br>Regards,<br>Peter Teoh
</font></span></blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Regards,<br>Peter Teoh
</div>