1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-02 14:33:18 +02:00

Introduce serialport_write_nonblock()

It seems useful to have a generic and platform-independent method to
read and write to a serial port without blocking. This is the write part.

This allows to get rid of the explicit temporary disabling of blocking I/O in
serprog's sp_synchronize().

Corresponding to flashrom svn r1662.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
This commit is contained in:
Stefan Tauner
2013-04-01 00:45:45 +00:00
parent 00e1608501
commit ae3d83765c
3 changed files with 78 additions and 14 deletions

View File

@ -660,6 +660,7 @@ extern fdtype sp_fd;
/* expose serialport_shutdown as it's currently used by buspirate */
int serialport_shutdown(void *data);
int serialport_write(unsigned char *buf, unsigned int writecnt);
int serialport_write_nonblock(unsigned char *buf, unsigned int writecnt, unsigned int timeout, unsigned int *really_wrote);
int serialport_read(unsigned char *buf, unsigned int readcnt);
int serialport_read_nonblock(unsigned char *c, unsigned int readcnt, unsigned int timeout, unsigned int *really_read);