This is the mail archive of the
ecos-discuss@sourceware.cygnus.com
mailing list for the eCos project.
Re: Ethernet driver /MPC860 FADS
- To: Claus Jarnik <jarnik at esk dot fhg dot de>
- Subject: Re: [ECOS] Ethernet driver /MPC860 FADS
- From: Samuel Tardieu <sam at inf dot enst dot fr>
- Date: Mon, 20 Dec 1999 11:22:51 +0100
- Cc: ecos-discuss at sourceware dot cygnus dot com
- Organization: Ecole Nationale Superieure des Telecommunications
- References: <385E01EF.727F5845@esk.fhg.de>
- Reply-To: Samuel Tardieu <sam at inf dot enst dot fr>
| I use the eCos cyg_io_read and cyg_io_write function for
| receive/transmit data.
| (cyg_io_write(cyg_io_handle_t handle, const void *buf, cyg_uint32 *len)
|
| In these functions I copy the data from/to buf with the desired length
| len. This copying (I use memcpy) costs a lot of performance.
Those functions are as close as possible of the read() and write() classical
form. I would suggest that you do not use it for memory mapped devices (such
as the ethernet part of the MPC860) as the data is already available in memory
and you will not be able to prevent the copy. Those functions were designed
originally to read/write from/to a file, with the content loaded on demand,
without needing any extra copy.
So my suggestion is: do not use this if you need to avoid useless copies.