baremetal: get exit status working with on_exit :-)

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-05-08 00:00:01 +00:00
parent 18ca0b3c9c
commit 406ee82cf3
16 changed files with 79 additions and 34 deletions

View File

@@ -14,6 +14,12 @@ mystart:
/* Prepare the stack for main, mandatory for C code. */
ldr x0, =stack_top
mov sp, x0
/* https://github.com/cirosantilli/linux-kernel-module-cheat#magic-failure-string */
adr x0, lkmc_baremetal_on_exit_callback
bl on_exit
/* Run main. */
bl main
/* If main returns, exit. */

View File

@@ -1,5 +1,16 @@
#include <lkmc.h>
.global mystart
mystart:
/* Prepare the stack for main, mandatory for C code. */
ldr sp, =stack_top
/* https://github.com/cirosantilli/linux-kernel-module-cheat#magic-failure-string */
ldr r0, =lkmc_baremetal_on_exit_callback
bl on_exit
/* Run main. */
bl main
/* If main returns, exit. */
bl exit