1 /*******************************************************************************
\r
2 * (c) Copyright 2016-2018 Microsemi SoC Products Group. All rights reserved.
\r
5 * @author Microsemi SoC Products Group
\r
6 * @brief Mi-V soft processor memory section initializations and start-up code.
\r
8 * SVN $Revision: 9661 $
\r
9 * SVN $Date: 2018-01-15 16:13:33 +0530 (Mon, 15 Jan 2018) $
\r
16 #include "encoding.h"
\r
22 extern uint32_t __sdata_load;
\r
23 extern uint32_t __sdata_start;
\r
24 extern uint32_t __sdata_end;
\r
26 extern uint32_t __data_load;
\r
27 extern uint32_t __data_start;
\r
28 extern uint32_t __data_end;
\r
30 extern uint32_t __sbss_start;
\r
31 extern uint32_t __sbss_end;
\r
32 extern uint32_t __bss_start;
\r
33 extern uint32_t __bss_end;
\r
36 static void copy_section(uint32_t * p_load, uint32_t * p_vma, uint32_t * p_vma_end)
\r
38 while(p_vma <= p_vma_end)
\r
46 static void zero_section(uint32_t * start, uint32_t * end)
\r
48 uint32_t * p_zero = start;
\r
50 while(p_zero <= end)
\r
59 extern int main(int, char**);
\r
60 const char *argv0 = "hello";
\r
61 char *argv[] = {(char *)argv0, NULL, NULL};
\r
63 copy_section(&__sdata_load, &__sdata_start, &__sdata_end);
\r
64 copy_section(&__data_load, &__data_start, &__data_end);
\r
65 zero_section(&__sbss_start, &__sbss_end);
\r
66 zero_section(&__bss_start, &__bss_end);
\r
71 /* Function called after main() finishes */
\r