patch-pre2.0.8 linux/arch/ppc/boot/compressed/head.S

Next file: linux/arch/ppc/boot/compressed/inflate.c
Previous file: linux/arch/ppc/boot/compressed/gzip.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file pre2.0.7/linux/arch/ppc/boot/compressed/head.S linux/arch/ppc/boot/compressed/head.S
@@ -0,0 +1,33 @@
+#include "ppc_defs.h"
+
+	.text
+/*
+ * This code may be executed by a bootstrap process.  If so, the
+ * purpose is to relocate the loaded image to it's final location
+ * in memory.
+ *    R3: End of image
+ *    R4: Start of image - 0x400
+ *
+ */
+	.globl	start
+start:
+	addi	r4,r4,0x400	/* Point at start of image */
+	lis	r5,start@h	/* Load address */
+	ori	r5,r5,start@l
+	subi	r4,r4,4		/* Adjust for auto-increment */
+	subi	r5,r5,4
+	subi	r3,r3,4
+00:	lwzu	r0,4(r4)	/* Fast move */
+	stwu	r0,4(r5)
+	cmp	0,r3,r4
+	bne	00b
+	lis	r5,continue@h	/* Actual code starts here */
+	ori	r5,r5,continue@l
+	mtlr	r5
+	blr
+
+continue:
+	bl	decompress_kernel
+	li	r5,0x100	/* Kernel code starts here */
+	mtlr	r5
+	blr	

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this