mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-19 17:58:41 +07: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>
16 lines
341 B
C
16 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
|