mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
Split userland/arch/<arch>/c/ into inline_asm and intrinsics, and move programs that don't match either up.
16 lines
286 B
C
16 lines
286 B
C
/* https://github.com/cirosantilli/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);
|
|
}
|