aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@xensource.com>2007-01-22 15:29:04 +0000
committerIan Campbell <ian.campbell@xensource.com>2007-01-22 15:29:04 +0000
commit6e9515dab3ca7b9312cd229ea0b4e86622d792e2 (patch)
tree4333708a22569a16071ca4d90dd1eca9673f29e5 /xen/common
parentf4e8a7e419d9616e8f45affb694eb83168fe25bc (diff)
downloadxen-6e9515dab3ca7b9312cd229ea0b4e86622d792e2.tar.gz
xen-6e9515dab3ca7b9312cd229ea0b4e86622d792e2.tar.bz2
xen-6e9515dab3ca7b9312cd229ea0b4e86622d792e2.zip
[XEN] Avoid void* arithmetic in kexec ELF note manipulations.
From: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
Diffstat (limited to 'xen/common')
-rw-r--r--xen/common/kexec.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index e0708ac7c9..c165745891 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -27,9 +27,9 @@
typedef long ret_t;
#define ELFNOTE_ALIGN(_n_) (((_n_)+3)&~3)
-#define ELFNOTE_NAME(_n_) ((void*)(_n_) + sizeof(*(_n_)))
+#define ELFNOTE_NAME(_n_) ((char*)(_n_) + sizeof(*(_n_)))
#define ELFNOTE_DESC(_n_) (ELFNOTE_NAME(_n_) + ELFNOTE_ALIGN((_n_)->namesz))
-#define ELFNOTE_NEXT(_n_) (ELFNOTE_DESC(_n_) + ELFNOTE_ALIGN((_n_)->descsz))
+#define ELFNOTE_NEXT(_n_) ((Elf_Note *)(ELFNOTE_DESC(_n_) + ELFNOTE_ALIGN((_n_)->descsz)))
static DEFINE_PER_CPU(void *, crash_notes);
@@ -75,10 +75,10 @@ void kexec_crash_save_cpu(void)
if ( cpu_test_and_set(cpu, crash_saved_cpus) )
return;
- prstatus = ELFNOTE_DESC(note);
+ prstatus = (ELF_Prstatus *)ELFNOTE_DESC(note);
note = ELFNOTE_NEXT(note);
- xencore = ELFNOTE_DESC(note);
+ xencore = (crash_xen_core_t *)ELFNOTE_DESC(note);
elf_core_save_regs(&prstatus->pr_reg, xencore);
}
@@ -87,7 +87,7 @@ void kexec_crash_save_cpu(void)
crash_xen_info_t *kexec_crash_save_info(void)
{
int cpu = smp_processor_id();
- crash_xen_info_t *info = ELFNOTE_DESC(xen_crash_note);
+ crash_xen_info_t *info = (crash_xen_info_t *)ELFNOTE_DESC(xen_crash_note);
BUG_ON(!cpu_test_and_set(cpu, crash_saved_cpus));