summaryrefslogtreecommitdiff
path: root/libdde_linux26
diff options
context:
space:
mode:
authorZheng Da <zhengda1936@gmail.com>2010-01-13 12:05:44 +0100
committerZheng Da <zhengda1936@gmail.com>2010-01-13 12:05:44 +0100
commit29f78c0a9520864b0b2f8707710ed4b46bd4bcaa (patch)
tree08caa4b592e95b7d8f60d2d0ba62be8182fb611b /libdde_linux26
parent436fa4a5352cea7fc8eeafe2fc078031d731b471 (diff)
fix the problem of HZ and jiffies.
Diffstat (limited to 'libdde_linux26')
-rw-r--r--libdde_linux26/contrib/drivers/pci/access.c1
-rw-r--r--libdde_linux26/contrib/net/core/neighbour.c2
-rw-r--r--libdde_linux26/lib/src/kernel/time.c11
-rw-r--r--libdde_linux26/lib/src/kernel/timer.c2
-rw-r--r--libdde_linux26/lib/src/net/core/dev.c2
5 files changed, 14 insertions, 4 deletions
diff --git a/libdde_linux26/contrib/drivers/pci/access.c b/libdde_linux26/contrib/drivers/pci/access.c
index 38144479..9d05aea2 100644
--- a/libdde_linux26/contrib/drivers/pci/access.c
+++ b/libdde_linux26/contrib/drivers/pci/access.c
@@ -6,6 +6,7 @@
#include <linux/wait.h>
#include "pci.h"
+#include <ddekit/timer.h>
/*
* This interrupt-safe spinlock protects all accesses to PCI
diff --git a/libdde_linux26/contrib/net/core/neighbour.c b/libdde_linux26/contrib/net/core/neighbour.c
index 02dc8bda..97ed0aee 100644
--- a/libdde_linux26/contrib/net/core/neighbour.c
+++ b/libdde_linux26/contrib/net/core/neighbour.c
@@ -36,6 +36,8 @@
#include <linux/string.h>
#include <linux/log2.h>
+#include <ddekit/timer.h>
+
#define NEIGH_DEBUG 1
#define NEIGH_PRINTK(x...) printk(x)
diff --git a/libdde_linux26/lib/src/kernel/time.c b/libdde_linux26/lib/src/kernel/time.c
index 4e49f06f..ce5b5fd4 100644
--- a/libdde_linux26/lib/src/kernel/time.c
+++ b/libdde_linux26/lib/src/kernel/time.c
@@ -43,6 +43,7 @@
#include <asm/unistd.h>
#include "timeconst.h"
+#include <ddekit/timer.h>
/*
* The timezone where the local system is located. Used as a default by some
@@ -590,14 +591,14 @@ timespec_to_jiffies(const struct timespec *value)
EXPORT_SYMBOL(timespec_to_jiffies);
void
-jiffies_to_timespec(const unsigned long jiffies, struct timespec *value)
+jiffies_to_timespec(const unsigned long jiffiesv, struct timespec *value)
{
/*
* Convert jiffies to nanoseconds and separate with
* one divide.
*/
u32 rem;
- value->tv_sec = div_u64_rem((u64)jiffies * TICK_NSEC,
+ value->tv_sec = div_u64_rem((u64)jiffiesv * TICK_NSEC,
NSEC_PER_SEC, &rem);
value->tv_nsec = rem;
}
@@ -631,7 +632,7 @@ timeval_to_jiffies(const struct timeval *value)
}
EXPORT_SYMBOL(timeval_to_jiffies);
-void jiffies_to_timeval(const unsigned long jiffies, struct timeval *value)
+void jiffies_to_timeval(const unsigned long jiffiesv, struct timeval *value)
{
/*
* Convert jiffies to nanoseconds and separate with
@@ -639,7 +640,7 @@ void jiffies_to_timeval(const unsigned long jiffies, struct timeval *value)
*/
u32 rem;
- value->tv_sec = div_u64_rem((u64)jiffies * TICK_NSEC,
+ value->tv_sec = div_u64_rem((u64)jiffiesv * TICK_NSEC,
NSEC_PER_SEC, &rem);
value->tv_usec = rem / NSEC_PER_USEC;
}
@@ -681,6 +682,8 @@ unsigned long clock_t_to_jiffies(unsigned long x)
#else
unsigned long clock_t_to_jiffies(unsigned long x)
{
+ assert (HZ);
+ assert (USER_HZ);
if (x >= ~0UL / (HZ / USER_HZ))
return ~0UL;
return x * (HZ / USER_HZ);
diff --git a/libdde_linux26/lib/src/kernel/timer.c b/libdde_linux26/lib/src/kernel/timer.c
index 3af77924..951d6ffc 100644
--- a/libdde_linux26/lib/src/kernel/timer.c
+++ b/libdde_linux26/lib/src/kernel/timer.c
@@ -44,6 +44,8 @@
#include <asm/timex.h>
#include <asm/io.h>
+#include <ddekit/timer.h>
+
#ifndef DDE_LINUX
u64 jiffies_64 __cacheline_aligned_in_smp = INITIAL_JIFFIES;
diff --git a/libdde_linux26/lib/src/net/core/dev.c b/libdde_linux26/lib/src/net/core/dev.c
index e66f1da2..b1307dd2 100644
--- a/libdde_linux26/lib/src/net/core/dev.c
+++ b/libdde_linux26/lib/src/net/core/dev.c
@@ -134,6 +134,8 @@
#include "net-sysfs.h"
+#include <ddekit/timer.h>
+
/* Instead of increasing this, you should create a hash table. */
#define MAX_GRO_SKBS 8