Linux Power Managment 分析二
来源:互联网 发布:取消trunk端口 编辑:程序博客网 时间:2024/06/10 04:42
中午吃顿饭,继续开始研究kernel/power/main.c的内容。
这才到了最关键的地方static int enter_state(suspend_state_t state)
enter_state 是负责处理进入何种状态的函数。貌似在arm linux里,电源管理都经过如下几步:
1. suspend_prepare
2. suspend_enter
3. suspend_finish
当然这几个函数又有封装,但是从总体上看,上层实现时,operation也对应这几个函数。
先看看suspend_prepare的实现吧
pm_prepare_console(); 设置console为suspend模式
freeze_processes() 将user space和kernel的thread freeze
global_page_state() 貌似要free一些space出来,不是很确定呃。
pm_ops->prepare(state) 调用上层operation的prepare函数
suspend_console(); 获取console信号量,设置suspend标志位,标志进入suspend,与其对应的resume_console
device_suspend(PMSG_SUSPEND); 每个设备进入suspend模式,有待进一步分析内部实现。
disable_nonboot_cpus(); 对于我们这个单CPU,没啥用处
suspend prepare 是为了suspend做准备的一部,下一步就要进入suspend状态了。
suspend_enter实现要简单多了
device_power_down(PMSG_SUSPEND) 关闭所有device的power,如果失败,则退出,并且suspend也失败。
pm_ops->enter(state); 进入suspend模式。
device_power_up(); 退出suspend模式,将device的状态恢复
suspend_finish实现,主要恢复suspend prepare里的工作。
enable_nonboot_cpus();
pm_finish(state);
device_resume();
resume_console();
thaw_processes();
pm_restore_console();
休息一下,回头继续。 感冒了,真是很痛苦的一件事情,特别是头疼。
- Linux Power Managment 分析二
- Linux Power Managment详解
- Linux Power Managment详解 .
- linux power managment 详解
- Linux Power Managment详解
- Linux Power Managment 【guolele修改】
- Linux Power Management分析一
- Linux Power Management源码分析(一)
- android6.0 power显示(亮度等)深入分析(二)DisplayManagerService
- android6.0 power显示(亮度等)深入分析(二)DisplayManagerService
- Linux VFS分析(二)
- 学习 Exchange managment shell
- POWER SWOT分析
- Power Designer 分析数据表
- Power按键流程分析
- Power键不亮屏分析方法
- Power按键流程分析
- Linux hrtimer分析(二)
- 零食包装上的英语
- 我有没有必要将C99的文档翻译成中文?
- c# 在mono上的移植 系列之 开篇
- 说话“毫不留情”
- [双语阅读]普京成柔道教练 发布教学DVD
- Linux Power Managment 分析二
- Can not find so for swat in Samba in Solaris? Try crle command to update runtime linking configuration.
- None
- 【JfaceTextFramework学习笔记之六】Jface提供的Rule基类总结
- 散户笑傲股市要记住十句话 [精品] [转]
- csdn 在c++ builder中,使用treeview实现对xml文档增加删除修改和查询等基本操作
- 2009年,中国经济十大预言
- sitemesh的使用---修饰器
- 如何禁用表单中的按钮