mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-28 23:24:50 +00:00
cf0c3e68aa
KBuild abuses the asm statement to write to a file and clang chokes about these invalid asm statements. Hack it even more by fooling this is actual valid asm code. [masahiro: Import Jeroen's work for U-Boot: http://patchwork.ozlabs.org/patch/375026/ Tweak sed script a little to avoid garbage '#' for GCC case, like #define NR_PAGEFLAGS 23 /* __NR_PAGEFLAGS # */ ] Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Matthias Kaehlcke <mka@chromium.org> Tested-by: Matthias Kaehlcke <mka@chromium.org>
15 lines
341 B
C
15 lines
341 B
C
#ifndef __LINUX_KBUILD_H
|
|
#define __LINUX_KBUILD_H
|
|
|
|
#define DEFINE(sym, val) \
|
|
asm volatile("\n.ascii \"->" #sym " %0 " #val "\"" : : "i" (val))
|
|
|
|
#define BLANK() asm volatile("\n.ascii \"->\"" : : )
|
|
|
|
#define OFFSET(sym, str, mem) \
|
|
DEFINE(sym, offsetof(struct str, mem))
|
|
|
|
#define COMMENT(x) \
|
|
asm volatile("\n.ascii \"->#" x "\"")
|
|
|
|
#endif
|