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>
addr = base + cnt;
*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);
}
}
+ *base = save_base;
return (maxsize);
}