[ros-diffs] [arty] 26313: Remove boot process LE parts.

arty at svn.reactos.org arty at svn.reactos.org
Tue Apr 10 22:50:00 CEST 2007


Author: arty
Date: Wed Apr 11 00:49:58 2007
New Revision: 26313

URL: http://svn.reactos.org/svn/reactos?rev=26313&view=rev
Log:
Remove boot process LE parts.

Modified:
    branches/powerpc/reactos/boot/freeldr/bootsect/ofw_util.s
    branches/powerpc/reactos/boot/freeldr/bootsect/ofwboot.s
    branches/powerpc/reactos/tools/ofw_interface/ofw_interface.cpp
    branches/powerpc/reactos/tools/ppc.lost+found/link-freeldr

Modified: branches/powerpc/reactos/boot/freeldr/bootsect/ofw_util.s
URL: http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/boot/freeldr/bootsect/ofw_util.s?rev=26313&r1=26312&r2=26313&view=diff
==============================================================================
--- branches/powerpc/reactos/boot/freeldr/bootsect/ofw_util.s (original)
+++ branches/powerpc/reactos/boot/freeldr/bootsect/ofw_util.s Wed Apr 11 00:49:58 2007
@@ -1,104 +1,50 @@
 	.section .text
-
-	.globl ofw_functions_addr
-ofw_functions_addr:
-	.long	ofw_functions
-
-	.align	4
-call_freeldr:
-	/* Get the address of the functions list --
-	 * Note:
-	 * Because of little endian switch we must use an even number of
-	 * instructions here..  Pad with a nop if needed. */
-	mfmsr	%r10
-	ori	%r10,%r10,1
-	nop
-	mtmsr	%r10
-	
-	/* Note that this is little-endian from here on */
-	blr
-	nop
-
-	.align  4
-call_ofw:
-	/* R3 has the function offset to call (n * 4) 
-	 * Other arg registers are unchanged.
-	 * Note that these 4 instructions are in reverse order due to
-	 * little-endian convention */
-	stw	%r8,24(%r1)
-	subi	%r1,%r1,0x100
-	stw	%r8,0(%r1)
-	mflr	%r8
-	/* - */
-	stw	%r3,4(%r1)
-	stw	%r4,8(%r1)
-	stw	%r5,12(%r1)
-	stw	%r6,16(%r1)
-	/* - */
-	stw	%r7,20(%r1)
-	stw	%r9,28(%r1)
-	stw	%r10,32(%r1)
-	stw	%r20,36(%r1)
-	
-	/* - */	
-	subi	%r20,%r20,1
-	mfmsr	%r20
-	mtmsr	%r20
-	nop
-
-	sync
-	isync
-
-	/* BE MODE */
-	mflr	%r8
-	stw	%r8,16(%r1)
-
-	lis	%r10,0xe00000 at ha
-	addi	%r8,%r10,ofw_functions_addr at l
-	/* - */
-	lwz	%r9,0(%r8)
-	add	%r8,%r3,%r9
-	lwz	%r9,0(%r8)
-	mtctr	%r9
-	
-	/* - */
-	mr	%r3,%r4
-	mr	%r4,%r5
-	mr	%r5,%r6
-	mr	%r6,%r7
-	/* - */
-	mr	%r7,%r8
-	mr	%r8,%r9
-	
-	/* Call ofw proxy function */
-	bctrl
-	nop
-
-	/* Ok, go back to little endian */
-	mfmsr	%r10
-	ori	%r10,%r10,1
-	nop
-	mtmsr	%r10
-
-	sync
-	isync
-
-	/* LE MODE */
-	mtlr	%r8
-	lwz	%r8,0(%r1)
-	lwz	%r4,8(%r1)
-	lwz	%r5,12(%r1)
-	/* - */
-	lwz	%r6,16(%r1)
-	lwz	%r7,20(%r1)
-	lwz	%r8,24(%r1)
-	lwz	%r9,28(%r1)
-	/* - */
-	lwz	%r10,32(%r1)
-	lwz	%r20,36(%r1)
-	/* - */
-	blr
-	addi	%r1,%r1,0x100
+	.globl ofw_functions
+	.globl ofw_call_addr
+call_ofw:	
+       /* R3 has the function offset to call (n * 4)
+        * Other arg registers are unchanged. */
+       subi    %r1,%r1,0x100
+       stw     %r8,24(%r1)
+       mflr    %r8
+       stw     %r8,0(%r1)
+       stw     %r3,4(%r1)
+       stw     %r4,8(%r1)
+       stw     %r5,12(%r1)
+       stw     %r6,16(%r1)
+       stw     %r7,20(%r1)
+       stw     %r9,28(%r1)
+       stw     %r10,32(%r1)
+       stw     %r20,36(%r1)
+
+       lis     %r10,0xe00000 at ha
+       addi    %r8,%r10,ofw_functions at l
+       add     %r8,%r3,%r8
+       lwz     %r9,0(%r8)
+       mtctr   %r9
+
+       mr      %r3,%r4
+       mr      %r4,%r5
+       mr      %r5,%r6
+       mr      %r6,%r7
+       mr      %r7,%r8
+       mr      %r8,%r9
+
+       /* Call ofw proxy function */
+       bctrl
+
+       lwz     %r8,0(%r1)
+       mtlr    %r8
+       lwz     %r4,8(%r1)
+       lwz     %r5,12(%r1)
+       lwz     %r6,16(%r1)
+       lwz     %r7,20(%r1)
+       lwz     %r8,24(%r1)
+       lwz     %r9,28(%r1)
+       lwz     %r10,32(%r1)
+       lwz     %r20,36(%r1)
+       addi    %r1,%r1,0x100
+       blr
 
 prim_strlen:
 	mr	%r5,%r3

Modified: branches/powerpc/reactos/boot/freeldr/bootsect/ofwboot.s
URL: http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/boot/freeldr/bootsect/ofwboot.s?rev=26313&r1=26312&r2=26313&view=diff
==============================================================================
--- branches/powerpc/reactos/boot/freeldr/bootsect/ofwboot.s (original)
+++ branches/powerpc/reactos/boot/freeldr/bootsect/ofwboot.s Wed Apr 11 00:49:58 2007
@@ -5,7 +5,9 @@
 	.long	0
 	.long	0
 	
-	.globl _begin
+	.globl	_begin
+	.globl	call_ofw
+	.globl	ofw_functions
 _begin:
 	sync                    
 	isync
@@ -33,11 +35,10 @@
 	addi	%r3,%r3,0xe17000 at l
 
 	mtlr	%r3
+	lis	%r3,0xe00000 at ha
+	addi	%r3,%r3,call_ofw - _start at l
 
-	lis	%r3,call_ofw at ha
-	addi	%r3,%r3,call_ofw - _start
-
-	b	call_freeldr
+	blr
 
 zero_registers:
 	xor	%r2,%r2,%r2

Modified: branches/powerpc/reactos/tools/ofw_interface/ofw_interface.cpp
URL: http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/tools/ofw_interface/ofw_interface.cpp?rev=26313&r1=26312&r2=26313&view=diff
==============================================================================
--- branches/powerpc/reactos/tools/ofw_interface/ofw_interface.cpp (original)
+++ branches/powerpc/reactos/tools/ofw_interface/ofw_interface.cpp Wed Apr 11 00:49:58 2007
@@ -47,10 +47,6 @@
 	len = other.len;
 	lit_value = other.lit_value;
 	return *this;
-    }
-
-    bool need_swap() const {
-	return c_type.find('*') != std::string::npos;
     }
 
     std::string c_type;
@@ -205,41 +201,20 @@
 	    le_stub << "\t" << argtypes[i].c_type << " arg" << i << " = " 
 		    << argtypes[i].lit_value << ";\n";
 	}
-	if( argtypes[i].need_swap() ) {
-	    le_stub << "\tint len" << i << " = ";
-	    if( argtypes[i].len.size() ) 
-		le_stub << argtypes[i].len << ";\n";
-	    else {
-		le_stub << "strlen(arg" << i << ");\n";
-	    }
-	    le_stub << "\tle_swap("
-		    << "arg" << i << "," 
-		    << "arg" << i << "+len" << i << ","
-		    << "arg" << i << ");\n";
-	}
     }
 
     le_stub << "\t";
     if( rettype != "void" ) le_stub << "ret = (" << rettype << ")";
 
     le_stub << "ofproxy(" << 
-	(method_call ? (wrapper.method_ctindex * 4) : (wrapper.ctindex * 4));
-    
+      (method_call ? (wrapper.method_ctindex * 4) : (wrapper.ctindex * 4));
+
     for( i = 0; i < 6; i++ ) {
 	if( i < args ) le_stub << ",(void *)arg" << i;
 	else le_stub << ",NULL";
     }
 
     le_stub << ");\n";
-
-    for( i = args-1; i >= 0; i-- ) {
-	if( argtypes[i].need_swap() ) {
-	    le_stub << "\tle_swap("
-		    << "arg" << i << "," 
-		    << "arg" << i << "+len" << i << ","
-		    << "arg" << i << ");\n";
-	}
-    }
 
     if( rettype != "void" ) 
 	le_stub << "\treturn ret;\n";

Modified: branches/powerpc/reactos/tools/ppc.lost+found/link-freeldr
URL: http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/tools/ppc.lost%2Bfound/link-freeldr?rev=26313&r1=26312&r2=26313&view=diff
==============================================================================
--- branches/powerpc/reactos/tools/ppc.lost+found/link-freeldr (original)
+++ branches/powerpc/reactos/tools/ppc.lost+found/link-freeldr Wed Apr 11 00:49:58 2007
@@ -2,7 +2,7 @@
 
 export PATH=$PATH:/usr/local/pkg/reactos-powerpc/bin
 powerpc-unknown-linux-gnu-ld \
-	-EL -g -nostartfiles -nostdlib -N -Ttext=0xe17000 \
+	-g -nostartfiles -nostdlib -N -Ttext=0xe17000 \
 	-o freeldr.elf \
 	obj-ppc/boot/freeldr/freeldr/arch/powerpc/boot.o \
 	obj-ppc/boot/freeldr/freeldr/cache/blocklist.o \
@@ -63,8 +63,7 @@
 	obj-ppc/lib/string/string.a \
 	obj-ppc/lib/rtl/rtl.a \
 	/usr/local/pkg/reactos-powerpc/lib/libgcc.a
-powerpc-unknown-linux-gnu-objcopy -O binary freeldr.elf freeldr.tmp.le
-output-ppc/tools/ppc-le2be freeldr.tmp.le freeldr.tmp
+powerpc-unknown-linux-gnu-objcopy -O binary freeldr.elf freeldr.tmp
 (dd if=/dev/zero bs=4k count=16 ; echo 'byebye') >> freeldr.tmp
 powerpc-unknown-linux-gnu-objcopy -I binary -B powerpc:common -O elf32-powerpc freeldr.tmp ofwldr.payload
 reactos-powerpc-as -mbig -o ofwboot.o boot/freeldr/bootsect/ofwboot.s boot/freeldr/bootsect/ofw_util.s boot/freeldr/bootsect/ofw.s




More information about the Ros-diffs mailing list