<feed xmlns='http://www.w3.org/2005/Atom'>
<title>opensbi.git/lib/sbi/sbi_console.c, branch v1.5</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/opensbi.git/atom/lib/sbi/sbi_console.c?h=v1.5</id>
<link rel='self' href='http://cgit.235523.xyz/opensbi.git/atom/lib/sbi/sbi_console.c?h=v1.5'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/'/>
<updated>2024-03-19T05:50:40Z</updated>
<entry>
<title>lib: tests: Move tests to a separate directory</title>
<updated>2024-03-19T05:50:40Z</updated>
<author>
<name>Ivan Orlov</name>
<email>ivan.orlov0322@gmail.com</email>
</author>
<published>2024-03-13T15:01:57Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=5c992a115a15ce2f2518f0ff7a655b42c3a8ebad'/>
<id>urn:sha1:5c992a115a15ce2f2518f0ff7a655b42c3a8ebad</id>
<content type='text'>
Move all of the SBIUnit-related code into the lib/sbi/tests directory.
Update 'Makefile' to index objects from the tests subdirectory.

I don't think creating the full separate list of Makefile variables
(libsbitests-objs-path-y, libsbitests-object-mks, etc. as it is done for
libsbiutils) is necessary for the tests because:

1) `lib/sbi/tests/objects.mk` is already indexed into
'libsbi-objects-mks' since the find expression for the libsbi-object-mks
variable looks for objects.mk files in the nested directories as well).

2) Tests are tightly coupled with the `lib/sbi/` sources, therefore it
may be reasonable to store the list of lib/sbi and lib/sbi/tests object
files together in the libsbi-objs-path-y variable.

Additionally, update relative paths in the tests where necessary.

Signed-off-by: Ivan Orlov &lt;ivan.orlov0322@gmail.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: tests: Add sbi_console test</title>
<updated>2024-03-10T04:42:52Z</updated>
<author>
<name>Ivan Orlov</name>
<email>ivan.orlov0322@gmail.com</email>
</author>
<published>2024-03-04T21:45:51Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=87d8fe78653e77de33cc12b9df07fc3a202f7d49'/>
<id>urn:sha1:87d8fe78653e77de33cc12b9df07fc3a202f7d49</id>
<content type='text'>
Add the test suite covering some of the functions from
lib/sbi/sbi_console.c: putc, puts and printf. The test covers a variety
of format specifiers for printf and different strings and characters for
putc and puts.

In order to do that, the test "mocks" the sbi_console_device structure
by setting the 'console_dev' variable to the virtual console.

Signed-off-by: Ivan Orlov &lt;ivan.orlov0322@gmail.com&gt;
Reviewed-by: Andrew Jones &lt;ajones@ventanamicro.com&gt;
</content>
</entry>
<entry>
<title>lib: sbi: Make console_puts/console_putc interchangeable</title>
<updated>2023-11-17T10:33:21Z</updated>
<author>
<name>Xiang W</name>
<email>wxjstz@126.com</email>
</author>
<published>2023-11-17T01:03:58Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=3aaed4fadfce9e02823c813bd5a69a84376b3397'/>
<id>urn:sha1:3aaed4fadfce9e02823c813bd5a69a84376b3397</id>
<content type='text'>
console_puts/console_putc should replace each other, but the previous
sbi_putc can only use console_putc. This patch addresses this problem.

Signed-off-by: Xiang W &lt;wxjstz@126.com&gt;
Reviewed-by: Guo Ren &lt;guoren@kernel.org&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi: Fix missing '\0' when buffer szie equal 1</title>
<updated>2023-07-12T05:07:43Z</updated>
<author>
<name>Xiang W</name>
<email>wxjstz@126.com</email>
</author>
<published>2023-07-09T16:03:26Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=a73982d7376a71cf6e230b255069da46fe2becc9'/>
<id>urn:sha1:a73982d7376a71cf6e230b255069da46fe2becc9</id>
<content type='text'>
Fix special case: sbi_snprintf(out, out_len, ...) when out_len equal
1, The previous code will not fill the buffer with any char.

Signed-off-by: Xiang W &lt;wxjstz@126.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi: Fix timing of clearing tbuf</title>
<updated>2023-07-12T05:07:16Z</updated>
<author>
<name>Xiang W</name>
<email>wxjstz@126.com</email>
</author>
<published>2023-07-09T16:02:30Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=ff43168137a4890fe65460c1506fdf08c26bebad'/>
<id>urn:sha1:ff43168137a4890fe65460c1506fdf08c26bebad</id>
<content type='text'>
A single scan of the format char may add multiple characters to the
tbuf, causing a buffer overflow. You should check if tbuf is full in
printc so that it does not cause a buffer overflow.

Signed-off-by: Xiang W &lt;wxjstz@126.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi: Fix printc</title>
<updated>2023-07-12T04:32:27Z</updated>
<author>
<name>Xiang W</name>
<email>wxjstz@126.com</email>
</author>
<published>2023-07-09T16:02:29Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=cc89fa7b5481b3279f1628f71debf795d5618044'/>
<id>urn:sha1:cc89fa7b5481b3279f1628f71debf795d5618044</id>
<content type='text'>
Because *out needs to reserve a byte to hold '\0', no more characters
should be added to the buffer when *out has one byte left, and the
buffer size *out_len should not be modified. this patch prevents
the correction of *out_len when *out_len is 1.

Signed-off-by: Xiang W &lt;wxjstz@126.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi: Simplify prints</title>
<updated>2023-07-12T04:32:06Z</updated>
<author>
<name>Xiang W</name>
<email>wxjstz@126.com</email>
</author>
<published>2023-07-09T16:02:28Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=3b6fcddcebf82bb58ac750a2ab4d6e22d7549ac9'/>
<id>urn:sha1:3b6fcddcebf82bb58ac750a2ab4d6e22d7549ac9</id>
<content type='text'>
When doing width = width - strlen(string) in prints there is no need
to consider the case that witdh may be less than 0. This is because
the code to do filling needs to be executed under the condition that
width &gt; 0.

Signed-off-by: Xiang W &lt;wxjstz@126.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi: Fix printi</title>
<updated>2023-07-12T04:31:43Z</updated>
<author>
<name>Xiang W</name>
<email>wxjstz@126.com</email>
</author>
<published>2023-07-09T16:02:27Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=c6ee5ae5a485335fa28a5f74811f900d8da9f87d'/>
<id>urn:sha1:c6ee5ae5a485335fa28a5f74811f900d8da9f87d</id>
<content type='text'>
Fix two bug:
&gt; printf("%#08x", 0x123); /* print 0000x123 */
&gt; printf("%#x", 0); /* print 0x0 */

Signed-off-by: Xiang W &lt;wxjstz@126.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi: print add 'o' type</title>
<updated>2023-07-12T04:29:22Z</updated>
<author>
<name>Xiang W</name>
<email>wxjstz@126.com</email>
</author>
<published>2023-07-09T16:02:26Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=fe0828142fa34a95b6933dd94e68ed528d4c5778'/>
<id>urn:sha1:fe0828142fa34a95b6933dd94e68ed528d4c5778</id>
<content type='text'>
Add o type for print to print octal numbers

Signed-off-by: Xiang W &lt;wxjstz@126.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi: implifying the parameters of printi</title>
<updated>2023-07-12T04:28:52Z</updated>
<author>
<name>Xiang W</name>
<email>wxjstz@126.com</email>
</author>
<published>2023-07-09T16:02:25Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=05cbb6e908a469f152d0253cfdf7c1aa2bda820d'/>
<id>urn:sha1:05cbb6e908a469f152d0253cfdf7c1aa2bda820d</id>
<content type='text'>
The information of sg/b/letbase can be obtained by the type character,
simplifying the parameter by passing the type directly.

Signed-off-by: Xiang W &lt;wxjstz@126.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
</feed>
