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: eCos cyg/io/devtab.h typos?


"Trenton D. Adams" wrote:
> 
> I'm looking at the code below from the devtab.h file starting around
> line 113.  Shouldn't the cyg_devio_bwrite and cyg_devio_bread be
> switched between the two macros?  I mean doesn't cyg_devio_bwrite and
> cyg_devio_bread stand for block write/read respectively, and not
> character write/read respectively?  If so, what are the block read/write
> doing in a char table and visaversa in the block table?

A cyg_devio_table_t includes methods for both block and character reads.
The way the initializer is done below, a default function is provided when
not supported (see io/common/current/src/iosys.c). So for a
CHAR_DEVIO_TABLE, we use the default block read/write functions, which
return -EDEVNOSUPP.

Jifl
 
> #define
> CHAR_DEVIO_TABLE(_l,_write,_read,_select,_get_config,_set_config)    \
> cyg_devio_table_t _l = {                                        \
>     _write,                                                     \
>     _read,                                                      \
>     cyg_devio_bwrite,                                           \
>     cyg_devio_bread,                                            \
>     _select,                                                    \
>     _get_config,                                                \
>     _set_config,                                                \
> };
> 
> #define
> BLOCK_DEVIO_TABLE(_l,_bwrite,_bread,_select,_get_config,_set_config)
> \
> cyg_devio_table_t _l = {                                        \
>     cyg_devio_cwrite,                                           \
>     cyg_devio_cread,                                            \
>     _bwrite,                                                    \
>     _bread,                                                     \
>     _select,                                                    \
>     _get_config,                                                \
>     _set_config,                                                \
> };

-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine
Come to the Red Hat TechWorld open source conference in Brussels!
Keynotes, techie talks and exhibitions    http://www.redhat-techworld.com/


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