Broadcom SDK中reboot的流程分析

来源:互联网 发布:coc武神升级数据 编辑:程序博客网 时间:2024/04/30 22:18

/sbin/reboot 链接到rc文件à

Path

File

Function

Remark

.

init.c

fatal_signal()

 

 

 

shutdown_system()

 

 

 

kill(-1, SIGTERM);

kill(-1, SIGKILL);

向所有进程发送信号

 

 

reboot()

 

 

 

调用内核接口

 

 

调用busybox中的reboot()函数à

Busybox调用顺序:

Path

File

Function

Remark

.

init.c

halt_reboot_pwoff()/

restart_handler()

 

 

 

run_shutdown_and_kill_processes();

 

 

 

kill(-1, SIGTERM); kill(-1, SIGKILL);

向所有进程发送信号

 

 

pause_and_low_level_reboot()

调用底层reboot接口

 

 

reboot();  

 

 

 

调用内核接口

 

注:rc和busybox中的reboot命令二选一;

 

内核空间:

Path

File

Function

Remark

kernel/

sys.c

SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd,

                   void __user *, arg)

定义内核入口

kernel/

sys.c

kernel_restart()

 

arch/arm/kernel

process.c

machine_restart()

 

arch/arm/kernel

process.c

arm_pm_restart()

 

arch/arm/kernel

process.c

arm_machine_restart()

arm架构通用接口

arch/arm/mach-brcm-hnd

board_ns.c

arch_reset()

平台相关

main/src/shared

hndarm_ca9.c

hnd_cpu_reset()

 

main/src/shared

siutils_rsdb.c

si_watchdog()

 

 

 

si_corereg(sih, SI_CC_IDX, OFFSETOF(chipcregs_t, watchdog), ~0, ticks)

设置watchdog进行复位

 

0 0
原创粉丝点击