Skip to contentSkip to conversation

Réf . : Re: [U-Boot-Users] get_ram_size bug and ask [...]

DNX#2006040142000973 DENX Support System 1 participant 1 message Mar 31, 2006

lore
Share & tools
lore
#0 lore raw

Hello list,

inside the automatic U-Boot patch tracking system a new ticket [DNX#2006040142000973] was created:

<snip>

Quoted 40 lines

Hi Wolfgang,

it seems the code I have was modified.
I look in the original cvs version and it seems that the base address isn't restored either.

      [...]
        addr = base;
        save[i] = *addr; <-- save value@base address
        *addr = 0; <--- modify it.

        if ((val = *addr) != 0) {
                <--- error case : restore all values
            [...]
        }

        <-- we forget to restore the value and start to restore value 

@base+1 with save[i-1].

        for (cnt = 1; cnt < maxsize / sizeof (long); cnt <<= 1) {
                addr = base + cnt;      /* pointer arith! */
                val = *addr;
                *addr = save[--i];
                if (val != ~cnt) {
                        size = cnt * sizeof (long);
                        /* Restore the original data before leaving the 
function.
                         */
                        for (cnt <<= 1; cnt < maxsize / sizeof (long);
cnt 
<<= 1) {
                                addr  = base + cnt;
                                *addr = save[--i];
                        }
                        return (size);
                }
        }
Quoted 3 lines

regards,

Matthieu

</snip>

Your U-Boot support team