added a lot of printk output to ease writing of emulator
[linux-2.4.21-pre4.git] / include / asm-ppc64 / kdb.h
1 /*
2  * Minimalist Kernel Debugger
3  *
4  * Copyright (C) 1999 Silicon Graphics, Inc.
5  * Copyright (C) Scott Lurndal (slurn@engr.sgi.com)
6  * Copyright (C) Scott Foehner (sfoehner@engr.sgi.com)
7  * Copyright (C) Srinivasa Thirumalachar (sprasad@engr.sgi.com)
8  *
9  * See the file LIA-COPYRIGHT for additional information.
10  *
11  * Written March 1999 by Scott Lurndal at Silicon Graphics, Inc.
12  *
13  * Modifications from:
14  *      Richard Bass                    1999/07/20
15  *              Many bug fixes and enhancements.
16  *      Scott Foehner
17  *              Port to ia64
18  *      Scott Lurndal                   1999/12/12
19  *              v1.0 restructuring.
20  */
21 #if !defined(_ASM_KDB_H)
22 #define _ASM_KDB_H
23         /*
24          * KDB_ENTER() is a macro which causes entry into the kernel
25          * debugger from any point in the kernel code stream.  If it 
26          * is intended to be used from interrupt level, it must  use
27          * a non-maskable entry method.
28          */
29 #define KDB_ENTER()     asm("\ttrap\n")
30
31         /*
32          * Define the exception frame for this architecture
33          */
34 struct pt_regs;
35 typedef struct pt_regs  *kdb_eframe_t;
36
37         /*
38          * Needed for exported symbols.
39          */
40 typedef unsigned long kdb_machreg_t;
41
42 #define kdb_machreg_fmt         "0x%016lx"
43 #define kdb_machreg_fmt0        "0x%016lx"
44 #define kdb_bfd_vma_fmt         "0x%016lx"
45 #define kdb_bfd_vma_fmt0        "0x%016lx"
46 #define kdb_elfw_addr_fmt       "0x%016lx"
47 #define kdb_elfw_addr_fmt0      "0x%016lx"
48
49         /*
50          * Per cpu arch specific kdb state.  Must be in range 0xff000000.
51          */
52 #define KDB_STATE_A_IF          0x01000000      /* Saved IF flag */
53
54          /*
55           * Interface from kernel trap handling code to kernel debugger.
56           */
57 extern int      kdba_callback_die(struct pt_regs *, int, long, void*);
58 extern int      kdba_callback_bp(struct pt_regs *, int, long, void*);
59 extern int      kdba_callback_debug(struct pt_regs *, int, long, void *);
60
61 #include <linux/types.h>
62 extern int kdba_putarea_size(unsigned long to_xxx, void *from, size_t size);
63 extern int kdba_getarea_size(void *to, unsigned long from_xxx, size_t size);
64
65 static inline int
66 kdba_verify_rw(unsigned long addr, size_t size)
67 {
68         unsigned char data[size];
69         return(kdba_getarea_size(data, addr, size) || kdba_putarea_size(addr, data, size));
70 }
71
72 #endif  /* ASM_KDB_H */