1 /*
2  * kgdb.h: Defines and declarations for serial line source level
3  *         remote debugging of the Linux kernel using gdb.
4  *
5  * PPC Mods (C) 1998 Michael Tesch (tesch@cs.wisc.edu)
6  *
7  * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version
12  * 2 of the License, or (at your option) any later version.
13  */
14 #ifndef _PPC64_KGDB_H
15 #define _PPC64_KGDB_H
16 
17 #ifndef __ASSEMBLY__
18 /* To initialize the serial, first thing called */
19 extern void zs_kgdb_hook(int tty_num);
20 /* To init the kgdb engine. (called by serial hook)*/
21 extern void set_debug_traps(void);
22 
23 /* To enter the debugger explicitly. */
24 extern void breakpoint(void);
25 
26 /* For taking exceptions
27  * these are defined in traps.c
28  */
29 extern void (*debugger)(struct pt_regs *regs);
30 extern int (*debugger_bpt)(struct pt_regs *regs);
31 extern int (*debugger_sstep)(struct pt_regs *regs);
32 extern int (*debugger_iabr_match)(struct pt_regs *regs);
33 extern int (*debugger_dabr_match)(struct pt_regs *regs);
34 extern void (*debugger_fault_handler)(struct pt_regs *regs);
35 
36 /* What we bring to the party */
37 int kgdb_bpt(struct pt_regs *regs);
38 int kgdb_sstep(struct pt_regs *regs);
39 void kgdb(struct pt_regs *regs);
40 int kgdb_iabr_match(struct pt_regs *regs);
41 int kgdb_dabr_match(struct pt_regs *regs);
42 static void kgdb_fault_handler(struct pt_regs *regs);
43 static void handle_exception (struct pt_regs *regs);
44 
45 /*
46  * external low-level support routines (ie macserial.c)
47  */
48 extern void kgdb_interruptible(int); /* control interrupts from serial */
49 extern void putDebugChar(char);   /* write a single character      */
50 extern char getDebugChar(void);   /* read and return a single char */
51 
52 #endif /* !(__ASSEMBLY__) */
53 #endif /* !(_PPC64_KGDB_H) */
54