mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-25 11:11:35 +01:00
17 lines
371 B
ArmAsm
17 lines
371 B
ArmAsm
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-conditional-execution */
|
|
|
|
#include "common.h"
|
|
|
|
LKMC_ENTRY
|
|
mov r0, 0
|
|
mov r1, 1
|
|
cmp r0, 1
|
|
/* Previous cmp failed, skip this operation. */
|
|
addeq r1, 1
|
|
LKMC_ASSERT_EQ(r1, 1)
|
|
cmp r0, 0
|
|
/* Previous passed, do this operation. */
|
|
addeq r1, 1
|
|
LKMC_ASSERT_EQ(r1, 2)
|
|
LKMC_EXIT
|