`static noinline void __sched __down(struct semaphore *sem)`
在上面的函数中,为什么__scehd在信号量代码的__down函数之前使用
答案 0 :(得分:2)
__sched
是一个宏而不是关键字,为该函数添加一个属性,将其视为一些添加的元信息。
如<linux/sched.h>
中所定义:
/* Attach to any functions which should be ignored in wchan output. */
#define __sched __attribute__((__section__(".sched.text")))
因此,将__sched
宏添加到函数会导致压缩该函数的wchan信息。