pm: notify readclock of reboot(RBT_POWEROFF)
Some ARM chips handle power-off with RTC alarms. PM notifies readclock (the driver for RTCs) about the impending power-off. If the power-off mechanism is an RTC alarm, readclock will set the alarm. If not, there is no effect. Change-Id: Iee00066def2a0f742cdf0dbde8e32b376edf1b78
This commit is contained in:
parent
6d7eff8023
commit
1b95bbbfe9
1 changed files with 9 additions and 0 deletions
|
@ -298,6 +298,15 @@ int do_reboot()
|
|||
abort_flag = (unsigned) m_in.reboot_flag;
|
||||
if (abort_flag >= RBT_INVALID) return(EINVAL);
|
||||
|
||||
/* notify readclock (some arm systems power off via RTC alarms) */
|
||||
if (abort_flag == RBT_POWEROFF) {
|
||||
endpoint_t readclock_ep;
|
||||
if (ds_retrieve_label_endpt("readclock.drv", &readclock_ep) == OK) {
|
||||
message m; /* no params to set, nothing we can do if it fails */
|
||||
_taskcall(readclock_ep, RTCDEV_PWR_OFF, &m);
|
||||
}
|
||||
}
|
||||
|
||||
/* Order matters here. When VFS is told to reboot, it exits all its
|
||||
* processes, and then would be confused if they're exited again by
|
||||
* SIGKILL. So first kill, then reboot.
|
||||
|
|
Loading…
Reference in a new issue