From 99e4a977986f67334f6b82a87f23f66cf88f4cb4 Mon Sep 17 00:00:00 2001 From: Vic Yang Date: Tue, 23 Jul 2013 12:13:42 +0800 Subject: 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 Reviewed-on: https://gerrit.chromium.org/gerrit/62969 Reviewed-by: Randall Spangler Reviewed-by: Vincent Palatin --- core/host/main.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/host/main.c b/core/host/main.c index e7b6718ac8..ed8985670b 100644 --- a/core/host/main.c +++ b/core/host/main.c @@ -18,8 +18,17 @@ #define CPUTS(outstr) cputs(CC_SYSTEM, outstr) #define CPRINTF(format, args...) cprintf(CC_SYSTEM, format, ## args) -int main(void) +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(); -- cgit v1.2.1