mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-22 17:55:57 +01:00
21 lines
361 B
C
21 lines
361 B
C
/* https://github.com/cirosantilli/linux-kernel-module-cheat#your-first-binutils-hack */
|
|
|
|
#include <assert.h>
|
|
#include <inttypes.h>
|
|
|
|
int main(void) {
|
|
#if 0
|
|
uint64_t in = 0xFFFFFFFF;
|
|
uint64_t out = 0;
|
|
__asm__ (
|
|
"mov %[in], %%rax;"
|
|
"myinc %%rax;"
|
|
"movq %%rax, %[out]"
|
|
: [out] "=g" (out)
|
|
: [in] "g" (in)
|
|
: "rax"
|
|
);
|
|
assert(out == in + 1);
|
|
#endif
|
|
}
|