mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
18 lines
376 B
ArmAsm
18 lines
376 B
ArmAsm
#include <lkmc.h>
|
|
|
|
.global lkmc_start
|
|
lkmc_start:
|
|
/* 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. */
|
|
mov r0, 0
|
|
bl main
|
|
|
|
/* If main returns, exit. */
|
|
bl exit
|