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