diff --git a/repos/dde_linux/src/lib/lxip/include/lx_emul.h b/repos/dde_linux/src/lib/lxip/include/lx_emul.h index bd741c15b..78d094c0b 100644 --- a/repos/dde_linux/src/lib/lxip/include/lx_emul.h +++ b/repos/dde_linux/src/lib/lxip/include/lx_emul.h @@ -351,6 +351,30 @@ enum { true = 1, false = 0 }; #define __bitwise +/********************* + ** linux/jiffies.h ** + *********************/ + +/* we directly map 'jiffies' to 'dde_kit_timer_ticks' */ +#define jiffies dde_kit_timer_ticks + +extern volatile unsigned long jiffies; + +enum { INITIAL_JIFFIES = 0 }; + +unsigned int jiffies_to_msecs(const unsigned long); +unsigned int jiffies_to_usecs(const unsigned long); +unsigned long msecs_to_jiffies(const unsigned int); + +long time_after(long a, long b); +long time_after_eq(long a, long b); + +static inline long time_before(long a, long b) { return time_after(b, a); } +static inline long time_before_eq(long a, long b) { return time_after_eq(b ,a); } + +clock_t jiffies_to_clock_t(unsigned long); + + /****************** ** linux/kmod.h ** ******************/ @@ -1255,27 +1279,6 @@ struct rw_semaphore { int dummy; }; -/********************* - ** linux/jiffies.h ** - *********************/ - -extern volatile unsigned long jiffies; - -enum { INITIAL_JIFFIES = 0 }; - -unsigned int jiffies_to_msecs(const unsigned long); -unsigned int jiffies_to_usecs(const unsigned long); -unsigned long msecs_to_jiffies(const unsigned int); - -long time_after(long a, long b); -long time_after_eq(long a, long b); - -static inline long time_before(long a, long b) { return time_after(b, a); } -static inline long time_before_eq(long a, long b) { return time_after_eq(b ,a); } - -clock_t jiffies_to_clock_t(unsigned long); - - /****************** ** linux/time.h ** ******************/ diff --git a/repos/dde_linux/src/lib/usb/include/lx_emul.h b/repos/dde_linux/src/lib/usb/include/lx_emul.h index 61408fbf8..e464ee869 100644 --- a/repos/dde_linux/src/lib/usb/include/lx_emul.h +++ b/repos/dde_linux/src/lib/usb/include/lx_emul.h @@ -295,6 +295,22 @@ typedef unsigned short ushort; #define __printf(a, b) __attribute__((format(printf, a, b))) + +/********************* + ** linux/jiffies.h ** + *********************/ + +/* we directly map 'jiffies' to 'dde_kit_timer_ticks' */ +#define jiffies dde_kit_timer_ticks + +extern volatile unsigned long jiffies; +unsigned long msecs_to_jiffies(const unsigned int m); +unsigned int jiffies_to_msecs(const unsigned long j); +long time_after(long a, long b); +long time_after_eq(long a, long b); +long time_before(long a, long b); + + /*********************** ** linux/irqreturn.h ** ***********************/ @@ -979,21 +995,6 @@ void up_write(struct rw_semaphore *sem); #define __RWSEM_INITIALIZER(name) { 0 } -/********************* - ** linux/jiffies.h ** - *********************/ - -/* - * XXX check how the jiffies variable is used - */ -extern volatile unsigned long jiffies; -unsigned long msecs_to_jiffies(const unsigned int m); -unsigned int jiffies_to_msecs(const unsigned long j); -long time_after(long a, long b); -long time_after_eq(long a, long b); -long time_before(long a, long b); - - /****************** ** linux/time.h ** ******************/ diff --git a/repos/os/include/dde_kit/timer.h b/repos/os/include/dde_kit/timer.h index b1dba6978..1940653ac 100644 --- a/repos/os/include/dde_kit/timer.h +++ b/repos/os/include/dde_kit/timer.h @@ -28,7 +28,6 @@ /** Timer tick (global symbol) */ extern volatile unsigned long dde_kit_timer_ticks; -extern volatile unsigned long jiffies; /** Timer tick rate */ enum { DDE_KIT_HZ = 100 }; diff --git a/repos/os/src/lib/dde_kit/thread.cc b/repos/os/src/lib/dde_kit/thread.cc index aad46b72f..c2c87b9ef 100644 --- a/repos/os/src/lib/dde_kit/thread.cc +++ b/repos/os/src/lib/dde_kit/thread.cc @@ -274,7 +274,7 @@ extern "C" void dde_kit_thread_msleep(unsigned long msecs) Lock *lock; struct dde_kit_timer *timer; - unsigned long timeout = jiffies + (msecs * DDE_KIT_HZ) / 1000; + unsigned long timeout = dde_kit_timer_ticks + (msecs * DDE_KIT_HZ) / 1000; lock = new (env()->heap()) Lock(Lock::LOCKED); timer = dde_kit_timer_add(_wake_up_msleep, lock, timeout); diff --git a/repos/os/src/lib/dde_kit/timer.cc b/repos/os/src/lib/dde_kit/timer.cc index 1208b39f1..002c14c5b 100644 --- a/repos/os/src/lib/dde_kit/timer.cc +++ b/repos/os/src/lib/dde_kit/timer.cc @@ -30,7 +30,6 @@ using namespace Genode; ************************/ volatile unsigned long dde_kit_timer_ticks; -extern "C" volatile unsigned long jiffies __attribute__ ((alias ("dde_kit_timer_ticks"))); /*************************** diff --git a/repos/os/src/test/dde_kit/test.cc b/repos/os/src/test/dde_kit/test.cc index 6462b3740..ea7cf0d50 100644 --- a/repos/os/src/test/dde_kit/test.cc +++ b/repos/os/src/test/dde_kit/test.cc @@ -34,6 +34,9 @@ extern "C" { #include } +/* we directly map 'jiffies' to 'dde_kit_timer_ticks' */ +#define jiffies dde_kit_timer_ticks + static Timer::Session_client *timer = 0;