# Linux Kernel Module Cheat

#### 28.8.2. ARM calling convention

Call C standard library functions from assembly and vice versa.

- arm

  - lkmc/arm.h `ENTRY` and `EXIT`

  - userland/arch/arm/linux/c_from_asm.S

- aarch64

  - lkmc/aarch64.h `ENTRY` and `EXIT`

  - userland/arch/aarch64/inline_asm/linux/asm_from_c.c

ARM Architecture Procedure Call Standard (AAPCS) is the name that ARM Holdings gives to the calling convention.

Official specification: http://infocenter.arm.com/help/topic/com.arm.doc.ihi0042f/IHI0042F_aapcs.pdf

Bibliography:

- https://en.wikipedia.org/wiki/Calling_convention#ARM_(A32) Wiki contains the master list as usual.

- https://stackoverflow.com/questions/8422287/calling-c-functions-from-arm-assembly

- https://stackoverflow.com/questions/261419/arm-to-c-calling-convention-registers-to-save

- https://stackoverflow.com/questions/10494848/arm-whats-the-difference-between-apcs-and-aapcs-abi