Now we have Sysseg_pa value so no need to calculate it from KVA Sysseg. Tested on hp300. XXX: mac68k seems to have a different VA vs PA mechanism so I leave it for now.diff -r1.20 -r1.21 src/sys/arch/cesfic/cesfic/locore.s
(tsutsui)
--- src/sys/arch/cesfic/cesfic/locore.s 2009/12/11 18:28:35 1.20
+++ src/sys/arch/cesfic/cesfic/locore.s 2009/12/13 11:24:02 1.21
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: locore.s,v 1.20 2009/12/11 18:28:35 tsutsui Exp $ */ | 1 | /* $NetBSD: locore.s,v 1.21 2009/12/13 11:24:02 tsutsui Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1980, 1990, 1993 | 4 | * Copyright (c) 1980, 1990, 1993 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to Berkeley by | 7 | * This code is derived from software contributed to Berkeley by | |
8 | * the Systems Programming Group of the University of Utah Computer | 8 | * the Systems Programming Group of the University of Utah Computer | |
9 | * Science Department. | 9 | * Science Department. | |
10 | * | 10 | * | |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without | |
12 | * modification, are permitted provided that the following conditions | 12 | * modification, are permitted provided that the following conditions | |
13 | * are met: | 13 | * are met: | |
14 | * 1. Redistributions of source code must retain the above copyright | 14 | * 1. Redistributions of source code must retain the above copyright | |
@@ -235,51 +235,50 @@ Lnot8M: | @@ -235,51 +235,50 @@ Lnot8M: | |||
235 | Lunkmem: | 235 | Lunkmem: | |
236 | /* ??? */ | 236 | /* ??? */ | |
237 | movl #0x20400000, %d1 | memory end, assume at least 4M | 237 | movl #0x20400000, %d1 | memory end, assume at least 4M | |
238 | 238 | |||
239 | Lmemok: | 239 | Lmemok: | |
240 | moveq #PGSHIFT,%d2 | 240 | moveq #PGSHIFT,%d2 | |
241 | lsrl %d2,%d1 | convert to page (click) number | 241 | lsrl %d2,%d1 | convert to page (click) number | |
242 | movl %a5,%d0 | lowram value from ROM via boot | 242 | movl %a5,%d0 | lowram value from ROM via boot | |
243 | lsrl %d2,%d0 | convert to page number | 243 | lsrl %d2,%d0 | convert to page number | |
244 | subl %d0,%d1 | compute amount of RAM present | 244 | subl %d0,%d1 | compute amount of RAM present | |
245 | RELOC(physmem, %a0) | 245 | RELOC(physmem, %a0) | |
246 | movl %d1,%a0@ | and physmem | 246 | movl %d1,%a0@ | and physmem | |
247 | /* configure kernel and lwp0 VA space so we can get going */ | 247 | /* configure kernel and lwp0 VA space so we can get going */ | |
248 | .globl _Sysseg, _pmap_bootstrap, _avail_start | 248 | .globl _Sysseg_pa, _pmap_bootstrap, _avail_start | |
249 | #if NKSYMS || defined(DDB) || defined(LKM) | 249 | #if NKSYMS || defined(DDB) || defined(LKM) | |
250 | RELOC(esym,%a0) | end of static kernel test/data/syms | 250 | RELOC(esym,%a0) | end of static kernel test/data/syms | |
251 | movl %a0@,%d5 | 251 | movl %a0@,%d5 | |
252 | jne Lstart2 | 252 | jne Lstart2 | |
253 | #endif | 253 | #endif | |
254 | movl #_C_LABEL(end),%d5 | end of static kernel text/data | 254 | movl #_C_LABEL(end),%d5 | end of static kernel text/data | |
255 | Lstart2: | 255 | Lstart2: | |
256 | addl #PAGE_SIZE-1,%d5 | 256 | addl #PAGE_SIZE-1,%d5 | |
257 | andl #PG_FRAME,%d5 | round to a page | 257 | andl #PG_FRAME,%d5 | round to a page | |
258 | movl %d5,%a4 | 258 | movl %d5,%a4 | |
259 | addl %a5,%a4 | convert to PA | 259 | addl %a5,%a4 | convert to PA | |
260 | subl #KERNBASE, %a4 | 260 | subl #KERNBASE, %a4 | |
261 | pea %a5@ | firstpa | 261 | pea %a5@ | firstpa | |
262 | pea %a4@ | nextpa | 262 | pea %a4@ | nextpa | |
263 | RELOC(pmap_bootstrap,%a0) | 263 | RELOC(pmap_bootstrap,%a0) | |
264 | jbsr %a0@ | pmap_bootstrap(firstpa, nextpa) | 264 | jbsr %a0@ | pmap_bootstrap(firstpa, nextpa) | |
265 | addql #8,%sp | 265 | addql #8,%sp | |
266 | 266 | |||
267 | /* | 267 | /* | |
268 | * Prepare to enable MMU. | 268 | * Prepare to enable MMU. | |
269 | */ | 269 | */ | |
270 | RELOC(Sysseg, %a0) | system segment table addr | 270 | RELOC(Sysseg_pa, %a0) | system segment table addr | |
271 | movl %a0@,%d1 | read value (a KVA) | 271 | movl %a0@,%d1 | read value (a PA) | |
272 | addl %a5,%d1 | convert to PA | |||
273 | subl #KERNBASE, %d1 | 272 | subl #KERNBASE, %d1 | |
274 | 273 | |||
275 | RELOC(mmutype, %a0) | 274 | RELOC(mmutype, %a0) | |
276 | cmpl #MMU_68040,%a0@ | 68040? | 275 | cmpl #MMU_68040,%a0@ | 68040? | |
277 | jne Lmotommu1 | no, skip | 276 | jne Lmotommu1 | no, skip | |
278 | .long 0x4e7b1807 | movc d1,srp | 277 | .long 0x4e7b1807 | movc d1,srp | |
279 | jra Lstploaddone | 278 | jra Lstploaddone | |
280 | Lmotommu1: | 279 | Lmotommu1: | |
281 | RELOC(protorp, %a0) | 280 | RELOC(protorp, %a0) | |
282 | movl #0x80000202,%a0@ | nolimit + share global + 4 byte PTEs | 281 | movl #0x80000202,%a0@ | nolimit + share global + 4 byte PTEs | |
283 | movl %d1,%a0@(4) | + segtable address | 282 | movl %d1,%a0@(4) | + segtable address | |
284 | pmove %a0@,%srp | load the supervisor root pointer | 283 | pmove %a0@,%srp | load the supervisor root pointer | |
285 | movl #0x80000002,%a0@ | reinit upper half for CRP loads | 284 | movl #0x80000002,%a0@ | reinit upper half for CRP loads |
--- src/sys/arch/hp300/hp300/locore.s 2009/12/12 16:37:22 1.150
+++ src/sys/arch/hp300/hp300/locore.s 2009/12/13 11:24:02 1.151
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: locore.s,v 1.150 2009/12/12 16:37:22 tsutsui Exp $ */ | 1 | /* $NetBSD: locore.s,v 1.151 2009/12/13 11:24:02 tsutsui Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1980, 1990, 1993 | 4 | * Copyright (c) 1980, 1990, 1993 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to Berkeley by | 7 | * This code is derived from software contributed to Berkeley by | |
8 | * the Systems Programming Group of the University of Utah Computer | 8 | * the Systems Programming Group of the University of Utah Computer | |
9 | * Science Department. | 9 | * Science Department. | |
10 | * | 10 | * | |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without | |
12 | * modification, are permitted provided that the following conditions | 12 | * modification, are permitted provided that the following conditions | |
13 | * are met: | 13 | * are met: | |
14 | * 1. Redistributions of source code must retain the above copyright | 14 | * 1. Redistributions of source code must retain the above copyright | |
@@ -443,29 +443,28 @@ Lstart3: | @@ -443,29 +443,28 @@ Lstart3: | |||
443 | jbsr %a0@ | pmap_bootstrap(firstpa, nextpa) | 443 | jbsr %a0@ | pmap_bootstrap(firstpa, nextpa) | |
444 | addql #8,%sp | 444 | addql #8,%sp | |
445 | 445 | |||
446 | /* | 446 | /* | |
447 | * Prepare to enable MMU. | 447 | * Prepare to enable MMU. | |
448 | * Since the kernel is not mapped logical == physical we must insure | 448 | * Since the kernel is not mapped logical == physical we must insure | |
449 | * that when the MMU is turned on, all prefetched addresses (including | 449 | * that when the MMU is turned on, all prefetched addresses (including | |
450 | * the PC) are valid. In order guarantee that, we use the last physical | 450 | * the PC) are valid. In order guarantee that, we use the last physical | |
451 | * page (which is conveniently mapped == VA) and load it up with enough | 451 | * page (which is conveniently mapped == VA) and load it up with enough | |
452 | * code to defeat the prefetch, then we execute the jump back to here. | 452 | * code to defeat the prefetch, then we execute the jump back to here. | |
453 | * | 453 | * | |
454 | * Is this all really necessary, or am I paranoid?? | 454 | * Is this all really necessary, or am I paranoid?? | |
455 | */ | 455 | */ | |
456 | RELOC(Sysseg, %a0) | system segment table addr | 456 | RELOC(Sysseg_pa, %a0) | system segment table addr | |
457 | movl %a0@,%d1 | read value (a KVA) | 457 | movl %a0@,%d1 | read value (a PA) | |
458 | addl %a5,%d1 | convert to PA | |||
459 | RELOC(mmutype, %a0) | 458 | RELOC(mmutype, %a0) | |
460 | tstl %a0@ | HP MMU? | 459 | tstl %a0@ | HP MMU? | |
461 | jeq Lhpmmu2 | yes, skip | 460 | jeq Lhpmmu2 | yes, skip | |
462 | cmpl #MMU_68040,%a0@ | 68040? | 461 | cmpl #MMU_68040,%a0@ | 68040? | |
463 | jne Lmotommu1 | no, skip | 462 | jne Lmotommu1 | no, skip | |
464 | .long 0x4e7b1807 | movc %d1,%srp | 463 | .long 0x4e7b1807 | movc %d1,%srp | |
465 | jra Lstploaddone | 464 | jra Lstploaddone | |
466 | Lmotommu1: | 465 | Lmotommu1: | |
467 | RELOC(protorp, %a0) | 466 | RELOC(protorp, %a0) | |
468 | movl #0x80000202,%a0@ | nolimit + share global + 4 byte PTEs | 467 | movl #0x80000202,%a0@ | nolimit + share global + 4 byte PTEs | |
469 | movl %d1,%a0@(4) | + segtable address | 468 | movl %d1,%a0@(4) | + segtable address | |
470 | pmove %a0@,%srp | load the supervisor root pointer | 469 | pmove %a0@,%srp | load the supervisor root pointer | |
471 | movl #0x80000002,%a0@ | reinit upper half for CRP loads | 470 | movl #0x80000002,%a0@ | reinit upper half for CRP loads |
--- src/sys/arch/luna68k/luna68k/locore.s 2009/12/11 18:28:35 1.32
+++ src/sys/arch/luna68k/luna68k/locore.s 2009/12/13 11:24:02 1.33
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: locore.s,v 1.32 2009/12/11 18:28:35 tsutsui Exp $ */ | 1 | /* $NetBSD: locore.s,v 1.33 2009/12/13 11:24:02 tsutsui Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1980, 1990, 1993 | 4 | * Copyright (c) 1980, 1990, 1993 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to Berkeley by | 7 | * This code is derived from software contributed to Berkeley by | |
8 | * the Systems Programming Group of the University of Utah Computer | 8 | * the Systems Programming Group of the University of Utah Computer | |
9 | * Science Department. | 9 | * Science Department. | |
10 | * | 10 | * | |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without | |
12 | * modification, are permitted provided that the following conditions | 12 | * modification, are permitted provided that the following conditions | |
13 | * are met: | 13 | * are met: | |
14 | * 1. Redistributions of source code must retain the above copyright | 14 | * 1. Redistributions of source code must retain the above copyright | |
@@ -257,29 +257,28 @@ Lstart3: | @@ -257,29 +257,28 @@ Lstart3: | |||
257 | addl #PAGE_SIZE-1,%d2 | 257 | addl #PAGE_SIZE-1,%d2 | |
258 | andl #PG_FRAME,%d2 | round to a page | 258 | andl #PG_FRAME,%d2 | round to a page | |
259 | movl %d2,%a4 | 259 | movl %d2,%a4 | |
260 | addl %a5,%a4 | convert to PA | 260 | addl %a5,%a4 | convert to PA | |
261 | pea %a5@ | firstpa | 261 | pea %a5@ | firstpa | |
262 | pea %a4@ | nextpa | 262 | pea %a4@ | nextpa | |
263 | RELOC(pmap_bootstrap,%a0) | 263 | RELOC(pmap_bootstrap,%a0) | |
264 | jbsr %a0@ | pmap_bootstrap(firstpa, nextpa) | 264 | jbsr %a0@ | pmap_bootstrap(firstpa, nextpa) | |
265 | addql #8,%sp | 265 | addql #8,%sp | |
266 | /* | 266 | /* | |
267 | * Enable the MMU. | 267 | * Enable the MMU. | |
268 | * Since the kernel is mapped logical == physical, we just turn it on. | 268 | * Since the kernel is mapped logical == physical, we just turn it on. | |
269 | */ | 269 | */ | |
270 | RELOC(Sysseg,%a0) | system segment table addr | 270 | RELOC(Sysseg_pa,%a0) | system segment table addr | |
271 | movl %a0@,%d1 | read value (a KVA) | 271 | movl %a0@,%d1 | read value (a PA) | |
272 | addl %a5,%d1 | convert to PA (%a5 == 0, indeed) | |||
273 | #if defined(M68040) | 272 | #if defined(M68040) | |
274 | RELOC(mmutype,%a0) | 273 | RELOC(mmutype,%a0) | |
275 | cmpl #MMU_68040,%a0@ | 68040? | 274 | cmpl #MMU_68040,%a0@ | 68040? | |
276 | jne Lmotommu1 | no, skip | 275 | jne Lmotommu1 | no, skip | |
277 | Lmotommu0: | 276 | Lmotommu0: | |
278 | .long 0x4e7b1807 | movc %d1,%srp | 277 | .long 0x4e7b1807 | movc %d1,%srp | |
279 | RELOC(proto040tt0,%a0) | 278 | RELOC(proto040tt0,%a0) | |
280 | movl %a0@,%d0 | tt0 range 4000.0000-7fff.ffff | 279 | movl %a0@,%d0 | tt0 range 4000.0000-7fff.ffff | |
281 | .long 0x4e7b0004 | movc %d0,%itt0 | 280 | .long 0x4e7b0004 | movc %d0,%itt0 | |
282 | .long 0x4e7b0006 | movc %d0,%dtt0 | 281 | .long 0x4e7b0006 | movc %d0,%dtt0 | |
283 | RELOC(proto040tt1,%a0) | 282 | RELOC(proto040tt1,%a0) | |
284 | movl %a0@,%d0 | tt1 range 8000.0000-feff.ffff | 283 | movl %a0@,%d0 | tt1 range 8000.0000-feff.ffff | |
285 | .long 0x4e7b0005 | movc %d0,%itt1 | 284 | .long 0x4e7b0005 | movc %d0,%itt1 |
--- src/sys/arch/mvme68k/mvme68k/locore.s 2009/12/11 18:28:35 1.103
+++ src/sys/arch/mvme68k/mvme68k/locore.s 2009/12/13 11:24:03 1.104
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: locore.s,v 1.103 2009/12/11 18:28:35 tsutsui Exp $ */ | 1 | /* $NetBSD: locore.s,v 1.104 2009/12/13 11:24:03 tsutsui Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1980, 1990, 1993 | 4 | * Copyright (c) 1980, 1990, 1993 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to Berkeley by | 7 | * This code is derived from software contributed to Berkeley by | |
8 | * the Systems Programming Group of the University of Utah Computer | 8 | * the Systems Programming Group of the University of Utah Computer | |
9 | * Science Department. | 9 | * Science Department. | |
10 | * | 10 | * | |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without | |
12 | * modification, are permitted provided that the following conditions | 12 | * modification, are permitted provided that the following conditions | |
13 | * are met: | 13 | * are met: | |
14 | * 1. Redistributions of source code must retain the above copyright | 14 | * 1. Redistributions of source code must retain the above copyright | |
@@ -600,29 +600,28 @@ Lstart2: | @@ -600,29 +600,28 @@ Lstart2: | |||
600 | andl #PG_FRAME,%d2 | round to a page | 600 | andl #PG_FRAME,%d2 | round to a page | |
601 | movl %d2,%a4 | 601 | movl %d2,%a4 | |
602 | addl %a5,%a4 | convert to PA | 602 | addl %a5,%a4 | convert to PA | |
603 | pea %a5@ | firstpa | 603 | pea %a5@ | firstpa | |
604 | pea %a4@ | nextpa | 604 | pea %a4@ | nextpa | |
605 | RELOC(pmap_bootstrap,%a0) | 605 | RELOC(pmap_bootstrap,%a0) | |
606 | jbsr %a0@ | pmap_bootstrap(firstpa, nextpa) | 606 | jbsr %a0@ | pmap_bootstrap(firstpa, nextpa) | |
607 | addql #8,%sp | 607 | addql #8,%sp | |
608 | 608 | |||
609 | /* | 609 | /* | |
610 | * Enable the MMU. | 610 | * Enable the MMU. | |
611 | * Since the kernel is mapped logical == physical, we just turn it on. | 611 | * Since the kernel is mapped logical == physical, we just turn it on. | |
612 | */ | 612 | */ | |
613 | RELOC(Sysseg, %a0) | system segment table addr | 613 | RELOC(Sysseg_pa, %a0) | system segment table addr | |
614 | movl %a0@,%d1 | read value (a KVA) | 614 | movl %a0@,%d1 | read value (a PA) | |
615 | addl %a5,%d1 | convert to PA | |||
616 | RELOC(mmutype, %a0) | 615 | RELOC(mmutype, %a0) | |
617 | cmpl #MMU_68040,%a0@ | 68040? | 616 | cmpl #MMU_68040,%a0@ | 68040? | |
618 | jne Lmotommu1 | no, skip | 617 | jne Lmotommu1 | no, skip | |
619 | .long 0x4e7b1807 | movc d1,srp | 618 | .long 0x4e7b1807 | movc d1,srp | |
620 | jra Lstploaddone | 619 | jra Lstploaddone | |
621 | Lmotommu1: | 620 | Lmotommu1: | |
622 | RELOC(protorp, %a0) | 621 | RELOC(protorp, %a0) | |
623 | movl #0x80000202,%a0@ | nolimit + share global + 4 byte PTEs | 622 | movl #0x80000202,%a0@ | nolimit + share global + 4 byte PTEs | |
624 | movl %d1,%a0@(4) | + segtable address | 623 | movl %d1,%a0@(4) | + segtable address | |
625 | pmove %a0@,%srp | load the supervisor root pointer | 624 | pmove %a0@,%srp | load the supervisor root pointer | |
626 | movl #0x80000002,%a0@ | reinit upper half for CRP loads | 625 | movl #0x80000002,%a0@ | reinit upper half for CRP loads | |
627 | Lstploaddone: | 626 | Lstploaddone: | |
628 | RELOC(mmutype, %a0) | 627 | RELOC(mmutype, %a0) |
--- src/sys/arch/news68k/news68k/locore.s 2009/12/12 09:54:42 1.51
+++ src/sys/arch/news68k/news68k/locore.s 2009/12/13 11:24:03 1.52
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: locore.s,v 1.51 2009/12/12 09:54:42 tsutsui Exp $ */ | 1 | /* $NetBSD: locore.s,v 1.52 2009/12/13 11:24:03 tsutsui Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1980, 1990, 1993 | 4 | * Copyright (c) 1980, 1990, 1993 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to Berkeley by | 7 | * This code is derived from software contributed to Berkeley by | |
8 | * the Systems Programming Group of the University of Utah Computer | 8 | * the Systems Programming Group of the University of Utah Computer | |
9 | * Science Department. | 9 | * Science Department. | |
10 | * | 10 | * | |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without | |
12 | * modification, are permitted provided that the following conditions | 12 | * modification, are permitted provided that the following conditions | |
13 | * are met: | 13 | * are met: | |
14 | * 1. Redistributions of source code must retain the above copyright | 14 | * 1. Redistributions of source code must retain the above copyright | |
@@ -355,27 +355,27 @@ Lnotyet: | @@ -355,27 +355,27 @@ Lnotyet: | |||
355 | * kernel. Just drop out to the monitor. | 355 | * kernel. Just drop out to the monitor. | |
356 | */ | 356 | */ | |
357 | TOMONITOR | 357 | TOMONITOR | |
358 | /* NOTREACHED */ | 358 | /* NOTREACHED */ | |
359 | 359 | |||
360 | Lstart1: | 360 | Lstart1: | |
361 | /* initialize source/destination control registers for movs */ | 361 | /* initialize source/destination control registers for movs */ | |
362 | moveq #FC_USERD,%d0 | user space | 362 | moveq #FC_USERD,%d0 | user space | |
363 | movc %d0,%sfc | as source | 363 | movc %d0,%sfc | as source | |
364 | movc %d0,%dfc | and destination of transfers | 364 | movc %d0,%dfc | and destination of transfers | |
365 | /* | 365 | /* | |
366 | * configure kernel and lwp0 VA space so we can get going | 366 | * configure kernel and lwp0 VA space so we can get going | |
367 | */ | 367 | */ | |
368 | .globl _Sysseg, _pmap_bootstrap, _avail_start | 368 | .globl _Sysseg_pa, _pmap_bootstrap, _avail_start | |
369 | 369 | |||
370 | #if NKSYMS || defined(DDB) || defined(LKM) | 370 | #if NKSYMS || defined(DDB) || defined(LKM) | |
371 | RELOC(esym,%a0) | end of static kernel test/data/syms | 371 | RELOC(esym,%a0) | end of static kernel test/data/syms | |
372 | movl %a0@,%d2 | 372 | movl %a0@,%d2 | |
373 | jne Lstart2 | 373 | jne Lstart2 | |
374 | #endif | 374 | #endif | |
375 | RELOC(end,%a0) | 375 | RELOC(end,%a0) | |
376 | movl %a0,%d2 | end of static kernel text/data | 376 | movl %a0,%d2 | end of static kernel text/data | |
377 | Lstart2: | 377 | Lstart2: | |
378 | addl #PAGE_SIZE-1,%d2 | 378 | addl #PAGE_SIZE-1,%d2 | |
379 | andl #PG_FRAME,%d2 | round to a page | 379 | andl #PG_FRAME,%d2 | round to a page | |
380 | movl %d2,%a4 | 380 | movl %d2,%a4 | |
381 | addl %a5,%a4 | convert to PA | 381 | addl %a5,%a4 | convert to PA | |
@@ -388,29 +388,28 @@ Lstart2: | @@ -388,29 +388,28 @@ Lstart2: | |||
388 | RELOC(pmap_bootstrap,%a0) | 388 | RELOC(pmap_bootstrap,%a0) | |
389 | jbsr %a0@ | pmap_bootstrap(firstpa, nextpa) | 389 | jbsr %a0@ | pmap_bootstrap(firstpa, nextpa) | |
390 | addql #8,%sp | 390 | addql #8,%sp | |
391 | /* | 391 | /* | |
392 | * Enable the MMU. | 392 | * Enable the MMU. | |
393 | * Since the kernel is mapped logical == physical, we just turn it on. | 393 | * Since the kernel is mapped logical == physical, we just turn it on. | |
394 | */ | 394 | */ | |
395 | movc %vbr,%d0 | Preserve monitor's VBR address | 395 | movc %vbr,%d0 | Preserve monitor's VBR address | |
396 | movl %d0,_ASM_LABEL(monitor_vbr) | 396 | movl %d0,_ASM_LABEL(monitor_vbr) | |
397 | 397 | |||
398 | movl #_C_LABEL(vectab),%d0 | get our VBR address | 398 | movl #_C_LABEL(vectab),%d0 | get our VBR address | |
399 | movc %d0,%vbr | 399 | movc %d0,%vbr | |
400 | 400 | |||
401 | RELOC(Sysseg, %a0) | system segment table addr | 401 | RELOC(Sysseg_pa, %a0) | system segment table addr | |
402 | movl %a0@,%d1 | read value (a KVA) | 402 | movl %a0@,%d1 | read value (a PA) | |
403 | addl %a5,%d1 | convert to PA | |||
404 | RELOC(mmutype, %a0) | 403 | RELOC(mmutype, %a0) | |
405 | cmpl #MMU_68040,%a0@ | 68040? | 404 | cmpl #MMU_68040,%a0@ | 68040? | |
406 | jne Lmotommu1 | no, skip | 405 | jne Lmotommu1 | no, skip | |
407 | .long 0x4e7b1807 | movc %d1,%srp | 406 | .long 0x4e7b1807 | movc %d1,%srp | |
408 | jra Lstploaddone | 407 | jra Lstploaddone | |
409 | Lmotommu1: | 408 | Lmotommu1: | |
410 | RELOC(protorp, %a0) | 409 | RELOC(protorp, %a0) | |
411 | movl #0x80000202,%a0@ | nolimit + share global + 4 byte PTEs | 410 | movl #0x80000202,%a0@ | nolimit + share global + 4 byte PTEs | |
412 | movl %d1,%a0@(4) | + segtable address | 411 | movl %d1,%a0@(4) | + segtable address | |
413 | pmove %a0@,%srp | load the supervisor root pointer | 412 | pmove %a0@,%srp | load the supervisor root pointer | |
414 | movl #0x80000002,%a0@ | reinit upper half for CRP loads | 413 | movl #0x80000002,%a0@ | reinit upper half for CRP loads | |
415 | Lstploaddone: | 414 | Lstploaddone: | |
416 | RELOC(mmutype, %a0) | 415 | RELOC(mmutype, %a0) |
--- src/sys/arch/next68k/next68k/locore.s 2009/12/11 18:28:35 1.53
+++ src/sys/arch/next68k/next68k/locore.s 2009/12/13 11:24:03 1.54
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: locore.s,v 1.53 2009/12/11 18:28:35 tsutsui Exp $ */ | 1 | /* $NetBSD: locore.s,v 1.54 2009/12/13 11:24:03 tsutsui Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1998 Darrin B. Jewell | 4 | * Copyright (c) 1998 Darrin B. Jewell | |
5 | * Copyright (c) 1980, 1990, 1993 | 5 | * Copyright (c) 1980, 1990, 1993 | |
6 | * The Regents of the University of California. All rights reserved. | 6 | * The Regents of the University of California. All rights reserved. | |
7 | * | 7 | * | |
8 | * This code is derived from software contributed to Berkeley by | 8 | * This code is derived from software contributed to Berkeley by | |
9 | * the Systems Programming Group of the University of Utah Computer | 9 | * the Systems Programming Group of the University of Utah Computer | |
10 | * Science Department. | 10 | * Science Department. | |
11 | * | 11 | * | |
12 | * Redistribution and use in source and binary forms, with or without | 12 | * Redistribution and use in source and binary forms, with or without | |
13 | * modification, are permitted provided that the following conditions | 13 | * modification, are permitted provided that the following conditions | |
14 | * are met: | 14 | * are met: | |
@@ -320,29 +320,28 @@ Lstart3: | @@ -320,29 +320,28 @@ Lstart3: | |||
320 | jbsr %a0@ | pmap_bootstrap(firstpa,nextpa) | 320 | jbsr %a0@ | pmap_bootstrap(firstpa,nextpa) | |
321 | addql #8,%sp | 321 | addql #8,%sp | |
322 | 322 | |||
323 | /* | 323 | /* | |
324 | * Prepare to enable MMU. | 324 | * Prepare to enable MMU. | |
325 | * Since the kernel is not mapped logical == physical we must insure | 325 | * Since the kernel is not mapped logical == physical we must insure | |
326 | * that when the MMU is turned on, all prefetched addresses (including | 326 | * that when the MMU is turned on, all prefetched addresses (including | |
327 | * the PC) are valid. In order guarantee that, we use the last physical | 327 | * the PC) are valid. In order guarantee that, we use the last physical | |
328 | * page (which is conveniently mapped == VA) and load it up with enough | 328 | * page (which is conveniently mapped == VA) and load it up with enough | |
329 | * code to defeat the prefetch, then we execute the jump back to here. | 329 | * code to defeat the prefetch, then we execute the jump back to here. | |
330 | * | 330 | * | |
331 | * Is this all really necessary, or am I paranoid?? | 331 | * Is this all really necessary, or am I paranoid?? | |
332 | */ | 332 | */ | |
333 | RELOC(Sysseg, %a0) | system segment table addr | 333 | RELOC(Sysseg_pa, %a0) | system segment table addr | |
334 | movl %a0@,%d1 | read value (a KVA) | 334 | movl %a0@,%d1 | read value (a PA) | |
335 | addl %a5,%d1 | convert to PA | |||
336 | 335 | |||
337 | RELOC(mmutype, %a0) | 336 | RELOC(mmutype, %a0) | |
338 | #if defined(ENABLE_HP_CODE) | 337 | #if defined(ENABLE_HP_CODE) | |
339 | tstl %a0@ | HP MMU? | 338 | tstl %a0@ | HP MMU? | |
340 | jeq Lhpmmu2 | yes, skip | 339 | jeq Lhpmmu2 | yes, skip | |
341 | #endif | 340 | #endif | |
342 | cmpl #MMU_68040,%a0@ | 68040? | 341 | cmpl #MMU_68040,%a0@ | 68040? | |
343 | jne Lmotommu1 | no, skip | 342 | jne Lmotommu1 | no, skip | |
344 | .long 0x4e7b1807 | movc %d1,%srp | 343 | .long 0x4e7b1807 | movc %d1,%srp | |
345 | jra Lstploaddone | 344 | jra Lstploaddone | |
346 | Lmotommu1: | 345 | Lmotommu1: | |
347 | RELOC(protorp, %a0) | 346 | RELOC(protorp, %a0) | |
348 | movl #0x80000202,%a0@ | nolimit + share global + 4 byte PTEs | 347 | movl #0x80000202,%a0@ | nolimit + share global + 4 byte PTEs |
--- src/sys/arch/x68k/x68k/locore.s 2009/12/11 18:28:35 1.95
+++ src/sys/arch/x68k/x68k/locore.s 2009/12/13 11:24:04 1.96
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: locore.s,v 1.95 2009/12/11 18:28:35 tsutsui Exp $ */ | 1 | /* $NetBSD: locore.s,v 1.96 2009/12/13 11:24:04 tsutsui Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1980, 1990, 1993 | 4 | * Copyright (c) 1980, 1990, 1993 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to Berkeley by | 7 | * This code is derived from software contributed to Berkeley by | |
8 | * the Systems Programming Group of the University of Utah Computer | 8 | * the Systems Programming Group of the University of Utah Computer | |
9 | * Science Department. | 9 | * Science Department. | |
10 | * | 10 | * | |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without | |
12 | * modification, are permitted provided that the following conditions | 12 | * modification, are permitted provided that the following conditions | |
13 | * are met: | 13 | * are met: | |
14 | * 1. Redistributions of source code must retain the above copyright | 14 | * 1. Redistributions of source code must retain the above copyright | |
@@ -853,29 +853,28 @@ Lstart2: | @@ -853,29 +853,28 @@ Lstart2: | |||
853 | jbsr %a0@ | pmap_bootstrap(firstpa, nextpa) | 853 | jbsr %a0@ | pmap_bootstrap(firstpa, nextpa) | |
854 | addql #8,%sp | 854 | addql #8,%sp | |
855 | 855 | |||
856 | /* | 856 | /* | |
857 | * Prepare to enable MMU. | 857 | * Prepare to enable MMU. | |
858 | * Since the kernel is not mapped logical == physical we must insure | 858 | * Since the kernel is not mapped logical == physical we must insure | |
859 | * that when the MMU is turned on, all prefetched addresses (including | 859 | * that when the MMU is turned on, all prefetched addresses (including | |
860 | * the PC) are valid. In order guarantee that, we use the last physical | 860 | * the PC) are valid. In order guarantee that, we use the last physical | |
861 | * page (which is conveniently mapped == VA) and load it up with enough | 861 | * page (which is conveniently mapped == VA) and load it up with enough | |
862 | * code to defeat the prefetch, then we execute the jump back to here. | 862 | * code to defeat the prefetch, then we execute the jump back to here. | |
863 | * | 863 | * | |
864 | * Is this all really necessary, or am I paranoid?? | 864 | * Is this all really necessary, or am I paranoid?? | |
865 | */ | 865 | */ | |
866 | RELOC(Sysseg, %a0) | system segment table addr | 866 | RELOC(Sysseg_pa, %a0) | system segment table addr | |
867 | movl %a0@,%d1 | read value (a KVA) | 867 | movl %a0@,%d1 | read value (a PA) | |
868 | addl %a5,%d1 | convert to PA | |||
869 | RELOC(mmutype, %a0) | 868 | RELOC(mmutype, %a0) | |
870 | cmpl #MMU_68040,%a0@ | 68040? | 869 | cmpl #MMU_68040,%a0@ | 68040? | |
871 | jne Lmotommu1 | no, skip | 870 | jne Lmotommu1 | no, skip | |
872 | .long 0x4e7b1807 | movc d1,srp | 871 | .long 0x4e7b1807 | movc d1,srp | |
873 | jra Lstploaddone | 872 | jra Lstploaddone | |
874 | Lmotommu1: | 873 | Lmotommu1: | |
875 | RELOC(protorp, %a0) | 874 | RELOC(protorp, %a0) | |
876 | movl #0x80000202,%a0@ | nolimit + share global + 4 byte PTEs | 875 | movl #0x80000202,%a0@ | nolimit + share global + 4 byte PTEs | |
877 | movl %d1,%a0@(4) | + segtable address | 876 | movl %d1,%a0@(4) | + segtable address | |
878 | pmove %a0@,%srp | load the supervisor root pointer | 877 | pmove %a0@,%srp | load the supervisor root pointer | |
879 | movl #0x80000002,%a0@ | reinit upper half for CRP loads | 878 | movl #0x80000002,%a0@ | reinit upper half for CRP loads | |
880 | Lstploaddone: | 879 | Lstploaddone: | |
881 | RELOC(mmutype, %a0) | 880 | RELOC(mmutype, %a0) |