From e5e674724ec527c45efaa1622d0e9a1618757ca3 Mon Sep 17 00:00:00 2001 From: Michal Idziorek Date: Wed, 3 Sep 2014 15:26:19 +0200 Subject: system clock --- kernel/x86.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'kernel/x86.c') diff --git a/kernel/x86.c b/kernel/x86.c index 0b6a448..782baec 100644 --- a/kernel/x86.c +++ b/kernel/x86.c @@ -1,14 +1,23 @@ +#define FOOLOS_MODULE_NAME "x86" + #include "x86.h" +#include "lib/int/stdint.h" +#include "lib/logger/log.h" + +extern volatile uint64_t task_system_clock; // from task.c -//TODO!!! void sleep(int i) { - i*=1000000; - for(;i>0;i--) - { - - } + volatile uint64_t clock=task_system_clock; + +// while(clock+i>task_system_clock) +// { +// log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"It is %d but I will sleep until %d...",task_system_clock,clock+i); + for(int j=0;j