root / hw / sh7750_regnames.c @ b6741956
History | View | Annotate | Download (2.2 kB)
1 | 27c7ca7e | bellard | #include "vl.h" |
---|---|---|---|
2 | 27c7ca7e | bellard | #include "sh7750_regs.h" |
3 | 27c7ca7e | bellard | |
4 | 27c7ca7e | bellard | #define REGNAME(r) {r, #r}, |
5 | 27c7ca7e | bellard | |
6 | 27c7ca7e | bellard | typedef struct { |
7 | 27c7ca7e | bellard | uint32_t regaddr; |
8 | 27c7ca7e | bellard | const char *regname; |
9 | 27c7ca7e | bellard | } regname_t; |
10 | 27c7ca7e | bellard | |
11 | 27c7ca7e | bellard | static regname_t regnames[] = {
|
12 | 27c7ca7e | bellard | REGNAME(SH7750_PTEH_A7) |
13 | 27c7ca7e | bellard | REGNAME(SH7750_PTEL_A7) |
14 | 27c7ca7e | bellard | REGNAME(SH7750_PTEA_A7) |
15 | 27c7ca7e | bellard | REGNAME(SH7750_TTB_A7) |
16 | 27c7ca7e | bellard | REGNAME(SH7750_TEA_A7) |
17 | 27c7ca7e | bellard | REGNAME(SH7750_MMUCR_A7) |
18 | 27c7ca7e | bellard | REGNAME(SH7750_CCR_A7) |
19 | 27c7ca7e | bellard | REGNAME(SH7750_QACR0_A7) |
20 | 27c7ca7e | bellard | REGNAME(SH7750_QACR1_A7) |
21 | 27c7ca7e | bellard | REGNAME(SH7750_TRA_A7) |
22 | 27c7ca7e | bellard | REGNAME(SH7750_EXPEVT_A7) |
23 | 27c7ca7e | bellard | REGNAME(SH7750_INTEVT_A7) |
24 | 27c7ca7e | bellard | REGNAME(SH7750_STBCR_A7) |
25 | 27c7ca7e | bellard | REGNAME(SH7750_STBCR2_A7) |
26 | 27c7ca7e | bellard | REGNAME(SH7750_FRQCR_A7) |
27 | 27c7ca7e | bellard | REGNAME(SH7750_WTCNT_A7) |
28 | 27c7ca7e | bellard | REGNAME(SH7750_WTCSR_A7) |
29 | 27c7ca7e | bellard | REGNAME(SH7750_R64CNT_A7) |
30 | 27c7ca7e | bellard | REGNAME(SH7750_RSECCNT_A7) |
31 | 27c7ca7e | bellard | REGNAME(SH7750_RMINCNT_A7) |
32 | 27c7ca7e | bellard | REGNAME(SH7750_RHRCNT_A7) |
33 | 27c7ca7e | bellard | REGNAME(SH7750_RWKCNT_A7) |
34 | 27c7ca7e | bellard | REGNAME(SH7750_RDAYCNT_A7) |
35 | 27c7ca7e | bellard | REGNAME(SH7750_RMONCNT_A7) |
36 | 27c7ca7e | bellard | REGNAME(SH7750_RYRCNT_A7) |
37 | 27c7ca7e | bellard | REGNAME(SH7750_RSECAR_A7) |
38 | 27c7ca7e | bellard | REGNAME(SH7750_RMINAR_A7) |
39 | 27c7ca7e | bellard | REGNAME(SH7750_RHRAR_A7) |
40 | 27c7ca7e | bellard | REGNAME(SH7750_RWKAR_A7) |
41 | 27c7ca7e | bellard | REGNAME(SH7750_RDAYAR_A7) |
42 | 27c7ca7e | bellard | REGNAME(SH7750_RMONAR_A7) |
43 | 27c7ca7e | bellard | REGNAME(SH7750_RCR1_A7) |
44 | 27c7ca7e | bellard | REGNAME(SH7750_RCR2_A7) |
45 | 27c7ca7e | bellard | REGNAME(SH7750_BCR1_A7) |
46 | 27c7ca7e | bellard | REGNAME(SH7750_BCR2_A7) |
47 | 27c7ca7e | bellard | REGNAME(SH7750_WCR1_A7) |
48 | 27c7ca7e | bellard | REGNAME(SH7750_WCR2_A7) |
49 | 27c7ca7e | bellard | REGNAME(SH7750_WCR3_A7) |
50 | 27c7ca7e | bellard | REGNAME(SH7750_MCR_A7) |
51 | 27c7ca7e | bellard | REGNAME(SH7750_PCR_A7) |
52 | 27c7ca7e | bellard | REGNAME(SH7750_RTCSR_A7) |
53 | 27c7ca7e | bellard | REGNAME(SH7750_RTCNT_A7) |
54 | 27c7ca7e | bellard | REGNAME(SH7750_RTCOR_A7) |
55 | 27c7ca7e | bellard | REGNAME(SH7750_RFCR_A7) |
56 | 27c7ca7e | bellard | REGNAME(SH7750_SAR0_A7) |
57 | 27c7ca7e | bellard | REGNAME(SH7750_SAR1_A7) |
58 | 27c7ca7e | bellard | REGNAME(SH7750_SAR2_A7) |
59 | 27c7ca7e | bellard | REGNAME(SH7750_SAR3_A7) |
60 | 27c7ca7e | bellard | REGNAME(SH7750_DAR0_A7) |
61 | 27c7ca7e | bellard | REGNAME(SH7750_DAR1_A7) |
62 | 27c7ca7e | bellard | REGNAME(SH7750_DAR2_A7) |
63 | 27c7ca7e | bellard | REGNAME(SH7750_DAR3_A7) |
64 | 27c7ca7e | bellard | REGNAME(SH7750_DMATCR0_A7) |
65 | 27c7ca7e | bellard | REGNAME(SH7750_DMATCR1_A7) |
66 | 27c7ca7e | bellard | REGNAME(SH7750_DMATCR2_A7) |
67 | 27c7ca7e | bellard | REGNAME(SH7750_DMATCR3_A7) |
68 | 27c7ca7e | bellard | REGNAME(SH7750_CHCR0_A7) |
69 | 27c7ca7e | bellard | REGNAME(SH7750_CHCR1_A7) |
70 | 27c7ca7e | bellard | REGNAME(SH7750_CHCR2_A7) |
71 | 27c7ca7e | bellard | REGNAME(SH7750_CHCR3_A7) |
72 | 27c7ca7e | bellard | REGNAME(SH7750_DMAOR_A7) |
73 | 27c7ca7e | bellard | REGNAME(SH7750_PCTRA_A7) |
74 | 27c7ca7e | bellard | REGNAME(SH7750_PDTRA_A7) |
75 | 27c7ca7e | bellard | REGNAME(SH7750_PCTRB_A7) |
76 | 27c7ca7e | bellard | REGNAME(SH7750_PDTRB_A7) |
77 | 27c7ca7e | bellard | REGNAME(SH7750_GPIOIC_A7) |
78 | 27c7ca7e | bellard | REGNAME(SH7750_ICR_A7) |
79 | 27c7ca7e | bellard | REGNAME(SH7750_BCR3_A7) |
80 | 27c7ca7e | bellard | REGNAME(SH7750_BCR4_A7) |
81 | 27c7ca7e | bellard | REGNAME(SH7750_PRECHARGE0_A7) |
82 | 27c7ca7e | bellard | REGNAME(SH7750_PRECHARGE1_A7) {(uint32_t) - 1, 0} |
83 | 27c7ca7e | bellard | }; |
84 | 27c7ca7e | bellard | |
85 | 27c7ca7e | bellard | const char *regname(uint32_t addr) |
86 | 27c7ca7e | bellard | { |
87 | 27c7ca7e | bellard | unsigned int i; |
88 | 27c7ca7e | bellard | |
89 | 27c7ca7e | bellard | for (i = 0; regnames[i].regaddr != (uint32_t) - 1; i++) { |
90 | 27c7ca7e | bellard | if (regnames[i].regaddr == addr)
|
91 | 27c7ca7e | bellard | return regnames[i].regname;
|
92 | 27c7ca7e | bellard | } |
93 | 27c7ca7e | bellard | |
94 | 27c7ca7e | bellard | return "<unknown reg>"; |
95 | 27c7ca7e | bellard | } |