This fix is for compatibility with lwip_select(). It moves the lock to
UART which is the only VFS driver which is implemented and is not
"thread-safe".
vfs_uart used same locks for read and write operations on a single UART.
If read operation was blocking (i.e. carried out via UART driver), the
lock was held by reading task until it received a line. During this time,
other tasks trying to write to the same UART would get blocked.
This change introduces separate read/write locks, and adds a test.
Another vfs_uart test if fixed (it was disabled since the
CONFIG_NEWLIB_STDOUT_ADDCR option was removed).
Previously VFS driver for UART could only use simple non-blocking
functions to read from and write to the UART. UART driver provides more
complex blocking and interrupt-driven functions, which can be used
instead.
This commit adds optional support for using UART driver's functions.
Also added is a more flexible mechanism for configuring newline
conversion rules on input and output.
This commit also fixes a bug that all UARTs shared one static variable
used as a character buffer in newline conversion code. This variable is
changed to be per-UART.
- spaces->tabs in tasks.c
- update vfs_uart.c to use per-UART locks
- add license to vfs_uart.c
- allocate separate streams for stdout, stdin, stderr, so that they can be independently reassigned
- fix build system test failure
- use posix off_t instead of newlib internal _off_t