Index: arch/mips32/include/asm/regname.h
===================================================================
--- arch/mips32/include/asm/regname.h	(revision f5935ed33be88b71c675e1e444f606d26789d549)
+++ arch/mips32/include/asm/regname.h	(revision 021d471663b9f267f1999923f91fc387f1943aca)
@@ -63,6 +63,6 @@
 #define ra      31
 
-#define index		0
-#define random		1
+#define rindex		0
+#define rrandom		1
 #define entrylo0	2
 #define entrylo1	3
@@ -77,10 +77,10 @@
 #define cause		13
 #define epc		14
-#define config		16
+#define rconfig		16
 #define lladdr		17
 #define watchlo		18
 #define watchhi		19
 #define xcontext	20
-#define debug		23
+#define rdebug		23
 #define depc		24
 #define eepc		30
Index: arch/mips32/src/exception.c
===================================================================
--- arch/mips32/src/exception.c	(revision f5935ed33be88b71c675e1e444f606d26789d549)
+++ arch/mips32/src/exception.c	(revision 021d471663b9f267f1999923f91fc387f1943aca)
@@ -41,4 +41,5 @@
 #include <console/kconsole.h>
 #include <arch/debugger.h>
+#include <syscall/syscall.h>
 
 static char * exctable[] = {
@@ -135,4 +136,19 @@
 }
 
+#include <debug.h>
+/** Handle syscall userspace call */
+static void syscall_exception(int n, void *data)
+{
+	struct exception_regdump *pstate = (struct exception_regdump *)data;
+	
+	if (pstate->a3 < SYSCALL_END)
+		pstate->v0 = syscall_table[pstate->a3](pstate->a0,
+						       pstate->a1,
+						       pstate->a2);
+	else
+		panic("Undefined syscall %d", pstate->a3);
+	pstate->epc += 4;
+}
+
 
 void exception(struct exception_regdump *pstate)
@@ -191,3 +207,4 @@
 	exc_register(EXC_CpU, "cpunus", cpuns_exception);
 #endif
-}
+	exc_register(EXC_Sys, "syscall", syscall_exception);
+}
Index: arch/mips32/src/mips32.c
===================================================================
--- arch/mips32/src/mips32.c	(revision f5935ed33be88b71c675e1e444f606d26789d549)
+++ arch/mips32/src/mips32.c	(revision 021d471663b9f267f1999923f91fc387f1943aca)
@@ -96,4 +96,8 @@
 	arc_print_memory_map();
 	arc_print_devices();
+
+	/* Setup usermode...*/
+	config.init_addr = 0x20000000;
+	config.init_size = FRAME_SIZE;
 }
 
@@ -110,4 +114,12 @@
 }
 
+/* Stack pointer saved when entering user mode */
+/* TODO: How do we do it on SMP system???? */
+
+/* Why the hell moves the linker the variable 64K away in assembler
+ * when not in .text section ????????
+ */
+__address supervisor_sp __attribute__ ((section (".text")));
+
 void userspace(void)
 {
@@ -123,8 +135,4 @@
 }
 
-/* Stack pointer saved when entering user mode */
-/* TODO: How do we do it on SMP system???? */
-__address supervisor_sp;
-
 void before_thread_runs_arch(void)
 {
