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]
Other format: [Raw text]

Re: about at91 serial device drivers


Gary Thomas wrote:
> 
> On Mon, 2002-04-15 at 06:29, Marc Pignat wrote:
> > As said in the comments, the getc must wait.
> > In the source code of the at91 serial device drivers, this function is not blocking. Is this a bug ?
> >
> > // Fetch a character from the device input buffer, waiting if necessary
> > static unsigned char
> > at91_serial_getc(serial_channel *chan)
> > {
> >     at91_serial_info *at91_chan = (at91_serial_info *)chan->dev_priv;
> >     CYG_ADDRWORD base = at91_chan->base;
> >     cyg_uint32 c;
> >
> >     // Read data
> >     HAL_READ_UINT32(base+AT91_US_RHR, c);
> >     return c;
> > }
> 
> This is OK since this routine should not be called unless either
> a) the device is operating without interrupts or
> b) interrupts are in use and the interrupt service routine has
>    determined that data are present to be read.

Surely in case a) it could return junk if there's nothing there yet?

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
--[ "You can complain because roses have thorns, or you ]--
--[  can rejoice because thorns have roses." -Lincoln   ]-- Opinions==mine

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


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