Subversion Repositories HelenOS-historic

Rev

Rev 634 | Rev 664 | 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
 
663 jermar 63
/* TT = 0x60, TL = 0, interrupt_vector_trap handler */
64
.org trap_table + TT_INTERRUPT_VECTOR_TRAP*ENTRY_SIZE
65
.global interrupt_vector_trap_handler
66
interrupt_vector_trap_handler:
67
	INTERRUPT_VECTOR_TRAP_HANDLER
68
 
69
/* TT = 0x80, TL = 0, spill_0_normal handler */
634 jermar 70
.org trap_table + TT_SPILL_0_NORMAL*ENTRY_SIZE
630 jermar 71
.global spill_0_normal
72
spill_0_normal:
73
	SPILL_NORMAL_HANDLER
529 jermar 74
 
663 jermar 75
/* TT = 0xc0, TL = 0, fill_0_normal handler */
634 jermar 76
.org trap_table + TT_FILL_0_NORMAL*ENTRY_SIZE
663 jermar 77
.global fill_0_normal
630 jermar 78
fill_0_normal:
79
	FILL_NORMAL_HANDLER
80
 
529 jermar 81
/*
663 jermar 82
 * Handlers for TL>0.
529 jermar 83
 */
84
 
663 jermar 85
/* TT = 0x24, TL > 0, clean_window handler */
86
.org trap_table + (TT_CLEAN_WINDOW+512)*ENTRY_SIZE
87
.global clean_window_handler_high
88
clean_window_handler_high:
89
	CLEAN_WINDOW_HANDLER
529 jermar 90
 
91
 
663 jermar 92
/* TT = 0x80, TL > 0, spill_0_normal handler */
529 jermar 93
 
663 jermar 94
.org trap_table + (TT_SPILL_0_NORMAL+512)*ENTRY_SIZE
95
.global spill_0_normal_high
96
spill_0_normal_high:
97
	SPILL_NORMAL_HANDLER
529 jermar 98
 
634 jermar 99
 
663 jermar 100
/* TT = 0xc0, TL > 0, fill_0_normal handler */
101
.org trap_table + (TT_FILL_0_NORMAL+512)*ENTRY_SIZE
102
.global fill_0_normal_high
103
fill_0_normal_high:
104
	FILL_NORMAL_HANDLER
634 jermar 105
 
663 jermar 106
 
107
 
634 jermar 108
/*
109
 * Save trap table.
110
 */
663 jermar 111
.align TABLE_SIZE
634 jermar 112
.global trap_table_save
113
trap_table_save:
114
	.space TABLE_SIZE, 0