The init_entry struct got modified to add a union with a non const dev
pointer in afc59112a9. Some old compiler (such as GCC 4) seems to
require a pair of brackets to correctly initialize the field in the
union. Add those brackets to the initializers in device.h and init.h to
maintain compatibility.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This allows HCI drivers to expose vendor-specific functions to set the
public address.
Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
pthread_cleanup_push() and pthread_cleanup_pop() are required
by the POSIX_THREADS_BASE Option Group as detailed in Section
E.1 of IEEE-1003.1-2017.
The POSIX_THREADS_BASE Option Group is required for PSE51,
PSE52, PSE53, and PSE54 conformance, and is otherwise mandatory
for any POSIX conforming system as per Section A.2.1.3 of
IEEE-1003-1.2017.
In this change, we require the addition of a dedicated
pthread_key_t that will not be available for applilcation usage.
Rather than including that as part of
CONFIG_MAX_PTHREAD_KEY_COUNT, we increase the storage by 1 in
order to be least invasive from the application perspective.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
The Zephyr's core ethernet code had to be adjusted to support setting T1S
PLCA parameters from user Zephyr programs.
Such approach allows more flexibility, as T1S network configuration;
especially PLCA node numbers, can be assigned not only via device tree
at compile time. For example user can read them from EEPROM and then
configure the network accordingly.
For now - the union in struct ethernet_t1s_param only consists of plca
structure. This can change in the future, when other T1S OA parameters -
like Receive/Transmit Cut-Through Enable (bits RXCTE/TXCTE in OA_CONFIG0
register) are made adjustable from user program.
Signed-off-by: Lukasz Majewski <lukma@denx.de>
This commits adds the LE API's for the LE Power Control Request Feature
in Zephyr.
The support of feature is provided with the controller-based feature
selection with BT_CTLR_LE_POWER_CONTROL_SUPPORT and is selectable via
BT_TRANSMIT_POWER_CONTROL.
With the new APIs, the applications will:
get improved reading of local and remote tx power
be aware of changes in remote or local tx power
Defined HCI commands in Core Spec v5.4:
7.8.117 LE Enhanced Read Transmit Power Level command:
improvement to existing local tx power reading.
7.8.118 LE Read Remote Transmit Power Level command:
Remote tx power is read through an event (LE Transmit Power Reporting)
7.8.121 LE Set Transmit Power Reporting Enable command:
Enables local or remote tx power reporting to monitor changes in tx power
7.7.65.33 LE Transmit Power Reporting event
Note: to utilize the Feature fully Nordic-LL-only vendor-specific commands
are needed. These will not be added in RTOS zephyr but instead
implemented in a maintainable way in sdk.
Signed-off-by: Kyra Lengfeld <kyra.lengfeld@nordicsemi.no>
The Device Multiplexer (devmux) is a pseudo-device that can
be used to select between multiple included sub-devices.
It is experimental, but its current use is in system
remediation. Take for example, the scenario where the
system console and log subsystem both have the uart backend
enabled. The case may arise, where the chosen backing uart
could be an abstraction of another very high-bandwidth bus
- such as a PCIe BAR, a UDP socket, or even even just memory.
If the "service" (for lack of a better term) that backs this
abstract "uart" experiences an error, it is of critical
importance to be able to switch the system console, uart log
backend, or whatever to another uart (semi-transparently) in
order to bring up a shell, continue to view system logs, or
even just support user console I/O.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Add support for mutable devices. Mutable devices are those which
can be modified after declaration, in-place, in kernel mode.
In order for a device to be mutable, the following must be true
* `CONFIG_DEVICE_MUTABLE` must be y-selected
* the Devicetree bindings for the device must include
`mutable.yaml`
* the Devicetree node must include the `zephyr,mutable` property
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Adds the tja1103 enet phy for setting phy options on the mr_canhubk3.
Co-authored-by: Manuel Argüelles <manuel.arguelles@nxp.com>
Co-authored-by: Peter van der Perk <peter.vanderperk@nxp.com>
Signed-off-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>
If user has set either IP_PKTINFO (for IPv4) or
IPV6_RECVPKTINFO (for IPv6) socket options, then the system
will return relevant information in recvmsg() ancillary data.
Fixes#36415
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add IP_PKTINFO or IPV6_RECVPKTINFO BSD socket options that
can be used to get extra information of received data in
the ancillary data in recvmsg() call.
For IPV6_RECVPKTINFO see RFC 3542 for details.
For IP_PKTINFO see Linux ip(7) manual page for details.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add low level support for setting IP_PKTINFO or IPV6_RECVPKTINFO
socket options. The support is disabled by default.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Currently, DAI_DIR_TX and DAI_DIR_RX have different values from
SOF_IPC_STREAM_PLAYBACK and SOF_IPC_STREAM_CAPTURE. Since SOF
performs no conversion from one encoding to another this may lead
DAI operations performed on the wrong directions.
Since it's much easier to just change the values for DAI_DIR_TX
and DAI_DIR_RX rather than try to perform a conversion from
one format to another on SOF side, this commit changes DAI_DIR_TX
to 0 (equal to SOF_IPC_STREAM_PLAYBACK) and DAI_DIR_RX to 1
(equal to SOF_IPC_STREAM_CAPTURE).
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Using this new library it is now possible to leverage the memory
attribute property 'zephyr,memory-attr' to define and create a set of
memory heaps from which the user can allocate memory from with certain
attributes / capabilities.
When the CONFIG_MEM_ATTR_HEAP option is set, every region marked with
one of the memory attributes listed in
include/zephyr/dt-bindings/memory-attr/memory-attr-sw.h is added to a
pool of memory heaps used for dynamic allocation of memory buffers with
certain attributes.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Zephyr must support all functionality of the XSI_THREADS_EXT
subprofiling option group in order to claim it supports that
subprofiling option group.
The XSI_THREADS_EXT option group is critical to be able to
run POSIX threads with statically allocated thread stacks, which
has been a feature of the implementation since it was initially
added.
The pthread_getconcurrency() and pthread_setconcurrency()
functions are the only remaining, unimplemented functions of
the XSI_THREADS_EXT option group.
Implement pthread_getconcurrency() and pthread_setconcurrency()
via the more "posixly correct" interpretation of the
specification.
I.e. as the pthread_t:k_thread relationship is 1:1 and not M:N,
Zephyr does not support multiplexing of user threads on top of
schedulable kernel entities (i.e. "user threads" are directly
mapped to native threads, just like linuxthreads or NPTL are in
Linux).
For that reason, to be "posixly correct", we should save the
provided value via pthread_setconcurrency(), in the absense of
errors, and also return that same value back via
pthread_getconcurrency(), even though that serves zero purpose
in Zephyr for the foreseeable future.
Note: the specification also states
"an implementation can always ignore any calls to
pthread_setconcurrency() and return a constant for
pthread_getconcurrency()."
For that reason, the implementation may be revisited at a later
time when when considering optimizations and when there is a
better system in place for documenting deviations.
Any such optimization should be explicitly controlled via
Kconfig.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
The description of `STM32_EXTI_TRIG_FALLING` got copied into
the `STM32_EXTI_TRIG_BOTH` as well, fix that.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
- Fixed a few improperly formatted struct
- Marked some mask definitions as internal when macros abstracting them
out already exist
- Fixed a few code blocks to add proper syntax highlightingy
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Recent changes to the arm64 MMU code mean that you can no longer map
R/O memory as R/W. Mapping R/W memory now causes a cache invalidation
instruction (DC IVAC) that requires write permissions or else a fault
is generated.
Modify ivshmem-v2 to map each R/O and R/W section individually
Signed-off-by: Grant Ramsay <gramsay@enphaseenergy.com>
Some thread options were made architecture specific, i.e. K_ARC_DSP_IDX. We
have other architectures with similar functionality and we need to be
architecture agnostic at this level.
Changed the option to be more generic. The option is now called K_DSP_IDX.
Also remove multiple level of ifdefs and guards around those defines to
allow for documentation to be published and added a note about required
configs in the docstring.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
pthread_setcanceltype() is required by the POSIX_THREADS_BASE
Option Group as detailed in Section E.1 of IEEE-1003.1-2017.
The POSIX_THREADS_BASE Option Group is required for PSE51,
PSE52, PSE53, and PSE54 conformance, and is otherwise mandatory
for any POSIX conforming system as per Section A.2.1.3 of
IEEE-1003-1.2017.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Add support of r8a779f0 cpg driver.
r8a779f0 soc has its own clock tree.
Gen4 SoCs common registers addresses have been added in header.
Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
Signed-off-by: Aymeric Aillet <aymeric.aillet@iot.bzh>
Renesas R-Car Gen4 is different from Gen3 regarding pinmux.
While Gen3 had only one base address to manage all pins,
Gen4 has one set of pinmux registers per GPIO banks.
We could expose one pinmux register per GPIO controllers,
but that would break potential compatibility with Linux
Device tree.
Instead create a reg_base array to parse all reg base from
device tree and identify proper base address based on the pin
definition.
This imply to add a pfc_base parameter to most of the pfc_rcar
function.
Signed-off-by: Julien Massot <julien.massot@iot.bzh>
Signed-off-by: Pierre Marzin <pierre.marzin@iot.bzh>
Signed-off-by: Aymeric Aillet <aymeric.aillet@iot.bzh>
_PTHREAD_CANCEL_POS is an implementation detail and should not
be defined in the global scope. Furthermore, _PTHREAD_CANCEL_POS
uses a reserved identifier (underscore followed by capital
letter).
Adjust definitions so that the implementation detail is only
used in the implementation and not in the interface.
Additionally, modify naming so that the non-standard macro does
not use a reserved identifier.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
When building using GCC version < 11.0.0, TOOLCHAIN_CLANG_VERSION is not
yet defined in gcc.h. Nevertheless, it's still needed due to reuse of
gcc.h in llvm.h.
Guard access to TOOLCHAIN_CLANG_VERSION to fix that.
Signed-off-by: Igor Druzhinin <igord@xilinx.com>
Logging shall not use character pointers with %p because in
certain configurations it may lead to memory faults. A compile
time detection is added. If faulty usage is detected then
message is replaced with error message which indicates which
message failed and what shall be done (casting to a pointer
of different type).
Validation is enabled only for configurations which remove
strings from binary as otherwise it may impact CI execution
time.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
When cbprintf package is created statically then only argument
types are taken into account and not the format string. It means that a
character pointer is always interpreted as %s and not %p. When %s is
found then string from rw location is copied into the package.
Copying unexpected data may lead to memory faults so it must
be avoided. User shall cast an argument to a pointer of a different
type.
Patch adds macros which can at compile time determine if %p is
used with char *. Result cannot be passed to static assert because
compiler sees it as non-constant (even though calculated at compile
time) but a runtime logging error message can be added instead of
original message.
Z_CBPRINTF_NONE_CHAR_PTR_COUNT counts number of none character
pointers in the arguments list.
Z_CBPRINTF_P_COUNT counts number of %p occurrences in the format
string. If results of both macros are equal it means that string
is ok.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
This moves including of demand_paging.h out of kernel/mm.h,
so that users of demand paging APIs must include the header
explicitly. Since the main user is kernel itself, we can be
more discipline about header inclusion.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Due to arch_syscall_invoke are declared static, if there are
no corresponding definition, compiler will complain. It has
been working fine so far because arch/syscall.h is included
indirectly through some other headers (especially through
generated syscall stubs). However, with enough header files
shuffling this becomes an issue. So include arch/syscall.h
in arch_interface.h explicitly.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
zephyr/net/socket_types.h file also includes _timeval.h, but it uses
correct path/filename depending on configuration.
Signed-off-by: Kamil Rakoczy <krakoczy@antmicro.com>
Some drivers like the ADC access the DMA through it's index
and not the DMA name. This commit add some better support
for such instances.
Signed-off-by: Hein Wessels <heinwessels93@gmail.com>
pthread_atfork() is required by the POSIX_THREADS_BASE
Option Group as detailed in Section E.1 of IEEE-1003.1-2017.
The POSIX_THREADS_BASE Option Group is required for PSE51,
PSE52, PSE53, and PSE54 conformance, and is otherwise
mandatory for any POSIX conforming system as per Section
A.2.1.3 of IEEE-1003-1.2017.
Since Zephyr does not yet support processes and (by extension)
fork(), this implementation includes a deviation and should be
categorized as producing undefined behaviour.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
This patch fixes the include of `atomic_builtin.h` and `atomic_arch.h`
so that they are IWYU. This mean they compile correctly independent of
other includes at the include-site. It was nessessary to move the
definition of the atomic types out of `atomic.h` to avoid unsatifiable
circular dependencies between `atomic.h` and `atomic_builtin.h`, as well
as definition conflicts between `atomic_arch.h` and `atomic_builtin.h`.
The definition of the type was to moved to a new file `atomic_types.h`.
The include in `atomic.h` has a IWYU pragma which will preserve
backwards compatibility with code expecting the types to be defined in
`atomic.h` if we start linting for IWYU.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
This pointers need to be writable by the power management code,
but were declared as const, resulting in a fault
for platforms which prevent writing to RAM containing const
values.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>