>From http://kernelnewbies.org/FAQ/asmlinkage :

What is asmlinkage?

The asmlinkage tag is one other thing that we should observe about this
simple function. This is a #define for some gcc magic that tells the
compiler that the function should not expect to find any of its
arguments in registers (a common optimization), but only on the CPU's
stack. Recall our earlier assertion that system_call consumes its first
argument, the system call number, and allows up to four more arguments
that are passed along to the real system call. system_call achieves this
feat simply by leaving its other arguments (which were passed to it in
registers) on the stack. All system calls are marked with the asmlinkage
tag, so they all look to the stack for arguments. Of course, in
sys_ni_syscall's case, this doesn't make any difference, because
sys_ni_syscall doesn't take any arguments, but it's an issue for most
other system calls. And, because you'll be seeing asmlinkage in front of
many other functions, I thought you should know what it was about.


On 07/22/2010 02:00 PM, Smital Desai wrote:
> Hi,
>
> I was just going through some kernel init sequence where a saw something like 
> this –
>
> asmlinkage void __init start_kernel(void)
>
> What does this asmlinkage modifier/ qualifier do ?
>
> help is greatly appreciated ....
>
> Thanks and Regards
>  Smital Desai
>
> This Email may contain confidential or privileged information for the 
> intended recipient (s) If you are not the intended recipient, please do not 
> use or disseminate the information, notify the sender and delete it from your 
> system.
>
> ______________________________________________________________________
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to [email protected]
> Please read the FAQ at http://kernelnewbies.org/FAQ
>
>   

Reply via email to