- 论坛徽章:
- 1
|
在看软中断的处理函数时我知道先是do_softirq(void),do_softirq(void)完成软中断栈的转换,然后它调用__do_softirq(void),完成实际软中断函数的调用。但我不明白的是linux 2.6.18中有两个do_softirq(void)函数- asmlinkage void do_softirq(void)
- {
- .........
- //完成软中断栈的切换
- if (local_softirq_pending()) {
- curctx = current_thread_info();
- irqctx = softirq_ctx[smp_processor_id()];
- irqctx->tinfo.task = curctx->task;
- irqctx->tinfo.previous_esp = current_stack_pointer;
- /* build the stack frame on the softirq stack */
- isp = (u32*) ((char*)irqctx + sizeof(*irqctx));
- asm volatile(
- " xchgl %%ebx,%%esp \n"
- " call __do_softirq \n"
- " movl %%ebx,%%esp \n"
- : "=b"(isp)
- : "0"(isp)
- : "memory", "cc", "edx", "ecx", "eax"
- );
- ............
- }
复制代码 这一个在arch\i386\kernel.c中
另一个在softirq.c中- asmlinkage void do_softirq(void)
- {
- __u32 pending;
- unsigned long flags;
- if (in_interrupt())
- return;
- local_irq_save(flags);
- pending = local_softirq_pending();
- if (pending)
- __do_softirq();
- local_irq_restore(flags);
- }
复制代码 很明显在调用第1个do_softirq(void)与体系结构有关,但让我不明白的是gcc是怎么编译这两个具有相同函数符号的函数的?
望各位指点指点...先谢谢了! |
|