kgdb.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * The PowerPC (32/64) specific defines / externs for KGDB. Based on
  3. * the previous 32bit and 64bit specific files, which had the following
  4. * copyrights:
  5. *
  6. * PPC64 Mods (C) 2005 Frank Rowand ([email protected])
  7. * PPC Mods (C) 2004 Tom Rini ([email protected])
  8. * PPC Mods (C) 2003 John Whitney ([email protected])
  9. * PPC Mods (C) 1998 Michael Tesch ([email protected])
  10. *
  11. *
  12. * Copyright (C) 1995 David S. Miller ([email protected])
  13. * Author: Tom Rini <[email protected]>
  14. *
  15. * 2006 (c) MontaVista Software, Inc. This file is licensed under
  16. * the terms of the GNU General Public License version 2. This program
  17. * is licensed "as is" without any warranty of any kind, whether express
  18. * or implied.
  19. */
  20. #ifdef __KERNEL__
  21. #ifndef __POWERPC_KGDB_H__
  22. #define __POWERPC_KGDB_H__
  23. #ifndef __ASSEMBLY__
  24. #define BREAK_INSTR_SIZE 4
  25. #define BUFMAX ((NUMREGBYTES * 2) + 512)
  26. #define OUTBUFMAX ((NUMREGBYTES * 2) + 512)
  27. #define BREAK_INSTR 0x7d821008 /* twge r2, r2 */
  28. static inline void arch_kgdb_breakpoint(void)
  29. {
  30. asm(stringify_in_c(.long BREAK_INSTR));
  31. }
  32. #define CACHE_FLUSH_IS_SAFE 1
  33. #define DBG_MAX_REG_NUM 70
  34. /* The number bytes of registers we have to save depends on a few
  35. * things. For 64bit we default to not including vector registers and
  36. * vector state registers. */
  37. #ifdef CONFIG_PPC64
  38. /*
  39. * 64 bit (8 byte) registers:
  40. * 32 gpr, 32 fpr, nip, msr, link, ctr
  41. * 32 bit (4 byte) registers:
  42. * ccr, xer, fpscr
  43. */
  44. #define NUMREGBYTES ((68 * 8) + (3 * 4))
  45. #define NUMCRITREGBYTES 184
  46. #else /* CONFIG_PPC32 */
  47. /* On non-E500 family PPC32 we determine the size by picking the last
  48. * register we need, but on E500 we skip sections so we list what we
  49. * need to store, and add it up. */
  50. #ifndef CONFIG_PPC_E500
  51. #define MAXREG (PT_FPSCR+1)
  52. #else
  53. /* 32 GPRs (8 bytes), nip, msr, ccr, link, ctr, xer, acc (8 bytes), spefscr*/
  54. #define MAXREG ((32*2)+6+2+1)
  55. #endif
  56. #define NUMREGBYTES (MAXREG * sizeof(int))
  57. /* CR/LR, R1, R2, R13-R31 inclusive. */
  58. #define NUMCRITREGBYTES (23 * sizeof(int))
  59. #endif /* 32/64 */
  60. #endif /* !(__ASSEMBLY__) */
  61. #endif /* !__POWERPC_KGDB_H__ */
  62. #endif /* __KERNEL__ */