Rev 2071 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2071 | Rev 3825 | ||
---|---|---|---|
Line 26... | Line 26... | ||
26 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | # |
27 | # |
28 | 28 | ||
29 | #include "asm.h" |
29 | #include "asm.h" |
30 | #include "regname.h" |
30 | #include "regname.h" |
31 | #include "debug.inc" |
- | |
32 | 31 | ||
33 | .text |
32 | .text |
34 | 33 | ||
35 | .global halt |
34 | .global halt |
36 | .global memcpy |
35 | .global memcpy |
Line 138... | Line 137... | ||
138 | .align PAGE_WIDTH |
137 | .align PAGE_WIDTH |
139 | .global real_mode |
138 | .global real_mode |
140 | 139 | ||
141 | real_mode: |
140 | real_mode: |
142 | 141 | ||
143 | DEBUG_INIT |
- | |
144 | DEBUG_real_mode |
- | |
145 | - | ||
146 | # copy kernel to proper location |
142 | # copy kernel to proper location |
147 | # |
143 | # |
148 | # r5 = trans (pa) |
144 | # r5 = trans (pa) |
149 | # r6 = bytes to copy |
145 | # r6 = bytes to copy |
150 | # r8 = framebuffer (pa) |
146 | # r8 = framebuffer (pa) |
Line 161... | Line 157... | ||
161 | # copy page |
157 | # copy page |
162 | 158 | ||
163 | mtctr r31 |
159 | mtctr r31 |
164 | lwz r29, 0(r5) |
160 | lwz r29, 0(r5) |
165 | 161 | ||
166 | DEBUG_INIT |
- | |
167 | DEBUG_copy_loop |
- | |
168 | - | ||
169 | copy_loop: |
162 | copy_loop: |
170 | 163 | ||
171 | lwz r28, 0(r29) |
164 | lwz r28, 0(r29) |
172 | stw r28, 0(r30) |
165 | stw r28, 0(r30) |
173 | 166 | ||
Line 178... | Line 171... | ||
178 | cmpwi r6, 0 |
171 | cmpwi r6, 0 |
179 | beq copy_end |
172 | beq copy_end |
180 | 173 | ||
181 | bdnz copy_loop |
174 | bdnz copy_loop |
182 | 175 | ||
183 | DEBUG_end_copy_loop |
- | |
184 | - | ||
185 | addi r5, r5, 4 |
176 | addi r5, r5, 4 |
186 | b page_copy |
177 | b page_copy |
187 | 178 | ||
188 | copy_end: |
179 | copy_end: |
189 | 180 | ||
190 | DEBUG_segments |
- | |
191 | - | ||
192 | # initially fill segment registers |
181 | # initially fill segment registers |
193 | 182 | ||
194 | li r31, 0 |
183 | li r31, 0 |
195 | 184 | ||
196 | li r29, 8 |
185 | li r29, 8 |
Line 219... | Line 208... | ||
219 | bdnz seg_fill_kernel |
208 | bdnz seg_fill_kernel |
220 | 209 | ||
221 | # create empty Page Hash Table |
210 | # create empty Page Hash Table |
222 | # on top of memory, size 64 KB |
211 | # on top of memory, size 64 KB |
223 | 212 | ||
224 | DEBUG_pht |
- | |
225 | - | ||
226 | lwz r31, 0(r3) # r31 = memory size |
213 | lwz r31, 0(r3) # r31 = memory size |
227 | 214 | ||
228 | lis r30, 65536@h |
215 | lis r30, 65536@h |
229 | ori r30, r30, 65536@l # r30 = 65536 |
216 | ori r30, r30, 65536@l # r30 = 65536 |
230 | 217 | ||
Line 250... | Line 237... | ||
250 | 237 | ||
251 | cmpwi r30, 0 |
238 | cmpwi r30, 0 |
252 | beq clear_end |
239 | beq clear_end |
253 | 240 | ||
254 | bdnz pht_clear |
241 | bdnz pht_clear |
255 | - | ||
256 | DEBUG_end_pht_clear |
- | |
257 | 242 | ||
258 | clear_end: |
243 | clear_end: |
259 | 244 | ||
260 | DEBUG_tlb |
- | |
261 | - | ||
262 | tlbia |
- | |
263 | tlbsync |
245 | tlbsync |
264 | 246 | ||
265 | DEBUG_prepare |
- | |
266 | - | ||
267 | # start the kernel |
247 | # start the kernel |
268 | # |
248 | # |
269 | # pc = KERNEL_START_ADDR |
249 | # pc = KERNEL_START_ADDR |
270 | # r3 = bootinfo (pa) |
250 | # r3 = bootinfo (pa) |
271 | # sprg0 = KA2PA(KERNEL_START_ADDR) |
251 | # sprg0 = KA2PA(KERNEL_START_ADDR) |
Line 289... | Line 269... | ||
289 | ori r31, r31, (msr_ir | msr_dr)@l |
269 | ori r31, r31, (msr_ir | msr_dr)@l |
290 | mtspr srr1, r31 |
270 | mtspr srr1, r31 |
291 | 271 | ||
292 | sync |
272 | sync |
293 | isync |
273 | isync |
294 | - | ||
295 | DEBUG_rfi |
- | |
296 | rfid |
274 | rfid |
297 | 275 | ||
298 | .align PAGE_WIDTH |
276 | .align PAGE_WIDTH |
299 | .global trans |
277 | .global trans |
300 | trans: |
278 | trans: |