Subversion Repositories HelenOS

Rev

Rev 663 | Rev 666 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
529 jermar 1
#
2
# Copyright (C) 2005 Jakub Jermar
3
# All rights reserved.
4
#
5
# Redistribution and use in source and binary forms, with or without
6
# modification, are permitted provided that the following conditions
7
# are met:
8
#
9
# - Redistributions of source code must retain the above copyright
10
#   notice, this list of conditions and the following disclaimer.
11
# - Redistributions in binary form must reproduce the above copyright
12
#   notice, this list of conditions and the following disclaimer in the
13
#   documentation and/or other materials provided with the distribution.
14
# - The name of the author may not be used to endorse or promote products
15
#   derived from this software without specific prior written permission.
16
#
17
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
#
28
 
29
/**
634 jermar 30
 * This file contains two trap tables.
31
 * First, trap_table, is the one wich contains handlers implemented by
32
 * kernel. During initialization, these handlers are copied out to
33
 * the second trap table, trap_table_save, and the first table is
34
 * overwritten with copy of OFW's own trap table. The copy is then patched
35
 * from the trap_table_save.
36
 *
37
 * This arrangement is beneficial because kernel handlers stay on their
38
 * link-time addresses which is good for debugging.
529 jermar 39
 */
40
 
41
.text
42
 
630 jermar 43
#include <arch/trap/trap_table.h>
44
#include <arch/trap/regwin.h>
663 jermar 45
#include <arch/trap/interrupt.h>
529 jermar 46
 
47
#define TABLE_SIZE	TRAP_TABLE_SIZE
48
#define ENTRY_SIZE	TRAP_TABLE_ENTRY_SIZE
49
 
50
/*
634 jermar 51
 * Kernel trap table.
529 jermar 52
 */
53
.align TABLE_SIZE
54
.global trap_table
55
trap_table:
56
 
663 jermar 57
/* TT = 0x24, TL = 0, clean_window handler */
634 jermar 58
.org trap_table + TT_CLEAN_WINDOW*ENTRY_SIZE
630 jermar 59
.global clean_window_handler
60
clean_window_handler:
61
	CLEAN_WINDOW_HANDLER
529 jermar 62
 
664 jermar 63
/* TT = 0x41, TL = 0, interrupt_level_1 handler */
64
.org trap_table + TT_INTERRUPT_LEVEL_1*ENTRY_SIZE
65
.global interrupt_level_1_handler
66
interrupt_level_1_handler:
67
	INTERRUPT_LEVEL_N_HANDLER 1
68
 
69
/* TT = 0x42, TL = 0, interrupt_level_2 handler */
70
.org trap_table + TT_INTERRUPT_LEVEL_2*ENTRY_SIZE
71
.global interrupt_level_2_handler
72
interrupt_level_2_handler:
73
	INTERRUPT_LEVEL_N_HANDLER 2
74
 
75
/* TT = 0x43, TL = 0, interrupt_level_3 handler */
76
.org trap_table + TT_INTERRUPT_LEVEL_3*ENTRY_SIZE
77
.global interrupt_level_3_handler
78
interrupt_level_3_handler:
79
	INTERRUPT_LEVEL_N_HANDLER 3
80
 
81
/* TT = 0x44, TL = 0, interrupt_level_4 handler */
82
.org trap_table + TT_INTERRUPT_LEVEL_4*ENTRY_SIZE
83
.global interrupt_level_4_handler
84
interrupt_level_4_handler:
85
	INTERRUPT_LEVEL_N_HANDLER 4
86
 
87
/* TT = 0x45, TL = 0, interrupt_level_5 handler */
88
.org trap_table + TT_INTERRUPT_LEVEL_5*ENTRY_SIZE
89
.global interrupt_level_5_handler
90
interrupt_level_5_handler:
91
	INTERRUPT_LEVEL_N_HANDLER 5
92
 
93
/* TT = 0x46, TL = 0, interrupt_level_6 handler */
94
.org trap_table + TT_INTERRUPT_LEVEL_6*ENTRY_SIZE
95
.global interrupt_level_6_handler
96
interrupt_level_6_handler:
97
	INTERRUPT_LEVEL_N_HANDLER 6
98
 
99
/* TT = 0x47, TL = 0, interrupt_level_7 handler */
100
.org trap_table + TT_INTERRUPT_LEVEL_7*ENTRY_SIZE
101
.global interrupt_level_7_handler
102
interrupt_level_7_handler:
103
	INTERRUPT_LEVEL_N_HANDLER 7
104
 
105
/* TT = 0x48, TL = 0, interrupt_level_8 handler */
106
.org trap_table + TT_INTERRUPT_LEVEL_8*ENTRY_SIZE
107
.global interrupt_level_8_handler
108
interrupt_level_8_handler:
109
	INTERRUPT_LEVEL_N_HANDLER 8
110
 
111
/* TT = 0x49, TL = 0, interrupt_level_9 handler */
112
.org trap_table + TT_INTERRUPT_LEVEL_9*ENTRY_SIZE
113
.global interrupt_level_9_handler
114
interrupt_level_9_handler:
115
	INTERRUPT_LEVEL_N_HANDLER 9
116
 
117
/* TT = 0x4a, TL = 0, interrupt_level_10 handler */
118
.org trap_table + TT_INTERRUPT_LEVEL_10*ENTRY_SIZE
119
.global interrupt_level_10_handler
120
interrupt_level_10_handler:
121
	INTERRUPT_LEVEL_N_HANDLER 10
122
 
123
/* TT = 0x4b, TL = 0, interrupt_level_11 handler */
124
.org trap_table + TT_INTERRUPT_LEVEL_11*ENTRY_SIZE
125
.global interrupt_level_11_handler
126
interrupt_level_11_handler:
127
	INTERRUPT_LEVEL_N_HANDLER 11
128
 
129
/* TT = 0x4c, TL = 0, interrupt_level_12 handler */
130
.org trap_table + TT_INTERRUPT_LEVEL_12*ENTRY_SIZE
131
.global interrupt_level_12_handler
132
interrupt_level_12_handler:
133
	INTERRUPT_LEVEL_N_HANDLER 12
134
 
135
/* TT = 0x4d, TL = 0, interrupt_level_13 handler */
136
.org trap_table + TT_INTERRUPT_LEVEL_13*ENTRY_SIZE
137
.global interrupt_level_13_handler
138
interrupt_level_13_handler:
139
	INTERRUPT_LEVEL_N_HANDLER 13
140
 
141
/* TT = 0x4e, TL = 0, interrupt_level_14 handler */
142
.org trap_table + TT_INTERRUPT_LEVEL_14*ENTRY_SIZE
143
.global interrupt_level_14_handler
144
interrupt_level_14_handler:
145
	INTERRUPT_LEVEL_N_HANDLER 14
146
 
147
/* TT = 0x4f, TL = 0, interrupt_level_15 handler */
148
.org trap_table + TT_INTERRUPT_LEVEL_15*ENTRY_SIZE
149
.global interrupt_level_15_handler
150
interrupt_level_15_handler:
151
	INTERRUPT_LEVEL_N_HANDLER 15
152
 
663 jermar 153
/* TT = 0x60, TL = 0, interrupt_vector_trap handler */
154
.org trap_table + TT_INTERRUPT_VECTOR_TRAP*ENTRY_SIZE
155
.global interrupt_vector_trap_handler
156
interrupt_vector_trap_handler:
157
	INTERRUPT_VECTOR_TRAP_HANDLER
158
 
159
/* TT = 0x80, TL = 0, spill_0_normal handler */
634 jermar 160
.org trap_table + TT_SPILL_0_NORMAL*ENTRY_SIZE
630 jermar 161
.global spill_0_normal
162
spill_0_normal:
163
	SPILL_NORMAL_HANDLER
529 jermar 164
 
663 jermar 165
/* TT = 0xc0, TL = 0, fill_0_normal handler */
634 jermar 166
.org trap_table + TT_FILL_0_NORMAL*ENTRY_SIZE
663 jermar 167
.global fill_0_normal
630 jermar 168
fill_0_normal:
169
	FILL_NORMAL_HANDLER
170
 
529 jermar 171
/*
663 jermar 172
 * Handlers for TL>0.
529 jermar 173
 */
174
 
663 jermar 175
/* TT = 0x24, TL > 0, clean_window handler */
176
.org trap_table + (TT_CLEAN_WINDOW+512)*ENTRY_SIZE
177
.global clean_window_handler_high
178
clean_window_handler_high:
179
	CLEAN_WINDOW_HANDLER
529 jermar 180
 
181
 
663 jermar 182
/* TT = 0x80, TL > 0, spill_0_normal handler */
529 jermar 183
 
663 jermar 184
.org trap_table + (TT_SPILL_0_NORMAL+512)*ENTRY_SIZE
185
.global spill_0_normal_high
186
spill_0_normal_high:
187
	SPILL_NORMAL_HANDLER
529 jermar 188
 
634 jermar 189
 
663 jermar 190
/* TT = 0xc0, TL > 0, fill_0_normal handler */
191
.org trap_table + (TT_FILL_0_NORMAL+512)*ENTRY_SIZE
192
.global fill_0_normal_high
193
fill_0_normal_high:
194
	FILL_NORMAL_HANDLER
634 jermar 195
 
663 jermar 196
 
197
 
634 jermar 198
/*
199
 * Save trap table.
200
 */
663 jermar 201
.align TABLE_SIZE
634 jermar 202
.global trap_table_save
203
trap_table_save:
204
	.space TABLE_SIZE, 0