2019-01-19 12:57:38 +01:00
|
|
|
# Copyright (c) 2016 Intel Corporation
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
menu "OS Support Library"
|
|
|
|
|
2023-09-25 14:30:16 +02:00
|
|
|
config FDTABLE
|
|
|
|
bool "File descriptor table"
|
|
|
|
help
|
|
|
|
This file provides generic file descriptor table implementation, suitable
|
|
|
|
for any I/O object implementing POSIX I/O semantics (i.e. read/write +
|
|
|
|
aux operations).
|
|
|
|
|
2020-06-03 00:07:28 +02:00
|
|
|
config PRINTK_SYNC
|
|
|
|
bool "Serialize printk() calls"
|
2023-07-20 21:34:23 +02:00
|
|
|
default y if SMP && MP_MAX_NUM_CPUS > 1 && !(EFI_CONSOLE && LOG)
|
2020-06-03 00:07:28 +02:00
|
|
|
help
|
|
|
|
When true, a spinlock will be taken around the output from a
|
|
|
|
single printk() call, preventing the output data from
|
|
|
|
interleaving with concurrent usage from another CPU or an
|
|
|
|
preempting interrupt.
|
|
|
|
|
2021-01-14 07:59:52 +01:00
|
|
|
config MPSC_PBUF
|
|
|
|
bool "Multi producer, single consumer packet buffer"
|
|
|
|
select TIMEOUT_64BIT
|
|
|
|
help
|
|
|
|
Enable usage of mpsc packet buffer. Packet buffer is capable of
|
|
|
|
storing variable length packets in a circular way and operate directly
|
|
|
|
on the buffer memory.
|
|
|
|
|
2022-05-17 15:49:59 +02:00
|
|
|
config SPSC_PBUF
|
|
|
|
bool "Single producer, single consumer packet buffer"
|
|
|
|
help
|
|
|
|
Enable usage of spsc packet buffer. Packet buffer is capable of
|
|
|
|
storing variable length packets in a circular way and operate directly
|
|
|
|
on the buffer memory.
|
|
|
|
|
2022-05-17 19:36:07 +02:00
|
|
|
if SPSC_PBUF
|
|
|
|
|
|
|
|
choice SPSC_PBUF_CACHE_HANDLING
|
|
|
|
prompt "Cache handling"
|
|
|
|
default SPSC_PBUF_CACHE_ALWAYS if SPSC_PBUF_USE_CACHE && !SPSC_PBUF_NO_CACHE
|
|
|
|
default SPSC_PBUF_CACHE_NEVER if !SPSC_PBUF_USE_CACHE && SPSC_PBUF_NO_CACHE
|
|
|
|
default SPSC_PBUF_CACHE_FLAG
|
|
|
|
|
|
|
|
config SPSC_PBUF_CACHE_FLAG
|
|
|
|
bool "Use cache flag"
|
|
|
|
help
|
|
|
|
Use instance specific configuration flag for cache handling.
|
|
|
|
|
|
|
|
config SPSC_PBUF_CACHE_ALWAYS
|
|
|
|
bool "Always handle cache"
|
|
|
|
help
|
|
|
|
Handle cache writeback and invalidation for all instances. Option used
|
|
|
|
to avoid runtime check and thus reduce memory footprint.
|
|
|
|
|
|
|
|
config SPSC_PBUF_CACHE_NEVER
|
|
|
|
bool "Never handle cache"
|
|
|
|
help
|
|
|
|
Discar cache handling for all instances. Option used to avoid runtime
|
|
|
|
check and thus reduce memory footprint.
|
|
|
|
|
|
|
|
endchoice
|
|
|
|
|
|
|
|
config SPSC_PBUF_USE_CACHE
|
|
|
|
bool
|
|
|
|
|
|
|
|
config SPSC_PBUF_NO_CACHE
|
|
|
|
bool
|
|
|
|
|
2022-05-18 13:06:40 +02:00
|
|
|
if SPSC_PBUF_CACHE_FLAG || SPSC_PBUF_CACHE_ALWAYS
|
|
|
|
|
2022-07-18 14:33:13 +02:00
|
|
|
config SPSC_PBUF_REMOTE_DCACHE_LINE
|
|
|
|
int "Remote cache line size"
|
2022-05-18 13:06:40 +02:00
|
|
|
default 32
|
|
|
|
help
|
2022-07-18 14:33:13 +02:00
|
|
|
If a packet buffer is used for data sharing between two cores then
|
|
|
|
this value should be set to the data cache line size of the remote core.
|
|
|
|
If local data cache line is detected at runtime then it should be
|
|
|
|
maximum of local and remote line size.
|
2022-05-18 13:06:40 +02:00
|
|
|
|
|
|
|
endif # SPSC_PBUF_CACHE_FLAG || SPSC_PBUF_CACHE_ALWAYS
|
|
|
|
|
2022-06-01 13:53:50 +02:00
|
|
|
config SPSC_PBUF_UTILIZATION
|
|
|
|
bool "Track maximum utilization"
|
|
|
|
help
|
|
|
|
When enabled, maximum utilization is tracked which can be used to
|
|
|
|
determine the size of the packet buffer.
|
|
|
|
|
2022-05-17 19:36:07 +02:00
|
|
|
endif # SPSC_PBUF
|
|
|
|
|
2021-03-19 08:30:29 +01:00
|
|
|
if MPSC_PBUF
|
|
|
|
config MPSC_CLEAR_ALLOCATED
|
|
|
|
bool "Clear allocated packet"
|
|
|
|
help
|
|
|
|
When enabled packet space is zeroed before returning from allocation.
|
|
|
|
endif
|
|
|
|
|
2021-04-27 11:56:39 +02:00
|
|
|
config REBOOT
|
|
|
|
bool "Reboot functionality"
|
|
|
|
help
|
|
|
|
Enable the sys_reboot() API. Enabling this can drag in other subsystems
|
2021-11-04 14:26:19 +01:00
|
|
|
needed to perform a "safe" reboot (e.g. to stop the system clock before
|
|
|
|
issuing a reset).
|
2021-04-27 11:56:39 +02:00
|
|
|
|
lib: os: add support for system power off
Add a new API to perform an immediate system power off:
`sys_poweroff()`.
Until now, this functionality has been implemented via the system power
management module, but in a clunky fashion. The way system PM works is
by defining some idle states in devicetree, that, given some properties
(e.g. minimal residency, exit latency, etc.) are automatically selected
when system goes to idle based on the expected next wake-up. However,
system off is a power state that one typically wants to control manually
from the application because it implies state loss, and in most cases,
configuring some sort of wake-up source. So in general, it is not
desired to let the system enter this state automatically. This led to
the following stuff in-tree:
from `boards/arm/mimxrt595_evk/mimxrt595_evk_cm33.dts`:
```c
/*
* Deep power-down mode is supported in this SoC through
* 'PM_STATE_SOFT_OFF' state. There is no entry for this in device tree,
* user can call pm_state_force to enter this state.
*/
```
That is, state not being defined in devicetree so that PM subsystem
doesn't pick it automatically, but still implemented in in the PM hooks:
from `soc/arm/nxp_imx/rt5xx/power.c`, `pm_state_set()`:
```c
case PM_STATE_SOFT_OFF:
set_deepsleep_pin_config();
POWER_EnterDeepPowerDown(EXCLUDE_FROM_DEEP_POWERDOWN);
break;
```
And to actually make use of this state, users had to do this kind of
abominations:
```c
pm_state_force(0u, &(struct pm_state_info){ PM_STATE_SOFT_OFF, 0, 0 });
/* Now we need to go sleep. This will let the idle thread runs and
* the pm subsystem will use the forced state. To confirm that the
* forced state is used, lets set the same timeout used previously.
*/
k_sleep(K_SECONDS(SLEEP_S));
printk("ERROR: System off failed\n");
while (true) {
/* spin to avoid fall-off behavior */
}
```
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-07-20 11:46:41 +02:00
|
|
|
config HAS_POWEROFF
|
|
|
|
bool
|
|
|
|
help
|
|
|
|
Option to signal that power off functionality is implemented.
|
|
|
|
|
|
|
|
config POWEROFF
|
|
|
|
bool "Power off functionality"
|
|
|
|
depends on HAS_POWEROFF
|
|
|
|
help
|
|
|
|
Enable support for system power off.
|
|
|
|
|
2020-11-08 13:24:22 +01:00
|
|
|
rsource "Kconfig.cbprintf"
|
|
|
|
|
2019-01-19 12:57:38 +01:00
|
|
|
endmenu
|