dde_kit: remove jiffies alias

The alias is rather Linux-specific and also prevents particularly
tailored jiffies implementations. For the existing dde_linux ports (usb
and lxip) we just define jiffies to be dde_kit_timer_ticks with a
preprocessor macro.
This commit is contained in:
Josef Söntgen 2014-10-10 13:05:01 +02:00 committed by Christian Helmuth
parent 6244c6ec97
commit 35239b84df
6 changed files with 44 additions and 39 deletions

View File

@ -351,6 +351,30 @@ enum { true = 1, false = 0 };
#define __bitwise #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 ** ** 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 ** ** linux/time.h **
******************/ ******************/

View File

@ -295,6 +295,22 @@ typedef unsigned short ushort;
#define __printf(a, b) __attribute__((format(printf, a, b))) #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 ** ** linux/irqreturn.h **
***********************/ ***********************/
@ -979,21 +995,6 @@ void up_write(struct rw_semaphore *sem);
#define __RWSEM_INITIALIZER(name) { 0 } #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 ** ** linux/time.h **
******************/ ******************/

View File

@ -28,7 +28,6 @@
/** Timer tick (global symbol) */ /** Timer tick (global symbol) */
extern volatile unsigned long dde_kit_timer_ticks; extern volatile unsigned long dde_kit_timer_ticks;
extern volatile unsigned long jiffies;
/** Timer tick rate */ /** Timer tick rate */
enum { DDE_KIT_HZ = 100 }; enum { DDE_KIT_HZ = 100 };

View File

@ -274,7 +274,7 @@ extern "C" void dde_kit_thread_msleep(unsigned long msecs)
Lock *lock; Lock *lock;
struct dde_kit_timer *timer; 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); lock = new (env()->heap()) Lock(Lock::LOCKED);
timer = dde_kit_timer_add(_wake_up_msleep, lock, timeout); timer = dde_kit_timer_add(_wake_up_msleep, lock, timeout);

View File

@ -30,7 +30,6 @@ using namespace Genode;
************************/ ************************/
volatile unsigned long dde_kit_timer_ticks; volatile unsigned long dde_kit_timer_ticks;
extern "C" volatile unsigned long jiffies __attribute__ ((alias ("dde_kit_timer_ticks")));
/*************************** /***************************

View File

@ -34,6 +34,9 @@ extern "C" {
#include <dde_kit/panic.h> #include <dde_kit/panic.h>
} }
/* we directly map 'jiffies' to 'dde_kit_timer_ticks' */
#define jiffies dde_kit_timer_ticks
static Timer::Session_client *timer = 0; static Timer::Session_client *timer = 0;