diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2011-01-28 03:58:51 +0100 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2011-01-28 04:02:11 +0100 |
commit | 608f796648e8de74f9aac3e60db3f7d87e69e9f4 (patch) | |
tree | 2966b76b8d12e23f99c8fbd13aeccbb4d4ef8ce8 /os/src/init.c | |
parent | 18d53779c4fef3efca606aead2da3af40ec76332 (diff) |
Work on the MPU port. The exception VTOR redirection doesn't work as expected.
Diffstat (limited to 'os/src/init.c')
-rw-r--r-- | os/src/init.c | 37 |
1 files changed, 13 insertions, 24 deletions
diff --git a/os/src/init.c b/os/src/init.c index 4febb10..bb3a6fb 100644 --- a/os/src/init.c +++ b/os/src/init.c @@ -1,40 +1,29 @@ #include <stdlib.h> #include <BoardConsole.h> -extern void __libc_init_array() __attribute__((weak)); -extern void __libc_fini_array() __attribute__((weak)); -extern void __main() __attribute__ ((weak)); +extern void __libc_init_array(); +extern void __libc_fini_array(); +extern void __main(); extern int main(int, char **, char **); -extern void BoardEarlyInit() __attribute__((weak)); -extern void BoardLateInit() __attribute__((weak)); -extern void BoardExceptionHandler(int) __attribute__((weak)); -extern void BoardShutdown() __attribute__((weak)); +extern void BoardEarlyInit(); +extern void BoardLateInit(); +extern void BoardExceptionHandler(int); +extern void BoardShutdown(); void _exit(int return_code) __attribute__((noreturn)); void _exit(int return_code) { - if (return_code && BoardExceptionHandler) + if (return_code) BoardExceptionHandler(return_code); - if (BoardShutdown) - BoardShutdown(); + BoardShutdown(); while(1); } void _start() { - if (BoardEarlyInit) - BoardEarlyInit(); + BoardEarlyInit(); BoardConsoleInit(); BoardConsolePuts("uC-sdk - booting."); - if (__libc_init_array) - __libc_init_array(); - - if (__main) - __main(); - - if (BoardLateInit) - BoardLateInit(); - - if (__libc_fini_array) - atexit(__libc_fini_array); - + __libc_init_array(); + BoardLateInit(); + atexit(__libc_fini_array); exit(main(0, NULL, NULL)); } |