diff -uNr linux-2.6.8.1-kexec.ppc/arch/ppc/boot/simple/relocate.S linux-2.6.8.1-homebrew-dol-support.ppc/arch/ppc/boot/simple/relocate.S
--- linux-2.6.8.1-kexec.ppc/arch/ppc/boot/simple/relocate.S	Tue Jun 15 23:19:17 2004
+++ linux-2.6.8.1-homebrew-dol-support.ppc/arch/ppc/boot/simple/relocate.S	Wed Aug 18 15:00:32 2004
@@ -18,6 +18,7 @@
 #include <linux/config.h>
 #include <asm/cache.h>
 #include <asm/ppc_asm.h>
+#include <asm/kexec.h>
 
 #define GETSYM(reg, sym)	\
 	lis	reg, sym@h; ori	reg, reg, sym@l
@@ -174,6 +175,26 @@
 	subi	r1,r1,256
 	li	r2,0x000F	/* Mask pointer to 16-byte boundary */
 	andc	r1,r1,r2
+
+#if defined(CONFIG_KEXEC) && defined(CONFIG_GAMECUBE)
+
+/* Save DolphinOS state, including perhaps Costis psoload reloader,  */
+/* to a temporary location (we will save it later to a safer place) */
+
+	lis	r4, KEXEC_GC_SAVED_STATE_FROM@ha
+	ori	r4, r4, KEXEC_GC_SAVED_STATE_FROM@l
+	lis	r5, KEXEC_GC_SAVED_STATE_TEMP_TO@ha
+	ori	r5, r5, KEXEC_GC_SAVED_STATE_TEMP_TO@l
+	li	r3, KEXEC_GC_SAVED_STATE_SIZE / 4
+	mtctr	r3
+	subi	r4, r4, 4
+	subi	r5, r5, 4
+9:	lwzu	r3, 4(r4)
+	stwu	r3, 4(r5)
+	dcbf	0, r5
+	bdnz	9b
+
+#endif /* CONFIG_KEXEC && CONFIG_GAMECUBE */
 
 	/*
 	 * Exec kernel loader
diff -uNr linux-2.6.8.1-kexec.ppc/arch/ppc/kernel/machine_kexec.c linux-2.6.8.1-homebrew-dol-support.ppc/arch/ppc/kernel/machine_kexec.c
--- linux-2.6.8.1-kexec.ppc/arch/ppc/kernel/machine_kexec.c	Wed Aug 18 15:00:25 2004
+++ linux-2.6.8.1-homebrew-dol-support.ppc/arch/ppc/kernel/machine_kexec.c	Wed Aug 18 15:00:32 2004
@@ -18,6 +18,12 @@
 #include <asm/hw_irq.h>
 #include <asm/cacheflush.h>
 
+#ifdef CONFIG_GAMECUBE
+u32 kexec_gc_saved_state[KEXEC_GC_SAVED_STATE_SIZE/sizeof(u32)] = { 
+	0xDEADC0DE
+};
+#endif /* CONFIG_GAMECUBE */
+
 typedef void (*relocate_new_kernel_t)(
 	unsigned long indirection_page, unsigned long reboot_code_buffer,
 	unsigned long start_address);
@@ -120,6 +126,11 @@
 	/* copy it out */
 	memcpy((void *)reboot_code_buffer, 
 		relocate_new_kernel, relocate_new_kernel_size);
+
+#ifdef CONFIG_GAMECUBE
+	memcpy((void *)reboot_code_buffer + relocate_new_kernel_size,
+		kexec_gc_saved_state, KEXEC_GC_SAVED_STATE_SIZE);
+#endif /* CONFIG_GAMECUBE */
 
 	flush_icache_range(reboot_code_buffer,
 		reboot_code_buffer + KEXEC_CONTROL_CODE_SIZE);
diff -uNr linux-2.6.8.1-kexec.ppc/arch/ppc/kernel/relocate_kernel.S linux-2.6.8.1-homebrew-dol-support.ppc/arch/ppc/kernel/relocate_kernel.S
--- linux-2.6.8.1-kexec.ppc/arch/ppc/kernel/relocate_kernel.S	Wed Aug 18 15:00:25 2004
+++ linux-2.6.8.1-homebrew-dol-support.ppc/arch/ppc/kernel/relocate_kernel.S	Wed Aug 18 15:00:32 2004
@@ -107,6 +107,27 @@
 
 2:
 
+#ifdef CONFIG_GAMECUBE
+
+	/* Copy back saved state to original location. */
+
+	li      r3, KEXEC_GC_SAVED_STATE_SIZE / 4
+	mtctr   r3
+	RELOC_SYM(kexec_gc_saved_state_temporary_buffer)
+	mr	r9, r3
+	lis	r8, KEXEC_GC_SAVED_STATE_FROM@ha /* in fact, it is TO now ;) */
+	oris	r8, r8, KEXEC_GC_SAVED_STATE_FROM@l
+	subi    r9, r9, 4
+	subi    r8, r8, 4
+9:	lwzu    r3, 4(r9)
+	stwu    r3, 4(r8)
+	dcbst   0, r8
+	sync
+	icbi    0, r8
+	bdnz    9b
+
+#endif /* CONFIG_GAMECUBE */
+
 	/* To be certain of avoiding problems with self-modifying code
 	 * execute a serializing instruction here.
 	 */
@@ -120,6 +141,10 @@
 1:	b	1b
 
 relocate_new_kernel_end:
+
+#ifdef CONFIG_GAMECUBE
+kexec_gc_saved_state_temporary_buffer:
+#endif
 
 	.globl relocate_new_kernel_size
 relocate_new_kernel_size:	
diff -uNr linux-2.6.8.1-kexec.ppc/arch/ppc/kernel/setup.c linux-2.6.8.1-homebrew-dol-support.ppc/arch/ppc/kernel/setup.c
--- linux-2.6.8.1-kexec.ppc/arch/ppc/kernel/setup.c	Wed Aug 18 14:54:29 2004
+++ linux-2.6.8.1-homebrew-dol-support.ppc/arch/ppc/kernel/setup.c	Wed Aug 18 15:00:32 2004
@@ -17,6 +17,7 @@
 #include <linux/root_dev.h>
 #include <linux/cpu.h>
 #include <linux/console.h>
+#include <linux/kexec.h>
 
 #include <asm/residual.h>
 #include <asm/io.h>
@@ -291,6 +292,12 @@
 	/* First zero the BSS -- use memset, some arches don't have
 	 * caches on yet */
 	memset_io(PTRRELOC(&__bss_start), 0, _end - __bss_start);
+
+#if defined(CONFIG_KEXEC) && defined(CONFIG_GAMECUBE)
+	memcpy(PTRRELOC(&kexec_gc_saved_state[0]),
+		(void *)KEXEC_GC_SAVED_STATE_TEMP_TO,
+		KEXEC_GC_SAVED_STATE_SIZE);
+#endif /* CONFIG_KEXEC && CONFIG_GAMECUBE */
 
 	/*
 	 * Identify the CPU type and fix up code sections
diff -uNr linux-2.6.8.1-kexec.ppc/include/asm-ppc/kexec.h linux-2.6.8.1-homebrew-dol-support.ppc/include/asm-ppc/kexec.h
--- linux-2.6.8.1-kexec.ppc/include/asm-ppc/kexec.h	Wed Aug 18 15:00:25 2004
+++ linux-2.6.8.1-homebrew-dol-support.ppc/include/asm-ppc/kexec.h	Wed Aug 18 15:00:32 2004
@@ -21,6 +21,21 @@
 
 #define KEXEC_CONTROL_CODE_SIZE	4096
 
+#ifdef CONFIG_GAMECUBE
+
+#define KEXEC_GC_SAVED_STATE_FROM	(0x00000000)
+#define KEXEC_GC_SAVED_STATE_TEMP_TO	(0x00f00000)
+#define KEXEC_GC_SAVED_STATE_SIZE	(3*4096) /* bytes */
+
+#undef  KEXEC_CONTROL_CODE_SIZE
+#define KEXEC_CONTROL_CODE_SIZE	(4096+KEXEC_GC_SAVED_STATE_SIZE)
+
+#ifndef __ASSEMBLY__
+extern u32 kexec_gc_saved_state[];
+#endif
+
+#endif /* CONFIG_GAMECUBE */
+
 #endif /* CONFIG_KEXEC */
 
 #endif /* _PPC_KEXEC_H */
