Browse Source

Replaced modulo code with the modulo operator.

Tobias Anderberg 19 years ago
parent
commit
b6f2c594df
1 changed files with 1 additions and 38 deletions
  1. 1 38
      ldso/ldso/cris/dl-sysdep.h

+ 1 - 38
ldso/ldso/cris/dl-sysdep.h

@@ -18,44 +18,7 @@
 struct elf_resolve;
 extern unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry);
 
-/* Cheap modulo implementation, taken from arm/dl-sysdep.h. */
-static inline unsigned long
-cris_mod(unsigned long m, unsigned long p)
-{
-	unsigned long i, t, inc;
-
-	i = p;
-	t = 0;
-
-	while (!(i & (1 << 31))) {
-		i <<= 1;
-		t++;
-	}
-
-	t--;
-
-	for (inc = t; inc > 2; inc--) {
-		i = p << inc;
-
-		if (i & (1 << 31))
-			break;
-
-		while (m >= i) {
-			m -= i;
-			i <<= 1;
-			if (i & (1 << 31))
-				break;
-			if (i < p)
-				break;
-		}
-	}
-
-	while (m >= p)
-		m -= p;
-
-	return m;
-}
-#define do_rem(result, n, base) ((result) = cris_mod(n, base))
+#define do_rem(result, n, base) ((result) = (n) % (base))
 
 /* 8192 bytes alignment */
 #define PAGE_ALIGN 0xffffe000