mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-29 21:14:27 +01:00
baremetal: get exit status working with on_exit :-)
This commit is contained in:
@@ -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. */
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user