mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-24 10:41:35 +01:00
16 lines
279 B
C
16 lines
279 B
C
/* https://cirosantilli.com/linux-kernel-module-cheat#gcc-inline-assembly */
|
|
|
|
#include <assert.h>
|
|
#include <inttypes.h>
|
|
|
|
int main(void) {
|
|
uint64_t io = 1;
|
|
__asm__ (
|
|
"lea 1(%[io]), %[io];"
|
|
: [io] "+r" (io)
|
|
:
|
|
:
|
|
);
|
|
assert(io == 2);
|
|
}
|