From 15ea618a79886024f50cabac19d7f91811dec5fb Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Mon, 28 Nov 2016 18:56:57 -0800 Subject: Pass argc and argv to main() --- bsp/env/freedom-e300-arty/init.c | 2 -- bsp/env/freedom-e300-hifive1/init.c | 2 -- bsp/env/start.S | 3 +++ 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/bsp/env/freedom-e300-arty/init.c b/bsp/env/freedom-e300-arty/init.c index c766e98..0a80cbb 100644 --- a/bsp/env/freedom-e300-arty/init.c +++ b/bsp/env/freedom-e300-arty/init.c @@ -59,8 +59,6 @@ void _init() printf("core freq at %d Hz\n", get_cpu_freq()); write_csr(mtvec, &trap_entry); - - // _exit(main(0, NULL)); } diff --git a/bsp/env/freedom-e300-hifive1/init.c b/bsp/env/freedom-e300-hifive1/init.c index c088079..167d652 100644 --- a/bsp/env/freedom-e300-hifive1/init.c +++ b/bsp/env/freedom-e300-hifive1/init.c @@ -188,8 +188,6 @@ void _init() write_csr(mstatus, MSTATUS_FS); // allow FPU instructions without trapping write_csr(fcsr, 0); // initialize rounding mode, undefined at reset } - - //_exit(main(0, NULL)); } void _fini() diff --git a/bsp/env/start.S b/bsp/env/start.S index 77e223d..b526411 100644 --- a/bsp/env/start.S +++ b/bsp/env/start.S @@ -47,5 +47,8 @@ _start: 1: #endif + /* argc = argv = 0 */ + li a0, 0 + li a1, 0 call main tail exit -- cgit v1.2.3