summaryrefslogtreecommitdiff
path: root/src/lib/timestamp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/timestamp.c')
-rw-r--r--src/lib/timestamp.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/timestamp.c b/src/lib/timestamp.c
index eac33a2aff..63f17f7467 100644
--- a/src/lib/timestamp.c
+++ b/src/lib/timestamp.c
@@ -23,6 +23,7 @@
#include <cbmem.h>
#include <timestamp.h>
#include <cpu/x86/car.h>
+#include <cpu/x86/lapic.h>
#define MAX_TIMESTAMPS 30
@@ -60,6 +61,9 @@ void timestamp_add(enum timestamp_id id, tsc_t ts_time)
{
struct timestamp_entry *tse;
+ if (!boot_cpu())
+ return;
+
if (!ts_table) {
timestamp_stash(id, ts_time);
return;
@@ -114,6 +118,9 @@ static void timestamp_do_sync(void)
void timestamp_init(tsc_t base)
{
+ if (!boot_cpu())
+ return;
+
#ifdef __PRE_RAM__
/* Copy of basetime, it is too early for CBMEM. */
ts_basetime = base;
@@ -135,6 +142,9 @@ void timestamp_init(tsc_t base)
void timestamp_sync(void)
{
+ if (!boot_cpu())
+ return;
+
#ifdef __PRE_RAM__
timestamp_real_init(ts_basetime);
#else