source: anotherchoice/tags/jsp-1.4.4-full-UTF8/config/powerpc32/vea_oea_emb.h@ 363

Last change on this file since 363 was 363, checked in by ykominami, 5 years ago

add tags/jsp-1.4.4-full-UTF8

  • Property svn:executable set to *
File size: 9.6 KB
Line 
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アーキテクチャの定義は以下の3つのレベルから成る
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 /* プログラム例外(要因7種)*/
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(要因7種) */
212/* 0x2010-0x2ff0:Implementation Specific */
213
214/*
215 * 例外の種別数
216 *  外部割込みも1つと数える
217 *   0番は未使用
218 *    ・例外ベクタのオフセットと対応
219 *    ・外部割り込みも1つと数える
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 */
Note: See TracBrowser for help on using the repository browser.