- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我读到它用于在 Linux 中实现系统调用的函数。例如:
asmlinkage long sys_getjiffies( void )
{
return (long)get_jiffies_64();
}
并且它告诉编译器将所有函数参数传递到堆栈上。但这不已经是这样了吗?函数参数通常通过仅将它们压入堆栈来传递。还是我们在这里指的是通过寄存器传递函数参数?
最佳答案
有一个 FAQ :
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, becausesys_ni_syscall
doesn't take any arguments, but it's an issue for most other system calls. And, because you'll be seeingasmlinkage
in front of many other functions, I thought you should know what it was about.It is also used to allow calling a function from assembly files.
关于c - 'asmlinkage' 修饰符是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10459688/
SQL FMDB 的修饰符在哪里描述?特别是,如何在要插入的字符串中放置引号。比如我想将名称“Mac's Place”插入数据库?谢谢 最佳答案 如果在 SQL 中使用 executeUpdate 和
我读过 article在 MSDN 上。它解释了为什么“in”应该只与自定义只读结构一起使用,否则会有性能损失。但是,我不太明白如何对原始类型使用“in”。由于 C# 中的所有内置值类型都是不可变的,
“__printflike__ 修饰符”到底是什么?这个词是什么意思? 最佳答案 据推测,它会告诉编译器您正在使用的函数接受格式为 [anything, ] format, ... 的参数,其中 fo
我在 VS2010 上使用 ReSharper 插件,我正在生成一个接口(interface)方法。ReSharper 在参数名称上放置一个 @。那是做什么用的? int Count(Func @wh
我在写小偷中用了大量的正则,所以在接下来的版本中要逐步减少正则的应用 在PHP正则表达式中需要转义的字符如下: $^*()+={}[]|/:<>.?'" 注意:perl风
http://msdn.microsoft.com/en-us/library/435f1dw2.aspx public class Base { public string Field; }
根据scala-wartremover静态分析工具我必须将“final”放在我创建的每个案例类前面:错误消息显示“案例类必须是最终的”。 根据scapegoat (Scala 的另一个静态分析工具)相
在 tcsh 中,我可以通过以下方式从路径末尾提取第二个路径元素 cd /some/long/directory/structure/path/ set x=`pwd` echo ${x:h:h:t}
我找到了很多 SwiftUI 教程,其中修饰符 .resizable() 用于图像。它似乎不再适用于带有 Swift 5 的 Xcode 13.3.1。 导入了 SwiftUI。如果您自己键入整个修饰
我已经设置好了音频播放器 除了步进器的当前功能外,我还想为 onIncrement 和 onDecrement 播放单独的声音。 这个项目使用核心数据来持久化。 $estimatorData.qty
来自 linux 内核脚本/mod/modpost.c: static int is_vmlinux(const char *modname) { const char *myname;
我刚刚遇到了一个BNF Grammar for JAVA 。其中,“修饰符”有一个称为“threadsafe”的终结符号。但是,我以前从未见过它,也无法在《Java 语言规范》Java SE 7 版
我创建了一个脚本,它将我组中的所有帖子嵌入到我的网站上。为此,我必须知道所有可能的修饰符“附件”类型。 现在我知道,那个类型可以是: 分享, video_share_youtube。 但我不知道在哪里
在 tcsh 中,我可以通过以下方式从路径末尾提取第二个路径元素 cd /some/long/directory/structure/path/ set x=`pwd` echo ${x:h:h:t}
我找到了很多 SwiftUI 教程,其中修饰符 .resizable() 用于图像。它似乎不再适用于带有 Swift 5 的 Xcode 13.3.1。 导入了 SwiftUI。如果您自己键入整个修饰
我正在编写一个代表一些简单几何形状的 Java 类。 最上面abstract类(它本身是包私有(private))我已经声明了需要从同一包中的子类访问的属性。 如果我将属性声明为 final在 Abs
我已经设置好了音频播放器 除了步进器的当前功能外,我还想为 onIncrement 和 onDecrement 播放单独的声音。 这个项目使用核心数据来持久化。 $estimatorData.qty
明确地说,我是 不是 询问如何使用 ViewModifier 协议(protocol)来创建一个带有 body 函数的结构,然后可以使用它来修改 View 。这个问题有点不同。 我正在尝试创建 Nav
我有一个内部类,用于存储我用于游戏的控件的信息,现在我想在其中存储一个静态 ArrayList,其中包含所有控件的名称。但我收到此错误:“修饰符 static 只允许在常量变量声明中” private
public class This_testing { int x,y; public This_testing(int x,int y){ //Why modifier void
我是一名优秀的程序员,十分优秀!