Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/src/linux_schedule.c
Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | default: | ||||
linux_schedule_save_interrupt_value(current, ret); | linux_schedule_save_interrupt_value(current, ret); | ||||
return (ms); | return (ms); | ||||
} | } | ||||
} | } | ||||
static int | static int | ||||
wake_up_task(struct task_struct *task, unsigned int state) | wake_up_task(struct task_struct *task, unsigned int state) | ||||
{ | { | ||||
int ret, wakeup_swapper; | int ret; | ||||
ret = wakeup_swapper = 0; | ret = 0; | ||||
sleepq_lock(task); | sleepq_lock(task); | ||||
if ((atomic_read(&task->state) & state) != 0) { | if ((atomic_read(&task->state) & state) != 0) { | ||||
set_task_state(task, TASK_WAKING); | set_task_state(task, TASK_WAKING); | ||||
wakeup_swapper = sleepq_signal(task, SLEEPQ_SLEEP, 0, 0); | sleepq_signal(task, SLEEPQ_SLEEP, 0, 0); | ||||
ret = 1; | ret = 1; | ||||
} | } | ||||
sleepq_release(task); | sleepq_release(task); | ||||
if (wakeup_swapper) | |||||
kick_proc0(); | |||||
return (ret); | return (ret); | ||||
} | } | ||||
bool | bool | ||||
linux_signal_pending(struct task_struct *task) | linux_signal_pending(struct task_struct *task) | ||||
{ | { | ||||
struct thread *td; | struct thread *td; | ||||
sigset_t pending; | sigset_t pending; | ||||
▲ Show 20 Lines • Show All 204 Lines • ▼ Show 20 Lines | linux_schedule_timeout(int timeout) | ||||
else if (remainder > timeout) | else if (remainder > timeout) | ||||
remainder = timeout; | remainder = timeout; | ||||
return (remainder); | return (remainder); | ||||
} | } | ||||
static void | static void | ||||
wake_up_sleepers(void *wchan) | wake_up_sleepers(void *wchan) | ||||
{ | { | ||||
int wakeup_swapper; | |||||
sleepq_lock(wchan); | sleepq_lock(wchan); | ||||
wakeup_swapper = sleepq_signal(wchan, SLEEPQ_SLEEP, 0, 0); | sleepq_signal(wchan, SLEEPQ_SLEEP, 0, 0); | ||||
sleepq_release(wchan); | sleepq_release(wchan); | ||||
if (wakeup_swapper) | |||||
kick_proc0(); | |||||
} | } | ||||
#define bit_to_wchan(word, bit) ((void *)(((uintptr_t)(word) << 6) | (bit))) | #define bit_to_wchan(word, bit) ((void *)(((uintptr_t)(word) << 6) | (bit))) | ||||
void | void | ||||
linux_wake_up_bit(void *word, int bit) | linux_wake_up_bit(void *word, int bit) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 76 Lines • Show Last 20 Lines |