From mboxrd@z Thu Jan 1 00:00:00 1970 From: DENX Support System Date: Sat, 1 Apr 2006 00:50:07 +0200 Subject: [DNX#2006040142000973] =?ISO-8859-15?Q?R=E9f?=. : Re: [U-Boot-Users] get_ram_size bug and ask [...] Message-ID: <1143845407.608718.071190831@castor.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello list, inside the automatic U-Boot patch tracking system a new ticket [DNX#2006040142000973] was created: > 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); > } > } > > > regards, > > Matthieu Your U-Boot support team