Skip to contentSkip to conversation

: getting r4k to work in 64 bits.

PATCH New Juan Quintela 1 participant 1 message Dec 20, 2002 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : getting r4k to work in 64 bits.

Hi
without this patch, addresses are bad calculated for
r4k in 64bits mode. Notice that the corresponding variables for instruction and data caches already were unsigned long.

a = addr & ~(sc_lsize - 1);
end = (addr + size - 1) & ~(sc_lsize - 1);

Problem is that in this kind of expression, it uses 32 bits to calculate ~(sc_lsize -1). I don't know if this is really a compiler or kernel bug.

Later, Juan.

Index: arch/mips64/mm/c-r4k.c
===================================================================
RCS file: /home/cvs/linux/arch/mips64/mm/c-r4k.c,v retrieving revision 1.1.2.10

mips64/mm/c-r4k.c +1 -1
diff -u -r1.1.2.10 c-r4k.c
@@ -30,7 +30,7 @@
 static unsigned long ic_lsize, dc_lsize;       /* LineSize in bytes */
 
 /* Secondary cache (if present) parameters. */
-static unsigned int scache_size, sc_lsize;	/* Again, in bytes */
+static unsigned long scache_size, sc_lsize;	/* Again, in bytes */
 
 #include <asm/cacheops.h>
 #include <asm/r4kcache.h>
Signature · 2 lines
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy