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操作时,需要超时机制保证任务不处于无休止的等待状态;在延时处理时,可以通过“闹表”进行相对准点的唤醒操作。在多任务操作系统中,定时器是一种非常常用的资源。
对于熟悉硬件 ......
内核配置很费事,选项太多了,最好用默认的.在linux-2.6.10/arch下有很多关于各种机子的配置:
alpha cris ia64 m68knommu ppc sh sparc64 x86_64
arm h8300 m32r mips &n ......
Linux系统都是以文件的形式来访问硬件设备的,各种设备是以系统设备文件的形式存在于系统设备目录/dev中的。这些文件用于访问系统中所有不同类型的硬件。例如,/dev/mouse文件对应鼠标设备文件,用于读取鼠标输入的;/dev/fd0文件对应软驱设备文件,用于处理软盘读写的;
Linux文件系统中每个文件用 i节点 来标识,关 ......
在linux的日常服务器维护站点维护中,经常需要批量操作一部分文件,比如数据库用户的资料变更,那么所以相关站点的数据库配置文件要相应的修改。大家都知道,linux下面几乎所有的配置文件都是纯粹的文本文件,所以这其实就是一个基本的文本操作。一台服务器上有上百个甚至上千个的网站。如果我们一个个来修改不是不可以,但 ......
etc/profile:此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行.
并从/etc/profile.d目录的配置文件中搜集shell的设置.
/etc/bashrc:为每一个运行bash shell的用户执行此文件.当bash shell被打开时,该文件被读取.
~/.bash_profile:每个用户都可使用该文件输入专用于自己使用的shell信息,当用户登录时 ......