Files
OpenCellular/core/host/main.c
Vic Yang 99e4a97798 Reboot emulator with execv()
With this, the emulator is able to reboot itself without the help of
run_host_test script. This makes it easier for development and also
speeds up the test.

BUG=chrome-os-partner:19235
TEST=Pass all tests
BRANCH=None

Change-Id: Ifa510442de19256c671ab91b6bc75fe9e8b9dc7b
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/62969
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2013-07-24 15:50:19 -07:00

55 lines
1.1 KiB
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.
*/
/* Entry point of unit test executable */
#include "console.h"
#include "flash.h"
#include "hooks.h"
#include "system.h"
#include "task.h"
#include "test_util.h"
#include "timer.h"
#include "uart.h"
/* Console output macros */
#define CPUTS(outstr) cputs(CC_SYSTEM, outstr)
#define CPRINTF(format, args...) cprintf(CC_SYSTEM, format, ## args)
const char *__prog_name;
const char *__get_prog_name(void)
{
return __prog_name;
}
int main(int argc, char **argv)
{
__prog_name = argv[0];
register_test_end_hook();
flash_pre_init();
system_pre_init();
system_common_pre_init();
timer_init();
hook_init();
uart_init();
if (system_jumped_to_this_image()) {
CPRINTF("[%T Emulator initialized after sysjump]\n");
} else {
CPUTS("\n\n--- Emulator initialized after reboot ---\n");
CPUTS("[Reset cause: ");
system_print_reset_flags();
CPUTS("]\n");
}
task_start();
return 0;
}