Files
OpenCellular/core/host/main.c
Vic (Chun-Ju) Yang 7c686dd68b emulator: Move trace dump to a separate module
The implementation of trace dump has little to do with task scheduling,
so we should move it to a separate module for cleaner code. This
requires exposing some emulator-specific task info, as defined in
host_task.h.

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

Change-Id: Iba9bc0794a4e1dd4ddb92b98345162b398fa6a8d
Signed-off-by: Vic (Chun-Ju) Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/183238
2014-01-22 04:52:49 +00:00

64 lines
1.2 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 "keyboard_scan.h"
#include "stack_trace.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];
task_register_tracedump();
register_test_end_hook();
flash_pre_init();
system_pre_init();
system_common_pre_init();
test_init();
timer_init();
#ifdef HAS_TASK_KEYSCAN
keyboard_scan_init();
#endif
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;
}