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中定时器的算法实现
定时器的作用
定时器在操作系统中起到了举足轻重的作用。在做IO操作时,需要超时机制保证任务不处于无休止的等待状态;在延时处理时,可以通过“闹表”进行相对准点的唤醒操作。在多任务操作系统中,定时器是一种非常常用的资源。
对于熟悉硬件 ......
因为自己的傻,所以才有的此篇日志。也许有人可以发现,在我博客上已经有篇名为“LFS配置IP及安装OpenSSH”,而再写这篇日记是因为自己在Linux下使用了光盘里的OpenSSH,然后装上后使用自己硬盘上的SSH时老是提示已经占用,结果反复装了好几遍才意识到这个问题!~这就好比一个人骑在马上数马的数目一样,总是少一 ......
Linux 2.6.19.x 内核编译配置选项简介
作者:金步国
版权声明
本文作者是一位自由软件爱好者,所以本文虽然不是软件,但是本着 GPL 的精神发布。任何人都可以自由使用、转载、复制和再分发,但必须保留作者署名,亦不得对声明中的任何条款作任何形式的修改,也不得附加任何其它条件。您可以自由链接、下载、传播此文档 ......
虚拟机下linux下可以用使用主机的串口(虚拟机添加硬件里面可选)
linux下的超级终端minicom
进入超级终端的命令
[root]#minicom -s
选择串口一项
需要设定串口ttyS0(你的串口的设备名)
波特率115200
硬件流控关闭(默认是开启,如果开启的话,不能用键盘输入)
软件流控关闭
Save setup as dfl
exit
OK,这就可 ......
etc/profile:此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行.
并从/etc/profile.d目录的配置文件中搜集shell的设置.
/etc/bashrc:为每一个运行bash shell的用户执行此文件.当bash shell被打开时,该文件被读取.
~/.bash_profile:每个用户都可使用该文件输入专用于自己使用的shell信息,当用户登录时 ......