设为首页 加入收藏

TOP

Android 关机(reboot)流程(二)
2015-08-31 21:24:04 来源: 作者: 【 】 浏览:66
Tags:Android 关机 reboot 流程
hine_restart()


=>arch/arm/kernel/process.c
void machine_restart(char *cmd)
{
? ? local_irq_disable();
? ? smp_send_stop();


? ? /* Flush the console to make sure all the relevant messages make it
? ? * out to the console drivers */
? ? arm_machine_flush_console();


? ? arm_pm_restart(reboot_mode, cmd);


? ? /* Give a grace period for failure to restart of 1s */
? ? mdelay(1000); // 1s之内没有restart完成就reboot失败。


? ? /* Whoops - the platform was unable to reboot. Tell the user! */
? ? printk("Reboot failed -- System halted\n");
? ? local_irq_disable();
? ? while (1);
}


=》
void (*arm_pm_restart)(char str, const char *cmd) = arm_machine_restart;
=》
void arm_machine_restart(char mode, const char *cmd)
{
...
aml_write_reg32(P_AO_RTI_STATUS_REG1, reboot_reason); //这一个标志寄存器
...


arch_reset(mode, cmd); // mode = 'h' cmd = "recovery"
}


差不多了,尝试就如此吧。


那么有必要了解这个寄存器P_AO_RTI_STATUS_REG1在下次启动的时候,uboot是什么时候读。这就可以实现一些关机之后的状态保存。


首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇使用 GDB 工具调试 Go 下一篇Spring 容器加载完成后执行某个方..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: