Chinaunix

标题: __sched是什么意思? [打印本页]

作者: whxlovehy    时间: 2012-05-11 09:41
标题: __sched是什么意思?
在看源码的时候,遇到下面这个函数定义,主要是其中__sched不懂,求解释(源自kernel/wait.c):
/*
* To allow interruptible waiting and asynchronous (i.e. nonblocking)
* waiting, the actions of __wait_on_bit() and __wait_on_bit_lock() are
* permitted return codes. Nonzero return codes halt waiting and return.
*/
int __sched
__wait_on_bit(wait_queue_head_t *wq, struct wait_bit_queue *q,
                        int (*action)(void *), unsigned mode)
{
     .....
}


顺便问一句,我们在发表主题或回帖的时候如何插入tab键啊?
作者: firkraag    时间: 2012-05-11 10:59
in linux/include/linux/sched.h:

/* Attach to any functions which should be ignored in wchan output. */
#define __sched         __attribute__((__section__(".sched.text")))

作者: amarant    时间: 2012-05-11 16:00
我对LS做个补充吧。
编译内核最后的连接过程是按照连接脚本来连接的。加了这个以后就把这个函数的代码放在了.sched.text这个区里。代码段里面也分了很多区。
作者: whxlovehy    时间: 2012-05-11 17:48
本帖最后由 whxlovehy 于 2012-05-11 17:49 编辑

回复 2# firkraag


    这尼玛,压根没想到这一出啊,居然是个宏定义!我还朝这gcc特性这个方向去查找....
    只不过也算是gcc特性了!(*^__^*) 嘻嘻……




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2