smi: make tseg_relocate check pointer offset
In case tseg_relocate() is called again on a pointer we should not relocate it again. Change-Id: Ida1f9c20dc94b448c773b14d8864afe585369119 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: http://review.coreboot.org/1740 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
parent
5c88c6f2d7
commit
2558c736a0
|
@ -65,7 +65,7 @@ u32 smi_get_tseg_base(void)
|
||||||
void tseg_relocate(void **ptr)
|
void tseg_relocate(void **ptr)
|
||||||
{
|
{
|
||||||
/* Adjust pointer with TSEG base */
|
/* Adjust pointer with TSEG base */
|
||||||
if (*ptr)
|
if (*ptr && *ptr < (void*)smi_get_tseg_base())
|
||||||
*ptr = (void *)(((u8*)*ptr) + smi_get_tseg_base());
|
*ptr = (void *)(((u8*)*ptr) + smi_get_tseg_base());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue