[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [RFC XEN PATCH 08/23] xen, Kbuild: Change filechk_offsets


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Wed, 23 Oct 2019 17:48:22 +0100
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@xxxxxxxxxx; spf=Pass smtp.mailfrom=anthony.perard@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Delivery-date: Wed, 23 Oct 2019 16:48:58 +0000
  • Ironport-sdr: D4hiskaVKU5bP9gLi3odpCa4mRDJUQhKZcyQbOMmbbFW5gSm++iSLlQ+YrZ9OHZ/nNl3GkO/W1 25o2GVX7q+KVd8K4v23rW8OFdkRa559kDyIje4nIgRp0LlB4EztiXRfR2RPFS6J8KNVDYONr4a SO5wHKHkf+4itmWEZMz8JLlpEyOeudIhQEfEMEleKWiR4zUViRJ6MbdOcds7zdJ/HxpPWp7jLB 5TVmvPPG7iZaylRPvi3LlOjbJZR6Kz4cnj7z21njn8Za2f5sbAwJQTUbS/hQsJEMkF6N7Pd+dS ck4=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

This functions will be use later to generate asm-offsets.h.

Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
---
 xen/scripts/Makefile.lib | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/xen/scripts/Makefile.lib b/xen/scripts/Makefile.lib
index e022f053494e..19641e836dc3 100644
--- a/xen/scripts/Makefile.lib
+++ b/xen/scripts/Makefile.lib
@@ -413,29 +413,26 @@ quiet_cmd_xzmisc = XZMISC  $@
 # ASM offsets
 # ---------------------------------------------------------------------------
 
-# Default sed regexp - multiline due to syntax constraints
+# Default sed regexp
 #
-# Use [:space:] because LLVM's integrated assembler inserts <tab> around
-# the .ascii directive whereas GCC keeps the <space> as-is.
 define sed-offsets
-       's:^[[:space:]]*\.ascii[[:space:]]*"\(.*\)".*:\1:; \
-       /^->/{s:->#\(.*\):/* \1 */:; \
-       s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \
-       s:->::; p;}'
+       '/^[^#].*==>/{s:.*==>(.*)<==.*:\1:; s: [\$$#]: :; p;}'
 endef
 
 # Use filechk to avoid rebuilds when a header changes, but the resulting file
 # does not
 define filechk_offsets
-        echo "#ifndef $2"; \
-        echo "#define $2"; \
         echo "/*"; \
         echo " * DO NOT MODIFY."; \
         echo " *"; \
-        echo " * This file was generated by Kbuild"; \
+        echo " * This file was auto-generated from $<"; \
+        echo " *"; \
         echo " */"; \
         echo ""; \
-        sed -ne $(sed-offsets) < $<; \
+        echo "#ifndef $2"; \
+        echo "#define $2"; \
+        echo ""; \
+        sed -rne $(sed-offsets) < $<; \
         echo ""; \
         echo "#endif"
 endef
-- 
Anthony PERARD

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.