Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Feb 2008 03:01:25 GMT
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 135618 for review
Message-ID:  <200802180301.m1I31PZA024993@repoman.freebsd.org>

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

Change 135618 by marcel@marcel_xcllnt on 2008/02/18 03:00:27

	Save the address of the global data structure in
	uboot_address. This will be used by the U-Boot
	library in the API search algorithm.
	
	Disable interrupts on entry and enable them for
	the duration of the syscall.

Affected files ...

.. //depot/projects/e500/sys/boot/powerpc/uboot/start.S#7 edit

Differences ...

==== //depot/projects/e500/sys/boot/powerpc/uboot/start.S#7 (text+ko) ====

@@ -40,11 +40,18 @@
 	lis	%r1, stack@ha
 	addi	%r1, %r1, stack@l
 	addi	%r1, %r1, (STACK_SIZE - 32)
-	/* Save U-Boot's r14 and r29 */
+	/* Hint where to look for the API signature */
+	lis	%r11, uboot_address@ha
+	addi	%r11, %r11, uboot_address@l
+	stw	%r2, 0(%r11)
+	/* Save U-Boot's r14 */
 	lis	%r11, saved_regs@ha
 	addi	%r11, %r11, saved_regs@l
 	stw	%r14, 0(%r11)
-	stw	%r29, 4(%r11)
+	/* Disable interrupts */
+	mfmsr	%r11
+	andi.	%r11, %r11, ~0x8000@l
+	mtmsr	%r11
 	b	main
 
 /*
@@ -54,25 +61,30 @@
 	stwu	%r1, -16(%r1)
 	mflr	%r0
 	stw	%r14, 8(%r1)
-	stw	%r29, 12(%r1)
 	stw	%r0, 20(%r1)
 	/* Restore U-Boot's r14 and r29 */
 	lis	%r11, saved_regs@ha
 	addi	%r11, %r11, saved_regs@l
 	lwz	%r14, 0(%r11)
-	lwz	%r29, 4(%r11)
+	/* Enable interrupts */
+	mfmsr	%r11
+	ori	%r11, %r11, 0x8000@l
+	mtmsr	%r11
 	/* Call into u-Boot */
 	lis	%r11, syscall_ptr@ha
 	addi	%r11, %r11, syscall_ptr@l
 	lwz	%r11, 0(%r11)
 	mtctr	%r11
 	bctrl
+	/* Disable interrupts */
+	mfmsr	%r11
+	andi.	%r11, %r11, ~0x8000@l
+	mtmsr	%r11
 	/* Epilogue */
 	lwz	%r11, 0(%r1)
 	lwz	%r0, 4(%r11)
 	mtlr	%r0
 	lwz	%r14, 8(%r1)
-	lwz	%r29, 12(%r1)
 	mr	%r1, %r11
 	blr
 
@@ -88,5 +100,5 @@
 	.long	0
 GLOBAL(saved_regs)
 	.long	0	/* R14 */
-	.long	0	/* R29 */
-
+GLOBAL(uboot_address)
+	.long	0



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