kernel/pic32mz: Add call to SystemInit
system32_pic32.c provides SystemInit function in fashion used in arm based
MCUs.
This adds invocation of this function in startup code.
It also provides weak empty implementation that is
used in pic32mx470f512h and pic32mz2048efg100.
Those two are older implementations that share crt0.S file
but differ in many aspects.
@@ -592,6 +592,9 @@ _main_entry:
nop
2:
#endif
+ la t0, SystemInit
+ jalr t0
+
and a0,a0,0
and a1,a1,0
@@ -629,3 +632,13 @@ __crt0_exit:
.globl __crt0_exit
.end _main_entry
+
+ .section .text.SystemInit,code
+ .align 2
+ .weak SystemInit
+ .ent SystemInit
+SystemInit:
+ jr ra
+ nop
+
+ .end SystemInit
