Initial attempt at syscall support for the cris architecture

diff --git a/klibc/arch/cris/syscall.S b/klibc/arch/cris/syscall.S
new file mode 100644
index 0000000..0bd8279
--- /dev/null
+++ b/klibc/arch/cris/syscall.S
@@ -0,0 +1,33 @@
+/*
+ * arch/cris/syscall.S
+ *
+ * On cris, r9 contains the syscall number (set by generated stub);
+ * r10..r13 contain arguments 0-3 per the standard calling convention,
+ * and arguments 4-5 are passed in $mof and $srp; however, we have
+ * to save $srp around the system call.
+ */
+
+	.set noreorder
+
+	.text
+	.subsection ".syscall"
+	.align	4
+	.globl	__syscall_common
+	.type	__syscall_common,@function
+__syscall_common:
+	push	$srp
+	move.d	[$sp+4],$mof
+	move.d	[$sp+8],$srp
+	break	13
+	pop	$srp
+
+	cmpq.d	-4096,$r10
+	blt	1f
+	  neg.d	$r10,$r11
+	move.d	$r11,[errno]
+	moveq.d	-1,$r10
+1:
+	ret
+	  nop
+
+	.size	__syscall_common,.-__syscall_common
diff --git a/klibc/arch/cris/sysstub.ph b/klibc/arch/cris/sysstub.ph
new file mode 100644
index 0000000..cc4ca3a
--- /dev/null
+++ b/klibc/arch/cris/sysstub.ph
@@ -0,0 +1,30 @@
+# -*- perl -*-
+#
+# arch/cris/sysstub.ph
+#
+# Script to generate system call stubs
+#
+
+# We use a subsection for the syscall stubs, so we can be
+# sure they're within reach of a 16-bit BA
+
+sub make_sysstub($$$$@) {
+    my($fname, $type, $sname, $stype, @args) = @_;
+
+    open(OUT, '>', "syscalls/${fname}.S");
+    print OUT "#include <asm/unistd.h>\n";
+    print OUT "\n";
+    print OUT "\t.set noreorder\n";
+    print OUT "\n";
+    print OUT "\t.text\n";
+    print OUT "\t.subsection \".syscall\"\n";
+    print OUT "\t.type ${fname},\@function\n";
+    print OUT "\t.globl ${fname}\n";
+    print OUT "${fname}:\n";
+    print OUT "\tba\t__syscall_common\n";
+    print OUT "\t  move.d\t__NR_${sname}, $r9\n";
+    print OUT "\t.size ${fname},.-${fname}\n";
+    close(OUT);
+}
+
+1;