diff options
author | Flavian Kaufmann <flavian@flaviankaufmann.ch> | 2024-06-28 16:10:11 +0200 |
---|---|---|
committer | Flavian Kaufmann <flavian@flaviankaufmann.ch> | 2024-06-28 16:10:11 +0200 |
commit | 04a934987445897a03652aa73e2a5c5088d40ba1 (patch) | |
tree | eb9ecb1cf1a68ef5fa602d0581b8046b39fe8406 /prog | |
parent | 94954f13818a55aae02b660942abd12dab32372d (diff) | |
download | riscv_cpu-04a934987445897a03652aa73e2a5c5088d40ba1.tar.gz riscv_cpu-04a934987445897a03652aa73e2a5c5088d40ba1.zip |
Diffstat (limited to 'prog')
-rw-r--r-- | prog/src/startup.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/prog/src/startup.c b/prog/src/startup.c index b587a95..ad9b9b6 100644 --- a/prog/src/startup.c +++ b/prog/src/startup.c @@ -5,15 +5,16 @@ extern unsigned int _sbss; // start of .bss section extern unsigned int _ebss; // end of .bss section extern unsigned int _estack; // end of .stack section (stack top) -//void main(void); // main function declaration +extern void main(void); // main function declaration extern void test_prog(void); -void _start(void) __attribute__((section(".text.startup"), naked)); // entry point, cpu starts executing from here - void _start(void) -{ - //test_prog(); + __attribute__((section(".text.startup"), + naked)); // entry point, cpu starts executing from here + +void _start(void) { + // test_prog(); unsigned int *src, *dst; @@ -29,11 +30,12 @@ void _start(void) } // initialize stack pointer - asm volatile ("la sp, _estack"); + asm volatile("la sp, _estack"); // call main function main(); // halt - while (1); + while (1) + ; } |