Changeset View
Changeset View
Standalone View
Standalone View
sys/contrib/vchiq/interface/compat/vchi_bsd.c
| Show First 20 Lines • Show All 334 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| int | int | ||||
| down_interruptible(struct semaphore *s) | down_interruptible(struct semaphore *s) | ||||
| { | { | ||||
| int ret ; | int ret ; | ||||
| ret = 0; | ret = 0; | ||||
| mtx_lock(&s->mtx); | mtx_lock(&s->mtx); | ||||
| while (s->value == 0) { | while (s->value == 0) { | ||||
| s->waiters++; | s->waiters++; | ||||
| ret = cv_wait_sig(&s->cv, &s->mtx); | ret = cv_wait_sig(&s->cv, &s->mtx); | ||||
| s->waiters--; | s->waiters--; | ||||
| if (ret == EINTR) { | /* XXXMDC As per its semaphore.c, linux can only return EINTR */ | ||||
| if (ret) { | |||||
| mtx_unlock(&s->mtx); | mtx_unlock(&s->mtx); | ||||
| return (-EINTR); | return -EINTR; | ||||
| } | } | ||||
| if (ret == ERESTART) | |||||
| continue; | |||||
| } | } | ||||
| s->value--; | s->value--; | ||||
| mtx_unlock(&s->mtx); | mtx_unlock(&s->mtx); | ||||
| return (0); | return (0); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | |||||
| flush_signals(VCHIQ_THREAD_T thr) | flush_signals(VCHIQ_THREAD_T thr) | ||||
| { | { | ||||
| printf("Implement ME: %s\n", __func__); | printf("Implement ME: %s\n", __func__); | ||||
| } | } | ||||
| int | int | ||||
| fatal_signal_pending(VCHIQ_THREAD_T thr) | fatal_signal_pending(VCHIQ_THREAD_T thr) | ||||
| { | { | ||||
| printf("Implement ME: %s\n", __func__); | return (curproc_sigkilled()); | ||||
| return (0); | |||||
| } | } | ||||
| /* | /* | ||||
| * kthread API | * kthread API | ||||
| */ | */ | ||||
| /* | /* | ||||
| * This is a hack to avoid memory leak | * This is a hack to avoid memory leak | ||||
| ▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines | |||||