Commit Graph

9 Commits

Author SHA1 Message Date
Olof Johansson 10baa64c02 all: run clang-format and update checked-in files
Noisy commit, no functional changes.

Generated with an current upstream clang-format and:

clang-format -i $(find . -name \*.[ch])

Signed-off-by: Olof Johansson <olof@lixom.net>
2019-04-24 09:49:46 +05:30
Xiang Wang 9eb8f0f90d platform: Make the `platform` read-only
platform should be a read-only variable, if it is placed in the data
segment, it may be exploited.

Signed-off-by: Xiang Wang <wxjstz@126.com>
2019-03-06 11:10:35 -08:00
Atish Patra 86cc9b8633 lib:platform: Fix sbi_getc return type.
As per the current SBI specification, sbi_getc should return
an int instead of char.

In case of FIFO is empty, return -1 as per the specification.

Reported-by: Sergi Granell <xerpi.g.12@gmail.com>
Suggested-by:Thadeu Lima de Souza Cascardo <cascardo@cascardo.eti.br>
Signed-off-by: Atish Patra <atish.patra@wdc.com>
2019-03-05 14:05:12 +05:30
Anup patel 20990ee0ab all: Update copyright header in all files
This patch updates copyright header in all files as follows:
1. Makes "SPDX-License-Identifier: BSD-2-Clause" as first line
2. Change copyright year to 2019 for Western Digital

Signed-off-by: Anup Patel <anup.patel@wdc.com>
2019-01-24 14:07:47 +05:30
Damien Le Moal f4373731e3 lib: code cleanup
Use commonly accepted styles: newlines after declarations and before
return to make the code more readable.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
2019-01-21 09:58:33 +05:30
Damien Le Moal e1e8f18130 console: protect output with a spinlock
Avoid getting messages from multiple harts mingled into garbage text
with a spinlock serializing calls to sbi_puts() and sbi_printf().

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
2018-12-21 18:12:58 +09:00
Atish Patra 1d4e36edf8 Support unsigned long in sbi_printf
Signed-off-by: Atish Patra <atish.patra@wdc.com>
2018-12-20 15:55:32 -08:00
Atish Patra 3250fe7299 Support /r/n as newline character.
Signed-off-by: Atish Patra <atish.patra@wdc.com>
2018-12-20 15:38:43 -08:00
Anup Patel 9e8ff05cb6 Initial commit.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
2018-12-11 19:24:06 +05:30