aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/xen/elfcore.h
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@xensource.com>2007-01-09 17:15:28 +0000
committerIan Campbell <ian.campbell@xensource.com>2007-01-09 17:15:28 +0000
commit123e738ef2e8111fdb21972766f9f209ef21cf46 (patch)
tree089690954ec491f7729fc3717e8250777575c626 /xen/include/xen/elfcore.h
parentb0a47bd080d9c9d78cbc054d04db609d0d085d2d (diff)
downloadxen-123e738ef2e8111fdb21972766f9f209ef21cf46.tar.gz
xen-123e738ef2e8111fdb21972766f9f209ef21cf46.tar.bz2
xen-123e738ef2e8111fdb21972766f9f209ef21cf46.zip
[XEN] Kexec: Clean up ELF note construction to avoid multiply nested
struct/unions and the packed keyword. Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
Diffstat (limited to 'xen/include/xen/elfcore.h')
-rw-r--r--xen/include/xen/elfcore.h57
1 files changed, 0 insertions, 57 deletions
diff --git a/xen/include/xen/elfcore.h b/xen/include/xen/elfcore.h
index 75ce7c49ef..fbe8ed1a6a 100644
--- a/xen/include/xen/elfcore.h
+++ b/xen/include/xen/elfcore.h
@@ -56,49 +56,6 @@ typedef struct
int pr_fpvalid; /* True if math co-processor being used. */
} ELF_Prstatus;
-/*
- * The following data structures provide 64-bit ELF notes. In theory it should
- * be possible to support both 64-bit and 32-bit ELF files, but to keep it
- * simple we only do 64-bit.
- *
- * Please note that the current code aligns the 64-bit notes in the same
- * way as Linux does. We are not following the 64-bit ELF spec, no one does.
- *
- * We are avoiding two problems by restricting us to 64-bit notes only:
- * - Alignment of notes change with the word size. Ick.
- * - We would need to tell kexec-tools which format we are using in the
- * hypervisor to make sure the right ELF format is generated.
- * That requires infrastructure. Let's not.
- */
-
-#define NOTE_ALIGN(x, n) ((x + ((1 << n) - 1)) / (1 << n))
-#define PAD32(x) u32 pad_data[NOTE_ALIGN(x, 2)]
-
-#define TYPEDEF_NOTE(type, strlen, desctype) \
- typedef struct { \
- union { \
- struct { \
- Elf_Note note; \
- unsigned char name[strlen]; \
- } note; \
- PAD32(sizeof(Elf_Note) + strlen); \
- } note; \
- union { \
- desctype desc; \
- PAD32(sizeof(desctype)); \
- } desc; \
- } __attribute__ ((packed)) type
-
-#define CORE_STR "CORE"
-#define CORE_STR_LEN 5 /* including terminating zero */
-
-TYPEDEF_NOTE(crash_note_core_t, CORE_STR_LEN, ELF_Prstatus);
-
-#define XEN_STR "Xen"
-#define XEN_STR_LEN 4 /* including terminating zero */
-
-TYPEDEF_NOTE(crash_note_xen_core_t, XEN_STR_LEN, crash_xen_core_t);
-
typedef struct {
unsigned long xen_major_version;
unsigned long xen_minor_version;
@@ -113,20 +70,6 @@ typedef struct {
#endif
} crash_xen_info_t;
-TYPEDEF_NOTE(crash_note_xen_info_t, XEN_STR_LEN, crash_xen_info_t);
-
-typedef struct {
- crash_note_core_t core;
- crash_note_xen_core_t xen_regs;
- crash_note_xen_info_t xen_info;
-} __attribute__ ((packed)) crash_note_t;
-
-#define setup_crash_note(np, member, str, str_len, id) \
- np->member.note.note.note.namesz = str_len; \
- np->member.note.note.note.descsz = sizeof(np->member.desc.desc); \
- np->member.note.note.note.type = id; \
- memcpy(np->member.note.note.name, str, str_len)
-
#endif /* __ELFCOREC_H__ */
/*