mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-28 02:35:28 +00:00
Support emulator hibernate
If we are hibernating indefinitely, just exit with hibernate exit code. If hibernating with a delay, delay for that amount of time and then reboot. BUG=chrome-os-partner:19235 TEST='hibernate 1' and see emulator reboot after a second with reset flag 'hibernate' BRANCH=None Change-Id: If25bf2eefbcf275f2592b92a997a9d7e1ff2384d Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/62970 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
@@ -152,7 +152,17 @@ test_mockable void system_reset(int flags)
|
||||
|
||||
test_mockable void system_hibernate(uint32_t seconds, uint32_t microseconds)
|
||||
{
|
||||
exit(EXIT_CODE_HIBERNATE);
|
||||
uint32_t i;
|
||||
|
||||
save_reset_flags(RESET_FLAG_HIBERNATE);
|
||||
|
||||
if (!seconds && !microseconds)
|
||||
exit(EXIT_CODE_HIBERNATE);
|
||||
|
||||
for (i = 0; i < seconds; ++i)
|
||||
udelay(SECOND);
|
||||
udelay(microseconds);
|
||||
emulator_reboot();
|
||||
}
|
||||
|
||||
test_mockable int system_is_locked(void)
|
||||
|
||||
Reference in New Issue
Block a user