linux内核中开头带有 asmlinkage 的函数表示什么
强制通过堆栈传递参数,不要用寄存器传递
仔细看一下有asmlinkage的地方通常是系统调用的函数,因为在系统调用中,寄存器从用户空间传过来后SAVE_ALL压入堆栈,接着调用相应的系统调用函数,这样系统调用函数一定要保证是通过堆栈传递参数的
转贴一段:
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.
相关文档:
文章来源:http://dev.yesky.com/468/7601968.shtml
2007-10-12 11:01作者:宋宝华出处:天极网软件频道责任编辑:方舟
1.Linux文件系统
Linux支持多种文件系统,如ext、ext2、minix、iso9660、msdos、fat、vfat、nfs等。在这些具体文件系统的上层,Linux提供了虚拟文件系统(VFS)来统一它们的行为,虚拟文件系统为 ......
<!--
@page { margin: 2cm }
P { margin-bottom: 0.21cm }
-->
当前,一个很明显的事实是,
Linux
桌面并不普及。原因何在?
在
XP
盗版海洋中,普及
Linux
,谈何容易?十几年了,说尽
XP
盗版的坏话也无用(不灵验)。
Linux
国产化也失败了。问题究竟 ......
怎样创建真正很小的Linux下的ELF可执行文件
转载: ELF文件格式研究
日期: Friday, July 25 @ 14:46:16 CST
主题: 软件开发
发信人: someone (++), 信区: Linux
标 题: 怎样创建真正很小的Linux下的ELF可执行文件
发信站: ......
因为自己的傻,所以才有的此篇日志。也许有人可以发现,在我博客上已经有篇名为“LFS配置IP及安装OpenSSH”,而再写这篇日记是因为自己在Linux下使用了光盘里的OpenSSH,然后装上后使用自己硬盘上的SSH时老是提示已经占用,结果反复装了好几遍才意识到这个问题!~这就好比一个人骑在马上数马的数目一样,总是少一 ......