mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-26 19:51:35 +01:00
userland: add ported to all archs
This commit is contained in:
9
userland/arch/x86_64/add.S
Normal file
9
userland/arch/x86_64/add.S
Normal file
@@ -0,0 +1,9 @@
|
||||
/* https://github.com/cirosantilli/linux-kernel-module-cheat#userland-assembly */
|
||||
|
||||
#include "common.h"
|
||||
|
||||
ENTRY
|
||||
mov $1, %rax
|
||||
add $2, %rax
|
||||
ASSERT_EQ(%rax, $3)
|
||||
EXIT
|
||||
@@ -9,9 +9,9 @@
|
||||
mov reg, %rax; \
|
||||
mov const, %rbx; \
|
||||
cmp %rax, %rbx; \
|
||||
ASSERT(je); \
|
||||
pop %rbx; \
|
||||
pop %rax; \
|
||||
ASSERT(je); \
|
||||
;
|
||||
|
||||
# TODO
|
||||
|
||||
Reference in New Issue
Block a user