mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-27 04:01:36 +01:00
userland: add assembly support
Move arm assembly cheat here, and start some work on x86 cheat as well.
This commit is contained in:
28
userland/arch/common.h
Normal file
28
userland/arch/common.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef COMMON_H
|
||||
#define COMMON_H
|
||||
|
||||
/* We define in this header only macros that are the same on all archs. */
|
||||
|
||||
/* common_arch.h contains arch specific macros. */
|
||||
#include "common_arch.h"
|
||||
|
||||
.extern \
|
||||
exit, \
|
||||
printf, \
|
||||
puts \
|
||||
;
|
||||
|
||||
/* Assert that the given branch instruction is taken. */
|
||||
#define ASSERT(branch_if_pass) \
|
||||
branch_if_pass 1f; \
|
||||
FAIL; \
|
||||
1: \
|
||||
;
|
||||
|
||||
/* Assert that a register equals another register. */
|
||||
#define ASSERT_EQ_REG(reg1, reg2) \
|
||||
cmp reg1, reg2; \
|
||||
ASSERT(beq); \
|
||||
;
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user