--- syscall_shiny7.h.orig	2005-08-21 02:00:29.000000000 +0200
+++ syscall_shiny7.h	2005-08-21 02:00:33.000000000 +0200
@@ -397,8 +397,37 @@
 
 #elif	defined(__mips__)
 
-#error syscall arch mips not implemented yet
+/*	The MIPS_SIM_ABI32 calling convention uses a0-a3  to pass the first
+	four arguments, the rest is passed on the userspace stack.  The 5th arg
+	starts at 16($sp).
+
+	scnr:	id(v0)
+	args:	a1(a0), a2(a1), a3(a2), a4(a3), a5(16($sp)), a6(20($sp))
+	sret:	r0(v0)
+	serr:	e0(a3)
+	call:	syscall
+	clob:	at, v0, t0-t7, t8-t9
+*/
+
+#define	__sysc_reg_cid	"v0"
+#define __sysc_reg_ret "v0"
+#define __sysc_reg_err "a3"
+
+#define __sysc_reg(n) __arg_##n\
+        ("a0","a1","a2","a3", "t0", "t1")
+
+#define __sysc_pre(n) 							\
+	__casm(n,5,1,"addiu $sp,$sp,-8",)				\
+	__casm(n,6,1,"sw $9,20($sp)",)					\
+	__casm(n,5,1,"sw $8, 16($sp)",)
+
+#define	__sysc_cmd_sys	"syscall"
+
+#define __sysc_fin(n) 							\
+	__casm(n,5,1,"addiu $sp,$sp,8",)
 
+#define __sysc_clobber "$1", "$3", "$8", "$9", "$10", "$11", "$12",	\
+        "$13", "$14", "$15", "$24", "$25", "memory"
 
 
 /*	*****************************************

