18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * arch/hexagon/include/asm/kgdb.h - Hexagon KGDB Support 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright (c) 2011, The Linux Foundation. All rights reserved. 68c2ecf20Sopenharmony_ci */ 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_ci#ifndef __HEXAGON_KGDB_H__ 98c2ecf20Sopenharmony_ci#define __HEXAGON_KGDB_H__ 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci#define BREAK_INSTR_SIZE 4 128c2ecf20Sopenharmony_ci#define CACHE_FLUSH_IS_SAFE 1 138c2ecf20Sopenharmony_ci#define BUFMAX ((NUMREGBYTES * 2) + 512) 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_cistatic inline void arch_kgdb_breakpoint(void) 168c2ecf20Sopenharmony_ci{ 178c2ecf20Sopenharmony_ci asm("trap0(#0xDB)"); 188c2ecf20Sopenharmony_ci} 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci/* Registers: 218c2ecf20Sopenharmony_ci * 32 gpr + sa0/1 + lc0/1 + m0/1 + gp + ugp + pred + pc = 42 total. 228c2ecf20Sopenharmony_ci * vm regs = psp+elr+est+badva = 4 238c2ecf20Sopenharmony_ci * syscall+restart = 2 more 248c2ecf20Sopenharmony_ci * also add cs0/1 = 2 258c2ecf20Sopenharmony_ci * so 48 = 42 + 4 + 2 + 2 268c2ecf20Sopenharmony_ci */ 278c2ecf20Sopenharmony_ci#define DBG_USER_REGS 42 288c2ecf20Sopenharmony_ci#define DBG_MAX_REG_NUM (DBG_USER_REGS + 8) 298c2ecf20Sopenharmony_ci#define NUMREGBYTES (DBG_MAX_REG_NUM*4) 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_ci#endif /* __HEXAGON_KGDB_H__ */ 32