* + kbuild-consolidate-header-generation-from-asm-offset-information.patch added to -mm tree
@ 2017-04-03 22:21 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2017-04-03 22:21 UTC (permalink / raw)
To: mka, fenghua.yu, ghackmann, grundler, jan.kiszka, kieran.bingham,
md, mmarek, tony.luck, yamada.masahiro, mm-commits
The patch titled
Subject: kbuild: consolidate header generation from ASM offset information
has been added to the -mm tree. Its filename is
kbuild-consolidate-header-generation-from-asm-offset-information.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/kbuild-consolidate-header-generation-from-asm-offset-information.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/kbuild-consolidate-header-generation-from-asm-offset-information.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/SubmitChecklist when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Matthias Kaehlcke <mka@chromium.org>
Subject: kbuild: consolidate header generation from ASM offset information
Largely redundant code is used in different places to generate C headers
from offset information extracted from assembly language output.
Consolidate the code in a Makefile include and use this instead.
Link: http://lkml.kernel.org/r/20170403193739.84905-1-mka@chromium.org
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Michal Marek <mmarek@suse.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Kieran Bingham <kieran.bingham@linaro.org>
Cc: Grant Grundler <grundler@chromium.org>
Cc: Michael Davidson <md@google.com>
Cc: Greg Hackmann <ghackmann@google.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
Kbuild | 21 ++-------------------
arch/ia64/kernel/Makefile | 19 +++----------------
scripts/Makefile.asm-offsets | 22 ++++++++++++++++++++++
scripts/mod/Makefile | 21 ++-------------------
4 files changed, 29 insertions(+), 54 deletions(-)
diff -puN Kbuild~kbuild-consolidate-header-generation-from-asm-offset-information Kbuild
--- a/Kbuild~kbuild-consolidate-header-generation-from-asm-offset-information
+++ a/Kbuild
@@ -7,29 +7,12 @@
# 4) Check for missing system calls
# 5) Generate constants.py (may need bounds.h)
-# Default sed regexp - multiline due to syntax constraints
-define sed-y
- "/^->/{s:->#\(.*\):/* \1 */:; \
- s:^->\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; \
- s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \
- s:->::; p;}"
-endef
+include scripts/Makefile.asm-offsets
# Use filechk to avoid rebuilds when a header changes, but the resulting file
# does not
define filechk_offsets
- (set -e; \
- echo "#ifndef $2"; \
- echo "#define $2"; \
- echo "/*"; \
- echo " * DO NOT MODIFY."; \
- echo " *"; \
- echo " * This file was generated by Kbuild"; \
- echo " */"; \
- echo ""; \
- sed -ne $(sed-y); \
- echo ""; \
- echo "#endif" )
+ $(call gen_header_from_asm_offsets,$2)
endef
#####
diff -puN arch/ia64/kernel/Makefile~kbuild-consolidate-header-generation-from-asm-offset-information arch/ia64/kernel/Makefile
--- a/arch/ia64/kernel/Makefile~kbuild-consolidate-header-generation-from-asm-offset-information
+++ a/arch/ia64/kernel/Makefile
@@ -50,25 +50,12 @@ CFLAGS_traps.o += -mfixed-range=f2-f5,f
# The gate DSO image is built using a special linker script.
include $(src)/Makefile.gate
+include $(srctree)/scripts/Makefile.asm-offsets
+
# Calculate NR_IRQ = max(IA64_NATIVE_NR_IRQS, XEN_NR_IRQS, ...) based on config
-define sed-y
- "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"
-endef
quiet_cmd_nr_irqs = GEN $@
define cmd_nr_irqs
- (set -e; \
- echo "#ifndef __ASM_NR_IRQS_H__"; \
- echo "#define __ASM_NR_IRQS_H__"; \
- echo "/*"; \
- echo " * DO NOT MODIFY."; \
- echo " *"; \
- echo " * This file was generated by Kbuild"; \
- echo " *"; \
- echo " */"; \
- echo ""; \
- sed -ne $(sed-y) $<; \
- echo ""; \
- echo "#endif" ) > $@
+ $(call gen_header_from_asm_offsets,__ASM_NR_IRQS_H__) < $< > $@
endef
# We use internal kbuild rules to avoid the "is up to date" message from make
diff -puN /dev/null scripts/Makefile.asm-offsets
--- /dev/null
+++ a/scripts/Makefile.asm-offsets
@@ -0,0 +1,22 @@
+# Default sed regexp - multiline due to syntax constraints
+define sed-asm-offsets-to-c
+ "/^->/{s:->#\(.*\):/* \1 */:; \
+ s:^->\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; \
+ s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \
+ s:->::; p;}"
+endef
+
+define gen_header_from_asm_offsets
+ (set -e; \
+ echo "#ifndef $1"; \
+ echo "#define $1"; \
+ echo "/*"; \
+ echo " * DO NOT MODIFY."; \
+ echo " *"; \
+ echo " * This file was generated by Kbuild"; \
+ echo " */"; \
+ echo ""; \
+ sed -ne $(sed-asm-offsets-to-c); \
+ echo ""; \
+ echo "#endif" )
+endef
diff -puN scripts/mod/Makefile~kbuild-consolidate-header-generation-from-asm-offset-information scripts/mod/Makefile
--- a/scripts/mod/Makefile~kbuild-consolidate-header-generation-from-asm-offset-information
+++ a/scripts/mod/Makefile
@@ -7,28 +7,11 @@ modpost-objs := modpost.o file2alias.o s
devicetable-offsets-file := devicetable-offsets.h
-define sed-y
- "/^->/{s:->#\(.*\):/* \1 */:; \
- s:^->\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; \
- s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \
- s:->::; p;}"
-endef
+include $(srctree)/scripts/Makefile.asm-offsets
quiet_cmd_offsets = GEN $@
define cmd_offsets
- (set -e; \
- echo "#ifndef __DEVICETABLE_OFFSETS_H__"; \
- echo "#define __DEVICETABLE_OFFSETS_H__"; \
- echo "/*"; \
- echo " * DO NOT MODIFY."; \
- echo " *"; \
- echo " * This file was generated by Kbuild"; \
- echo " *"; \
- echo " */"; \
- echo ""; \
- sed -ne $(sed-y) $<; \
- echo ""; \
- echo "#endif" ) > $@
+ $(call gen_header_from_asm_offsets,__DEVICETABLE_OFFSETS_H__) < $< > $@
endef
$(obj)/$(devicetable-offsets-file): $(obj)/devicetable-offsets.s
_
Patches currently in -mm which might be from mka@chromium.org are
kbuild-consolidate-header-generation-from-asm-offset-information.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-04-03 22:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-03 22:21 + kbuild-consolidate-header-generation-from-asm-offset-information.patch added to -mm tree akpm
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.