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

[Xen-changelog] [linux-2.6.18-xen] Imported patch x86-elfnote-as-preprocessor-macro.patch from xen-unstable.hg 15200:bd3d6b4c52ec



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxxxxx>
# Date 1180947924 -3600
# Node ID 3bf38ecef9001bf40ee6a43c4dbe4b463ed087f7
# Parent  50af4d15dfea05a3bcbec7bf77ad407663f69a48
Imported patch x86-elfnote-as-preprocessor-macro.patch from xen-unstable.hg 
15200:bd3d6b4c52ec
---
 include/linux/elfnote.h |   44 ++++++++++++++++++++++++++++++--------------
 1 files changed, 30 insertions(+), 14 deletions(-)

diff -r 50af4d15dfea -r 3bf38ecef900 include/linux/elfnote.h
--- a/include/linux/elfnote.h   Mon Jun 04 10:05:24 2007 +0100
+++ b/include/linux/elfnote.h   Mon Jun 04 10:05:24 2007 +0100
@@ -31,22 +31,38 @@
 /*
  * Generate a structure with the same shape as Elf{32,64}_Nhdr (which
  * turn out to be the same size and shape), followed by the name and
- * desc data with appropriate padding.  The 'desc' argument includes
- * the assembler pseudo op defining the type of the data: .asciz
- * "hello, world"
+ * desc data with appropriate padding.  The 'desctype' argument is the
+ * assembler pseudo op defining the type of the data e.g. .asciz while
+ * 'descdata' is the data itself e.g.  "hello, world".
+ *
+ * e.g. ELFNOTE(XYZCo, 42, .asciz, "forty-two")
+ *      ELFNOTE(XYZCo, 12, .long, 0xdeadbeef)
  */
-.macro ELFNOTE name type desc:vararg
-.pushsection ".note.\name"
-  .align 4
-  .long 2f - 1f                        /* namesz */
-  .long 4f - 3f                        /* descsz */
-  .long \type
-1:.asciz "\name"
-2:.align 4
-3:\desc
-4:.align 4
+#ifdef __STDC__
+#define ELFNOTE(name, type, desctype, descdata...) \
+.pushsection .note.name                        ;       \
+  .align 4                             ;       \
+  .long 2f - 1f                /* namesz */    ;       \
+  .long 4f - 3f                /* descsz */    ;       \
+  .long type                           ;       \
+1:.asciz #name                         ;       \
+2:.align 4                             ;       \
+3:desctype descdata                    ;       \
+4:.align 4                             ;       \
 .popsection
-.endm
+#else /* !__STDC__, i.e. -traditional */
+#define ELFNOTE(name, type, desctype, descdata) \
+.pushsection .note.name                        ;       \
+  .align 4                             ;       \
+  .long 2f - 1f                /* namesz */    ;       \
+  .long 4f - 3f                /* descsz */    ;       \
+  .long type                           ;       \
+1:.asciz "name"                                ;       \
+2:.align 4                             ;       \
+3:desctype descdata                    ;       \
+4:.align 4                             ;       \
+.popsection
+#endif /* __STDC__ */
 #else  /* !__ASSEMBLER__ */
 #include <linux/elf.h>
 /*

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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