#define ddi_get_lbolt() ((clock_t)jiffies)
#define ddi_get_lbolt64() ((int64_t)get_jiffies_64())
+#define ddi_time_before(a, b) (typecheck(clock_t, a) && \
+ typecheck(clock_t, b) && \
+ ((a) - (b) < 0))
+#define ddi_time_after(a, b) ddi_time_before(b, a)
+#define ddi_time_before_eq(a, b) (!ddi_time_after(a, b))
+#define ddi_time_after_eq(a, b) ddi_time_before_eq(b, a)
+
+#define ddi_time_before64(a, b) (typecheck(int64_t, a) && \
+ typecheck(int64_t, b) && \
+ ((a) - (b) < 0))
+#define ddi_time_after64(a, b) ddi_time_before64(b, a)
+#define ddi_time_before_eq64(a, b) (!ddi_time_after64(a, b))
+#define ddi_time_after_eq64(a, b) ddi_time_before_eq64(b, a)
+
#define delay(ticks) schedule_timeout_uninterruptible(ticks)
#define SEC_TO_TICK(sec) ((sec) * HZ)
atomic_t *count;
int order[SPLAT_TASKQ_ORDER_MAX];
unsigned int depth;
- unsigned long expire;
+ clock_t expire;
taskq_t *tq;
taskq_ent_t *tqe;
spinlock_t lock;
splat_taskq_arg_t *tq_arg = (splat_taskq_arg_t *)arg;
ASSERT(tq_arg);
- if (ddi_get_lbolt() >= tq_arg->expire)
+ if (ddi_time_after_eq(ddi_get_lbolt(), tq_arg->expire))
atomic_inc(tq_arg->count);
kmem_free(tq_arg, sizeof(splat_taskq_arg_t));
splat_taskq_arg_t *tq_arg = (splat_taskq_arg_t *)arg;
uint8_t rnd;
- if (ddi_get_lbolt() >= tq_arg->expire)
+ if (ddi_time_after_eq(ddi_get_lbolt(), tq_arg->expire))
atomic_inc(tq_arg->count);
/* Randomly sleep to further perturb the system */
int canceled = 0;
int completed = 0;
int blocked = 0;
- unsigned long start, cancel;
+ clock_t start, cancel;
tqas = vmalloc(sizeof(*tqas) * nr_tasks);
if (tqas == NULL)
start = ddi_get_lbolt();
i = 0;
- while (ddi_get_lbolt() < start + 5 * HZ) {
+ while (ddi_time_before(ddi_get_lbolt(), start + 5 * HZ)) {
taskqid_t id;
uint32_t rnd;