From: Christoph Lameter Date: Tue, 29 Apr 2008 08:03:49 +0000 (-0700) Subject: Add kbuild.h that contains common definitions for kbuild users X-Git-Tag: v2.6.26-rc1~393 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37487a56523d402e25650da16c337acf4cecd13d;p=linux-2.6 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 Signed-off-by: Christoph Lameter Cc: Ingo Molnar Cc: Thomas Gleixner Cc: Ralf Baechle Cc: Jay Estabrook Cc: Ivan Kokshaysky Cc: Richard Henderson Cc: "Luck, Tony" Cc: Russell King Cc: Chris Zankel Cc: David S. Miller Cc: Haavard Skinnemoen Cc: Bryan Wu Cc: Mike Frysinger Cc: Yoshinori Sato Cc: Geert Uytterhoeven Cc: Roman Zippel Cc: Greg Ungerer Cc: David Howells Cc: Kyle McMartin Cc: Grant Grundler Cc: Matthew Wilcox Cc: Paul Mackerras Cc: Benjamin Herrenschmidt Cc: Martin Schwidefsky Cc: Heiko Carstens Cc: Paul Mundt Cc: Miles Bader Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/kbuild.h b/include/linux/kbuild.h new file mode 100644 index 0000000000..22a72198c1 --- /dev/null +++ b/include/linux/kbuild.h @@ -0,0 +1,15 @@ +#ifndef __LINUX_KBUILD_H +#define __LINUX_KBUILD_H + +#define DEFINE(sym, val) \ + asm volatile("\n->" #sym " %0 " #val : : "i" (val)) + +#define BLANK() asm volatile("\n->" : : ) + +#define OFFSET(sym, str, mem) \ + DEFINE(sym, offsetof(struct str, mem)) + +#define COMMENT(x) \ + asm volatile("\n->#" x) + +#endif diff --git a/kernel/bounds.c b/kernel/bounds.c index c3c55544db..3c53013818 100644 --- a/kernel/bounds.c +++ b/kernel/bounds.c @@ -8,11 +8,7 @@ /* Include headers that define the enum constants of interest */ #include #include - -#define DEFINE(sym, val) \ - asm volatile("\n->" #sym " %0 " #val : : "i" (val)) - -#define BLANK() asm volatile("\n->" : : ) +#include void foo(void) {