arm timer fix

. set 'done' once initialized so 32-bit read frc works,
	  thanks to keesj
	. make sure the software-implemented upper 32 bit of the 64-bit
	  "tsc" value works OK by adding an assert in one of its calls

Change-Id: I5ce24fea919f4610c6a86ac7ec9f04b1815620c2
This commit is contained in:
Ben Gras
2013-06-19 13:11:32 +02:00
parent 718114d9b0
commit 8e7c0604bd
2 changed files with 4 additions and 0 deletions
+3
View File
@@ -10,6 +10,8 @@
#include "kernel/glo.h"
#include "kernel/profile.h"
#include <assert.h>
#include "kernel/spinlock.h"
@@ -61,6 +63,7 @@ void context_stop(struct proc * p)
u64_t * __tsc_ctr_switch = get_cpulocal_var_ptr(tsc_ctr_switch);
read_tsc_64(&tsc);
assert(tsc >= *__tsc_ctr_switch);
tsc_delta = tsc - *__tsc_ctr_switch;
p->p_cycles += tsc_delta;