Is there a Linux Kernel #ifdef
directive for conditional compilation available, which is set by the kernel build system (kbuild)?
Usecase:
I have a source code file with register map entries for a SoC and with functions used by a Kernel driver. This file shall be includable by userspace programs as well to use the register map entries:
myheader.h:
...
#define REGENTRY1 0x0001
#define REGENTRY2 0x0002
.....
#ifdef ANY_KERNEL_DIRECTIVE???
firstkernelspacefunc();
....
#endif
Or maybe there are other solutions to this usecase?