public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* problem about asmlinkage resolved.
@ 2002-11-06  1:50 Paul Dean
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Dean @ 2002-11-06  1:50 UTC (permalink / raw)
  To: gcc-help

Thanks for Momchil Velikov's help at first.

There are many useful information in the web site below.

http://kernelnewbies.org/faq/

It has detailed explanation of "asmlinkage" in it. I copied it to here for the coming users just like me.

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. 




^ permalink raw reply	[flat|nested] 2+ messages in thread

* problem about asmlinkage resolved.
@ 2002-11-06  1:56 Paul Dean
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Dean @ 2002-11-06  1:56 UTC (permalink / raw)
  To: gcc-help

Hi all,

Thanks for Momchil Velikov's help at first.
 
 There are many useful information in the web site below.
 
 http://kernelnewbies.org/faq/
 
 It has detailed explanation of "asmlinkage" in it. I copied it to here for the coming users just like me.
 
 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. 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-11-06  9:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-06  1:50 problem about asmlinkage resolved Paul Dean
2002-11-06  1:56 Paul Dean

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).