易截截图软件、单文件、免安装、纯绿色、仅160KB

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.


相关文档:

Linux 内核配置 make menuconfig

内核配置很费事,选项太多了,最好用默认的.在linux-2.6.10/arch下有很多关于各种机子的配置:
  alpha  cris   ia64   m68knommu   ppc   sh   sparc64   x86_64
  arm    h8300   m32r   mips  &n ......

Linux系统基础知识(一)

Linux系统都是以文件的形式来访问硬件设备的,各种设备是以系统设备文件的形式存在于系统设备目录/dev中的。这些文件用于访问系统中所有不同类型的硬件。例如,/dev/mouse文件对应鼠标设备文件,用于读取鼠标输入的;/dev/fd0文件对应软驱设备文件,用于处理软盘读写的;
Linux文件系统中每个文件用 i节点 来标识,关 ......

Linux下的C编程入门之“线程”控制与“线程”通信编程

本文来自:Linux教程 -- http://doc.linuxpk.com/53295.html
如有不明白之处,欢迎参加社区讨论
1.Linux“线程”
 笔者曾经在《基于嵌入式操作系统VxWorks的多任务并发程序设计》(《软件报》2006年第5~12期)中详细叙述了进程和线程的区别,并曾经说明Linux是一种“多进程单线程”的操作系统。 ......

Linux下安装OpenSSH

因为自己的傻,所以才有的此篇日志。也许有人可以发现,在我博客上已经有篇名为“LFS配置IP及安装OpenSSH”,而再写这篇日记是因为自己在Linux下使用了光盘里的OpenSSH,然后装上后使用自己硬盘上的SSH时老是提示已经占用,结果反复装了好几遍才意识到这个问题!~这就好比一个人骑在马上数马的数目一样,总是少一 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号