1# Copyright (c) 2016 Intel Corporation
2# SPDX-License-Identifier: Apache-2.0
3
4menu "OS Support Library"
5
6config FDTABLE
7	bool "File descriptor table"
8	help
9	  This file provides generic file descriptor table implementation, suitable
10	  for any I/O object implementing POSIX I/O semantics (i.e. read/write +
11	  aux operations).
12
13config ZVFS_OPEN_MAX
14	int "Maximum number of open file descriptors"
15	default 16 if WIFI_NM_WPA_SUPPLICANT
16	default 16 if POSIX_API
17	default 4
18	help
19	  Maximum number of open file descriptors, this includes
20	  files, sockets, special devices, etc.
21
22config PRINTK_SYNC
23	bool "Serialize printk() calls"
24	default y if SMP && MP_MAX_NUM_CPUS > 1 && !(EFI_CONSOLE && LOG)
25	help
26	  When true, a spinlock will be taken around the output from a
27	  single printk() call, preventing the output data from
28	  interleaving with concurrent usage from another CPU or an
29	  preempting interrupt.
30
31config MPSC_PBUF
32	bool "Multi producer, single consumer packet buffer"
33	select TIMEOUT_64BIT
34	help
35	  Enable usage of mpsc packet buffer. Packet buffer is capable of
36	  storing variable length packets in a circular way and operate directly
37	  on the buffer memory.
38
39config SPSC_PBUF
40	bool "Single producer, single consumer packet buffer"
41	help
42	  Enable usage of spsc packet buffer. Packet buffer is capable of
43	  storing variable length packets in a circular way and operate directly
44	  on the buffer memory.
45
46if SPSC_PBUF
47
48choice SPSC_PBUF_CACHE_HANDLING
49	prompt "Cache handling"
50	default SPSC_PBUF_CACHE_ALWAYS if SPSC_PBUF_USE_CACHE && !SPSC_PBUF_NO_CACHE
51	default SPSC_PBUF_CACHE_NEVER if !SPSC_PBUF_USE_CACHE && SPSC_PBUF_NO_CACHE
52	default SPSC_PBUF_CACHE_FLAG
53
54config SPSC_PBUF_CACHE_FLAG
55	bool "Use cache flag"
56	help
57	  Use instance specific configuration flag for cache handling.
58
59config SPSC_PBUF_CACHE_ALWAYS
60	bool "Always handle cache"
61	help
62	  Handle cache writeback and invalidation for all instances. Option used
63	  to avoid runtime check and thus reduce memory footprint. Beware! It shall
64	  be used only if all packet buffer instances are used for data sharing
65	  between cores.
66
67config SPSC_PBUF_CACHE_NEVER
68	bool "Never handle cache"
69	help
70	  Discar cache handling for all instances. Option used to avoid runtime
71	  check and thus reduce memory footprint.
72
73endchoice
74
75config SPSC_PBUF_USE_CACHE
76	bool
77
78config SPSC_PBUF_NO_CACHE
79	bool
80
81if SPSC_PBUF_CACHE_FLAG || SPSC_PBUF_CACHE_ALWAYS
82
83config SPSC_PBUF_REMOTE_DCACHE_LINE
84	int "Remote cache line size"
85	default 32
86	help
87	  If a packet buffer is used for data sharing between two cores then
88	  this value should be set to the data cache line size of the remote core.
89	  If local data cache line is detected at runtime then it should be
90	  maximum of local and remote line size.
91
92endif # SPSC_PBUF_CACHE_FLAG || SPSC_PBUF_CACHE_ALWAYS
93
94config SPSC_PBUF_UTILIZATION
95	bool "Track maximum utilization"
96	help
97	  When enabled, maximum utilization is tracked which can be used to
98	  determine the size of the packet buffer.
99
100endif # SPSC_PBUF
101
102if MPSC_PBUF
103config MPSC_CLEAR_ALLOCATED
104	bool "Clear allocated packet"
105	help
106	  When enabled packet space is zeroed before returning from allocation.
107endif
108
109config REBOOT
110	bool "Reboot functionality"
111	help
112	  Enable the sys_reboot() API. Enabling this can drag in other subsystems
113	  needed to perform a "safe" reboot (e.g. to stop the system clock before
114	  issuing a reset).
115
116config HAS_POWEROFF
117	bool
118	help
119	  Option to signal that power off functionality is implemented.
120
121config POWEROFF
122	bool "Power off functionality"
123	depends on HAS_POWEROFF
124	help
125	  Enable support for system power off.
126
127rsource "Kconfig.cbprintf"
128rsource "zvfs/Kconfig"
129
130endmenu
131