Module: xenomai-2.6 Branch: master Commit: 41b4f9c0f4bdf06107a788b762b5cf662b1d4108 URL: http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=41b4f9c0f4bdf06107a788b762b5cf662b1d4108
Author: Philippe Gerum <r...@xenomai.org> Date: Thu Jan 19 10:27:05 2012 +0100 nucleus, native, psos, vxworks: fix build w/ OPT_PERVASIVE disabled --- ksrc/nucleus/synch.c | 2 ++ ksrc/nucleus/vfile.c | 3 +-- ksrc/skins/native/alarm.c | 13 ++++++++++++- ksrc/skins/psos+/task.c | 4 ++-- ksrc/skins/vxworks/wdLib.c | 13 ++++++++++++- 5 files changed, 29 insertions(+), 6 deletions(-) diff --git a/ksrc/nucleus/synch.c b/ksrc/nucleus/synch.c index 47bc0c5..a8e8b9b 100644 --- a/ksrc/nucleus/synch.c +++ b/ksrc/nucleus/synch.c @@ -684,6 +684,7 @@ xnsynch_release_thread(struct xnsynch *synch, struct xnthread *lastowner) XENO_BUGON(NUCLEUS, !testbits(synch->status, XNSYNCH_OWNER)); +#ifdef CONFIG_XENO_OPT_PERVASIVE if (xnthread_test_state(lastowner, XNOTHER)) { if (xnthread_get_rescnt(lastowner) == 0) xnshadow_send_sig(lastowner, SIGDEBUG, @@ -691,6 +692,7 @@ xnsynch_release_thread(struct xnsynch *synch, struct xnthread *lastowner) else xnthread_dec_rescnt(lastowner); } +#endif lastownerh = xnthread_handle(lastowner); if (use_fastlock && diff --git a/ksrc/nucleus/vfile.c b/ksrc/nucleus/vfile.c index 4898e86..5928aef 100644 --- a/ksrc/nucleus/vfile.c +++ b/ksrc/nucleus/vfile.c @@ -814,8 +814,7 @@ ssize_t xnvfile_get_blob(struct xnvfile_input *input, if (nbytes < size) nbytes = size; - if (nbytes > 0 && - __xn_safe_copy_from_user(data, input->u_buf, nbytes)) + if (nbytes > 0 && copy_from_user(data, input->u_buf, nbytes)) return -EFAULT; return nbytes; diff --git a/ksrc/skins/native/alarm.c b/ksrc/skins/native/alarm.c index 847d26a..4bd9209 100644 --- a/ksrc/skins/native/alarm.c +++ b/ksrc/skins/native/alarm.c @@ -59,20 +59,28 @@ static int vfile_rewind(struct xnvfile_snapshot_iterator *it) { struct vfile_priv *priv = xnvfile_iterator_priv(it); RT_ALARM *alarm = xnvfile_priv(it->vfile); + int nr; alarm = xeno_h2obj_validate(alarm, XENO_ALARM_MAGIC, RT_ALARM); if (alarm == NULL) return -EIDRM; +#ifdef CONFIG_XENO_OPT_PERVASIVE priv->curr = getheadpq(xnsynch_wait_queue(&alarm->synch_base)); + nr = xnsynch_nsleepers(&alarm->synch_base); +#else + priv->curr = NULL; + nr = 0; +#endif priv->interval = rt_timer_tsc2ns(xntimer_interval(&alarm->timer_base)); priv->expiries = alarm->expiries; - return xnsynch_nsleepers(&alarm->synch_base); + return nr; } static int vfile_next(struct xnvfile_snapshot_iterator *it, void *data) { +#ifdef CONFIG_XENO_OPT_PERVASIVE struct vfile_priv *priv = xnvfile_iterator_priv(it); RT_ALARM *alarm = xnvfile_priv(it->vfile); struct vfile_data *p = data; @@ -89,6 +97,9 @@ static int vfile_next(struct xnvfile_snapshot_iterator *it, void *data) strncpy(p->name, xnthread_name(thread), sizeof(p->name)); return 1; +#else + return 0; +#endif } static int vfile_show(struct xnvfile_snapshot_iterator *it, void *data) diff --git a/ksrc/skins/psos+/task.c b/ksrc/skins/psos+/task.c index 0f05410..3de4da4 100644 --- a/ksrc/skins/psos+/task.c +++ b/ksrc/skins/psos+/task.c @@ -231,9 +231,9 @@ u_long t_start(u_long tid, if (xnthread_test_state(&task->threadbase, XNSHADOW)) { attr.entry = (void (*)(void *))startaddr; attr.cookie = (void *)xnthread_handle(&task->threadbase); - } + } else #endif /* CONFIG_XENO_OPT_PERVASIVE */ - else { + { attr.entry = psostask_trampoline; attr.cookie = task; } diff --git a/ksrc/skins/vxworks/wdLib.c b/ksrc/skins/vxworks/wdLib.c index ca2a97d..5483e70 100644 --- a/ksrc/skins/vxworks/wdLib.c +++ b/ksrc/skins/vxworks/wdLib.c @@ -39,19 +39,27 @@ static int vfile_rewind(struct xnvfile_snapshot_iterator *it) { struct vfile_priv *priv = xnvfile_iterator_priv(it); wind_wd_t *wd = xnvfile_priv(it->vfile); + int nr; wd = wind_h2obj_active((WDOG_ID)wd, WIND_WD_MAGIC, wind_wd_t); if (wd == NULL) return -EIDRM; +#ifdef CONFIG_XENO_OPT_PERVASIVE priv->curr = getheadpq(xnsynch_wait_queue(&wd->rh->wdsynch)); + nr = xnsynch_nsleepers(&wd->rh->wdsynch); +#else + priv->curr = NULL; + nr = 0; +#endif priv->timeout = xntimer_get_timeout(&wd->timerbase); - return xnsynch_nsleepers(&wd->rh->wdsynch); + return nr; } static int vfile_next(struct xnvfile_snapshot_iterator *it, void *data) { +#ifdef CONFIG_XENO_OPT_PERVASIVE struct vfile_priv *priv = xnvfile_iterator_priv(it); wind_wd_t *wd = xnvfile_priv(it->vfile); struct vfile_data *p = data; @@ -71,6 +79,9 @@ static int vfile_next(struct xnvfile_snapshot_iterator *it, void *data) strncpy(p->name, xnthread_name(thread), sizeof(p->name)); return 1; +#else + return 0; +#endif } static int vfile_show(struct xnvfile_snapshot_iterator *it, void *data) _______________________________________________ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git