diff -ruP linux-2.4.20/Makefile linux-2.4.20.mw/Makefile
--- linux-2.4.20/Makefile	Fri Nov 29 00:53:16 2002
+++ linux-2.4.20.mw/Makefile	Sat May  3 18:55:19 2003
@@ -6,6 +6,7 @@
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
+ARCH := sparc
 KERNELPATH=kernel-$(shell echo $(KERNELRELEASE) | sed -e "s/-//g")
 
 CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
@@ -19,7 +20,7 @@
 HOSTCC  	= gcc
 HOSTCFLAGS	= -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
 
-CROSS_COMPILE 	=
+#CROSS_COMPILE 	= sparc-linux-
 
 #
 # Include the make variables (CC, etc...)
@@ -88,7 +89,7 @@
 
 CPPFLAGS := -D__KERNEL__ -I$(HPATH)
 
-CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
+CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -mcpu=supersparc \
 	  -fno-strict-aliasing -fno-common
 ifndef CONFIG_FRAME_POINTER
 CFLAGS += -fomit-frame-pointer
diff -ruP linux-2.4.20/arch/sparc/Makefile linux-2.4.20.mw/arch/sparc/Makefile
--- linux-2.4.20/arch/sparc/Makefile	Sat Jul 28 21:12:37 2001
+++ linux-2.4.20.mw/arch/sparc/Makefile	Sat May  3 14:55:13 2003
@@ -28,6 +28,7 @@
 CFLAGS := $(CFLAGS) -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7
 else
 CFLAGS := $(CFLAGS) -m32 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7
+#CFLAGS := $(CFLAGS) -m32 -pipe -fcall-used-g5 -fcall-used-g7
 endif
 
 #LINKFLAGS = -N -Ttext 0xf0004000
diff -ruP linux-2.4.20/arch/sparc/kernel/head.S linux-2.4.20.mw/arch/sparc/kernel/head.S
--- linux-2.4.20/arch/sparc/kernel/head.S	Wed Aug 15 04:57:28 2001
+++ linux-2.4.20.mw/arch/sparc/kernel/head.S	Sat May  3 14:55:17 2003
@@ -1011,7 +1011,7 @@
 
 		/* I want a kernel stack NOW! */
 		set	C_LABEL(init_task_union), %g1
-		set	(TASK_UNION_SIZE - REGWIN_SZ), %g2
+		set	(TASK_UNION_SIZE - STACKFRAME_SZ), %g2
 		add	%g1, %g2, %sp
 		mov	0, %fp			/* And for good luck */
 
diff -ruP linux-2.4.20/include/asm-sparc/system.h linux-2.4.20.mw/include/asm-sparc/system.h
--- linux-2.4.20/include/asm-sparc/system.h	Wed Oct 31 00:08:11 2001
+++ linux-2.4.20.mw/include/asm-sparc/system.h	Sat May  3 19:34:46 2003
@@ -109,14 +109,13 @@
 	 * - Anton
 	 */
 #define switch_to(prev, next, last) do {						\
-	__label__ here;									\
-	register unsigned long task_pc asm("o7");					\
 	extern struct task_struct *current_set[NR_CPUS];				\
 	SWITCH_ENTER									\
 	SWITCH_DO_LAZY_FPU								\
 	next->active_mm->cpu_vm_mask |= (1 << smp_processor_id());			\
-	task_pc = ((unsigned long) &&here) - 0x8;					\
 	__asm__ __volatile__(								\
+	"sethi  %%hi(here - 0x8), %%o7\n\t"						\
+	"or     %%o7, %%lo(here - 0x8), %%o7\n\t"					\
 	"mov	%%g6, %%g3\n\t"								\
 	"rd	%%psr, %%g4\n\t"							\
 	"std	%%sp, [%%g6 + %4]\n\t"							\
@@ -140,16 +139,16 @@
 	"nop\n\t"									\
 	"nop\n\t"									\
 	"jmpl	%%o7 + 0x8, %%g0\n\t"							\
-	" mov	%%g3, %0\n\t"								\
+	" mov	%%g3, %0\n"								\
+	"here:\n\t"									\
         : "=&r" (last)									\
         : "r" (&(current_set[hard_smp_processor_id()])), "r" (next),			\
 	  "i" ((const unsigned long)(&((struct task_struct *)0)->thread.kpsr)),		\
-	  "i" ((const unsigned long)(&((struct task_struct *)0)->thread.ksp)),		\
-	  "r" (task_pc)									\
-	: "g1", "g2", "g3", "g4", "g5", "g7", "l0", "l1",				\
+	  "i" ((const unsigned long)(&((struct task_struct *)0)->thread.ksp))		\
+	: "g1", "g2", "g3", "g4", "g5", "g7", "l0", "l1", "l2",				\
 	"l4", "l5", "l6", "l7", "i0", "i1", "i2", "i3", "i4", "i5", "o0", "o1", "o2",	\
-	"o3");										\
-here:;  } while(0)
+	"o3", "o7");									\
+	} while(0)
 
 /*
  * Changing the IRQ level on the Sparc.
