Index: boot/genarch/include/division.h
===================================================================
--- boot/genarch/include/division.h	(revision 5a6a42f4d0f7e33bc079117b49c6e2ad4840ea1c)
+++ boot/genarch/include/division.h	(revision 8bcd727b2a0fd44ad4c48eabace4bad900ba75f2)
@@ -45,5 +45,8 @@
 extern unsigned long long __umoddi3(unsigned long long, unsigned long long);
 
+extern int __divmodsi3(int, int, int *);
 extern unsigned int __udivmodsi3(unsigned int, unsigned int, unsigned int *);
+
+extern long long __divmoddi3(long long, long long, long long *);
 extern unsigned long long __udivmoddi3(unsigned long long, unsigned long long,
     unsigned long long *);
Index: boot/genarch/src/division.c
===================================================================
--- boot/genarch/src/division.c	(revision 5a6a42f4d0f7e33bc079117b49c6e2ad4840ea1c)
+++ boot/genarch/src/division.c	(revision 8bcd727b2a0fd44ad4c48eabace4bad900ba75f2)
@@ -183,4 +183,18 @@
 }
 
+int __divmodsi3(int a, int b, int *c)
+{
+	unsigned int rem;
+	int result = (int) divandmod32(ABSVAL(a), ABSVAL(b), &rem);
+	
+	if (SGN(a) == SGN(b)) {
+		*c = rem;
+		return result;
+	}
+	
+	*c = -rem;
+	return -result;
+}
+
 unsigned int __udivmodsi3(unsigned int a, unsigned int b,
     unsigned int *c)
@@ -189,4 +203,18 @@
 }
 
+long long __divmoddi3(long long a, long long b, long long *c)
+{
+	unsigned long long rem;
+	long long result = (int) divandmod64(ABSVAL(a), ABSVAL(b), &rem);
+	
+	if (SGN(a) == SGN(b)) {
+		*c = rem;
+		return result;
+	}
+	
+	*c = -rem;
+	return -result;
+}
+
 unsigned long long __udivmoddi3(unsigned long long a, unsigned long long b,
     unsigned long long *c)
