Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/src/linux_compat.c
Show First 20 Lines • Show All 2,062 Lines • ▼ Show 20 Lines | linux_timer_init(void *arg) | ||||
lkpi_msec2hz_div /= gcd; | lkpi_msec2hz_div /= gcd; | ||||
lkpi_msec2hz_max = -1ULL / lkpi_msec2hz_rem; | lkpi_msec2hz_max = -1ULL / lkpi_msec2hz_rem; | ||||
} | } | ||||
SYSINIT(linux_timer, SI_SUB_DRIVERS, SI_ORDER_FIRST, linux_timer_init, NULL); | SYSINIT(linux_timer, SI_SUB_DRIVERS, SI_ORDER_FIRST, linux_timer_init, NULL); | ||||
void | void | ||||
linux_complete_common(struct completion *c, int all) | linux_complete_common(struct completion *c, int all) | ||||
{ | { | ||||
int wakeup_swapper; | |||||
sleepq_lock(c); | sleepq_lock(c); | ||||
if (all) { | if (all) { | ||||
c->done = UINT_MAX; | c->done = UINT_MAX; | ||||
wakeup_swapper = sleepq_broadcast(c, SLEEPQ_SLEEP, 0, 0); | sleepq_broadcast(c, SLEEPQ_SLEEP, 0, 0); | ||||
} else { | } else { | ||||
if (c->done != UINT_MAX) | if (c->done != UINT_MAX) | ||||
c->done++; | c->done++; | ||||
wakeup_swapper = sleepq_signal(c, SLEEPQ_SLEEP, 0, 0); | sleepq_signal(c, SLEEPQ_SLEEP, 0, 0); | ||||
} | } | ||||
sleepq_release(c); | sleepq_release(c); | ||||
if (wakeup_swapper) | |||||
kick_proc0(); | |||||
} | } | ||||
/* | /* | ||||
* Indefinite wait for done != 0 with or without signals. | * Indefinite wait for done != 0 with or without signals. | ||||
*/ | */ | ||||
int | int | ||||
linux_wait_for_common(struct completion *c, int flags) | linux_wait_for_common(struct completion *c, int flags) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 779 Lines • Show Last 20 Lines |