mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
x86 asm: fix LKMC_ASSERT_EQ which failed to fail for RDI!
This commit is contained in:
@@ -4,19 +4,25 @@
|
|||||||
/* This and other macros may make C function calls, and therefore can destroy
|
/* This and other macros may make C function calls, and therefore can destroy
|
||||||
* non-callee saved registers. */
|
* non-callee saved registers. */
|
||||||
#define LKMC_ASSERT_EQ(general1, general2) \
|
#define LKMC_ASSERT_EQ(general1, general2) \
|
||||||
|
push %rdi; \
|
||||||
mov general2, %rdi; \
|
mov general2, %rdi; \
|
||||||
push %rdi; \
|
push %rdi; \
|
||||||
|
mov 8(%rsp), %rdi; \
|
||||||
mov general1, %rdi; \
|
mov general1, %rdi; \
|
||||||
pop %rsi; \
|
pop %rsi; \
|
||||||
|
add $8, %rsp; \
|
||||||
mov $__LINE__, %edx; \
|
mov $__LINE__, %edx; \
|
||||||
call lkmc_assert_eq_64; \
|
call lkmc_assert_eq_64; \
|
||||||
;
|
;
|
||||||
|
|
||||||
#define LKMC_ASSERT_EQ_32(general1, general2) \
|
#define LKMC_ASSERT_EQ_32(general1, general2) \
|
||||||
|
push %rdi; \
|
||||||
mov general2, %edi; \
|
mov general2, %edi; \
|
||||||
push %rdi; \
|
push %rdi; \
|
||||||
|
mov 8(%rsp), %rdi; \
|
||||||
mov general1, %edi; \
|
mov general1, %edi; \
|
||||||
pop %rsi; \
|
pop %rsi; \
|
||||||
|
add $8, %rsp; \
|
||||||
mov $__LINE__, %edx; \
|
mov $__LINE__, %edx; \
|
||||||
call lkmc_assert_eq_32; \
|
call lkmc_assert_eq_32; \
|
||||||
;
|
;
|
||||||
|
|||||||
Reference in New Issue
Block a user