Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[linux-btrfs-devel.git] / arch / arm / include / asm / a.out-core.h
blob92f10cb5c70cc81161f978642fdfdddebf9b1a15
1 /* a.out coredump register dumper
3 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
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.
12 #ifndef _ASM_A_OUT_CORE_H
13 #define _ASM_A_OUT_CORE_H
15 #ifdef __KERNEL__
17 #include <linux/user.h>
18 #include <linux/elfcore.h>
21 * fill in the user structure for an a.out core dump
23 static inline void aout_dump_thread(struct pt_regs *regs, struct user *dump)
25 struct task_struct *tsk = current;
27 dump->magic = CMAGIC;
28 dump->start_code = tsk->mm->start_code;
29 dump->start_stack = regs->ARM_sp & ~(PAGE_SIZE - 1);
31 dump->u_tsize = (tsk->mm->end_code - tsk->mm->start_code) >> PAGE_SHIFT;
32 dump->u_dsize = (tsk->mm->brk - tsk->mm->start_data + PAGE_SIZE - 1) >> PAGE_SHIFT;
33 dump->u_ssize = 0;
35 memset(dump->u_debugreg, 0, sizeof(dump->u_debugreg));
37 if (dump->start_stack < 0x04000000)
38 dump->u_ssize = (0x04000000 - dump->start_stack) >> PAGE_SHIFT;
40 dump->regs = *regs;
41 dump->u_fpvalid = dump_fpu (regs, &dump->u_fp);
44 #endif /* __KERNEL__ */
45 #endif /* _ASM_A_OUT_CORE_H */