- 论坛徽章:
- 16
|
本帖最后由 embeddedlwp 于 2012-04-20 11:14 编辑
回复 1# cuibixiong_cu
在vmlinux.lds.S文件中有:- 71 __initcall_start = .;
- 72 .initcall.init : {
- 73 *(.initcall1.init)
- 74 *(.initcall2.init)
- 75 *(.initcall3.init)
- 76 *(.initcall4.init)
- 77 *(.initcall5.init)
- 78 *(.initcall6.init)
- 79 *(.initcall7.init)
- 80 }
- 81 __initcall_end = .;
复制代码 start_kenrel->rest_init->kernel_thread->init->do_basic_setup->do_initcalls:- 530static void __init do_initcalls(void)
- 531{
- 532 initcall_t *call;
- 533 int count = preempt_count();
- 534
- 535 for (call = __initcall_start; call < __initcall_end; call++) {
- 536 char *msg;
- 537
- 538 if (initcall_debug) {
- 539 printk(KERN_DEBUG "Calling initcall 0x%p", *call);
- 540 print_fn_descriptor_symbol(": %s()", (unsigned long) *call);
- 541 printk("\n");
- 542 }
- 543
- 544 (*call)();
- 545
- 546 msg = NULL;
- 547 if (preempt_count() != count) {
- 548 msg = "preemption imbalance";
- 549 preempt_count() = count;
- 550 }
- 551 if (irqs_disabled()) {
- 552 msg = "disabled interrupts";
- 553 local_irq_enable();
- 554 }
- 555 if (msg) {
- 556 printk("error in initcall at 0x%p: "
- 557 "returned with %s\n", *call, msg);
- 558 }
- 559 }
- 560
- 561 /* Make sure there is no pending stuff from the initcall sequence */
- 562 flush_scheduled_work();
- 563}
复制代码 |
|