# Linux Kernel Module Cheat
The perfect emulation setup to study and develop the <<linux-kernel>> v5.9.2, kernel modules, <<qemu-buildroot-setup,QEMU>>, <<gem5-buildroot-setup,gem5>> and x86_64, ARMv7 and ARMv8 <<userland-assembly,userland>> and <<baremetal-setup,baremetal>> assembly, <<c,ANSI C>>, <<cpp,C++>> and <<posix,POSIX>>. <<gdb>> and <<kgdb>> just work. Powered by <<about-the-qemu-buildroot-setup,Buildroot>> and <<about-the-baremetal-setup,crosstool-NG>>. Highly automated. Thoroughly documented. Automated <<test-this-repo,tests>>.

### 28.8. Linux calling conventions

A summary of results is shown at: Table 3, “Summary of Linux calling conventions for several architectures”.

Table 3. Summary of Linux calling conventions for several architectures
arch | arguments | return value | callee saved registers
--- | --- | --- | ---
x86_64 | rdi, rsi, rdx, rcx, r8, r9, xmm0–7 | rax, rdx | rbx, rbp, r12–r15
arm | r0-r3 | r0-r3 | r4-r11
aarch64 | x0-x7 | x0-x7 | x19-x29

- x86_64 calling convention

- ARM calling convention