timestamps: Stash early timestamps in CAR_GLOBAL
Change-Id: I87b454c748cf885491d5b38bfe53a2ec0e9f38c5 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/3910 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-by: Aaron Durbin <adurbin@google.com>
This commit is contained in:
@ -114,7 +114,10 @@ static void timestamp_do_sync(void)
|
||||
|
||||
void timestamp_init(tsc_t base)
|
||||
{
|
||||
#ifndef __PRE_RAM__
|
||||
#ifdef __PRE_RAM__
|
||||
/* Copy of basetime, it is too early for CBMEM. */
|
||||
ts_basetime = base;
|
||||
#else
|
||||
struct timestamp_table* tst;
|
||||
|
||||
/* Locate and use an already existing table. */
|
||||
@ -123,19 +126,21 @@ void timestamp_init(tsc_t base)
|
||||
ts_table = tst;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Copy of basetime, may be too early for CBMEM. */
|
||||
ts_basetime = base;
|
||||
timestamp_real_init(base);
|
||||
if (ts_table)
|
||||
timestamp_do_sync();
|
||||
else
|
||||
ts_basetime = base;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef __PRE_RAM__
|
||||
void timestamp_sync(void)
|
||||
{
|
||||
#ifdef __PRE_RAM__
|
||||
timestamp_real_init(ts_basetime);
|
||||
#else
|
||||
if (!ts_table)
|
||||
timestamp_init(ts_basetime);
|
||||
}
|
||||
#endif
|
||||
if (ts_table)
|
||||
timestamp_do_sync();
|
||||
}
|
||||
|
Reference in New Issue
Block a user