vboot: Implement VbExGetTimer using monotonic timers
On x86 VbExGetTimer() uses rdtsc. However, on all other platforms, let's just use coreboot's monotonic timers. BUG=none BRANCH=none TEST=more changes needed, but boot tested on pit Change-Id: I0cd359f298be33776740305b111624147e2c850d Signed-off-by: Stefan Reinauer <reinauer@google.com> Reviewed-on: https://chromium-review.googlesource.com/169620
This commit is contained in:
parent
f7df9f05fb
commit
e910bb1752
1 changed files with 10 additions and 0 deletions
|
|
@ -17,7 +17,11 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
#include <console/vtxprintf.h>
|
||||
#if CONFIG_ARCH_X86
|
||||
#include <cpu/x86/tsc.h>
|
||||
#else
|
||||
#include <timer.h>
|
||||
#endif
|
||||
#include <rmodule.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
|
@ -125,7 +129,13 @@ void VbExDebug(const char *format, ...)
|
|||
|
||||
uint64_t VbExGetTimer(void)
|
||||
{
|
||||
#if CONFIG_ARCH_X86
|
||||
return rdtscll();
|
||||
#else
|
||||
struct mono_time mt;
|
||||
timer_monotonic_get(&mt);
|
||||
return mt.microseconds;
|
||||
#endif
|
||||
}
|
||||
|
||||
VbError_t VbExNvStorageRead(uint8_t *buf)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue