Skip to content

Commit

Permalink
Add kbuild.h that contains common definitions for kbuild users
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Christoph Lameter <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Jay Estabrook <[email protected]>
Cc: Ivan Kokshaysky <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: "Luck, Tony" <[email protected]>
Cc: Russell King <[email protected]>
Cc: Chris Zankel <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: Haavard Skinnemoen <[email protected]>
Cc: Bryan Wu <[email protected]>
Cc: Mike Frysinger <[email protected]>
Cc: Yoshinori Sato <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: Roman Zippel <[email protected]>
Cc: Greg Ungerer <[email protected]>
Cc: David Howells <[email protected]>
Cc: Kyle McMartin <[email protected]>
Cc: Grant Grundler <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Martin Schwidefsky <[email protected]>
Cc: Heiko Carstens <[email protected]>
Cc: Paul Mundt <[email protected]>
Cc: Miles Bader <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Christoph Lameter authored and torvalds committed Apr 29, 2008
1 parent 39fa003 commit 37487a5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
15 changes: 15 additions & 0 deletions include/linux/kbuild.h
Original file line number Diff line number Diff line change
@@ -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
6 changes: 1 addition & 5 deletions kernel/bounds.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@
/* Include headers that define the enum constants of interest */
#include <linux/page-flags.h>
#include <linux/mmzone.h>

#define DEFINE(sym, val) \
asm volatile("\n->" #sym " %0 " #val : : "i" (val))

#define BLANK() asm volatile("\n->" : : )
#include <linux/kbuild.h>

void foo(void)
{
Expand Down

0 comments on commit 37487a5

Please sign in to comment.