Files
linux-kernel-module-cheat/userland/arch/common.h
Ciro Santilli 六四事件 法轮功 72200dee4e userland: scope every header identifier with lkmc_
2019-05-21 00:00:01 +00:00

33 lines
670 B
C

/* https://github.com/cirosantilli/linux-kernel-module-cheat#userland-assembly-c-standard-library */
#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 LKMC_ASSERT(branch_if_pass) \
branch_if_pass 1f; \
LKMC_FAIL; \
1: \
;
#ifndef LKMC_ASSERT_EQ_REG
/* Assert that a register equals another register. */
#define LKMC_ASSERT_EQ_REG(reg1, reg2) \
cmp reg1, reg2; \
LKMC_ASSERT(beq); \
;
#endif
#endif