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

[Xen-changelog] [xen-unstable] [XEN] Consolidate multiple defintions of ELFNOTE_* accessor macros



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxxxxx>
# Date 1169480412 0
# Node ID d86a96ca47a307532c17deaa875f07eda81b2c3f
# Parent  de6c4f72b65bf0bb06adc458ae223285c92241d9
[XEN] Consolidate multiple defintions of ELFNOTE_* accessor macros

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxxxxx>
---
 xen/common/elf.c      |   10 ++--------
 xen/common/kexec.c    |    5 -----
 xen/include/xen/elf.h |    5 +++++
 3 files changed, 7 insertions(+), 13 deletions(-)

diff -r de6c4f72b65b -r d86a96ca47a3 xen/common/elf.c
--- a/xen/common/elf.c  Mon Jan 22 15:31:27 2007 +0000
+++ b/xen/common/elf.c  Mon Jan 22 15:40:12 2007 +0000
@@ -99,12 +99,6 @@ static unsigned long long xen_guest_nume
     return value;
 }
 
-/*
- * Interface to the Xen ELF notes.
- */
-#define ELFNOTE_NAME(_n_)   ((const char*)(_n_) + sizeof(*(_n_)))
-#define ELFNOTE_DESC(_n_)   (ELFNOTE_NAME(_n_) + (((_n_)->namesz+3)&~3))
-#define ELFNOTE_NEXT(_n_)   (ELFNOTE_DESC(_n_) + (((_n_)->descsz+3)&~3))
 
 static int is_xen_elfnote_section(const char *image, const Elf_Shdr *shdr)
 {
@@ -115,7 +109,7 @@ static int is_xen_elfnote_section(const 
 
     for ( note = (const Elf_Note *)(image + shdr->sh_offset);
           note < (const Elf_Note *)(image + shdr->sh_offset + shdr->sh_size);
-          note = (const Elf_Note *)ELFNOTE_NEXT(note) )
+          note = ELFNOTE_NEXT(note) )
     {
         if ( !strncmp(ELFNOTE_NAME(note), "Xen", 4) )
             return 1;
@@ -134,7 +128,7 @@ static const Elf_Note *xen_elfnote_looku
 
     for ( note = (const Elf_Note *)dsi->__elfnote_section;
           note < (const Elf_Note *)dsi->__elfnote_section_end;
-          note = (const Elf_Note *)ELFNOTE_NEXT(note) )
+          note = ELFNOTE_NEXT(note) )
     {
         if ( strncmp(ELFNOTE_NAME(note), "Xen", 4) )
             continue;
diff -r de6c4f72b65b -r d86a96ca47a3 xen/common/kexec.c
--- a/xen/common/kexec.c        Mon Jan 22 15:31:27 2007 +0000
+++ b/xen/common/kexec.c        Mon Jan 22 15:40:12 2007 +0000
@@ -26,11 +26,6 @@
 
 typedef long ret_t;
 
-#define ELFNOTE_ALIGN(_n_) (((_n_)+3)&~3)
-#define ELFNOTE_NAME(_n_) ((char*)(_n_) + sizeof(*(_n_)))
-#define ELFNOTE_DESC(_n_) (ELFNOTE_NAME(_n_) + ELFNOTE_ALIGN((_n_)->namesz))
-#define ELFNOTE_NEXT(_n_) ((Elf_Note *)(ELFNOTE_DESC(_n_) + 
ELFNOTE_ALIGN((_n_)->descsz)))
-
 static DEFINE_PER_CPU(void *, crash_notes);
 
 static Elf_Note *xen_crash_note;
diff -r de6c4f72b65b -r d86a96ca47a3 xen/include/xen/elf.h
--- a/xen/include/xen/elf.h     Mon Jan 22 15:31:27 2007 +0000
+++ b/xen/include/xen/elf.h     Mon Jan 22 15:40:12 2007 +0000
@@ -517,6 +517,11 @@ typedef struct {
 #define AuxInfo                Aux64Info
 #endif
 
+#define ELFNOTE_ALIGN(_n_) (((_n_)+3)&~3)
+#define ELFNOTE_NAME(_n_) ((char*)(_n_) + sizeof(*(_n_)))
+#define ELFNOTE_DESC(_n_) (ELFNOTE_NAME(_n_) + ELFNOTE_ALIGN((_n_)->namesz))
+#define ELFNOTE_NEXT(_n_) ((Elf_Note *)(ELFNOTE_DESC(_n_) + 
ELFNOTE_ALIGN((_n_)->descsz)))
+
 struct domain_setup_info;
 extern int loadelfimage(struct domain_setup_info *);
 extern int parseelfimage(struct domain_setup_info *);

_______________________________________________
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®.