# 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>>.

#### 38.15.5. lkmc.c

The files:

- lkmc.c

- lkmc.h

contain common C function helpers that can be used both in userland and baremetal. Oh, the infinite joys of Newlib.

Those files also contain arch specific helpers under ifdefs like:

    #if defined(__aarch64__)

We try to keep as much as possible in those files. It bloats builds a little, but just makes everything simpler to understand.

Link with lkmc.o is enabled with the path_properties.py

    'extra_objs_lkmc_common': False,