1 /*
2  * Copyright (C) 1995 Advanced RISC Machines Limited. All rights reserved.
3  *
4  * This software may be freely used, copied, modified, and distributed
5  * provided that the above copyright notice is preserved in all copies of the
6  * software.
7  */
8 
9 /*
10  * ARM symbolic debugger toolbox: dbg_cp.h
11  */
12 
13 /*
14  * RCS $Revision: 1.3 $
15  * Checkin $Date: 2004/12/27 14:00:54 $
16  */
17 
18 #ifndef Dbg_CP__h
19 
20 #define Dbg_CP__h
21 
22 #define Dbg_Access_Readable  1
23 #define Dbg_Access_Writable  2
24 #define Dbg_Access_CPDT      4 /* else CPRT */
25 
26 typedef struct {
27     unsigned short rmin, rmax;
28     /* a single description can be used for a range of registers with
29        the same properties *accessed via CPDT instructions*
30      */
31     unsigned char nbytes;   /* size of register */
32     unsigned char access;   /* see above (Access_xxx) */
33     union {
34        struct { /* CPDT instructions do not allow the coprocessor much freedom:
35                    only bit 22 ('N') and 12-15 ('CRd') are free for the
36                    coprocessor to use as it sees fit.
37                  */
38                 unsigned char nbit;
39                 unsigned char rdbits;
40               } cpdt;
41        struct { /* CPRT instructions have much more latitude.  The bits fixed
42                    by the ARM are  24..31 (condition mask & opcode)
43                                    20 (direction)
44                                    8..15 (cpnum, arm register)
45                                    4 (CPRT not CPDO)
46                    leaving 14 bits free to the coprocessor (fortunately
47                    falling within two bytes).
48                  */
49                 unsigned char read_b0, read_b1,
50                               write_b0, write_b1;
51               } cprt;
52     } accessinst;
53 } Dbg_CoProRegDesc;
54 
55 struct Dbg_CoProDesc {
56     int entries;
57     Dbg_CoProRegDesc regdesc[1/* really nentries */];
58 };
59 
60 #define Dbg_CoProDesc_Size(n) (sizeof(struct Dbg_CoProDesc) + ((n)-1)*sizeof(Dbg_CoProRegDesc))
61 
62 #endif
63