source: anotherchoice/tags/jsp-1.4.4-full-UTF8/config/lm32/cpu_config.c@ 26

Last change on this file since 26 was 26, checked in by ykominami, 12 years ago

initial

File size: 5.8 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-2003 by Embedded and Real-Time Systems Laboratory
7 * Toyohashi Univ. of Technology, JAPAN
8 *
9 * 上記著作権者
10は,以下の (1)〜(4) の条件か,Free Software Foundation
11 * によってå…
12¬è¡¨ã•ã‚Œã¦ã„ã‚‹ GNU General Public License の Version 2 に記
13 * 述されている条件を満たす場合に限り,本ソフトウェア(本ソフトウェア
14 * を改変したものを含む.以下同じ)を使用・複製・改変・再é…
15å¸ƒï¼ˆä»¥ä¸‹ï¼Œ
16 * 利用と呼ぶ)することを無償で許諾する.
17 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
18 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー
19 * スコード中に含まれていること.
20 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
21 * 用できる形で再é…
22å¸ƒã™ã‚‹å ´åˆã«ã¯ï¼Œå†é…
23å¸ƒã«ä¼´ã†ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆï¼ˆåˆ©ç”¨
24 * 者
25マニュアルなど)に,上記の著作権表示,この利用条件および下記
26 * の無保証規定を掲載すること.
27 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
28 * 用できない形で再é…
29å¸ƒã™ã‚‹å ´åˆã«ã¯ï¼Œæ¬¡ã®ã„ずれかの条件を満たすこ
30 * と.
31 * (a) 再é…
32å¸ƒã«ä¼´ã†ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆï¼ˆåˆ©ç”¨è€…
33マニュアルなど)に,上記の著
34 * 作権表示,この利用条件および下記の無保証規定を掲載すること.
35 * (b) 再é…
36å¸ƒã®å½¢æ…
37‹ã‚’,別に定める方法によって,TOPPERSプロジェクトに
38 * 報告すること.
39 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
40 * 害からも,上記著作権者
41およびTOPPERSプロジェクトをå…
42è²¬ã™ã‚‹ã“と.
43 *
44 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者
45お
46 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,その適用可能性も
47 * 含めて,いかなる保証も行わない.また,本ソフトウェアの利用により直
48 * 接的または間接的に生じたいかなる損害に関しても,その責任を負わない.
49 *
50 * @(#) $Id: cpu_config.c,v 1.14 2007/07/27 11:28:44 honda Exp $
51 */
52
53#include "jsp_kernel.h"
54#include "cpu_config.h"
55
56UW exception_count;
57
58UW exception_registers[40];
59
60FP exc_table[TMAX_CORE_EXCNO] =
61{
62 (FP)_start,
63 (FP)Breakpoint_exception,
64 (FP)InstructionBusError_exception,
65 (FP)Watchpoint_exception,
66 (FP)DataBusError_exception,
67 (FP)DivideByZero_exception,
68 (FP)Interrupt_exception,
69 (FP)SystemCall_exception
70};
71
72void dump_registers()
73{
74 syslog(LOG_EMERG, "r0 : 0x%08x, r1 : 0x%08x, r2 : 0x%08x, r3 : 0x%08x",
75 exception_registers[0], exception_registers[1], exception_registers[2], exception_registers[3]);
76 syslog(LOG_EMERG, "r4 : 0x%08x, r5 : 0x%08x, r6 : 0x%08x, r7 : 0x%08x",
77 exception_registers[4], exception_registers[5], exception_registers[6], exception_registers[7]);
78 syslog(LOG_EMERG, "r8 : 0x%08x, r9 : 0x%08x, r10 : 0x%08x, r11 : 0x%08x",
79 exception_registers[8], exception_registers[9], exception_registers[10], exception_registers[11]);
80 syslog(LOG_EMERG, "r12 : 0x%08x, r13 : 0x%08x, r14 : 0x%08x, r15 : 0x%08x",
81 exception_registers[12], exception_registers[13], exception_registers[14], exception_registers[15]);
82 syslog(LOG_EMERG, "r16 : 0x%08x, r17 : 0x%08x, r18 : 0x%08x, r19 : 0x%08x",
83 exception_registers[16], exception_registers[17], exception_registers[18], exception_registers[19]);
84 syslog(LOG_EMERG, "r20 : 0x%08x, r21 : 0x%08x, r22 : 0x%08x, r23 : 0x%08x",
85 exception_registers[20], exception_registers[21], exception_registers[22], exception_registers[23]);
86 syslog(LOG_EMERG, "r24 : 0x%08x, r25 : 0x%08x, r26 : 0x%08x, r27 : 0x%08x",
87 exception_registers[24], exception_registers[25], exception_registers[26], exception_registers[27]);
88 syslog(LOG_EMERG, "sp : 0x%08x, ra : 0x%08x, ea : 0x%08x, ba : 0x%08x",
89 exception_registers[28], exception_registers[29], exception_registers[30], exception_registers[31]);
90
91 syslog(LOG_EMERG, "ie : 0x%08x, im : 0x%08x, ip : 0x%08x, icc : 0x%08x",
92 exception_registers[32], exception_registers[33], exception_registers[34], exception_registers[35]);
93 syslog(LOG_EMERG, "dcc : 0x%08x, cc : 0x%08x, cfg : 0x%08x, eba : 0x%08x",
94 exception_registers[36], exception_registers[37], exception_registers[38], exception_registers[39]);
95}
96
97void Breakpoint_exception()
98{
99 syslog(LOG_EMERG, "Breakpoint Exception occurs.");
100 dump_registers();
101 while(1);
102}
103
104void InstructionBusError_exception()
105{
106 syslog(LOG_EMERG, "InstructionBusError Exception occurs.");
107 dump_registers();
108 while(1);
109}
110
111void Watchpoint_exception()
112{
113 syslog(LOG_EMERG, "Watchpoint Exception occurs.");
114 dump_registers();
115 while(1);
116}
117
118void DataBusError_exception()
119{
120 syslog(LOG_EMERG, "DataBusError Exception occurs.");
121 dump_registers();
122 while(1);
123}
124
125void DivideByZero_exception()
126{
127 syslog(LOG_EMERG, "DivideByZero Exception occurs.");
128 dump_registers();
129 while(1);
130}
131
132void Interrupt_exception()
133{
134 syslog(LOG_EMERG, "Interrupt Exception occurs.");
135 dump_registers();
136 while(1);
137}
138
139void SystemCall_exception()
140{
141 syslog(LOG_EMERG, "SystemCall Exception occurs.");
142 dump_registers();
143 while(1);
144}
145
146void cpu_initialize(void)
147{
148 exception_count = 1;
149}
150
151void cpu_terminate(void)
152{
153
154}
Note: See TracBrowser for help on using the repository browser.