Subversion Repositories HelenOS

Rev

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

Rev Author Line No. Line
1 jermar 1
#
2
# Copyright (C) 2001-2004 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
.text
30
 
31
.macro cp0_read reg
50 jermar 32
	mfc0 $2,\reg
33
	j $31
34
	nop
1 jermar 35
.endm
36
 
37
.macro cp0_write reg
50 jermar 38
	mtc0 $4,\reg
39
	j $31
40
	nop
1 jermar 41
.endm
42
 
43
.set noat
44
.set noreorder
45
.set nomacro
46
 
47
.global cp0_index_read
48
.global cp0_index_write
49
.global cp0_random_read
50
.global cp0_entry_lo0_read
51
.global cp0_entry_lo0_write
52
.global cp0_entry_lo1_read
53
.global cp0_entry_lo1_write
54
.global cp0_context_read
55
.global cp0_context_write
56
.global cp0_pagemask_read
57
.global cp0_pagemask_write
58
.global cp0_wired_read
59
.global cp0_wired_write
60
.global cp0_badvaddr_read
61
.global cp0_count_read
62
.global cp0_count_write
63
.global cp0_hi_read
64
.global cp0_hi_write
65
.global cp0_compare_read
66
.global cp0_compare_write
67
.global cp0_status_read
68
.global cp0_status_write
69
.global cp0_cause_read
124 decky 70
.global cp0_cause_write
1 jermar 71
.global cp0_epc_read
72
.global cp0_epc_write
73
.global cp0_prid_read
74
 
75
cp0_index_read:		cp0_read $0
76
cp0_index_write:	cp0_write $0
77
 
78
cp0_random_read:	cp0_read $1
79
 
80
cp0_entry_lo0_read:	cp0_read $2
81
cp0_entry_lo0_write:	cp0_write $2
82
 
83
cp0_entry_lo1_read:	cp0_read $3
84
cp0_entry_lo1_write:	cp0_write $3
85
 
86
cp0_context_read:	cp0_read $4
87
cp0_context_write:	cp0_write $4
88
 
89
cp0_pagemask_read:	cp0_read $5
90
cp0_pagemask_write:	cp0_write $5
91
 
92
cp0_wired_read:		cp0_read $6
93
cp0_wired_write:	cp0_write $6
94
 
95
cp0_badvaddr_read:	cp0_read $8
96
 
97
cp0_count_read:		cp0_read $9
98
cp0_count_write:	cp0_write $9
99
 
100
cp0_entry_hi_read:	cp0_read $10
101
cp0_entry_hi_write:	cp0_write $10
102
 
103
cp0_compare_read:	cp0_read $11
104
cp0_compare_write:	cp0_write $11
105
 
106
cp0_status_read:	cp0_read $12
107
cp0_status_write:	cp0_write $12
108
 
109
cp0_cause_read:		cp0_read $13
124 decky 110
cp0_cause_write:	cp0_write $13
1 jermar 111
 
112
cp0_epc_read:		cp0_read $14
113
cp0_epc_write:		cp0_write $14
114
 
115
cp0_prid_read:		cp0_read $15
116
 
117
 
118
.global tlbp
119
tlbp:
120
	tlbp
121
	j $31
122
	nop
123
 
124
.global tlbr
125
tlbr:
126
	tlbr
127
	j $31
128
	nop
129
 
130
.global tlbwi
131
tlbwi:
132
	tlbwi
133
	j $31
134
	nop
135
 
136
.global tlbwr
137
tlbwr:
138
	tlbwr
139
	j $31
140
	nop
141
 
142
.global cpu_halt
143
cpu_halt:
144
	j cpu_halt
145
	nop
146
 
147
 
59 jermar 148
.global memsetb
149
memsetb:
150
	j _memsetb
151
	nop
152
 
205 jermar 153
.global memcpy
154
memcpy:
155
	j _memcpy
105 jermar 156
	nop
157
 
1 jermar 158
# THIS IS USERSPACE CODE
159
.global utext
160
utext:
161
	j $31
162
	nop
163
utext_end:
164
 
165
.data
166
.global utext_size
167
utext_size:
168
	.long utext_end-utext
169