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