a.out-core.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. #ifndef _ASM_A_OUT_CORE_H
  12. #define _ASM_A_OUT_CORE_H
  13. #ifdef __KERNEL__
  14. #include <linux/user.h>
  15. #include <linux/elfcore.h>
  16. /*
  17. * fill in the user structure for an a.out core dump
  18. */
  19. static inline void aout_dump_thread(struct pt_regs *regs, struct user *dump)
  20. {
  21. struct task_struct *tsk = current;
  22. dump->magic = CMAGIC;
  23. dump->start_code = tsk->mm->start_code;
  24. dump->start_stack = regs->ARM_sp & ~(PAGE_SIZE - 1);
  25. dump->u_tsize = (tsk->mm->end_code - tsk->mm->start_code) >> PAGE_SHIFT;
  26. dump->u_dsize = (tsk->mm->brk - tsk->mm->start_data + PAGE_SIZE - 1) >> PAGE_SHIFT;
  27. dump->u_ssize = 0;
  28. dump->u_debugreg[0] = tsk->thread.debug.bp[0].address;
  29. dump->u_debugreg[1] = tsk->thread.debug.bp[1].address;
  30. dump->u_debugreg[2] = tsk->thread.debug.bp[0].insn.arm;
  31. dump->u_debugreg[3] = tsk->thread.debug.bp[1].insn.arm;
  32. dump->u_debugreg[4] = tsk->thread.debug.nsaved;
  33. if (dump->start_stack < 0x04000000)
  34. dump->u_ssize = (0x04000000 - dump->start_stack) >> PAGE_SHIFT;
  35. dump->regs = *regs;
  36. dump->u_fpvalid = dump_fpu (regs, &dump->u_fp);
  37. }
  38. #endif /* __KERNEL__ */
  39. #endif /* _ASM_A_OUT_CORE_H */