posix: create kconfig options for pse51, pse52, pse53

Create Kconfig "shortcuts" for PSE51, PSE52, and PSE53.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
This commit is contained in:
Chris Friedt 2024-05-24 15:05:36 -04:00 committed by David Leach
parent 487a8756c3
commit 0fa97326c7
43 changed files with 286 additions and 95 deletions

View file

@ -42,7 +42,7 @@ The *Minimal Realtime System Profile* (PSE51) includes all of the
:header: Symbol, Support, Remarks
:widths: 50, 10, 50
_POSIX_AEP_REALTIME_MINIMAL, -1,
_POSIX_AEP_REALTIME_MINIMAL, -1, :kconfig:option:`CONFIG_POSIX_AEP_REALTIME_MINIMAL`
.. csv-table:: PSE51 Option Groups
:header: Symbol, Support, Remarks
@ -94,7 +94,7 @@ The *Realtime Controller System Profile* (PSE52) includes all features from PSE5
:header: Symbol, Support, Remarks
:widths: 50, 10, 50
_POSIX_AEP_REALTIME_CONTROLLER, -1,
_POSIX_AEP_REALTIME_CONTROLLER, -1, :kconfig:option:`CONFIG_POSIX_AEP_REALTIME_CONTROLLER`
.. csv-table:: PSE52 Option Groups
:header: Symbol, Support, Remarks
@ -134,7 +134,7 @@ The *Dedicated Realtime System Profile* (PSE53) includes all features from PSE52
:header: Symbol, Support, Remarks
:widths: 50, 10, 50
_POSIX_AEP_REALTIME_DEDICATED, -1,
_POSIX_AEP_REALTIME_DEDICATED, -1, :kconfig:option:`CONFIG_POSIX_AEP_REALTIME_DEDICATED`
.. csv-table:: PSE53 Option Groups
:header: Symbol, Support, Remarks

View file

@ -122,22 +122,43 @@ Configuration
Like most features in Zephyr, POSIX features are
:ref:`highly configurable<zephyr_intro_configurability>` but disabled by default. Users must
explicitly choose to enable POSIX options via :ref:`Kconfig<kconfig>` selection. Indeed, there are
:ref:`many Kconfig options in Zephyr<posix_kconfig_options>` for the POSIX API to allow for
feature selection at various levels of granularity.
explicitly choose to enable POSIX options via :ref:`Kconfig<kconfig>` selection.
Alternatively, users may enable one of the Kconfig options below as a shortcut to enable multiple
:ref:`Option Groups<posix_option_groups>`.
Subprofiles
+++++++++++
* :kconfig:option:`CONFIG_POSIX_API` - Enables all implemented POSIX API Options and Option Groups
Enable one of the Kconfig options below to quickly configure a pre-defined
:ref:`POSIX subprofile <posix_subprofiles>`.
.. note::
Since the POSIX environment in Zephyr is fully configurable via :ref:`Kconfig<kconfig>`,
configurations that require modifying features should not be made if strict compliance is
required (POSIX-1.2017, section 2.1.3.1).
* :kconfig:option:`CONFIG_POSIX_AEP_CHOICE_BASE` (:ref:`Base <posix_system_interfaces_required>`)
* :kconfig:option:`CONFIG_POSIX_AEP_CHOICE_PSE51` (:ref:`PSE51 <posix_aep_pse51>`)
* :kconfig:option:`CONFIG_POSIX_AEP_CHOICE_PSE52` (:ref:`PSE52 <posix_aep_pse52>`)
* :kconfig:option:`CONFIG_POSIX_AEP_CHOICE_PSE53` (:ref:`PSE53 <posix_aep_pse53>`)
..
TODO: create Kconfig shortcuts for PSE51, PSE52, and PSE53
Additional POSIX :ref:`Options and Option Groups <posix_option_groups>` may be enabled as needed
via Kconfig (e.g. ``CONFIG_POSIX_C_LIB_EXT=y``). Further fine-tuning may be accomplished via
:ref:`additional POSIX-related Kconfig options <posix_kconfig_options>`.
Subprofiles, Options, and Option Groups should be considered the preferred way to configure POSIX
in Zephyr going forward.
Legacy
++++++
Historically, Zephyr used :kconfig:option:`CONFIG_POSIX_API` to configure a set of POSIX features
that was overloaded and always increasing in size.
* :kconfig:option:`CONFIG_POSIX_API`
The option is now frozen, and can be considered equivalent to the following:
* :kconfig:option:`CONFIG_POSIX_AEP_CHOICE_PSE51`
* :kconfig:option:`CONFIG_POSIX_FD_MGMT`
* :kconfig:option:`CONFIG_POSIX_MESSAGE_PASSING`
* :kconfig:option:`CONFIG_POSIX_NETWORKING`
However, :kconfig:option:`CONFIG_POSIX_API` should be considered legacy and should not be used for
new Zephyr applications.
.. _IEEE: https://www.ieee.org/
.. _IEEE Computer Society: https://www.computer.org/

View file

@ -9,6 +9,7 @@ menuconfig WIFI_SIMPLELINK
select WIFI_OFFLOAD
select NET_L2_WIFI_MGMT
select FDTABLE
select POSIX_SEMAPHORES
if WIFI_SIMPLELINK

View file

@ -11,6 +11,22 @@
#include <autoconf.h> /* CONFIG_* */
#include <zephyr/sys/util_macro.h> /* COND_CODE_1() */
/*
* POSIX Application Environment Profiles (AEP - IEEE Std 1003.13-2003)
*/
#ifdef CONFIG_POSIX_AEP_REALTIME_MINIMAL
#define _POSIX_AEP_REALTIME_MINIMAL 200312L
#endif
#ifdef CONFIG_POSIX_AEP_REALTIME_CONTROLLER
#define _POSIX_AEP_REALTIME_CONTROLLER 200312L
#endif
#ifdef CONFIG_POSIX_AEP_REALTIME_DEDICATED
#define _POSIX_AEP_REALTIME_DEDICATED 200312L
#endif
/*
* POSIX System Interfaces
*/

View file

@ -6,13 +6,7 @@
menu "POSIX Options"
config POSIX_API
depends on !NATIVE_APPLICATION
bool "POSIX APIs"
select NATIVE_LIBC_INCOMPATIBLE
help
Enable mostly-standards-compliant implementations of
various POSIX (IEEE 1003.1) APIs.
rsource "Kconfig.profile"
rsource "Kconfig.aio"
rsource "Kconfig.barrier"

View file

@ -4,7 +4,6 @@
config POSIX_ASYNCHRONOUS_IO
bool "POSIX asynchronous I/O [EXPERIMENTAL]"
default y if POSIX_API
select EXPERIMENTAL
help
Enable this option for asynchronous I/O. This option is present for conformance purposes

View file

@ -6,7 +6,6 @@
menuconfig POSIX_BARRIERS
bool "POSIX barriers"
default y if POSIX_API
help
Select 'y' here to enable POSIX barriers.

View file

@ -4,7 +4,6 @@
menuconfig POSIX_C_LIB_EXT
bool "POSIX general C library extension"
default y if POSIX_API
help
Select 'y' here and Zephyr will provide an implementation of the POSIX_C_LIB_EXT Option
Group, consisting of fnmatch(), getopt(), getsubopt(), optarg, opterr, optind, optopt,

View file

@ -10,7 +10,6 @@ config EVENTFD
depends on !NATIVE_APPLICATION
select ZVFS
select ZVFS_EVENTFD
default y if POSIX_API
help
Enable support for event file descriptors, eventfd. An eventfd can
be used as an event wait/notify mechanism together with POSIX calls

View file

@ -6,7 +6,6 @@ menu "POSIX device I/O"
config POSIX_DEVICE_IO
bool "POSIX device I/O [EXPERIMENTAL]"
default y if POSIX_API
select FDTABLE
select EXPERIMENTAL
help

View file

@ -4,7 +4,6 @@
menuconfig POSIX_FD_MGMT
bool "POSIX file descriptor management [EXPERIMENTAL]"
default y if POSIX_API
select EXPERIMENTAL
help
Select 'y' here and Zephyr will provide implementations for the POSIX_FD_MGMT Option Group.

View file

@ -5,7 +5,7 @@
config POSIX_PAGE_SIZE_BITS
int "Number of bits to use for PAGE_SIZE"
range 6 16
default 12 if POSIX_API
default 12 if POSIX_BASE_DEFINITIONS
default 6
help
Define PAGE_SIZE as BIT(n), where n is the value configured here.

View file

@ -4,7 +4,6 @@
menuconfig POSIX_MESSAGE_PASSING
bool "POSIX message queue support"
default y if POSIX_API
help
This enabled POSIX message queue related APIs.

View file

@ -6,7 +6,6 @@
menuconfig POSIX_SINGLE_PROCESS
bool "POSIX single process support"
default y if POSIX_API
# imply COMMON_LIBC_MALLOC # for env.c
help
Select 'y' here to use confstr(), environ, errno, getenv(), setenv(), sysconf(), uname(),

View file

@ -4,7 +4,6 @@
menuconfig POSIX_MULTI_PROCESS
bool "POSIX multi-process support [EXPERIMENTAL]"
default y if POSIX_API
select EXPERIMENTAL
help
Support for multi-processing.

View file

@ -0,0 +1,186 @@
# Copyright (c) 2024 Tenstorrent
#
# SPDX-License-Identifier: Apache-2.0
config POSIX_API
bool "POSIX APIs"
depends on !NATIVE_APPLICATION
select NATIVE_LIBC_INCOMPATIBLE
select POSIX_BASE_DEFINITIONS # clock_gettime(), pthread_create(), sem_get(), etc
select POSIX_AEP_REALTIME_MINIMAL # CLOCK_MONOTONIC, pthread_attr_setstack(), etc
select POSIX_NETWORKING if NETWORKING # inet_ntoa(), socket(), etc
imply EVENTFD # eventfd(), eventfd_read(), eventfd_write()
imply POSIX_FD_MGMT # open(), close(), read(), write()
imply POSIX_MESSAGE_PASSING # mq_open(), etc
imply POSIX_MULTI_PROCESS # sleep(), getpid(), etc
help
This option enables the required POSIX System Interfaces (base definitions), all of PSE51,
and some features found in PSE52.
Note: in the future, this option may be deprecated in favour of subprofiling options.
choice POSIX_AEP_CHOICE
prompt "POSIX Subprofile"
default POSIX_AEP_CHOICE_NONE
help
This choice is intended to help users select the correct POSIX profile for their
application. Choices are based on IEEE 1003.13-2003 (now inactive / reserved) and
extrapolated to the more recent Subprofiling Option Groups in IEEE 1003.3-2017.
For more information, please refer to
https://standards.ieee.org/ieee/1003.13/3322/
https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_subprofiles.html
config POSIX_AEP_CHOICE_NONE
bool "No pre-defined POSIX subprofile"
help
No pre-defined POSIX profile is selected.
config POSIX_AEP_CHOICE_BASE
bool "Base definitions (system interfaces)"
depends on !NATIVE_APPLICATION
select NATIVE_LIBC_INCOMPATIBLE
select POSIX_BASE_DEFINITIONS
help
Only enable the base definitions required for all POSIX systems.
For more information, please see
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap02.html#tag_02_01_03_01
config POSIX_AEP_CHOICE_PSE51
bool "Minimal Realtime System Profile (PSE51)"
depends on !NATIVE_APPLICATION
select NATIVE_LIBC_INCOMPATIBLE
select POSIX_BASE_DEFINITIONS
select POSIX_AEP_REALTIME_MINIMAL
help
PSE51 includes the POSIX Base Definitions (System Interfaces) as well as several Options and
Option Groups to facilitate device I/O, signals, mandatory configuration utilities, and
threading.
For more information, please see
https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_subprofiles.html
config POSIX_AEP_CHOICE_PSE52
bool "Realtime Controller System Profile (PSE52)"
depends on !NATIVE_APPLICATION
select NATIVE_LIBC_INCOMPATIBLE
select POSIX_BASE_DEFINITIONS
select POSIX_AEP_REALTIME_MINIMAL
select POSIX_AEP_REALTIME_CONTROLLER
help
PSE52 includes the POSIX Base Definitions (System Interfaces) as well as all features of
PSE51. Additionally, it includes interfaces for file descriptor management, filesystem
support, support for message queues, and tracing.
For more information, please see
https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_subprofiles.html
config POSIX_AEP_CHOICE_PSE53
bool "Dedicated Realtime System Profile (PSE53)"
depends on !NATIVE_APPLICATION
select NATIVE_LIBC_INCOMPATIBLE
select POSIX_BASE_DEFINITIONS
select POSIX_AEP_REALTIME_MINIMAL
select POSIX_AEP_REALTIME_CONTROLLER
select POSIX_AEP_REALTIME_DEDICATED
help
PSE53 includes the POSIX Base Definitions (System Interfaces) as well as all features of
PSE52. Additionally, it includes interfaces for POSIX multi-processing, networking, pipes,
and prioritized I/O.
For more information, please see
https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_subprofiles.html
# TODO: PSE54: Multi-purpose Realtime System Profile
endchoice # POSIX_AEP_CHOICE
# Base Definitions (System Interfaces)
config POSIX_BASE_DEFINITIONS
bool
select POSIX_ASYNCHRONOUS_IO
select POSIX_BARRIERS
select POSIX_CLOCK_SELECTION
# select POSIX_MAPPED_FILES
# select POSIX_MEMORY_PROTECTION
select POSIX_READER_WRITER_LOCKS
select POSIX_REALTIME_SIGNALS
select POSIX_SEMAPHORES
select POSIX_SPIN_LOCKS
select POSIX_THREAD_SAFE_FUNCTIONS
select POSIX_THREADS
select POSIX_TIMEOUTS
select POSIX_TIMERS
help
This option is not user configurable. It may be configured indirectly by selecting
CONFIG_POSIX_AEP_CHOICE_BASE=y.
For more information, please see
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap02.html#tag_02_01_03_01
config POSIX_AEP_REALTIME_MINIMAL
bool
# Option Groups
select POSIX_DEVICE_IO
select POSIX_SIGNALS
select POSIX_SINGLE_PROCESS
select XSI_THREADS_EXT
# Options
select POSIX_FSYNC
# select POSIX_MEMLOCK
# select POSIX_MEMLOCK_RANGE
select POSIX_MONOTONIC_CLOCK
# select POSIX_SHARED_MEMORY_OBJECTS
select POSIX_SYNCHRONIZED_IO
select POSIX_THREAD_ATTR_STACKADDR
select POSIX_THREAD_ATTR_STACKSIZE
select POSIX_THREAD_CPUTIME
select POSIX_THREAD_PRIO_INHERIT
select POSIX_THREAD_PRIO_PROTECT
select POSIX_THREAD_PRIORITY_SCHEDULING
# select POSIX_THREAD_SPORADIC_SERVER
help
This option is not user configurable. It may be configured indirectly by selecting
CONFIG_POSIX_AEP_CHOICE_PSE51=y.
For more information, please see
https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_subprofiles.html
config POSIX_AEP_REALTIME_CONTROLLER
bool
# Option Groups
select POSIX_FD_MGMT
select POSIX_FILE_SYSTEM
# Options
select POSIX_MESSAGE_PASSING
# select POSIX_TRACE
# select POSIX_TRACE_EVENT_FILTER
# select POSIX_TRACE_LOG
help
This option is not user configurable. It may be configured indirectly by selecting
CONFIG_POSIX_AEP_CHOICE_PSE52=y.
For more information, please see
https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_subprofiles.html
config POSIX_AEP_REALTIME_DEDICATED
bool
# Option Groups
select POSIX_MULTI_PROCESS
select POSIX_NETWORKING
# select POSIX_PIPE
# select POSIX_SIGNAL_JUMP
# Options
select POSIX_CPUTIME
# select POSIX_PRIORITIZED_IO
select POSIX_PRIORITY_SCHEDULING
select POSIX_RAW_SOCKETS
# select POSIX_SPAWN
# select POSIX_SPORADIC_SERVER
help
This option is not user configurable. It may be configured indirectly by selecting
CONFIG_POSIX_AEP_CHOICE_PSE53=y.
For more information, please see
https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_subprofiles.html

View file

@ -6,7 +6,6 @@
menuconfig POSIX_THREADS
bool "POSIX thread support"
default y if POSIX_API
help
Select 'y' here to enable POSIX threads, mutexes, condition variables, and thread-specific
storage.
@ -65,7 +64,6 @@ config PTHREAD_RECYCLER_DELAY_MS
config POSIX_THREAD_ATTR_STACKADDR
bool "Support getting and setting POSIX thread stack addresses"
default y
help
Enable this option to use pthread_attr_getstackaddr() and
pthread_attr_setstackaddr().
@ -80,7 +78,6 @@ config POSIX_THREAD_ATTR_STACKADDR
config POSIX_THREAD_ATTR_STACKSIZE
bool "Support getting and setting POSIX thread stack sizes"
default y
help
Enable this option to use pthread_attr_getstacksize() or
pthread_attr_setstacksize().
@ -90,7 +87,6 @@ config POSIX_THREAD_ATTR_STACKSIZE
config POSIX_THREADS_EXT
bool "Extended POSIX thread support"
default y
help
Enable this option to use pthread_attr_getguardsize(), pthread_attr_setguardsize(),
pthread_mutexattr_gettype(), or pthread_mutexattr_settype().
@ -100,7 +96,6 @@ config POSIX_THREADS_EXT
config POSIX_THREAD_PRIORITY_SCHEDULING
bool "Run POSIX threads with different priorities and schedulers"
default y
help
Enabling this option allows the application to configure different priorities and
scheduling algorithms for different threads via functions such as pthread_setschedparam()
@ -145,7 +140,6 @@ config POSIX_PTHREAD_ATTR_GUARDSIZE_DEFAULT
config POSIX_THREAD_PRIO_INHERIT
bool "POSIX mutex priority inheritance"
default y
help
Select 'y' here to enable POSIX mutex priority inheritance.
@ -154,7 +148,6 @@ config POSIX_THREAD_PRIO_INHERIT
config POSIX_THREAD_PRIO_PROTECT
bool "POSIX mutex priority protection"
default y
help
Select 'y' here to enable POSIX mutex priority protection.
@ -163,7 +156,6 @@ config POSIX_THREAD_PRIO_PROTECT
config POSIX_THREAD_SAFE_FUNCTIONS
bool "POSIX thread-safe functions"
default y
help
Select 'y' here to enable POSIX thread-safe functions including asctime_r(), ctime_r(),
flockfile(), ftrylockfile(), funlockfile(), getc_unlocked(), getchar_unlocked(),

View file

@ -4,7 +4,6 @@
menuconfig POSIX_READER_WRITER_LOCKS
bool "POSIX reader-writer locks"
default y if POSIX_API
help
Select 'y' here to enable POSIX reader-writer locks.

View file

@ -6,7 +6,6 @@ menu "POSIX scheduler options"
config POSIX_PRIORITY_SCHEDULING
bool "POSIX priority-based process scheduling [EXPERIMENTAL]"
default y if POSIX_API
select EXPERIMENTAL
help
This enables POSIX scheduling APIs (_POSIX_PRIORITY_SCHEDULING).

View file

@ -4,7 +4,6 @@
menuconfig POSIX_SEMAPHORES
bool "POSIX semaphore support"
default y if POSIX_API
help
Enable this option for POSIX semaphore support.

View file

@ -6,7 +6,6 @@ menu "POSIX signals"
config POSIX_REALTIME_SIGNALS
bool "POSIX realtime signals [EXPERIMENTAL]"
default y if POSIX_API
select EXPERIMENTAL
help
Enable support for POSIX realtime signals.
@ -24,7 +23,6 @@ endif # POSIX_REALTIME_SIGNALS
config POSIX_SIGNALS
bool "POSIX signals [EXPERIMENTAL]"
default y if POSIX_API
select EXPERIMENTAL
help
Enable support for POSIX signals.

View file

@ -4,7 +4,6 @@
menuconfig POSIX_SPIN_LOCKS
bool "POSIX spin locks"
default y if POSIX_API
help
Select 'y' here to enable POSIX spin locks.

View file

@ -5,7 +5,6 @@
menuconfig POSIX_TIMERS
bool "POSIX timers, clocks, and sleep functions"
default y if POSIX_API
help
Select 'y' here and Zephyr will provide implementations of clock_getres(), clock_gettime(),
clock_settime(), nanosleep(), timer_create(), timer_delete(), timer_getoverrun(),
@ -18,7 +17,6 @@ if POSIX_TIMERS
config POSIX_THREAD_CPUTIME
bool "POSIX per-thread CPU-time clocks"
default y
help
This enables CLOCK_THREAD_CPUTIME_ID.
@ -29,7 +27,6 @@ config POSIX_THREAD_CPUTIME
config POSIX_MONOTONIC_CLOCK
bool "POSIX Monotonic clock support"
default y
help
This enables CLOCK_MONOTONIC.
@ -39,7 +36,6 @@ config POSIX_MONOTONIC_CLOCK
config POSIX_CPUTIME
bool "POSIX per-process CPU-time clocks"
default y
help
This enables CLOCK_PROCESS_CPUTIME_ID.
@ -50,7 +46,6 @@ config POSIX_CPUTIME
config POSIX_CLOCK_SELECTION
bool "POSIX Clock selection"
default y
help
This enables POSIX clock selection.
@ -79,7 +74,6 @@ config POSIX_TIMER_MAX
config POSIX_TIMEOUTS
bool "Support timeouts for some blocking POSIX services"
default y
help
Enable mandatory timeouts for some blocking operations.

View file

@ -6,7 +6,6 @@ menu "X/Open system interfaces"
config XSI_SINGLE_PROCESS
bool "X/Open single process"
default y if POSIX_API
depends on POSIX_SINGLE_PROCESS
depends on POSIX_TIMERS
help
@ -18,7 +17,6 @@ config XSI_SINGLE_PROCESS
config XOPEN_STREAMS
bool "X/Open streams"
default y if POSIX_API
help
This option provides support for the X/Open Streams interface, including functions such as
fattach(), fdetach(), getmsg(), getpmsg(), putmsg(), and putpmsg().
@ -28,7 +26,6 @@ config XOPEN_STREAMS
config XSI_SYSTEM_LOGGING
bool "X/Open system logging"
default y if POSIX_API
help
This option provides support for closelog(), openlog(), syslog(),
setlogmask(), and vsyslog().
@ -38,7 +35,6 @@ config XSI_SYSTEM_LOGGING
config XSI_THREADS_EXT
bool "X/Open threads extensions"
default y if POSIX_API
help
This option provides support for pthread_attr_getstack(), pthread_attr_setstack(),
pthread_getconcurrency(), and pthread_setconcurrency().

View file

@ -12,7 +12,6 @@ zephyr_include_directories(include)
zephyr_include_directories(${THRIFT_UPSTREAM}/lib/cpp/src)
zephyr_library_sources(
src/_stat.c
src/thrift/server/TFDServer.cpp
${THRIFT_UPSTREAM}/lib/cpp/src/thrift/protocol/TProtocol.cpp
${THRIFT_UPSTREAM}/lib/cpp/src/thrift/server/TConnectedClient.cpp

View file

@ -1,20 +0,0 @@
/*
* Copyright 2022 Meta
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <errno.h>
#include <sys/stat.h>
#include <zephyr/kernel.h>
int stat(const char *restrict path, struct stat *restrict buf)
{
ARG_UNUSED(path);
ARG_UNUSED(buf);
errno = ENOTSUP;
return -1;
}

View file

@ -6,6 +6,7 @@ CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=n
# POSIX_TIMERS requires an embedded C library while the native USB driver is incompatible with it.
# So let's disable it. Once USB_NATIVE_POSIX supports embedded C libraries this can be removed.
CONFIG_POSIX_API=n
CONFIG_POSIX_TIMERS=n
# DATE_SHELL requires POSIX_TIMERS
CONFIG_DATE_SHELL=n

View file

@ -9,6 +9,7 @@ CONFIG_THREAD_MONITOR=y
CONFIG_BOOT_BANNER=n
CONFIG_THREAD_NAME=y
CONFIG_DEVICE_SHELL=y
CONFIG_POSIX_API=y
CONFIG_POSIX_TIMERS=y
CONFIG_DATE_SHELL=y
CONFIG_THREAD_RUNTIME_STATS=y

View file

@ -9,6 +9,7 @@ CONFIG_THREAD_MONITOR=y
CONFIG_BOOT_BANNER=n
CONFIG_THREAD_NAME=y
CONFIG_DEVICE_SHELL=y
CONFIG_POSIX_API=y
CONFIG_POSIX_TIMERS=y
CONFIG_DATE_SHELL=y
CONFIG_THREAD_RUNTIME_STATS=y

View file

@ -8,6 +8,7 @@ CONFIG_THREAD_MONITOR=y
CONFIG_BOOT_BANNER=n
CONFIG_THREAD_NAME=y
CONFIG_DEVICE_SHELL=y
CONFIG_POSIX_API=y
CONFIG_POSIX_TIMERS=y
CONFIG_DATE_SHELL=y
CONFIG_THREAD_RUNTIME_STATS=y

View file

@ -1,5 +1,10 @@
sample:
name: Shell Sample
common:
filter: not CONFIG_NATIVE_LIBC
platform_exclude:
- native_posix
- native_posix/native/64
tests:
sample.shell.shell_module:
filter: CONFIG_SERIAL and dt_chosen_enabled("zephyr,shell-uart")

View file

@ -103,8 +103,6 @@ config NET_SOCKETS_SERVICE
bool "Socket service support [EXPERIMENTAL]"
select EXPERIMENTAL
select EVENTFD
# We select here POSIX_API so that zephyr libc will be used for native_sim
select POSIX_API if BOARD_NATIVE_SIM
help
The socket service can monitor multiple sockets and save memory
by only having one thread listening socket data. If data is received

View file

@ -1,7 +1,6 @@
CONFIG_POSIX_API=y
CONFIG_POSIX_THREAD_THREADS_MAX=6
CONFIG_ZTEST=y
CONFIG_POSIX_NETWORKING=n
CONFIG_POSIX_SEM_VALUE_MAX=32767
CONFIG_POSIX_MESSAGE_PASSING=y
CONFIG_POSIX_PRIORITY_SCHEDULING=y
@ -10,3 +9,22 @@ CONFIG_THREAD_NAME=y
CONFIG_DYNAMIC_THREAD=y
CONFIG_THREAD_STACK_INFO=y
CONFIG_DYNAMIC_THREAD_POOL_SIZE=6
# for fnmatch()
CONFIG_POSIX_C_LIB_EXT=y
# for putmsg()
CONFIG_XOPEN_STREAMS=y
# for sleep(), getpid()
CONFIG_POSIX_MULTI_PROCESS=y
# for syslog()
CONFIG_XSI_SYSTEM_LOGGING=y
# for sched_get_priority_min(), sched_get_priority_max()
CONFIG_POSIX_PRIORITY_SCHEDULING=y
# for networking
CONFIG_NET_TEST=y
CONFIG_TEST_RANDOM_GENERATOR=y

View file

@ -4,6 +4,5 @@ CONFIG_FAT_FILESYSTEM_ELM=y
CONFIG_POSIX_API=y
CONFIG_POSIX_FILE_SYSTEM=y
CONFIG_ZTEST=y
CONFIG_POSIX_NETWORKING=n
CONFIG_MAIN_STACK_SIZE=4096
CONFIG_EVENTFD=n

View file

@ -2,20 +2,22 @@ CONFIG_POSIX_API=y
CONFIG_ZTEST=y
# for POSIX_FILESYSTEM
CONFIG_FILE_SYSTEM=y
CONFIG_POSIX_FILE_SYSTEM=y
# for select to work
# for networking things to work
CONFIG_NETWORKING=y
CONFIG_POSIX_NETWORKING=y
CONFIG_NET_TEST=y
CONFIG_TEST_RANDOM_GENERATOR=y
CONFIG_NET_SOCKETS=y
CONFIG_NETWORKING=y
# for socketpair to work
CONFIG_NET_SOCKETPAIR=y
# For e.g. sched_get_priority_max()
CONFIG_POSIX_PRIORITY_SCHEDULING=y
# For putmsg(), etc
CONFIG_XOPEN_STREAMS=y
# for when CONFIG_POSIX_API is not selected
CONFIG_POSIX_THREADS=y
CONFIG_POSIX_FILE_SYSTEM=y
CONFIG_POSIX_TIMERS=y
CONFIG_POSIX_MESSAGE_PASSING=y
CONFIG_EVENTFD=y

View file

@ -24,7 +24,7 @@ ZTEST(posix_headers, test_arpa_inet_h)
zassert_not_equal(-1, ntohl(0));
zassert_not_equal(-1, ntohs(0));
if (IS_ENABLED(CONFIG_POSIX_API)) {
if (IS_ENABLED(CONFIG_POSIX_NETWORKING)) {
/* zassert_not_null(inet_addr); */ /* not implemented */
/* zassert_not_null(inet_ntoa); */ /* not implemented */
zassert_not_null(inet_ntop);

View file

@ -24,7 +24,7 @@ ZTEST(posix_headers, test_net_if_h)
zassert_not_equal(-1, IF_NAMESIZE);
if (IS_ENABLED(CONFIG_POSIX_API)) {
if (IS_ENABLED(CONFIG_POSIX_NETWORKING)) {
zassert_not_null(if_freenameindex);
zassert_not_null(if_indextoname);
zassert_not_null(if_nameindex);

View file

@ -76,7 +76,7 @@ ZTEST(posix_headers, test_netdb_h)
zassert_not_equal(-1, EAI_SYSTEM);
zassert_not_equal(-1, EAI_OVERFLOW);
if (IS_ENABLED(CONFIG_POSIX_API)) {
if (IS_ENABLED(CONFIG_POSIX_NETWORKING)) {
zassert_not_null(endhostent);
zassert_not_null(endnetent);
zassert_not_null(endprotoent);

View file

@ -36,7 +36,7 @@ ZTEST(posix_headers, test_poll_h)
zassert_not_equal(-1, POLLHUP);
zassert_not_equal(-1, POLLNVAL);
if (IS_ENABLED(CONFIG_POSIX_API)) {
if (IS_ENABLED(CONFIG_POSIX_DEVICE_IO)) {
zassert_not_null(poll);
}
}

View file

@ -27,7 +27,7 @@ ZTEST(posix_headers, test_sys_select_h)
FD_SET(0, &fds);
FD_ZERO(&fds);
if (IS_ENABLED(CONFIG_POSIX_API)) {
if (IS_ENABLED(CONFIG_POSIX_DEVICE_IO)) {
/* zassert_not_null(pselect); */ /* not implemented */
zassert_not_null(select);
}

View file

@ -100,7 +100,7 @@ ZTEST(posix_headers, test_sys_socket_h)
zassert_not_equal(-1, SHUT_RDWR);
zassert_not_equal(-1, SHUT_WR);
if (IS_ENABLED(CONFIG_POSIX_API)) {
if (IS_ENABLED(CONFIG_POSIX_NETWORKING)) {
zassert_not_null(accept);
zassert_not_null(bind);
zassert_not_null(connect);

View file

@ -4,3 +4,4 @@ CONFIG_TEST_RANDOM_GENERATOR=y
CONFIG_POSIX_API=y
CONFIG_POSIX_NETWORKING=y
CONFIG_NETWORKING=y

View file

@ -1,6 +1,6 @@
CONFIG_ZTEST=y
CONFIG_POSIX_API=y
CONFIG_POSIX_NETWORKING=n
CONFIG_POSIX_PRIORITY_SCHEDULING=y
## Note: for benchmarking purposes, uncomment the Kconfig below
# CONFIG_TEST_DURATION_S=60