mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 10:15:57 +01:00
15 lines
240 B
ArmAsm
15 lines
240 B
ArmAsm
/* https://cirosantilli.com/linux-kernel-module-cheat#arm-bl-instruction */
|
|
|
|
#include <lkmc.h>
|
|
|
|
LKMC_PROLOGUE
|
|
mov r0, 1
|
|
bl inc
|
|
LKMC_ASSERT_EQ(r0, =2)
|
|
LKMC_EPILOGUE
|
|
|
|
/* void inc(int *i) { (*i)++ } */
|
|
inc:
|
|
add r0, 1
|
|
bx lr
|