This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: about at91 serial device drivers
- From: Jonathan Larmour <jlarmour at redhat dot com>
- To: Gary Thomas <gthomas at redhat dot com>
- Cc: Marc Pignat <marc dot pignat at hevs dot ch>,eCos Discussion <ecos-discuss at sources dot redhat dot com>
- Date: Tue, 30 Apr 2002 19:00:38 +0100
- Subject: Re: [ECOS] about at91 serial device drivers
- Organization: Red Hat UK Ltd.
- References: <scbae3c0.037@hevs.ch> <1018875415.32517.5.camel@hermes>
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