aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@xensource.com>2007-01-22 15:40:12 +0000
committerIan Campbell <ian.campbell@xensource.com>2007-01-22 15:40:12 +0000
commitd50b445579462c9953d9352d3e0e000568e1171d (patch)
tree8ac793b20edfa5490e6f9df79832884ee86799c8 /xen/common
parent2bdecd53829f618ae71e2f67e5cd1c122643eb8e (diff)
downloadxen-d50b445579462c9953d9352d3e0e000568e1171d.tar.gz
xen-d50b445579462c9953d9352d3e0e000568e1171d.tar.bz2
xen-d50b445579462c9953d9352d3e0e000568e1171d.zip
[XEN] Consolidate multiple defintions of ELFNOTE_* accessor macros
Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
Diffstat (limited to 'xen/common')
-rw-r--r--xen/common/elf.c10
-rw-r--r--xen/common/kexec.c5
2 files changed, 2 insertions, 13 deletions
diff --git a/xen/common/elf.c b/xen/common/elf.c
index 877c704201..355aecf64e 100644
--- a/xen/common/elf.c
+++ b/xen/common/elf.c
@@ -99,12 +99,6 @@ static unsigned long long xen_guest_numeric(struct domain_setup_info *dsi,
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 char *image, const Elf_Shdr *shdr)
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_lookup(
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 --git a/xen/common/kexec.c b/xen/common/kexec.c
index c165745891..5727cdcaa8 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -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;