[U-Boot-Users] Some puzzles on dram_size()
SAM SONG
samsongshu at yahoo.com.cn
Sun Jan 4 07:16:40 CET 2004
Hi,
for (cnt = maxsize/sizeof(long); cnt > 0; cnt >>= 1) {
addr = base + cnt; /* pointer arith! */
save[i++] = *addr;
*addr = ~cnt;
}
** write 0 to base address **
addr = base;
save[i] = *addr;
*addr = 0;
** check at base address **
if ((val = *addr) != 0) {
*addr = save[i];
return (0);
}
for (cnt = 1; cnt <= maxsize/sizeof(long); cnt <<= 1)
{
addr = base + cnt; ** pointer arith! **
val = *addr;
*addr = save[--i];
if (val != (~cnt)) {
return (cnt * sizeof(long));
}
}
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the U-Boot
mailing list