Subversion Repositories HelenOS-historic

Rev

Rev 630 | Rev 663 | 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>
529 jermar 45
 
46
#define TABLE_SIZE	TRAP_TABLE_SIZE
47
#define ENTRY_SIZE	TRAP_TABLE_ENTRY_SIZE
48
 
49
/*
634 jermar 50
 * Kernel trap table.
529 jermar 51
 */
52
.align TABLE_SIZE
53
.global trap_table
54
trap_table:
55
 
630 jermar 56
/* TT = 0x24, TL = 0 *, clean_window handler */
634 jermar 57
.org trap_table + TT_CLEAN_WINDOW*ENTRY_SIZE
630 jermar 58
.global clean_window_handler
59
clean_window_handler:
60
	CLEAN_WINDOW_HANDLER
529 jermar 61
 
630 jermar 62
/* TT = 0x80, TL = 0 *, spill_0_normal handler */
634 jermar 63
.org trap_table + TT_SPILL_0_NORMAL*ENTRY_SIZE
630 jermar 64
.global spill_0_normal
65
spill_0_normal:
66
	SPILL_NORMAL_HANDLER
529 jermar 67
 
630 jermar 68
/* TT = 0xc0, TL = 0 *, fill_0_normal handler */
634 jermar 69
.org trap_table + TT_FILL_0_NORMAL*ENTRY_SIZE
630 jermar 70
fill_0_normal:
71
	FILL_NORMAL_HANDLER
72
 
529 jermar 73
/*
74
 * Software traps for TL=0.
75
 */
634 jermar 76
.org trap_table + 256*ENTRY_SIZE
529 jermar 77
tl_0_software_traps:
78
 
79
/* Reserved area. */
634 jermar 80
.org trap_table + 384*ENTRY_SIZE
529 jermar 81
.space 128*ENTRY_SIZE, 0
82
 
83
/*
84
 * Hardware interrupts for TL>0.
85
 */
634 jermar 86
.org trap_table + 512*ENTRY_SIZE
529 jermar 87
tl_non_0_hardware_traps:
88
 
89
/*
630 jermar 90
 * Register window spill/fill traps for TL>0.
529 jermar 91
 */
634 jermar 92
.org trap_table + 640*ENTRY_SIZE
529 jermar 93
tl_non_0_regwin_traps:
94
 
95
/*
96
 * Software traps for TL>0.
97
 */
634 jermar 98
.org trap_table + 768*ENTRY_SIZE
529 jermar 99
tl_non_0_software_traps:
100
 
101
/* Reserved area. */
634 jermar 102
.org trap_table + 896*ENTRY_SIZE
529 jermar 103
.space 128*ENTRY_SIZE, 0
634 jermar 104
 
105
 
106
/*
107
 * Save trap table.
108
 */
109
.global trap_table_save
110
trap_table_save:
111
	.space TABLE_SIZE, 0