]>
git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blob - include/asm-sparc/kgdb.h
1 /* $Id: kgdb.h,v 1.8 1998/01/07 06:33:44 baccala Exp $
2 * kgdb.h: Defines and declarations for serial line source level
3 * remote debugging of the Linux kernel using gdb.
5 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
11 /* To init the kgdb engine. */
12 extern void set_debug_traps(void);
14 /* To enter the debugger explicitly. */
15 extern void breakpoint(void);
17 /* For convenience we define the format of a kgdb trap breakpoint
21 unsigned long globals
[8];
22 unsigned long outs
[8];
23 unsigned long locals
[8];
25 unsigned long fpregs
[32];
35 #endif /* !(__ASSEMBLY__) */
37 /* Macros for assembly usage of the kgdb breakpoint frame. */
48 #define KGDB_PSR 0x104
49 #define KGDB_WIM 0x108
50 #define KGDB_TBR 0x10c
52 #define KGDB_NPC 0x114
54 #define SAVE_KGDB_GLOBALS(reg) \
55 std %g0, [%reg + STACKFRAME_SZ + KGDB_G0]; \
56 std %g2, [%reg + STACKFRAME_SZ + KGDB_G2]; \
57 std %g4, [%reg + STACKFRAME_SZ + KGDB_G4]; \
58 std %g6, [%reg + STACKFRAME_SZ + KGDB_G6];
60 #define SAVE_KGDB_INS(reg) \
61 std %i0, [%reg + STACKFRAME_SZ + KGDB_I0]; \
62 std %i2, [%reg + STACKFRAME_SZ + KGDB_I2]; \
63 std %i4, [%reg + STACKFRAME_SZ + KGDB_I4]; \
64 std %i6, [%reg + STACKFRAME_SZ + KGDB_I6];
66 #define SAVE_KGDB_SREGS(reg, reg_y, reg_psr, reg_wim, reg_tbr, reg_pc, reg_npc) \
67 st %reg_y, [%reg + STACKFRAME_SZ + KGDB_Y]; \
68 st %reg_psr, [%reg + STACKFRAME_SZ + KGDB_PSR]; \
69 st %reg_wim, [%reg + STACKFRAME_SZ + KGDB_WIM]; \
70 st %reg_tbr, [%reg + STACKFRAME_SZ + KGDB_TBR]; \
71 st %reg_pc, [%reg + STACKFRAME_SZ + KGDB_PC]; \
72 st %reg_npc, [%reg + STACKFRAME_SZ + KGDB_NPC];
74 #define LOAD_KGDB_GLOBALS(reg) \
75 ld [%reg + STACKFRAME_SZ + KGDB_G1], %g1; \
76 ldd [%reg + STACKFRAME_SZ + KGDB_G2], %g2; \
77 ldd [%reg + STACKFRAME_SZ + KGDB_G4], %g4; \
78 ldd [%reg + STACKFRAME_SZ + KGDB_G6], %g6;
80 #define LOAD_KGDB_INS(reg) \
81 ldd [%reg + STACKFRAME_SZ + KGDB_I0], %i0; \
82 ldd [%reg + STACKFRAME_SZ + KGDB_I2], %i2; \
83 ldd [%reg + STACKFRAME_SZ + KGDB_I4], %i4; \
84 ldd [%reg + STACKFRAME_SZ + KGDB_I6], %i6;
86 #define LOAD_KGDB_SREGS(reg, reg_y, reg_psr, reg_wim, reg_tbr, reg_pc, reg_npc) \
87 ld [%reg + STACKFRAME_SZ + KGDB_Y], %reg_y; \
88 ld [%reg + STACKFRAME_SZ + KGDB_PSR], %reg_psr; \
89 ld [%reg + STACKFRAME_SZ + KGDB_WIM], %reg_wim; \
90 ld [%reg + STACKFRAME_SZ + KGDB_TBR], %reg_tbr; \
91 ld [%reg + STACKFRAME_SZ + KGDB_PC], %reg_pc; \
92 ld [%reg + STACKFRAME_SZ + KGDB_NPC], %reg_npc;
94 #endif /* !(_SPARC_KGDB_H) */