Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Dec 2005 06:22:01 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 88024 for review
Message-ID:  <200512110622.jBB6M1bq083813@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=88024

Change 88024 by imp@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200512110622.jBB6M1bq083813>