blob: edd217006d270dc8ec112467d1d6fa048c8e0299 [file] [log] [blame]
Kumar Gala33d71d22007-08-20 08:50:28 -05001/*
Jason Wessel17ce4522008-07-23 11:30:15 -05002 * 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 (frowand@mvista.com)
7 * PPC Mods (C) 2004 Tom Rini (trini@mvista.com)
8 * PPC Mods (C) 2003 John Whitney (john.whitney@timesys.com)
Kumar Gala33d71d22007-08-20 08:50:28 -05009 * PPC Mods (C) 1998 Michael Tesch (tesch@cs.wisc.edu)
10 *
Jason Wessel17ce4522008-07-23 11:30:15 -050011 *
Kumar Gala33d71d22007-08-20 08:50:28 -050012 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
Jason Wessel17ce4522008-07-23 11:30:15 -050013 * Author: Tom Rini <trini@kernel.crashing.org>
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.
Kumar Gala33d71d22007-08-20 08:50:28 -050019 */
20#ifdef __KERNEL__
Jason Wessel17ce4522008-07-23 11:30:15 -050021#ifndef __POWERPC_KGDB_H__
22#define __POWERPC_KGDB_H__
Kumar Gala33d71d22007-08-20 08:50:28 -050023
24#ifndef __ASSEMBLY__
25
Jason Wessel17ce4522008-07-23 11:30:15 -050026#define BREAK_INSTR_SIZE 4
27#define BUFMAX ((NUMREGBYTES * 2) + 512)
28#define OUTBUFMAX ((NUMREGBYTES * 2) + 512)
29static inline void arch_kgdb_breakpoint(void)
30{
31 asm(".long 0x7d821008"); /* twge r2, r2 */
32}
33#define CACHE_FLUSH_IS_SAFE 1
Kumar Gala33d71d22007-08-20 08:50:28 -050034
Jason Wessel17ce4522008-07-23 11:30:15 -050035/* The number bytes of registers we have to save depends on a few
36 * things. For 64bit we default to not including vector registers and
37 * vector state registers. */
38#ifdef CONFIG_PPC64
Kumar Gala33d71d22007-08-20 08:50:28 -050039/*
Jason Wessel17ce4522008-07-23 11:30:15 -050040 * 64 bit (8 byte) registers:
41 * 32 gpr, 32 fpr, nip, msr, link, ctr
42 * 32 bit (4 byte) registers:
43 * ccr, xer, fpscr
Kumar Gala33d71d22007-08-20 08:50:28 -050044 */
Jason Wessel17ce4522008-07-23 11:30:15 -050045#define NUMREGBYTES ((68 * 8) + (3 * 4))
46#define NUMCRITREGBYTES 184
47#else /* CONFIG_PPC32 */
48/* On non-E500 family PPC32 we determine the size by picking the last
49 * register we need, but on E500 we skip sections so we list what we
50 * need to store, and add it up. */
51#ifndef CONFIG_E500
52#define MAXREG (PT_FPSCR+1)
53#else
54/* 32 GPRs (8 bytes), nip, msr, ccr, link, ctr, xer, acc (8 bytes), spefscr*/
55#define MAXREG ((32*2)+6+2+1)
56#endif
57#define NUMREGBYTES (MAXREG * sizeof(int))
58/* CR/LR, R1, R2, R13-R31 inclusive. */
59#define NUMCRITREGBYTES (23 * sizeof(int))
60#endif /* 32/64 */
Kumar Gala33d71d22007-08-20 08:50:28 -050061#endif /* !(__ASSEMBLY__) */
Jason Wessel17ce4522008-07-23 11:30:15 -050062#endif /* !__POWERPC_KGDB_H__ */
Kumar Gala33d71d22007-08-20 08:50:28 -050063#endif /* __KERNEL__ */