Page MenuHomeFreeBSD

D11871.diff
No OneTemporary

D11871.diff

Index: head/sys/compat/linuxkpi/common/include/linux/sched.h
===================================================================
--- head/sys/compat/linuxkpi/common/include/linux/sched.h
+++ head/sys/compat/linuxkpi/common/include/linux/sched.h
@@ -36,14 +36,16 @@
#include <sys/proc.h>
#include <sys/sched.h>
#include <sys/sleepqueue.h>
+#include <sys/time.h>
+#include <linux/bitmap.h>
#include <linux/compat.h>
#include <linux/completion.h>
+#include <linux/mm_types.h>
#include <linux/pid.h>
#include <linux/slab.h>
-#include <linux/mm_types.h>
#include <linux/string.h>
-#include <linux/bitmap.h>
+#include <linux/time.h>
#include <asm/atomic.h>
@@ -149,5 +151,14 @@
#define io_schedule() schedule()
#define io_schedule_timeout(timeout) schedule_timeout(timeout)
+
+static inline uint64_t
+local_clock(void)
+{
+ struct timespec ts;
+
+ nanotime(&ts);
+ return ((uint64_t)ts.tv_sec * NSEC_PER_SEC + ts.tv_nsec);
+}
#endif /* _LINUX_SCHED_H_ */
Index: head/sys/compat/linuxkpi/common/include/linux/timer.h
===================================================================
--- head/sys/compat/linuxkpi/common/include/linux/timer.h
+++ head/sys/compat/linuxkpi/common/include/linux/timer.h
@@ -46,15 +46,20 @@
extern unsigned long linux_timer_hz_mask;
-#define setup_timer(timer, func, dat) \
-do { \
+#define TIMER_IRQSAFE 0x0001
+
+#define setup_timer(timer, func, dat) do { \
(timer)->function = (func); \
(timer)->data = (dat); \
callout_init(&(timer)->timer_callout, 1); \
} while (0)
-#define init_timer(timer) \
-do { \
+#define __setup_timer(timer, func, dat, flags) do { \
+ CTASSERT(((flags) & ~TIMER_IRQSAFE) == 0); \
+ setup_timer(timer, func, dat); \
+} while (0)
+
+#define init_timer(timer) do { \
(timer)->function = NULL; \
(timer)->data = 0; \
callout_init(&(timer)->timer_callout, 1); \
@@ -67,9 +72,10 @@
#define del_timer(timer) callout_stop(&(timer)->timer_callout)
#define del_timer_sync(timer) callout_drain(&(timer)->timer_callout)
#define timer_pending(timer) callout_pending(&(timer)->timer_callout)
-#define round_jiffies(j) \
+#define round_jiffies(j) \
((unsigned long)(((j) + linux_timer_hz_mask) & ~linux_timer_hz_mask))
-#define round_jiffies_relative(j) \
- round_jiffies(j)
+#define round_jiffies_relative(j) round_jiffies(j)
+#define round_jiffies_up(j) round_jiffies(j)
+#define round_jiffies_up_relative(j) round_jiffies_up(j)
#endif /* _LINUX_TIMER_H_ */

File Metadata

Mime Type
text/plain
Expires
Wed, Dec 25, 5:47 AM (9 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15595091
Default Alt Text
D11871.diff (2 KB)

Event Timeline