All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [Xenomai-help] V2.4.4 on blackfin
@ 2008-07-25 16:13 Filip Van Rillaer
  2008-07-31  9:50 ` Philippe Gerum
  0 siblings, 1 reply; 3+ messages in thread
From: Filip Van Rillaer @ 2008-07-25 16:13 UTC (permalink / raw)
  To: xenomai

[-- Attachment #1: Type: text/plain, Size: 400 bytes --]

 
Hello, 
 
<< 

rt_event_wait seems not to work properly if one specifies a timeout :
the functioncall returns after the specified of time, but it returns 0,
instead of -ETIMEDOUT. 

>>

In the mean time I found the bug : ksrc/skins/native/syscall.c:

the last line of the function __rt_event_wait should be

return err;

instead of

return 0;

Best regards,

Filip


 


[-- Attachment #2: Type: text/html, Size: 2360 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread
* [Xenomai-help] V2.4.4 on blackfin
@ 2008-07-25 10:50 Filip Van Rillaer
  0 siblings, 0 replies; 3+ messages in thread
From: Filip Van Rillaer @ 2008-07-25 10:50 UTC (permalink / raw)
  To: xenomai

[-- Attachment #1: Type: text/plain, Size: 2405 bytes --]

Hello,

rt_event_wait seems not to work properly if one specifies a timeout :
the functioncall returns after the specified of time, but it returns 0,
instead of -ETIMEDOUT.
Below is an example that demonstrates the problem.

In version 2.4.0 it worked fine.
Probably the problem is not specific for the rt_event_wait function, but
in general the passing of return-values in userspace.

This are the version I am currently using:

URL: http://svn.gna.org/svn/xenomai/trunk
Repository Root: http://svn.gna.org/svn/xenomai
Repository UUID: c6d672ea-8702-0410-b560-f74c916a59fe
Revision: 4047

URL:
svn://firewall-sources.blackfin.uclinux.org:80/svn/uclinux-dist/trunk
Repository Root:
svn://firewall-sources.blackfin.uclinux.org:80/svn/uclinux-dist
Repository UUID: 3e2a5524-39e8-4cb9-84a9-c49da69cba3a
Revision: 6418

URL:
svn://firewall-sources.blackfin.uclinux.org:80/svn/linux-kernel/tags/200
8R1-RC8
Repository Root:
svn://firewall-sources.blackfin.uclinux.org:80/svn/linux-kernel
Repository UUID: 526b6c2d-f592-4532-a319-5dd88ccb003d
Revision: 4963


How can this be solved/avoided?

Best regards,

Filip

#include <stdio.h>
#include <sys/mman.h>
#include <native/task.h>
#include <native/event.h>

#define EVENT_INIT        0x0           /* No flags present at init */
#define EVENT_MODE        EV_PRIO       /* Tasks will wait by priority
order */
#define EVENT_WAIT_MASK   (0x1|0x2|0x4) /* List of monitored events */


RT_EVENT ev_desc;
int main(int argc, char **argv)
{
  RT_TASK task;
  unsigned long mask_ret;
  int err;
  RTIME timeout=13000000000LL; /* 13 sec */

  mlockall(MCL_CURRENT|MCL_FUTURE);
  rt_task_shadow(&task, "Task", 10, 0);

  err = rt_event_create(&ev_desc,"MyEventFlagGroup",EVENT_INIT,
EVENT_MODE);
  if (err<0) {
    fprintf(stderr,"rt_event_create failed\n");
    return -1;
  }
  else {
    fprintf(stderr,"rt_event_create ok\n");
  }

  err = rt_event_wait(&ev_desc, EVENT_WAIT_MASK, &mask_ret, EV_ANY
,timeout);
  if (err<0) {
    switch (err)  {
      case -ETIMEDOUT: fprintf(stderr,"rt_event_wait returned -ETIMEDOUT
(and that's OK)\n"); break;
      default:  fprintf(stderr,"rt_event_wait returned %d (which is
wrong)\n",err); return -2;
    }
  }
  else {
    fprintf(stderr,"rt_event_wait returned 0, but we expected
-ETIMEDOUT\n");
    return -3;
  }
  return 0;
}

 


[-- Attachment #2: Type: text/html, Size: 4263 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-07-31  9:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-25 16:13 [Xenomai-help] V2.4.4 on blackfin Filip Van Rillaer
2008-07-31  9:50 ` Philippe Gerum
  -- strict thread matches above, loose matches on Subject: below --
2008-07-25 10:50 Filip Van Rillaer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.