/* save all necessary core registers not covered by the drivers */ samsung_pm_save_gpios(); samsung_pm_saved_gpios(); s3c_pm_save_uarts(); s3c_pm_save_core();
/* set the irq configuration for wake */ s3c_pm_configure_extint(); S3C_PMDBG("sleep: irq wakeup masks: %08lx,%08lx\n", s3c_irqwake_intmask, s3c_irqwake_eintmask);
s3c_pm_arch_prepare_irqs();
/* call cpu specific preparation */ pm_cpu_prep();
/* flush cache back to ram */ flush_cache_all();
s3c_pm_check_store();
/* send the cpu to sleep... */ s3c_pm_arch_stop_clocks();
/* restore the system state */ /* 以下是唤醒过程,以后再细说 */ ....... return 0; }
二、内核怎么把睡眠唤醒的功能加入 在上面一小节中提到 s3c2416_pm_add函数,它的调用如下: static struct subsys_interface s3c2416_pm_interface = { .name = "s3c2416_pm", .subsys = &s3c2416_subsys, .add_dev = s3c2416_pm_add, };
static __init int s3c2416_pm_init(void) { return subsys_interface_register(&s3c2416_pm_interface); }
arch_initcall( s3c2416_pm_init);
至此,即实现了睡眠、唤醒的插入。
初版。待修改。。。