Support emulation on GNU/Linux.

This commit is contained in:
NIIBE Yutaka
2017-06-26 19:32:23 +09:00
parent 78c825afe8
commit 5419580519
2 changed files with 41 additions and 3 deletions

17
entry.c
View File

@@ -1,7 +1,7 @@
/*
* entry.c - Entry routine when reset and interrupt vectors.
*
* Copyright (C) 2013, 2014, 2015, 2016
* Copyright (C) 2013, 2014, 2015, 2016, 2017
* Flying Stone Technology
* Author: NIIBE Yutaka <gniibe@fsij.org>
*
@@ -32,6 +32,20 @@
#include <chopstx.h>
#include "board.h"
#ifdef GNU_LINUX_EMULATION
int emulated_main (int, const char **);
void chx_init (void);
void chx_systick_init (void);
int
main (int argc, const char *argv[])
{
chx_init ();
chx_systick_init ();
emulated_main (argc, argv);
}
#else
#if defined(USE_SYS3) || defined(USE_SYS_CLOCK_GPIO_SETTING)
#define REQUIRE_CLOCK_GPIO_SETTING_IN_SYS
#include "sys.h"
@@ -225,3 +239,4 @@ handler vector_table[] __attribute__ ((section(".startup.vectors"))) = {
chx_handle_intr, chx_handle_intr, chx_handle_intr,
#endif
};
#endif