make oldconfig will rebuild these...
[linux-2.4.21-pre4.git] / include / asm-ppc64 / kdbprivate.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  *      Keith Owens                     2000/05/23
21  *              KDB v1.2
22  */
23 #if !defined(_ASM_KDBPRIVATE_H)
24 #define _ASM_KDBPRIVATE_H
25
26 typedef unsigned char kdb_machinst_t;
27
28         /*
29          * KDB_MAXBPT describes the total number of breakpoints
30          * supported by this architecure.  
31          */
32 #define KDB_MAXBPT      16
33         /*
34          * KDB_MAXHARDBPT describes the total number of hardware
35          * breakpoint registers that exist.
36          */
37 #define KDB_MAXHARDBPT   4
38         /*
39          * Provide space for KDB_MAX_COMMANDS commands.
40          */
41 #define KDB_MAX_COMMANDS        125
42
43         /*
44          * Platform specific environment entries
45          */
46 #define KDB_PLATFORM_ENV        "IDMODE=PPC", "BYTESPERWORD=8", "IDCOUNT=16"
47
48         /*
49          * Define the direction that the stack grows
50          */
51 #define KDB_STACK_DIRECTION     -1      /* Stack grows down */
52
53         /*
54          * Support for ia32 debug registers 
55          */
56 typedef struct _kdbhard_bp {
57         kdb_machreg_t   bph_reg;        /* Register this breakpoint uses */
58
59         unsigned int    bph_free:1;     /* Register available for use */
60         unsigned int    bph_data:1;     /* Data Access breakpoint */
61
62         unsigned int    bph_write:1;    /* Write Data breakpoint */
63         unsigned int    bph_mode:2;     /* 0=inst, 1=write, 2=io, 3=read */
64         unsigned int    bph_length:2;   /* 0=1, 1=2, 2=BAD, 3=4 (bytes) */
65 } kdbhard_bp_t;
66
67 extern kdbhard_bp_t     kdb_hardbreaks[/* KDB_MAXHARDBPT */];
68
69 #define KDB_HAVE_LONGJMP 
70 #ifdef KDB_HAVE_LONGJMP
71 typedef struct __kdb_jmp_buf {
72         unsigned int regs[100];
73 } kdb_jmp_buf;
74 extern int kdb_setjmp(kdb_jmp_buf *);
75 extern void kdba_longjmp(kdb_jmp_buf *, int);
76 extern kdb_jmp_buf  kdbjmpbuf[];
77 #endif  /* KDB_HAVE_LONGJMP */
78
79
80 /*
81  A traceback table typically follows each function.
82  The find_tb_table() func will fill in this struct.  Note that the struct
83  is not an exact match with the encoded table defined by the ABI.  It is
84  defined here more for programming convenience.
85  */
86 typedef struct {
87     unsigned long       flags;          /* flags: */
88 #define KDBTBTAB_FLAGSGLOBALLINK        (1L<<47)
89 #define KDBTBTAB_FLAGSISEPROL           (1L<<46)
90 #define KDBTBTAB_FLAGSHASTBOFF          (1L<<45)
91 #define KDBTBTAB_FLAGSINTPROC           (1L<<44)
92 #define KDBTBTAB_FLAGSHASCTL            (1L<<43)
93 #define KDBTBTAB_FLAGSTOCLESS           (1L<<42)
94 #define KDBTBTAB_FLAGSFPPRESENT         (1L<<41)
95 #define KDBTBTAB_FLAGSNAMEPRESENT       (1L<<38)
96 #define KDBTBTAB_FLAGSUSESALLOCA        (1L<<37)
97 #define KDBTBTAB_FLAGSSAVESCR           (1L<<33)
98 #define KDBTBTAB_FLAGSSAVESLR           (1L<<32)
99 #define KDBTBTAB_FLAGSSTORESBC          (1L<<31)
100 #define KDBTBTAB_FLAGSFIXUP             (1L<<30)
101 #define KDBTBTAB_FLAGSPARMSONSTK        (1L<<0)
102     unsigned char       fp_saved;       /* num fp regs saved f(32-n)..f31 */
103     unsigned char       gpr_saved;      /* num gpr's saved */
104     unsigned char       fixedparms;     /* num fixed point parms */
105     unsigned char       floatparms;     /* num float parms */
106     unsigned char       parminfo[32];   /* types of args.  null terminated */
107 #define KDBTBTAB_PARMFIXED 1
108 #define KDBTBTAB_PARMSFLOAT 2
109 #define KDBTBTAB_PARMDFLOAT 3
110     unsigned int        tb_offset;      /* offset from start of func */
111     unsigned long       funcstart;      /* addr of start of function */
112     char                name[64];       /* name of function (null terminated)*/
113     kdb_symtab_t        symtab;         /* fake symtab entry */
114 } kdbtbtable_t;
115 int kdba_find_tb_table(kdb_machreg_t eip, kdbtbtable_t *tab);
116
117 #endif  /* !_ASM_KDBPRIVATE_H */