summaryrefslogtreecommitdiffstats
path: root/include/asm-offsets.h
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2010-10-26 00:08:35 +0200
committerWolfgang Denk <wd@denx.de>2010-10-26 21:04:34 +0200
commit16a354f920f3959ed847bd917bdfbc7eba48cf1e (patch)
tree71272417ffdc5942abadc01d251d5b03a4d99fd2 /include/asm-offsets.h
parent553f09823cced77296825f615f00321d932bf914 (diff)
downloadblackbird-obmc-uboot-16a354f920f3959ed847bd917bdfbc7eba48cf1e.tar.gz
blackbird-obmc-uboot-16a354f920f3959ed847bd917bdfbc7eba48cf1e.zip
include/asm-offsets.h: automatically generate assembler constants
A recurrent issue is that certain C level constructs like sizeof() or offsetof() cannot be used in assembler files, which is inconvenient when such constructs are used in the definition of macro names etc. To avoid duplication of such definitions (and thus another cause of problems), we adapt the Linux way to automatically generate the respective definitions from the respective C header files. In Linux, this is implemented in include/linux/kbuild.h, Kbuild, and arch/*/kernel/asm-offsets.c; we adapt the code from the Linux v2.6.36 kernel tree. We also copy the concept of the include/generated/ directory which can be used to hold other automatically generated files as well. We start with an architecture-independent lib/asm-offsets.c which generates include/generated/generic-asm-offsets.h (included by include/asm-offsets.h, which is what will be referred to in the actual source code). Later this may be extended by architecture-specific arch/*/lib/asm-offsets.c files that will generate a include/generated/asm-offsets.h. Signed-off-by: Wolfgang Denk <wd@denx.de> Acked-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'include/asm-offsets.h')
-rw-r--r--include/asm-offsets.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/asm-offsets.h b/include/asm-offsets.h
new file mode 100644
index 0000000000..ab28184054
--- /dev/null
+++ b/include/asm-offsets.h
@@ -0,0 +1,2 @@
+#include <generated/generic-asm-offsets.h>
+/* #include <generated/asm-offsets.h> */
OpenPOWER on IntegriCloud