Skip to content
Unverified Commit 48625474 authored by Hugues Kamba-Mpiana's avatar Hugues Kamba-Mpiana Committed by GitHub
Browse files

bsp: Synchronize serial driver access (#29)



The serial driver is used by multiple tasks and not all tasks use
the Log APIs to send data to the serial driver.
This was causing serial data buffer corruption.

Synchronise the access of the serial driver using mutual exclusion
to make it thread-safe.

This also removes code duplication and fixes return values for
the write system call:
* Arm GNU Toolchain: On failure, `-1`.
                     On success, total chars written.
* Arm Compiler: On failure, a positive number representing the number of
                chars NOT written or a negative number indicating an error.
                On success, `0`.

Signed-off-by: Devaraj Ranganna's avatarDevaraj Ranganna <devaraj.ranganna@arm.com>
Signed-off-by: Hugues Kamba Mpiana's avatarHugues Kamba-Mpiana <hugues.kambampiana@arm.com>
Co-authored-by: Devaraj Ranganna's avatarDevaraj Ranganna <devaraj.ranganna@arm.com>
parent 75f27d4b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment