Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* gdb-stub.h: FRV GDB stub |
| 2 | * |
| 3 | * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. |
| 4 | * Written by David Howells (dhowells@redhat.com) |
| 5 | * - Derived from asm-mips/gdb-stub.h (c) 1995 Andreas Busse |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU General Public License |
| 9 | * as published by the Free Software Foundation; either version |
| 10 | * 2 of the License, or (at your option) any later version. |
| 11 | */ |
| 12 | #ifndef __ASM_GDB_STUB_H |
| 13 | #define __ASM_GDB_STUB_H |
| 14 | |
| 15 | #undef GDBSTUB_DEBUG_PROTOCOL |
| 16 | |
| 17 | #include <asm/ptrace.h> |
| 18 | |
| 19 | /* |
| 20 | * important register numbers in GDB protocol |
| 21 | * - GR0, GR1, GR2, GR3, GR4, GR5, GR6, GR7, |
| 22 | * - GR8, GR9, GR10, GR11, GR12, GR13, GR14, GR15, |
| 23 | * - GR16, GR17, GR18, GR19, GR20, GR21, GR22, GR23, |
| 24 | * - GR24, GR25, GR26, GR27, GR28, GR29, GR30, GR31, |
| 25 | * - GR32, GR33, GR34, GR35, GR36, GR37, GR38, GR39, |
| 26 | * - GR40, GR41, GR42, GR43, GR44, GR45, GR46, GR47, |
| 27 | * - GR48, GR49, GR50, GR51, GR52, GR53, GR54, GR55, |
| 28 | * - GR56, GR57, GR58, GR59, GR60, GR61, GR62, GR63, |
| 29 | * - FR0, FR1, FR2, FR3, FR4, FR5, FR6, FR7, |
| 30 | * - FR8, FR9, FR10, FR11, FR12, FR13, FR14, FR15, |
| 31 | * - FR16, FR17, FR18, FR19, FR20, FR21, FR22, FR23, |
| 32 | * - FR24, FR25, FR26, FR27, FR28, FR29, FR30, FR31, |
| 33 | * - FR32, FR33, FR34, FR35, FR36, FR37, FR38, FR39, |
| 34 | * - FR40, FR41, FR42, FR43, FR44, FR45, FR46, FR47, |
| 35 | * - FR48, FR49, FR50, FR51, FR52, FR53, FR54, FR55, |
| 36 | * - FR56, FR57, FR58, FR59, FR60, FR61, FR62, FR63, |
| 37 | * - PC, PSR, CCR, CCCR, |
| 38 | * - _X132, _X133, _X134 |
| 39 | * - TBR, BRR, DBAR0, DBAR1, DBAR2, DBAR3, |
| 40 | * - SCR0, SCR1, SCR2, SCR3, |
| 41 | * - LR, LCR, |
| 42 | * - IACC0H, IACC0L, |
| 43 | * - FSR0, |
| 44 | * - ACC0, ACC1, ACC2, ACC3, ACC4, ACC5, ACC6, ACC7, |
| 45 | * - ACCG0123, ACCG4567, |
| 46 | * - MSR0, MSR1, |
| 47 | * - GNER0, GNER1, |
| 48 | * - FNER0, FNER1, |
| 49 | */ |
| 50 | #define GDB_REG_GR(N) (N) |
| 51 | #define GDB_REG_FR(N) (64+(N)) |
| 52 | #define GDB_REG_PC 128 |
| 53 | #define GDB_REG_PSR 129 |
| 54 | #define GDB_REG_CCR 130 |
| 55 | #define GDB_REG_CCCR 131 |
| 56 | #define GDB_REG_TBR 135 |
| 57 | #define GDB_REG_BRR 136 |
| 58 | #define GDB_REG_DBAR(N) (137+(N)) |
| 59 | #define GDB_REG_SCR(N) (141+(N)) |
| 60 | #define GDB_REG_LR 145 |
| 61 | #define GDB_REG_LCR 146 |
| 62 | #define GDB_REG_FSR0 149 |
| 63 | #define GDB_REG_ACC(N) (150+(N)) |
| 64 | #define GDB_REG_ACCG(N) (158+(N)/4) |
| 65 | #define GDB_REG_MSR(N) (160+(N)) |
| 66 | #define GDB_REG_GNER(N) (162+(N)) |
| 67 | #define GDB_REG_FNER(N) (164+(N)) |
| 68 | |
| 69 | #define GDB_REG_SP GDB_REG_GR(1) |
| 70 | #define GDB_REG_FP GDB_REG_GR(2) |
| 71 | |
| 72 | #ifndef _LANGUAGE_ASSEMBLY |
| 73 | |
| 74 | /* |
| 75 | * Prototypes |
| 76 | */ |
| 77 | extern void show_registers_only(struct pt_regs *regs); |
| 78 | |
| 79 | extern void gdbstub_init(void); |
| 80 | extern void gdbstub(int type); |
| 81 | extern void gdbstub_exit(int status); |
| 82 | |
| 83 | extern void gdbstub_io_init(void); |
| 84 | extern void gdbstub_set_baud(unsigned baud); |
| 85 | extern int gdbstub_rx_char(unsigned char *_ch, int nonblock); |
| 86 | extern void gdbstub_tx_char(unsigned char ch); |
| 87 | extern void gdbstub_tx_flush(void); |
| 88 | extern void gdbstub_do_rx(void); |
| 89 | |
| 90 | extern asmlinkage void __debug_stub_init_break(void); |
| 91 | extern asmlinkage void __break_hijack_kernel_event(void); |
| 92 | extern asmlinkage void start_kernel(void); |
| 93 | |
| 94 | extern asmlinkage void gdbstub_rx_handler(void); |
| 95 | extern asmlinkage void gdbstub_rx_irq(void); |
| 96 | extern asmlinkage void gdbstub_intercept(void); |
| 97 | |
| 98 | extern uint32_t __entry_usertrap_table[]; |
| 99 | extern uint32_t __entry_kerneltrap_table[]; |
| 100 | |
| 101 | extern volatile u8 gdbstub_rx_buffer[PAGE_SIZE]; |
| 102 | extern volatile u32 gdbstub_rx_inp; |
| 103 | extern volatile u32 gdbstub_rx_outp; |
| 104 | extern volatile u8 gdbstub_rx_overflow; |
| 105 | extern u8 gdbstub_rx_unget; |
| 106 | |
| 107 | extern void gdbstub_printk(const char *fmt, ...); |
| 108 | extern void debug_to_serial(const char *p, int n); |
| 109 | extern void console_set_baud(unsigned baud); |
| 110 | |
| 111 | #ifdef GDBSTUB_DEBUG_PROTOCOL |
| 112 | #define gdbstub_proto(FMT,...) gdbstub_printk(FMT,##__VA_ARGS__) |
| 113 | #else |
| 114 | #define gdbstub_proto(FMT,...) ({ 0; }) |
| 115 | #endif |
| 116 | |
| 117 | #endif /* _LANGUAGE_ASSEMBLY */ |
| 118 | #endif /* __ASM_GDB_STUB_H */ |