diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-10-28 11:54:49 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-28 11:54:49 -0400 |
commit | d1a76187a5be4f89c6cb19d800cb5fb7aac735c5 (patch) | |
tree | 2fac3ffbfffc7560eeef8364b541d0d7a0057920 /arch/x86/include/asm/a.out-core.h | |
parent | c7e78cff6b7518212247fb20b1dc6411540dc9af (diff) | |
parent | 0173a3265b228da319ceb9c1ec6a5682fd1b2d92 (diff) |
Merge commit 'v2.6.28-rc2' into core/locking
Conflicts:
arch/um/include/asm/system.h
Diffstat (limited to 'arch/x86/include/asm/a.out-core.h')
-rw-r--r-- | arch/x86/include/asm/a.out-core.h | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/arch/x86/include/asm/a.out-core.h b/arch/x86/include/asm/a.out-core.h new file mode 100644 index 000000000000..37822206083e --- /dev/null +++ b/arch/x86/include/asm/a.out-core.h | |||
@@ -0,0 +1,73 @@ | |||
1 | /* a.out coredump register dumper | ||
2 | * | ||
3 | * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. | ||
4 | * Written by David Howells (dhowells@redhat.com) | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public Licence | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the Licence, or (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #ifndef _ASM_X86_A_OUT_CORE_H | ||
13 | #define _ASM_X86_A_OUT_CORE_H | ||
14 | |||
15 | #ifdef __KERNEL__ | ||
16 | #ifdef CONFIG_X86_32 | ||
17 | |||
18 | #include <linux/user.h> | ||
19 | #include <linux/elfcore.h> | ||
20 | |||
21 | /* | ||
22 | * fill in the user structure for an a.out core dump | ||
23 | */ | ||
24 | static inline void aout_dump_thread(struct pt_regs *regs, struct user *dump) | ||
25 | { | ||
26 | u16 gs; | ||
27 | |||
28 | /* changed the size calculations - should hopefully work better. lbt */ | ||
29 | dump->magic = CMAGIC; | ||
30 | dump->start_code = 0; | ||
31 | dump->start_stack = regs->sp & ~(PAGE_SIZE - 1); | ||
32 | dump->u_tsize = ((unsigned long)current->mm->end_code) >> PAGE_SHIFT; | ||
33 | dump->u_dsize = ((unsigned long)(current->mm->brk + (PAGE_SIZE - 1))) | ||
34 | >> PAGE_SHIFT; | ||
35 | dump->u_dsize -= dump->u_tsize; | ||
36 | dump->u_ssize = 0; | ||
37 | dump->u_debugreg[0] = current->thread.debugreg0; | ||
38 | dump->u_debugreg[1] = current->thread.debugreg1; | ||
39 | dump->u_debugreg[2] = current->thread.debugreg2; | ||
40 | dump->u_debugreg[3] = current->thread.debugreg3; | ||
41 | dump->u_debugreg[4] = 0; | ||
42 | dump->u_debugreg[5] = 0; | ||
43 | dump->u_debugreg[6] = current->thread.debugreg6; | ||
44 | dump->u_debugreg[7] = current->thread.debugreg7; | ||
45 | |||
46 | if (dump->start_stack < TASK_SIZE) | ||
47 | dump->u_ssize = ((unsigned long)(TASK_SIZE - dump->start_stack)) | ||
48 | >> PAGE_SHIFT; | ||
49 | |||
50 | dump->regs.bx = regs->bx; | ||
51 | dump->regs.cx = regs->cx; | ||
52 | dump->regs.dx = regs->dx; | ||
53 | dump->regs.si = regs->si; | ||
54 | dump->regs.di = regs->di; | ||
55 | dump->regs.bp = regs->bp; | ||
56 | dump->regs.ax = regs->ax; | ||
57 | dump->regs.ds = (u16)regs->ds; | ||
58 | dump->regs.es = (u16)regs->es; | ||
59 | dump->regs.fs = (u16)regs->fs; | ||
60 | savesegment(gs, gs); | ||
61 | dump->regs.orig_ax = regs->orig_ax; | ||
62 | dump->regs.ip = regs->ip; | ||
63 | dump->regs.cs = (u16)regs->cs; | ||
64 | dump->regs.flags = regs->flags; | ||
65 | dump->regs.sp = regs->sp; | ||
66 | dump->regs.ss = (u16)regs->ss; | ||
67 | |||
68 | dump->u_fpvalid = dump_fpu(regs, &dump->i387); | ||
69 | } | ||
70 | |||
71 | #endif /* CONFIG_X86_32 */ | ||
72 | #endif /* __KERNEL__ */ | ||
73 | #endif /* _ASM_X86_A_OUT_CORE_H */ | ||