PERFORCE change 88024 for review
Warner Losh
imp at FreeBSD.org
Sat Dec 10 22:22:02 PST 2005
http://perforce.freebsd.org/chv.cgi?CH=88024
Change 88024 by imp at imp_plunger on 2005/12/11 06:21:10
Remove some debug LED wiggling.
Hopefully, properly implement the following bit if C code to
determine if we need to adjust the pc from PA to VA:
#if KERNVIRTADDR > KERNPHYSADDR
if (pc < KERNVIRTADDR)
pc += KERNVIRTADDR - KERNPHYSADDR;
#else
if (pc > KERNPHYSADDR)
pc -= KERNVIRTADDR - KERNPHYSADDR;
#endif
If va > pa, then we need to test to see if the pc is already > va
(since we know it will already be > pa).
If pa > va, then we check to see if it is below pa, in which case
we know it is already adjusted.
This eliminates the need for the va == pa hack in initarm, and we
get all the way to the mountroot> prompt. Of course, we have a lot
of work to do before that will work...
Affected files ...
.. //depot/projects/arm/src/sys/arm/arm/locore.S#11 edit
Differences ...
==== //depot/projects/arm/src/sys/arm/arm/locore.S#11 (text+ko) ====
@@ -155,7 +155,6 @@
Lunmapped:
R7SYS
- LED1ON
#ifdef STARTUP_PAGETABLE_ADDR
/* build page table from scratch */
ldr r0, Lstartup_pagetable
@@ -202,16 +201,17 @@
subs r2, r2, #4
bgt .L1
- ldr r4, =KERNVIRTADDR
- cmp pc, r4
#if KERNVIRTADDR > KERNPHYSADDR
- bgt virt_done
ldr r4, =KERNVIRTADDR
+ cmp r4, pc
+ bgt virt_done /* if pc is > KERNVIRTADDR, no adj */
ldr r5, =KERNPHYSADDR
sub r4, r4, r5
add pc, pc, r4
#else
- blt virt_done
+ ldr r4, =KERNPHYSADDR
+ cmp r4, pc
+ blt virt_done /* if pc is < KERNPHYSADDR, no adj */
ldr r4, =KERNPHYSADDR
ldr r5, =KERNVIRTADDR
sub r4, r4, r5
@@ -219,14 +219,12 @@
#endif
virt_done:
nop
- LED2ON
mov fp, #0 /* trace back starts here */
bl _C_LABEL(initarm) /* Off we go */
/* init arm will return the new stack pointer. */
mov sp, r0
- LED3ON
bl _C_LABEL(mi_startup) /* call mi_startup()! */
adr r0, .Lmainreturned
More information about the p4-projects
mailing list