| 109 |
109 |
#include <sys/thread2.h>
|
| 110 |
110 |
#include <sys/mplock2.h>
|
| 111 |
111 |
|
|
112 |
#include <machine/limits.h>
|
|
113 |
|
| 112 |
114 |
#ifndef MAX_SOFTCLOCK_STEPS
|
| 113 |
115 |
#define MAX_SOFTCLOCK_STEPS 100 /* Maximum allowed value of steps. */
|
| 114 |
116 |
#endif
|
| ... | ... | |
| 385 |
387 |
crit_exit_gd(gd);
|
| 386 |
388 |
}
|
| 387 |
389 |
|
|
390 |
void
|
|
391 |
callout_reset_s(struct callout *c, int s, void (*ftn)(void *),
|
|
392 |
void *arg)
|
|
393 |
{
|
|
394 |
uintmax_t t;
|
|
395 |
|
|
396 |
t = (uintmax_t)s * hz;
|
|
397 |
if (t > INT_MAX)
|
|
398 |
t = INT_MAX;
|
|
399 |
callout_reset(c, t, ftn, arg);
|
|
400 |
}
|
|
401 |
|
|
402 |
void
|
|
403 |
callout_reset_ms(struct callout *c, int ms, void (*ftn)(void *),
|
|
404 |
void *arg)
|
|
405 |
{
|
|
406 |
uintmax_t t;
|
|
407 |
|
|
408 |
t = (uintmax_t)ms * hz / 1000;
|
|
409 |
if (t > INT_MAX)
|
|
410 |
t = INT_MAX;
|
|
411 |
callout_reset(c, t, ftn, arg);
|
|
412 |
}
|
|
413 |
|
| 388 |
414 |
/*
|
| 389 |
415 |
* Stop a running timer. WARNING! If called on a cpu other then the one
|
| 390 |
416 |
* the callout was started on this function will liveloop on its IPI to
|