aarch64 baremetal svc factored out for C and asm

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-02-18 00:00:00 +00:00
parent a8b6f758ba
commit e855a262fd
17 changed files with 355 additions and 334 deletions

View File

@@ -1,3 +1,5 @@
#include <lkmc.h>
.global mystart
mystart:
/* = NEON setup */
@@ -5,7 +7,26 @@ mystart:
msr cpacr_el1, x1
isb
/* Load the vector table. */
ldr x0, =vector_table
msr vbar_el1, x0
/* Prepare the stack for main, mandatory for C code. */
ldr x0, =stack_top
mov sp, x0
bl main
/* If main returns, exit. */
bl exit
LKMC_VECTOR_TABLE
/* Default trap handler that does nothing.
*
* Weak means that if any other file deinfes it as a non-weak global,
* that one will take precedence.
*
* We need this one to not get undefined references.
*/
LKMC_WEAK(lkmc_vector_trap_handler)
ret