mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-29 08:00:26 +09:00
common/memsize.c: restore content of the base address
For the last return of function get_ram_size(), when size=maxsize, restore the base address (*base) content. Add comment for the remaining case to avoid regression: this case is already correctly handled. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
This commit is contained in:
parent
c5da05cd41
commit
218da804ef
@ -77,9 +77,16 @@ long get_ram_size(long *base, long maxsize)
|
|||||||
addr = base + cnt;
|
addr = base + cnt;
|
||||||
*addr = save[--i];
|
*addr = save[--i];
|
||||||
}
|
}
|
||||||
|
/* warning: don't restore save_base in this case,
|
||||||
|
* it is already done in the loop because
|
||||||
|
* base and base+size share the same physical memory
|
||||||
|
* and *base is saved after *(base+size) modification
|
||||||
|
* in first loop
|
||||||
|
*/
|
||||||
return (size);
|
return (size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*base = save_base;
|
||||||
|
|
||||||
return (maxsize);
|
return (maxsize);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user