Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * kgdb support for ARC
0004  *
0005  * Copyright (C) 2012 Synopsys, Inc. (www.synopsys.com)
0006  */
0007 
0008 #ifndef __ARC_KGDB_H__
0009 #define __ARC_KGDB_H__
0010 
0011 #ifdef CONFIG_KGDB
0012 
0013 #include <asm/ptrace.h>
0014 
0015 /* to ensure compatibility with Linux 2.6.35, we don't implement the get/set
0016  * register API yet */
0017 #undef DBG_MAX_REG_NUM
0018 
0019 #define GDB_MAX_REGS        87
0020 
0021 #define BREAK_INSTR_SIZE    2
0022 #define CACHE_FLUSH_IS_SAFE 1
0023 #define NUMREGBYTES     (GDB_MAX_REGS * 4)
0024 #define BUFMAX          2048
0025 
0026 static inline void arch_kgdb_breakpoint(void)
0027 {
0028     __asm__ __volatile__ ("trap_s   0x4\n");
0029 }
0030 
0031 extern void kgdb_trap(struct pt_regs *regs);
0032 
0033 /* This is the numbering of registers according to the GDB. See GDB's
0034  * arc-tdep.h for details.
0035  *
0036  * Registers are ordered for GDB 7.5. It is incompatible with GDB 6.8. */
0037 enum arc_linux_regnums {
0038     _R0     = 0,
0039     _R1, _R2, _R3, _R4, _R5, _R6, _R7, _R8, _R9, _R10, _R11, _R12, _R13,
0040     _R14, _R15, _R16, _R17, _R18, _R19, _R20, _R21, _R22, _R23, _R24,
0041     _R25, _R26,
0042     _FP     = 27,
0043     __SP        = 28,
0044     _R30        = 30,
0045     _BLINK      = 31,
0046     _LP_COUNT   = 60,
0047     _STOP_PC    = 64,
0048     _RET        = 64,
0049     _LP_START   = 65,
0050     _LP_END     = 66,
0051     _STATUS32   = 67,
0052     _ECR        = 76,
0053     _BTA        = 82,
0054 };
0055 
0056 #else
0057 #define kgdb_trap(regs)
0058 #endif
0059 
0060 #endif  /* __ARC_KGDB_H__ */