This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: select err in ecos application


thank you ! NICK!
every thing is ok!the 8 serial ports is working perfectly.
By the way , if  the intteruption isn't masked in ISR when it return to call
DSR , does it caused any err?
if not, I think it can improve the system realtime charactor .
Best regard!
                                    wangwei

> "wangwei" <wangw@start.com.cn> writes:
>
> > Hi all:
> >
> > I'm making a application in ecos , which will drive 8 serial ports and
> > tcp/ip.
> > I use function "select" in my program .To improve speed , I use ISR of
> > serial port
> > to receive data , not DSR. So the functon "cyg_selwakeup" is called in
ISR .
>
> You just cannot do that. There is no guarantee that the state of the
> kernel run queues, the condition variable or the mutex involved will
> be consistent. Applying any operation to them in an ISR is very
> likely to corrupt something. Which is exactly what is happening to
> you.
>
> Instead, you should move the call to cyg_selwakeup() to the DSR and
> have the ISR return the RUN_DSR bit only when it needs to be called.
>
>
> --
> Nick Garnett, eCos Kernel Architect
> Red Hat, Cambridge, UK
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]