Commit 5b20cd80 authored by Mark Nelson's avatar Mark Nelson Committed by Linus Torvalds

x86: replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE #define

Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE in the coredump code which
allows for more flexibility in the note type for the state of 'extended
floating point' implementations in coredumps.  New note types can now be
added with an appropriate #define.

This does #define ELF_CORE_XFPREG_TYPE to be NT_PRXFPREG in all
current users so there's are no change in behaviour.

This will let us use different note types on powerpc for the Altivec/VMX
state that some PowerPC cpus have (G4, PPC970, POWER6) and for the SPE
(signal processing extension) state that some embedded PowerPC cpus from
Freescale have.
Signed-off-by: default avatarMark Nelson <markn@au1.ibm.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Andi Kleen <ak@suse.de>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent eead1911
...@@ -117,6 +117,7 @@ elf_core_copy_task_fpregs(struct task_struct *tsk, struct pt_regs *regs, elf_fpr ...@@ -117,6 +117,7 @@ elf_core_copy_task_fpregs(struct task_struct *tsk, struct pt_regs *regs, elf_fpr
} }
#define ELF_CORE_COPY_XFPREGS 1 #define ELF_CORE_COPY_XFPREGS 1
#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG
static inline int static inline int
elf_core_copy_task_xfpregs(struct task_struct *tsk, elf_fpxregset_t *xfpu) elf_core_copy_task_xfpregs(struct task_struct *tsk, elf_fpxregset_t *xfpu)
{ {
......
...@@ -188,6 +188,7 @@ elf_core_copy_task_fpregs(struct task_struct *tsk, struct pt_regs *regs, elf_fpr ...@@ -188,6 +188,7 @@ elf_core_copy_task_fpregs(struct task_struct *tsk, struct pt_regs *regs, elf_fpr
} }
#define ELF_CORE_COPY_XFPREGS 1 #define ELF_CORE_COPY_XFPREGS 1
#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG
static inline int static inline int
elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregset_t *xfpu) elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregset_t *xfpu)
{ {
......
...@@ -1411,7 +1411,7 @@ struct elf_thread_status ...@@ -1411,7 +1411,7 @@ struct elf_thread_status
elf_fpregset_t fpu; /* NT_PRFPREG */ elf_fpregset_t fpu; /* NT_PRFPREG */
struct task_struct *thread; struct task_struct *thread;
#ifdef ELF_CORE_COPY_XFPREGS #ifdef ELF_CORE_COPY_XFPREGS
elf_fpxregset_t xfpu; /* NT_PRXFPREG */ elf_fpxregset_t xfpu; /* ELF_CORE_XFPREG_TYPE */
#endif #endif
struct memelfnote notes[3]; struct memelfnote notes[3];
int num_notes; int num_notes;
...@@ -1446,8 +1446,8 @@ static int elf_dump_thread_status(long signr, struct elf_thread_status *t) ...@@ -1446,8 +1446,8 @@ static int elf_dump_thread_status(long signr, struct elf_thread_status *t)
#ifdef ELF_CORE_COPY_XFPREGS #ifdef ELF_CORE_COPY_XFPREGS
if (elf_core_copy_task_xfpregs(p, &t->xfpu)) { if (elf_core_copy_task_xfpregs(p, &t->xfpu)) {
fill_note(&t->notes[2], "LINUX", NT_PRXFPREG, sizeof(t->xfpu), fill_note(&t->notes[2], "LINUX", ELF_CORE_XFPREG_TYPE,
&t->xfpu); sizeof(t->xfpu), &t->xfpu);
t->num_notes++; t->num_notes++;
sz += notesize(&t->notes[2]); sz += notesize(&t->notes[2]);
} }
...@@ -1621,7 +1621,7 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file) ...@@ -1621,7 +1621,7 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file)
#ifdef ELF_CORE_COPY_XFPREGS #ifdef ELF_CORE_COPY_XFPREGS
if (elf_core_copy_task_xfpregs(current, xfpu)) if (elf_core_copy_task_xfpregs(current, xfpu))
fill_note(notes + numnote++, fill_note(notes + numnote++,
"LINUX", NT_PRXFPREG, sizeof(*xfpu), xfpu); "LINUX", ELF_CORE_XFPREG_TYPE, sizeof(*xfpu), xfpu);
#endif #endif
fs = get_fs(); fs = get_fs();
......
...@@ -1417,7 +1417,7 @@ struct elf_thread_status ...@@ -1417,7 +1417,7 @@ struct elf_thread_status
elf_fpregset_t fpu; /* NT_PRFPREG */ elf_fpregset_t fpu; /* NT_PRFPREG */
struct task_struct *thread; struct task_struct *thread;
#ifdef ELF_CORE_COPY_XFPREGS #ifdef ELF_CORE_COPY_XFPREGS
elf_fpxregset_t xfpu; /* NT_PRXFPREG */ elf_fpxregset_t xfpu; /* ELF_CORE_XFPREG_TYPE */
#endif #endif
struct memelfnote notes[3]; struct memelfnote notes[3];
int num_notes; int num_notes;
...@@ -1453,8 +1453,8 @@ static int elf_dump_thread_status(long signr, struct elf_thread_status *t) ...@@ -1453,8 +1453,8 @@ static int elf_dump_thread_status(long signr, struct elf_thread_status *t)
#ifdef ELF_CORE_COPY_XFPREGS #ifdef ELF_CORE_COPY_XFPREGS
if (elf_core_copy_task_xfpregs(p, &t->xfpu)) { if (elf_core_copy_task_xfpregs(p, &t->xfpu)) {
fill_note(&t->notes[2], "LINUX", NT_PRXFPREG, sizeof(t->xfpu), fill_note(&t->notes[2], "LINUX", ELF_CORE_XFPREG_TYPE,
&t->xfpu); sizeof(t->xfpu), &t->xfpu);
t->num_notes++; t->num_notes++;
sz += notesize(&t->notes[2]); sz += notesize(&t->notes[2]);
} }
...@@ -1690,7 +1690,7 @@ static int elf_fdpic_core_dump(long signr, struct pt_regs *regs, ...@@ -1690,7 +1690,7 @@ static int elf_fdpic_core_dump(long signr, struct pt_regs *regs,
#ifdef ELF_CORE_COPY_XFPREGS #ifdef ELF_CORE_COPY_XFPREGS
if (elf_core_copy_task_xfpregs(current, xfpu)) if (elf_core_copy_task_xfpregs(current, xfpu))
fill_note(notes + numnote++, fill_note(notes + numnote++,
"LINUX", NT_PRXFPREG, sizeof(*xfpu), xfpu); "LINUX", ELF_CORE_XFPREG_TYPE, sizeof(*xfpu), xfpu);
#endif #endif
fs = get_fs(); fs = get_fs();
......
...@@ -129,6 +129,7 @@ extern int dump_task_extended_fpu (struct task_struct *, struct user_fxsr_struct ...@@ -129,6 +129,7 @@ extern int dump_task_extended_fpu (struct task_struct *, struct user_fxsr_struct
#define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs) #define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs)
#define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs) #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs)
#define ELF_CORE_COPY_XFPREGS(tsk, elf_xfpregs) dump_task_extended_fpu(tsk, elf_xfpregs) #define ELF_CORE_COPY_XFPREGS(tsk, elf_xfpregs) dump_task_extended_fpu(tsk, elf_xfpregs)
#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG
#define VDSO_HIGH_BASE (__fix_to_virt(FIX_VDSO)) #define VDSO_HIGH_BASE (__fix_to_virt(FIX_VDSO))
#define VDSO_CURRENT_BASE ((unsigned long)current->mm->context.vdso) #define VDSO_CURRENT_BASE ((unsigned long)current->mm->context.vdso)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment