This extra MPU alignment of RAMABLE_REGION is only required
if we put ROMABLE_REGION and RAMABLE_REGION into the same
(continuous) memory (i.e. SRAM) - so we won't get beginning of the
RAMABLE_REGION in the end of ROMABLE_REGION MPU aperture.
If we use different regions (ICCM & DCCM, FLASH & SRAM, etc...)
we don't need this extra MPU alignment.
Let's drop it to decrease ROM memory usage.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
The crypto hash context has a reference to the crypto device,
but the assignment was duplicated.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Reorder preprocessor condition endings in arm64/cache.h,
this eliminates the breaking of the 'extern "C"' construction.
Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
Mux Control Register Index are internals of driver, now
moved from dt-binding header to driver itself.
Signed-off-by: Siyuan Cheng <siyuanc@synopsys.com>
ARC EMSDP board has some peripherals are internal connected,
such as DW spi1 and DFSS i2c0. They are unmuxed and have fix
connection to spi-flash or sensor. For these peripheral, add
dummy mux type to avoid pinctrl ENOENT error.
Signed-off-by: Siyuan Cheng <siyuanc@synopsys.com>
In order to have clean, self-contained HCI headers that do not have any
dependencies towards the Host or any other part of the system (except
types), reorganize the headers in the following way:
- Split out the macros and structs from hci.h to a new hci_types.h
- Merge the existing hci_err.h into the new hci_types.h
Fixes#58214.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Add function to cancel any current proecedure. This is useful
in cases where the connection to one or more acceptors is lost
or if some acceptor does not respond to our requests for whatever
reason.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
portability.posix.common.arcmwdtlib test fails with ARCMWDT libc.
This path fixes the test.
STDIN_FILENO and others macroses are used in libc-hooks.c only. So they
defined localy.
Signed-off-by: Nikolay Agishev <agishev@synopsys.com>
Previously, the `posix_internal.h` header needed to be exposed
to the application because we had non-trivial details for
most posix types (pthread, mutex, cond, ...). Since most of
those have been simplified to a typedef'ed integer, we
no longer need to expose that header to the applicaiton.
Additionally, it means that we can adopt normalized
header order in posix.
Additionally, keep more implementation details hidden
and prefer the static keyword on internal symbols where
possible.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Previously pthread_barrier_t was implemented in terms of wait
queues and internal scheduler functions.
This introduced some obstacles and inconsistency. In order
to be more consistent, rely only on Zephyr's public API and
reuse as many concepts as possible.
Deprecate `PTHREAD_BARRIER_DEFINE()` since it's non-standard.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Currently the lazy fpu saving algorithm in arm64 is using the fpu_owner
pointer from the cpu structure to understand the owner of the context
in the cpu and save it in case someone different from the owner is
accessing the fpu.
The semantics for memory consistency across smp systems is quite prone
to errors and reworks on the current code might miss some barriers that
could lead to inconsistent state across cores, so to overcome the issue,
use atomics to hide the complexity and be sure that the code will behave
as intended.
While there, add some isb barriers after writes to cpacr_el1, following
the guidance of ARM ARM specs about writes on system registers.
Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
GATT server was not doing enough check before udpating the CCC.
For example, a non-bonded client could update the CCC of a bonded client
by spoofing his address.
This fix the issue by dissociating the CCC configuration of a bonded and
a non-bonded peer. To do that, a new field is added to the CCC config:
`link_encrypted`.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
In order to support external IP stacks that might have Connection
ID support, the LwM2M engine should allow client to bypass default
behaviour.
New set_socketoptions() callback added into client context
that allows overriding all socket opetions. This is called
after a socket is opened, but before the connect() is
called. This cannot be combined with load_credentials() callback
on all platforms as for example nRF91 requires modem offline
when credentials are written. This would cause socket to be closed
as well.
Second change is that we allow fine tuning of what we do with
socket handle when QUEUE mode is enabled and engine enters idle
state.
First option would be to close the socket. That would cause
TLS Alert(Close Notify) to be send. This is a band choice if
LTE modem was already in PSM or eDRX power saving mode.
Second option would be to delay socket closing until we
are going to send LwM2M update. There TLS Alert is also send,
but most probably lost due to NAT mapping timed out. This
is a best choice for LTE modem with DTL session cache enabled.
Two new options are to keep socket open, and either stop listening
or just keep listening. Both of these options work fine when
we have DTLS Connection ID support.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
If the num_ase == 0xff then it is a special case that needs to be
handled like if num_ase == 0x01.
If there is an error with ase_id = 0x00 then the error cannot
be translated to a specific stream, so the callbacks may now get
NULL for the stream object.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
These are not really display interfaces but APIs for 3rd party
services/hardware features.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Remove the top-level "structured data" group as in practice it was used
only by JSON APIs.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Add a new top-level group for APIs that interact with third-party
services or applications. Included in the group:
- MCUboot image control API
- Hawkbit
- UpdateHub
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
While these APIs are kind of independent from the PM subsys (why?), they
all belong to the "power management" domain, so add them to the
subsys_pm group.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Add a new top-level for general utilities, like utility functions,
linear range API, time utils, etc. This category should be used by stuff
that is not strictly bound to the OS, like are OS services.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Create a USB Doxygen group, part of the top-level connectivity group.
Added some existing groups to the usb group, note that USB Doxygen needs
to be improved, though.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Add a new connectivity group and add to it the following other groups:
- LoRaWAN
- Networking
- Bluetooth
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
If XCC toolchain is clang based, enabled C11 features by
defining TOOLCHAIN_HAS_C_GENERIC and TOOLCHAIN_HAS_C_AUTO_TYPE.
Mirror the definitions in include/zephyr/toolchain/llvm.h
This is required to build Zephyr with features requiring
tagged arguments like LOG_MIPI_SYST_USE_CATALOG.
Suggested-by: Daniel Leung <daniel.leung@intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
The include/zephyr/drivers/clock_control/stm32_clock_control.h header
file treats F2X, F4X and F7X as all being supported by the stmf4_clock.h
header. However, the F7 has additional clocks that are available as domain
clocks for devices (such as the stm32 uart) and these do not work with
the f4 header.
Signed-off-by: Nick Stoughton <nstoughton@logitech.com>
The previous implementation would read from `addr->val[0]` before it was
initialized if the input string started with a colon ':'.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Add a shell_strtoull function that works similar to
shell_strtoul except that it calls strtoull instead
of strtoul.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
A dangling `FIXME` comment was left in the `pthread.h` header
about how it would be difficult to implement
`PTHREAD_MUTEX_INITIALIZER` and `PTHREAD_COND_INITIALIZER`.
They were both implemented months ago, so let's retire
that comment.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Deprecate `EFD_IN_USE` and `EFD_FLAGS_SET` as they are not
specified as part of any public `eventfd()` API.
While those are being deprecated, use `_INTERNAL` variants.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
TL;DR - a complete rewrite.
Previously, the prototypical `eventfd()` usage (one thread
performing a blocking `read()`, followed by another thread
performing a `write()`) would deadlock Zephyr. This shortcoming
has existed in Zephyr's `eventfd()` implementation from the
start and the suggested workaround was to use `poll()`.
However, that is not sufficient for integrating 3rd-party
libraries that may rely on proper `eventfd()` blocking
operations such as `eventfd_read()` and `eventfd_write()`.
The culprit was the per-fdtable-entry `struct k_mutex`.
Here we perform a minor revision of the locking strategy
and employ `k_condvar_broadcast()` and `k_condvar_wait()`
to signal and wait on the holder of a given `struct k_mutex`.
It is important to note, however, that the primary means of
synchronizing the eventfd state is actually the eventfd
spinlock. The fdtable mutex and condition variable are mainly
used for the purposes of blocking io (r,w,close) and are not
used in the code path of non-blocking reads.
The `wait_q` and `k_poll_signal` entries were removed from
`struct eventfd` as they were unnecessary.
Additionally, switch to using a bitarray because it is
possibly faster than linear search for allocating and
deallocating eventfd resources.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
There is no major benefit to haveing `eventfd_read()` and
`eventfd_write()` as `static inline` functions and it is
arguably much easier to solve the deadlock bug when they
are not `inline`.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Complement the `struct k_mutex` in each fdtable entry
with a `struct k_condvar`. The reasoning for this should be
self-evident.
For a bit of history, `fdtable` was introduced in
commit 06eb489c45 ("kernel: add condition variables")
which predates `struct k_condvar`, introduced in
commit f484bbaa26 ("lib: posix: Implement generic file descriptor table")
by almost 2 years.
Additionally, provide a new accessor function,
`z_get_obj_lock_and_cond()`, that (optionally) gets the mutex
and condition variable associated with the provided object and
vtable.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Move the Bosch M_CAN header file to include/zephyr/drivers/can/can_mcan.h
for use in out-of-tree drivers.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Commit caea9dc196
("logging: Use TYPE_SECTION macros for log strings") changed to
use TYPE_SECTION macros for log strings. However, the data type
was changed from char[] to (char *), resulting in the pointer
to log strings are being put in the log_strings_area section
instead of the actual strings. Fix this by reverting the data
type change back to before that commit but semantically uses
TYPE_SECTION_ITERABLE() by expanding it manually.
Fixes#58476
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Relax the expected behavior of the RX path. So far it was stated
that UART_RX_BUF_RELEASED event is generated when one buffer is
completely filled. Now, it is relaxed so that buffer can be
released even when not completed (e.g. after the first timeout).
This approach does not violate the API and may be more convenient
for some devices where on timeout a switch between DMA buffers
must occur.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
The IEEE802154_2015 option is misleading, as it does not introduce full
802.15.4-2015 standard compliance but only random bits, plus it's
defined at the radio driver level, which brings yet another confusion.
Because of that, the option will be deprecated, and respective parts of
code that made use of it converted to use more specific configurations:
* nRF driver will now use CONFIG_NRF_802154_ENCRYPTION to specify
whether to compile in TX security
* net_pkt will only add extra 802.15.4 control block fields if
OpenThread is used, as they were solely used by this L2
* OpenThread radio layer will now use the OpenThread version to
determine whether to compile in TX security.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>