Save the content of the base address in a new variable
in stack (save_base) to prepare restore this content.
This patch don't modified code behavior and stack usage.
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
long get_ram_size(long *base, long maxsize)
{
volatile long *addr;
long get_ram_size(long *base, long maxsize)
{
volatile long *addr;
+ long save[31];
+ long save_base;
long cnt;
long val;
long size;
long cnt;
long val;
long size;
if ((val = *addr) != 0) {
/* Restore the original data before leaving the function. */
sync();
if ((val = *addr) != 0) {
/* Restore the original data before leaving the function. */
sync();
for (cnt = 1; cnt < maxsize / sizeof(long); cnt <<= 1) {
addr = base + cnt;
sync();
for (cnt = 1; cnt < maxsize / sizeof(long); cnt <<= 1) {
addr = base + cnt;
sync();