Files
OpenCellular/chip/host/reboot.c
Patrick Georgi 887e3962ca Mark reset and panic functions as noreturn
gcc 6.3 (as provided by coreboot-sdk) needs that to know which code
paths end early.
Also add a loop after the command that is "supposed" to reset the
machine so that the compiler believes it (and in case that assumption
fails).

BRANCH=none
BUG=b:65441143
TEST=none

Change-Id: Idb87253ec7880d66ffec30d75f4d007f02f63aab
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://chromium-review.googlesource.com/742916
Commit-Ready: Patrick Georgi <pgeorgi@chromium.org>
Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
2017-11-07 15:25:17 -08:00

24 lines
498 B
C

/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* Emulator self-reboot procedure */
#include <string.h>
#include <unistd.h>
#include "host_test.h"
#include "reboot.h"
#include "test_util.h"
__attribute__((noreturn))
void emulator_reboot(void)
{
char *argv[] = {strdup(__get_prog_name()), NULL};
emulator_flush();
execv(__get_prog_name(), argv);
while (1)
;
}