mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
aarch64 baremetal svc factored out for C and asm
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user