source: mainline/arch/mips/src/asm.s@ d47f0e1

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since d47f0e1 was dcbc8be, checked in by Jakub Jermar <jakub@…>, 20 years ago

Big changes in IA-32 address space map.
Now the kernel is mapped above 0x80000000. Finally!
Userspace address space starts at 0x00000000.
Changes in many places.
This improvement temporarily breaks SMP and most likely also other stuff.
Supported size of memory is now only 4M as it is the biggest size that can be mapped at once on IA-32.

Changes in linker script.
Changes required because of the above.
Do not patch hardcoded_* variables but assign to them instead.

Cosmetic changes here and there.

  • Property mode set to 100644
File size: 3.4 KB
Line 
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
32 mfc0 $2,\reg
33 j $31
34 nop
35.endm
36
37.macro cp0_write reg
38 mtc0 $4,\reg
39 j $31
40 nop
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
70.global cp0_epc_read
71.global cp0_epc_write
72.global cp0_prid_read
73
74cp0_index_read: cp0_read $0
75cp0_index_write: cp0_write $0
76
77cp0_random_read: cp0_read $1
78
79cp0_entry_lo0_read: cp0_read $2
80cp0_entry_lo0_write: cp0_write $2
81
82cp0_entry_lo1_read: cp0_read $3
83cp0_entry_lo1_write: cp0_write $3
84
85cp0_context_read: cp0_read $4
86cp0_context_write: cp0_write $4
87
88cp0_pagemask_read: cp0_read $5
89cp0_pagemask_write: cp0_write $5
90
91cp0_wired_read: cp0_read $6
92cp0_wired_write: cp0_write $6
93
94cp0_badvaddr_read: cp0_read $8
95
96cp0_count_read: cp0_read $9
97cp0_count_write: cp0_write $9
98
99cp0_entry_hi_read: cp0_read $10
100cp0_entry_hi_write: cp0_write $10
101
102cp0_compare_read: cp0_read $11
103cp0_compare_write: cp0_write $11
104
105cp0_status_read: cp0_read $12
106cp0_status_write: cp0_write $12
107
108cp0_cause_read: cp0_read $13
109
110cp0_epc_read: cp0_read $14
111cp0_epc_write: cp0_write $14
112
113cp0_prid_read: cp0_read $15
114
115
116.global tlbp
117tlbp:
118 tlbp
119 j $31
120 nop
121
122.global tlbr
123tlbr:
124 tlbr
125 j $31
126 nop
127
128.global tlbwi
129tlbwi:
130 tlbwi
131 j $31
132 nop
133
134.global tlbwr
135tlbwr:
136 tlbwr
137 j $31
138 nop
139
140.global cpu_halt
141cpu_halt:
142 j cpu_halt
143 nop
144
145
146.global memsetb
147memsetb:
148 j _memsetb
149 nop
150
151.global memcopy
152memcopy:
153 j _memcopy
154 nop
155
156# THIS IS USERSPACE CODE
157.global utext
158utext:
159 j $31
160 nop
161utext_end:
162
163.data
164.global utext_size
165utext_size:
166 .long utext_end-utext
167
Note: See TracBrowser for help on using the repository browser.