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教程 -- http://doc.linuxpk.com/53295.html
如有不明白之处,欢迎参加社区讨论
1.Linux“线程”
笔者曾经在《基于嵌入式操作系统VxWorks的多任务并发程序设计》(《软件报》2006年第5~12期)中详细叙述了进程和线程的区别,并曾经说明Linux是一种“多进程单线程”的操作系统。 ......
本文作者:Heliode
翻译人员:Jonah.Simon,
校对人员:lyreopera
“那我该用什么来备份我的系统呢?”也许你会问。小事一桩,就像你备份或压缩一个别的文件一样,TAR。不像Windows,Linux不限制根用户存取任何东西,因此,你完全可以把一个分区 ......
1. 查看内核版本命令:
1) [root@q1test01 ~]# cat /proc/version
Linux version 2.6.9-22.ELsmp (bhcompile@crowe.devel.redhat.com) (gcc version 3.4.4 20050721 (Red Hat
3.4.4-2)) #1 SMP Mon Sep 19 18:00:54 EDT 2005
2) [root@q1test01 ~]# uname -a
Linux q1test01 2.6.9-22.ELsmp #1 SMP Mon Sep 19 ......
虚拟机下linux下可以用使用主机的串口(虚拟机添加硬件里面可选)
linux下的超级终端minicom
进入超级终端的命令
[root]#minicom -s
选择串口一项
需要设定串口ttyS0(你的串口的设备名)
波特率115200
硬件流控关闭(默认是开启,如果开启的话,不能用键盘输入)
软件流控关闭
Save setup as dfl
exit
OK,这就可 ......
在linux的日常服务器维护站点维护中,经常需要批量操作一部分文件,比如数据库用户的资料变更,那么所以相关站点的数据库配置文件要相应的修改。大家都知道,linux下面几乎所有的配置文件都是纯粹的文本文件,所以这其实就是一个基本的文本操作。一台服务器上有上百个甚至上千个的网站。如果我们一个个来修改不是不可以,但 ......