Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
a.out-core.h
Go to the documentation of this file.
1 /* a.out coredump register dumper
2  *
3  * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
4  * Written by David Howells ([email protected])
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>
18 #include <linux/elfcore.h>
19 
20 /*
21  * fill in the user structure for an a.out core dump
22  */
23 static inline void aout_dump_thread(struct pt_regs *regs, struct user *dump)
24 {
25  struct task_struct *tsk = current;
26 
27  dump->magic = CMAGIC;
28  dump->start_code = tsk->mm->start_code;
29  dump->start_stack = regs->ARM_sp & ~(PAGE_SIZE - 1);
30 
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;
34 
35  memset(dump->u_debugreg, 0, sizeof(dump->u_debugreg));
36 
37  if (dump->start_stack < 0x04000000)
38  dump->u_ssize = (0x04000000 - dump->start_stack) >> PAGE_SHIFT;
39 
40  dump->regs = *regs;
41  dump->u_fpvalid = dump_fpu (regs, &dump->u_fp);
42 }
43 
44 #endif /* __KERNEL__ */
45 #endif /* _ASM_A_OUT_CORE_H */