Skip to content

Commit e42d770

Browse files
committed
x86 asm: fix LKMC_ASSERT_EQ which failed to fail for RDI!
1 parent 6aa2f78 commit e42d770

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lkmc/x86_64.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,25 @@
44
/* This and other macros may make C function calls, and therefore can destroy
55
* non-callee saved registers. */
66
#define LKMC_ASSERT_EQ(general1, general2) \
7+
push %rdi; \
78
mov general2, %rdi; \
89
push %rdi; \
10+
mov 8(%rsp), %rdi; \
911
mov general1, %rdi; \
1012
pop %rsi; \
13+
add $8, %rsp; \
1114
mov $__LINE__, %edx; \
1215
call lkmc_assert_eq_64; \
1316
;
1417

1518
#define LKMC_ASSERT_EQ_32(general1, general2) \
19+
push %rdi; \
1620
mov general2, %edi; \
1721
push %rdi; \
22+
mov 8(%rsp), %rdi; \
1823
mov general1, %edi; \
1924
pop %rsi; \
25+
add $8, %rsp; \
2026
mov $__LINE__, %edx; \
2127
call lkmc_assert_eq_32; \
2228
;

0 commit comments

Comments
 (0)