Skip to content

Commit 37487a5

Browse files
Christoph Lametertorvalds
authored andcommitted
Add kbuild.h that contains common definitions for kbuild users
The same definitions are used for the bounds logic and the asm-offsets.h generation by kbuild. Put them into include/linux/kbuild.h file. Also add a new feature COMMENT("text") which can be used to insert lines of ocmments into asm-offsets.h and bounds.h. Cc: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Christoph Lameter <clameter@sgi.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Jay Estabrook <jay.estabrook@hp.com> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: Richard Henderson <rth@twiddle.net> Cc: "Luck, Tony" <tony.luck@intel.com> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Chris Zankel <chris@zankel.net> Cc: David S. Miller <davem@davemloft.net> Cc: Haavard Skinnemoen <hskinnemoen@atmel.com> Cc: Bryan Wu <bryan.wu@analog.com> Cc: Mike Frysinger <vapier.adi@gmail.com> Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Roman Zippel <zippel@linux-m68k.org> Cc: Greg Ungerer <gerg@uclinux.org> Cc: David Howells <dhowells@redhat.com> Cc: Kyle McMartin <kyle@mcmartin.ca> Cc: Grant Grundler <grundler@parisc-linux.org> Cc: Matthew Wilcox <matthew@wil.cx> Cc: Paul Mackerras <paulus@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Paul Mundt <lethal@linux-sh.org> Cc: Miles Bader <miles@gnu.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 39fa003 commit 37487a5

2 files changed

Lines changed: 16 additions & 5 deletions

File tree

‎include/linux/kbuild.h‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#ifndef __LINUX_KBUILD_H
2+
#define __LINUX_KBUILD_H
3+
4+
#define DEFINE(sym, val) \
5+
asm volatile("\n->" #sym " %0 " #val : : "i" (val))
6+
7+
#define BLANK() asm volatile("\n->" : : )
8+
9+
#define OFFSET(sym, str, mem) \
10+
DEFINE(sym, offsetof(struct str, mem))
11+
12+
#define COMMENT(x) \
13+
asm volatile("\n->#" x)
14+
15+
#endif

‎kernel/bounds.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@
88
/* Include headers that define the enum constants of interest */
99
#include <linux/page-flags.h>
1010
#include <linux/mmzone.h>
11-
12-
#define DEFINE(sym, val) \
13-
asm volatile("\n->" #sym " %0 " #val : : "i" (val))
14-
15-
#define BLANK() asm volatile("\n->" : : )
11+
#include <linux/kbuild.h>
1612

1713
void foo(void)
1814
{

0 commit comments

Comments
 (0)