Skip to content

Commit 9557a9d

Browse files
sys/libc: model Kconfig
1 parent cf753c6 commit 9557a9d

File tree

4 files changed

+60
-6
lines changed

4 files changed

+60
-6
lines changed

sys/Kconfig

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,34 @@ rsource "frac/Kconfig"
3030
rsource "hashes/Kconfig"
3131
rsource "iolist/Kconfig"
3232
rsource "isrpipe/Kconfig"
33+
34+
menu "Libc"
35+
36+
choice LIBC_IMPLEMENTATION
37+
bool "Libc implementation"
38+
depends on TEST_KCONFIG
39+
40+
config MODULE_NEWLIB
41+
bool "NewLib"
42+
depends on HAS_NEWLIB
43+
44+
config MODULE_PICOLIBC
45+
bool "Picolibc"
46+
depends on HAS_PICOLIBC
47+
48+
endchoice
49+
50+
rsource "Kconfig.newlib"
51+
rsource "Kconfig.picolibc"
52+
53+
endmenu # Libc
54+
3355
rsource "luid/Kconfig"
3456
rsource "malloc_thread_safe/Kconfig"
3557
rsource "matstat/Kconfig"
3658
rsource "memarray/Kconfig"
3759
rsource "mineplex/Kconfig"
3860
rsource "net/Kconfig"
39-
rsource "Kconfig.newlib"
4061
rsource "Kconfig.stdio"
4162
rsource "od/Kconfig"
4263
rsource "posix/Kconfig"

sys/Kconfig.newlib

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
# directory for more details.
66
#
77

8-
menuconfig MODULE_NEWLIB
9-
bool "NewLib"
10-
depends on TEST_KCONFIG
11-
128
if MODULE_NEWLIB
139

1410
config MODULE_NEWLIB_NANO
@@ -18,9 +14,11 @@ config MODULE_NEWLIB_GNU_SOURCE
1814
bool "NewLib GNU source"
1915

2016
config MODULE_NEWLIB_SYSCALLS_DEFAULT
21-
bool "NewLib Syscalls default implementation"
17+
bool
2218
default y
2319
depends on !HAVE_CUSTOM_NEWLIB_SYSCALLS
20+
help
21+
Default implementation of newlib system calls.
2422

2523
endif # MODULE_NEWLIB
2624

sys/Kconfig.picolibc

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright (c) 2021 HAW Hamburg
2+
#
3+
# This file is subject to the terms and conditions of the GNU Lesser
4+
# General Public License v2.1. See the file LICENSE in the top level
5+
# directory for more details.
6+
#
7+
8+
if MODULE_PICOLIBC
9+
10+
config PICOLIBC_STDOUT_BUFFERED
11+
bool "Buffered standard output"
12+
default USE_STDOUT_BUFFERED
13+
help
14+
Say y to use buffering in the standard output, usually good for modules that benefit from
15+
sending out buffers in larger chunks.
16+
17+
config MODULE_PICOLIBC_SYSCALLS_DEFAULT
18+
bool
19+
default y
20+
depends on !HAVE_CUSTOM_PICOLIBC_SYSCALLS
21+
help
22+
Default implementation of picolibc system calls.
23+
24+
endif # MODULE_PICOLIBC
25+
26+
config HAVE_CUSTOM_PICOLIB_SYSCALLS
27+
bool
28+
help
29+
Indicates that a custom picolibc syscalls implementation is present.

sys/Kconfig.stdio

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ choice
1818
config MODULE_SLIPDEV_STDIO
1919
bool "SLIP network device"
2020
depends on MODULE_SLIPDEV
21+
select USE_STDOUT_BUFFERED
2122
select MODULE_ISRPIPE
2223

2324
config MODULE_STDIO_NULL
@@ -50,4 +51,9 @@ config MODULE_STDIO_UART_RX
5051
config MODULE_PRINTF_FLOAT
5152
bool "Float support in printf"
5253

54+
config USE_STDOUT_BUFFERED
55+
bool
56+
help
57+
Select this to prefer buffered standard output if provided by the implementation.
58+
5359
endmenu # Standard Input/Output (STDIO)

0 commit comments

Comments
 (0)