]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - arch/alpha/include/asm/a.out-core.h
Merge tag 'efi-urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi into...
[mirror_ubuntu-artful-kernel.git] / arch / alpha / include / asm / a.out-core.h
CommitLineData
7fa30315
DH
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_A_OUT_CORE_H
13#define _ASM_A_OUT_CORE_H
14
15#ifdef __KERNEL__
16
17#include <linux/user.h>
589ee628 18#include <linux/mm_types.h>
7fa30315
DH
19
20/*
21 * Fill in the user structure for an ECOFF core dump.
22 */
23static inline void aout_dump_thread(struct pt_regs *pt, struct user *dump)
24{
25 /* switch stack follows right below pt_regs: */
26 struct switch_stack * sw = ((struct switch_stack *) pt) - 1;
27
28 dump->magic = CMAGIC;
29 dump->start_code = current->mm->start_code;
30 dump->start_data = current->mm->start_data;
31 dump->start_stack = rdusp() & ~(PAGE_SIZE - 1);
32 dump->u_tsize = ((current->mm->end_code - dump->start_code)
33 >> PAGE_SHIFT);
34 dump->u_dsize = ((current->mm->brk + PAGE_SIZE-1 - dump->start_data)
35 >> PAGE_SHIFT);
36 dump->u_ssize = (current->mm->start_stack - dump->start_stack
37 + PAGE_SIZE-1) >> PAGE_SHIFT;
38
39 /*
40 * We store the registers in an order/format that is
41 * compatible with DEC Unix/OSF/1 as this makes life easier
42 * for gdb.
43 */
44 dump->regs[EF_V0] = pt->r0;
45 dump->regs[EF_T0] = pt->r1;
46 dump->regs[EF_T1] = pt->r2;
47 dump->regs[EF_T2] = pt->r3;
48 dump->regs[EF_T3] = pt->r4;
49 dump->regs[EF_T4] = pt->r5;
50 dump->regs[EF_T5] = pt->r6;
51 dump->regs[EF_T6] = pt->r7;
52 dump->regs[EF_T7] = pt->r8;
53 dump->regs[EF_S0] = sw->r9;
54 dump->regs[EF_S1] = sw->r10;
55 dump->regs[EF_S2] = sw->r11;
56 dump->regs[EF_S3] = sw->r12;
57 dump->regs[EF_S4] = sw->r13;
58 dump->regs[EF_S5] = sw->r14;
59 dump->regs[EF_S6] = sw->r15;
60 dump->regs[EF_A3] = pt->r19;
61 dump->regs[EF_A4] = pt->r20;
62 dump->regs[EF_A5] = pt->r21;
63 dump->regs[EF_T8] = pt->r22;
64 dump->regs[EF_T9] = pt->r23;
65 dump->regs[EF_T10] = pt->r24;
66 dump->regs[EF_T11] = pt->r25;
67 dump->regs[EF_RA] = pt->r26;
68 dump->regs[EF_T12] = pt->r27;
69 dump->regs[EF_AT] = pt->r28;
70 dump->regs[EF_SP] = rdusp();
71 dump->regs[EF_PS] = pt->ps;
72 dump->regs[EF_PC] = pt->pc;
73 dump->regs[EF_GP] = pt->gp;
74 dump->regs[EF_A0] = pt->r16;
75 dump->regs[EF_A1] = pt->r17;
76 dump->regs[EF_A2] = pt->r18;
77 memcpy((char *)dump->regs + EF_SIZE, sw->fp, 32 * 8);
78}
79
80#endif /* __KERNEL__ */
81#endif /* _ASM_A_OUT_CORE_H */