1 | /*
|
---|
2 | * TOPPERS/JSP Kernel
|
---|
3 | * Toyohashi Open Platform for Embedded Real-Time Systems/
|
---|
4 | * Just Standard Profile Kernel
|
---|
5 | *
|
---|
6 | * Copyright (C) 2000-2004 by Embedded and Real-Time Systems Laboratory
|
---|
7 | * Toyohashi Univ. of Technology, JAPAN
|
---|
8 | * Copyright (C) 2001-2004 by Industrial Technology Institute,
|
---|
9 | * Miyagi Prefectural Government, JAPAN
|
---|
10 | *
|
---|
11 | * ä¸è¨è使¨©è
|
---|
12 | ã¯ï¼ä»¥ä¸ã® (1)ã(4) ã®æ¡ä»¶ãï¼Free Software Foundation
|
---|
13 | * ã«ãã£ã¦å
|
---|
14 | ¬è¡¨ããã¦ãã GNU General Public License ã® Version 2 ã«è¨
|
---|
15 | * è¿°ããã¦ããæ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§ã¢ï¼æ¬ã½ããã¦ã§ã¢
|
---|
16 | * ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ã使ç¨ã»è¤è£½ã»æ¹å¤ã»åé
|
---|
17 | å¸ï¼ä»¥ä¸ï¼
|
---|
18 | * å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
|
---|
19 | * (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
|
---|
20 | * 権表示ï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
|
---|
21 | * ã¹ã³ã¼ãä¸ã«å«ã¾ãã¦ãããã¨ï¼
|
---|
22 | * (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
|
---|
23 | * ç¨ã§ããå½¢ã§åé
|
---|
24 | å¸ããå ´åã«ã¯ï¼åé
|
---|
25 | å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨
|
---|
26 | * è
|
---|
27 | ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è使¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
|
---|
28 | * ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
|
---|
29 | * (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
|
---|
30 | * ç¨ã§ããªãå½¢ã§åé
|
---|
31 | å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
|
---|
32 | * ã¨ï¼
|
---|
33 | * (a) åé
|
---|
34 | å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨è
|
---|
35 | ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
|
---|
36 | * 使¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
|
---|
37 | * (b) åé
|
---|
38 | å¸ã®å½¢æ
|
---|
39 | ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSããã¸ã§ã¯ãã«
|
---|
40 | * å ±åãããã¨ï¼
|
---|
41 | * (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
|
---|
42 | * 害ãããï¼ä¸è¨è使¨©è
|
---|
43 | ããã³TOPPERSããã¸ã§ã¯ããå
|
---|
44 | 責ãããã¨ï¼
|
---|
45 | *
|
---|
46 | * æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨è使¨©è
|
---|
47 | ã
|
---|
48 | * ãã³TOPPERSããã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ãã®é©ç¨å¯è½æ§ã
|
---|
49 | * å«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´
|
---|
50 | * æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ãã®è²¬ä»»ãè² ããªãï¼
|
---|
51 | *
|
---|
52 | * @(#) $Id: vea_oea_emb.h,v 1.2 2004/10/07 17:10:56 honda Exp $
|
---|
53 | */
|
---|
54 |
|
---|
55 | /*
|
---|
56 | * PowerPCã¢ã¼ããã¯ãã£VEA,OEAä¾åã®å®ç¾©
|
---|
57 | * ãThe IBM PowerPC Embedded Environmentã®å ´å
|
---|
58 | * ããIBMç³»PowerPC40xãã¡ããªãã¡ãã«è©²å½ããã
|
---|
59 | * ã
|
---|
60 | * ãPowerPCã¢ã¼ããã¯ãã£ã®å®ç¾©ã¯ä»¥ä¸ã®ï¼ã¤ã®ã¬ãã«ããæã
|
---|
61 | * ãã»USIA:User Instruction Set Architecture
|
---|
62 | * ãã»VEA: Virtual Environment Architecture
|
---|
63 | * ãã»OEA: Operating Environment Architecture
|
---|
64 | * ã
|
---|
65 | * ãUSIAã«ã¤ãã¦ã¯å
|
---|
66 | ¨æ©ç¨®å
|
---|
67 | ±éã§ããããVEAã¨OEAã«ã¤ãã¦ã¯
|
---|
68 | * ããªãªã¸ãã«ã®PowerPCã¢ã¼ããã¯ãã£ã¨The IBM PowerPC
|
---|
69 | * ãEmbedded Environmentããããå¥ã«å®ç¾©ããã¦ããããã
|
---|
70 | * ãVEAã¨OEAã®å®ç¾©ã¯ãã¡ã¤ã«ãåãã¦ããããã¤ã³ã¯ã«ã¼ã
|
---|
71 | * ããã¦ããã
|
---|
72 | */
|
---|
73 |
|
---|
74 |
|
---|
75 | #ifndef _VEA_OEA_EMB_H_
|
---|
76 | #define _VEA_OEA_EMB_H_
|
---|
77 |
|
---|
78 | /*
|
---|
79 | * ã¬ã¸ã¹ã¿çªå·ã®å®ç¾©
|
---|
80 | */
|
---|
81 |
|
---|
82 | /*
|
---|
83 | * Special Purpose Registerã®ã¬ã¸ã¹ã¿çªå·
|
---|
84 | * ãã(*)å°ï¼å
|
---|
85 | ã®PowerPCã¢ã¼ããã¯ãã£ã§ã¯å®ç¾©ããã¦ããªãã¬ã¸ã¹ã¿
|
---|
86 | */
|
---|
87 |
|
---|
88 | /*
|
---|
89 | * ä¾å¤å¦çã«é¢ããã¬ã¸ã¹ã¿
|
---|
90 | */
|
---|
91 | #define SRR0 26 /* Save/Restore Register0 */
|
---|
92 | #define SRR1 27 /* Save/Restore Register1 */
|
---|
93 | #define SRR2 990 /* Save/Restore Register2(*) */
|
---|
94 | #define SRR3 991 /* Save/Restore Register3(*) */
|
---|
95 | #define ESR 980 /* Exception Syndrome Register(*) */
|
---|
96 | #define DEAR 981 /* Data Exception Address Register(*) */
|
---|
97 | #define EVPR 982 /* Exception Vector Prefix Register(*) */
|
---|
98 |
|
---|
99 | #define SPRG0 272 /* SPR General 0 */
|
---|
100 | #define SPRG1 273 /* SPR General 1 */
|
---|
101 | #define SPRG2 274 /* SPR General 2 */
|
---|
102 | #define SPRG3 275 /* SPR General 3 */
|
---|
103 |
|
---|
104 | /*
|
---|
105 | * ãã®ä»ã®ã¬ã¸ã¹ã¿
|
---|
106 | */
|
---|
107 | #define DAC 1014 /* Data Address Compare(*) */
|
---|
108 | #define DBCR 1010 /* Debug Control Register(*) */
|
---|
109 | #define DBSR 1008 /* Debug Status Register(*) */
|
---|
110 | #define DCCR 1018 /* Data Cache Cacheability Register(*) */
|
---|
111 | #define DCWR 954 /* Data Cache Write-thru Register(*) */
|
---|
112 |
|
---|
113 | #define IAC 1012 /* Instruction Address Compare(*) */
|
---|
114 | #define ICCR 1019 /* Instruction Cache Cacheability Register(*) */
|
---|
115 |
|
---|
116 | #define PID 945 /* Process ID Register */
|
---|
117 | #define PIT 987 /* Programmable Interval Timer(*) */
|
---|
118 | #define PVR 287 /* Processor Version Register */
|
---|
119 |
|
---|
120 | #define SGR 953 /* Storage Guarded Register(*) */
|
---|
121 | #define SLER 955 /* Storage Little-Endian Register(*) */
|
---|
122 | #define SMR 952 /* Storage Memory-Coherent Register(*) */
|
---|
123 |
|
---|
124 | /* VEA */
|
---|
125 | #define TBL 268 /* Time Base Lower(for read) */
|
---|
126 | #define TBU 269 /* Time Base Upper(for read) */
|
---|
127 | /* OEA */
|
---|
128 | #define TBLw 284 /* Time Base Lower(for write) */
|
---|
129 | #define TBUw 285 /* Time Base Upper(for write) */
|
---|
130 |
|
---|
131 | #define TCR 986 /* Timer Control Registe(*) */
|
---|
132 | #define TSR 984 /* Timer Status Register(*) */
|
---|
133 | #define ZPR 944 /* Zone Protection Register(*) */
|
---|
134 |
|
---|
135 | /*
|
---|
136 | * MSRã®ãããé
|
---|
137 | å
|
---|
138 | */
|
---|
139 | /* 0-10:Reserved */
|
---|
140 | #define MSR_APE BIT11_32 /* Auxiliary Processor Exception Enable */
|
---|
141 | #define MSR_APA BIT12_32 /* Auxiliary Processor Available */
|
---|
142 | #define MSR_WE BIT13_32 /* Wait State Enable */
|
---|
143 | #define MSR_CE BIT14_32 /* Critical Enable */
|
---|
144 | #define MSR_ILE BIT15_32 /* Interrupt Little Endian */
|
---|
145 | #define MSR_EE BIT16_32 /* External Enable */
|
---|
146 | #define MSR_PR BIT17_32 /* Problem State */
|
---|
147 | #define MSR_FP BIT18_32 /* Floating Point Available */
|
---|
148 | #define MSR_ME BIT19_32 /* Machine Check Enable */
|
---|
149 | #define MSR_FE0 BIT20_32 /* Floating Point Exception Mode 0 */
|
---|
150 | /* 21:Reserved */
|
---|
151 | #define MSR_DE BIT22_32 /* Debug Interrupts Enable */
|
---|
152 | #define MSR_FE1 BIT23_32 /* Floating Point Exception Mode 1 */
|
---|
153 | /* 23-25:Reserved */
|
---|
154 | #define MSR_IR BIT26_32 /* Instruction Relocate */
|
---|
155 | #define MSR_DR BIT27_32 /* Data Relocate */
|
---|
156 | /* 28-30:Reserved */
|
---|
157 | #define MSR_LE BIT31_32 /* Little Endian */
|
---|
158 |
|
---|
159 |
|
---|
160 | /*
|
---|
161 | * ESR(Exception Syndrome Register)ã®ãããé
|
---|
162 | å
|
---|
163 | */
|
---|
164 | #define ESR_PIL BIT4_32 /* Program - Illegal Instruction exception */
|
---|
165 | #define ESR_PPR BIT5_32 /* Program - Privileged Instruction exception */
|
---|
166 | #define ESR_PTR BIT6_32 /* Program - Trap exception */
|
---|
167 | #define ESR_PFE BIT7_32 /* Program - Floating Point Enabled exception */
|
---|
168 | #define ESR_DST BIT8_32 /* Data Storage / Data TLB Miss - Store Operations */
|
---|
169 | #define ESR_DIZ BIT9_32 /* Data / Instruction Storage - Zone exception */
|
---|
170 | /* Program - Auxiliary Processor Unavailable exception */
|
---|
171 | #define ESR_PAU BIT12_32
|
---|
172 | /* Program - Floating Point Enabled but Unimplemented exception */
|
---|
173 | #define ESR_PFEU BIT13_32
|
---|
174 | /* Program - Auxiliary Processor Enabled exception */
|
---|
175 | #define ESR_PAE BIT14_32
|
---|
176 |
|
---|
177 |
|
---|
178 | /*
|
---|
179 | * CPUä¾å¤è¦å ã®å®ç¾©
|
---|
180 | * ãçªå·ãä¸é£ç¶ãªã®ã§CPUä¾å¤æ¬ä¼¼ãã¯ã¿ãã¼ãã«ã«ä¸é¨ç¡é§ãå
|
---|
181 | ¥ããã
|
---|
182 | * ãPowerPCã¢ã¼ããã¯ãã£ã®å®ç¾©ã«åãããæ¹ãåªå
|
---|
183 | ããã
|
---|
184 | */
|
---|
185 | #define EXC_NO_CRITICAL_INPUT 0x1
|
---|
186 | #define EXC_NO_MACHINE_CHECK 0x2
|
---|
187 | #define EXC_NO_DATA_STORAGE 0x3
|
---|
188 | #define EXC_NO_INSTRUCTION_STORAGE 0x4
|
---|
189 | #define EXC_NO_EXTERNAL_INTERRUPT 0x5 /* å¤é¨å²è¾¼ã¿ */
|
---|
190 | #define EXC_NO_ALIGNMENT 0x6
|
---|
191 | /* ããã°ã©ã ä¾å¤ï¼è¦å ï¼ç¨®ï¼*/
|
---|
192 | #define EXC_NO_PROGRAM 0x7
|
---|
193 | #define EXC_NO_FLOATING_POINT_UNAVAILABLE 0x8
|
---|
194 | /* ï¼APUãæã¤PowerPC405ã440ã®ã¿ï¼ */
|
---|
195 |
|
---|
196 | /* 0x900ï¼Reserved */
|
---|
197 | /* 0xa00ï¼Reserved */
|
---|
198 | /* 0xb00ï¼Reserved */
|
---|
199 | #define EXC_NO_SYSTEM_CALL 0xc /* ã·ã¹ãã ã³ã¼ã« */
|
---|
200 | /* 0xd00ï¼Reserved */
|
---|
201 | /* 0xe00ï¼Reserved */
|
---|
202 | /* 0xe10-0xff0ï¼Reserved */
|
---|
203 | /* 0x1000ï¼Programmable Interval Timer */
|
---|
204 | /* 0x1010ï¼Fixed Interval Timer */
|
---|
205 | /* 0x1020ï¼Watchdog Timer */
|
---|
206 | /* 0x1030-0x10f0ï¼Reserved */
|
---|
207 | /* 0x1100ï¼Data TLB miss */
|
---|
208 | /* 0x1110-0x11f0ï¼Reserved */
|
---|
209 | /* 0x1200ï¼Instruction TLB miss */
|
---|
210 | /* 0x1210-0x1ff0ï¼Reserved */
|
---|
211 | /* 0x2000ï¼Debugï¼è¦å ï¼ç¨®ï¼ */
|
---|
212 | /* 0x2010-0x2ff0ï¼Implementation Specific */
|
---|
213 |
|
---|
214 | /*
|
---|
215 | * ä¾å¤ã®ç¨®å¥æ°
|
---|
216 | * ãå¤é¨å²è¾¼ã¿ãï¼ã¤ã¨æ°ãã
|
---|
217 | * ãã0çªã¯æªä½¿ç¨
|
---|
218 | * ãããã»ä¾å¤ãã¯ã¿ã®ãªãã»ããã¨å¯¾å¿
|
---|
219 | * ãããã»å¤é¨å²ãè¾¼ã¿ãï¼ã¤ã¨æ°ãã
|
---|
220 | * ãããã»é
|
---|
221 | å宣è¨ã®ããã+1ãã¦ãã
|
---|
222 | */
|
---|
223 |
|
---|
224 | #define TMAX_EXCNO ( 0x20 + 1 + NUM_IMPLEMENT_EXCEPTION )
|
---|
225 |
|
---|
226 |
|
---|
227 | /*
|
---|
228 | * DCRã¸ã®ã¢ã¯ã»ã¹
|
---|
229 | * DCR:Device Control Register
|
---|
230 | * 以ä¸ã®ã«ã¼ãã³ã¯ããã¤ã¹ãã©ã¤ãåãã«ä½æãã¦ããã
|
---|
231 | * DCRã®å
|
---|
232 | ·ä½çãªåç§°ãæ©è½ã¯ããã¤ã¹ä¾åã§ããã
|
---|
233 | *
|
---|
234 | * åè
|
---|
235 | * ãmfdcr,mtdcrå½ä»¤ã¯DCRã®çªå·ãæ±ç¨ã¬ã¸ã¹ã¿ã§ã¯ãªãã
|
---|
236 | * ãå³å¤ã§æå®ãããããã¤ã³ã©ã¤ã³é¢æ°ã«ã§ããªãã
|
---|
237 | */
|
---|
238 |
|
---|
239 | /*
|
---|
240 | * DCRã®ç¾å¨å¤ã®èªåºã
|
---|
241 | * reg:ã¬ã¸ã¹ã¿çªå·ï¼æ´æ°å®æ°ï¼
|
---|
242 | * val:èªã¿åºããå¤ãæ ¼ç´ãã夿°ï¼UWåï¼
|
---|
243 | */
|
---|
244 | #define _sil_rew_dcr(reg, val) Asm("mfdcr %0," #reg : "=r"(val))
|
---|
245 | #define sil_rew_dcr(reg, val) _sil_rew_dcr(reg, val)
|
---|
246 |
|
---|
247 | /*
|
---|
248 | * DCRã®ç¾å¨å¤ã®å¤æ´
|
---|
249 | * reg:ã¬ã¸ã¹ã¿çªå·ï¼æ´æ°å®æ°ï¼
|
---|
250 | * val:è¨å®ããå¤ãæ ¼ç´ããã夿°ï¼UWåï¼
|
---|
251 | */
|
---|
252 | #define _sil_wrw_dcr(reg, val) Asm("mtdcr "#reg",%0" : : "r"(val) )
|
---|
253 | #define sil_wrw_dcr(reg, val) _sil_wrw_dcr(reg, val)
|
---|
254 |
|
---|
255 |
|
---|
256 | #endif /* _VEA_OEA_EMB_H_ */
|
---|
257 | /* end of file */
|
---|