Fixes macros that broke after changes were merged which started
using the unit address of partition nodes. This also fixes the
test to ensure devices not starting at 0x0 are properly checked
which previously would silently be unknown
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Add helpers for sending all the data in a buffer. This is
only useful for stream sockets like TCP.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
CoAP .well-known/core handling routine assumed that the "user_data"
pointer in struct coap_resource will be set to a valid struct
coap_core_metadata pointer, or left NULL. This approach is error
prone (application cannot use "user_data" field freely) and renders the
"user_data" field useless for other cases.
Therefore, introduce a separate "metadata" pointer within the struct
coap_resource specifically to configure the resource-related metadata,
and leave "user_data" for the applications to use freely.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The sensing subsystem currently calls fetch and get from a timer ISR
context. A TODO had been previously added to move this to the runtime
thread context, which has been done in this fix.
Signed-off-by: Brandon Edmonds <bedmonds91@gmail.com>
The `ucontext_t` structure includes a `stack_t` structure, so move the
definition of the `stack_t` structure ahead of `ucontext_t` to avoid
the error below.
```
In file included from lib/libc/minimal/include/signal.h:41,
from lib/posix/options/aio.c:8:
../zephyr/posix/posix_signal.h:204:9: error: unknown type name 'stack_t'
204 | stack_t uc_stack;
| ^~~~~~~
```
This would have also been fixed by #97855 but that PR still has not been
merged in spite of having had sufficient approvals.
Signed-off-by: Chris Friedt <chris@fr4.co>
There are slightly different definitions of pthread_attr_t in-tree.
This would have also been fixed by #97855 but that PR still has not been
merged in spite of having had sufficient approvals.
For now, fix it in a separate PR to avoid the error below.
```
include/zephyr/posix/posix_types.h:98:29: error: conflicting types for \
'pthread_attr_t'; have 'struct pthread_attr'
98 | typedef struct pthread_attr pthread_attr_t;
| ^~~~~~~~~~~~~~
In file included from lib/libc/minimal/include/signal.h:41,
from lib/posix/options/posix_internal.h:12:
include/zephyr/posix/posix_signal.h:92:3: note: previous declaration of \
'pthread_attr_t' with type 'pthread_attr_t'
92 | } pthread_attr_t;
| ^~~~~~~~~~~~~~
```
Signed-off-by: Chris Friedt <chris@fr4.co>
Adds sys_mem_blocks as an alternative implementation
for the heap. Users have reported that k_heap allocating
additional bytes for bookkeeping data when allocating e.g.
a LLEXT_PAGE for an extension region causes them to skip
an entire page for the next allocation. This also causes
problems RE: MPU slot usage. sys_mem_blocks stores bookkeeping
data outside of the memory it allocates from and does not
have this issue.
Note that sys_mem_blocks is only used to allocate extension
regions. Metadata is still stored in a k_heap.
Note also that tracking data for sys_mem_blocks must be stored
per extension, as unlike k_heap it can't deallocate with just
a pointer to the memory.
Further limitations:
* sys_mem_blocks is statically allocated, so this option
cannot be used with CONFIG_LLEXT_HEAP_DYNAMIC
* A minimum of 1 block must be allocated per region
regardless of size.
* If using the MPU / MMU where small allocations are
rounded up to LLEXT_PAGE regardless, this penalty
is not quite as noticeable.
* sys_mem_blocks does not support aligned allocations. However,
by selecting a sufficiently large power of 2 for the
block size and aligning the backing buffer to the block size,
any allocation will be automatically aligned for the block size
and smaller powers of 2. For LLEXT, this means users must select
a block size equal to or a multiple of the largest
requested region alignment of regions going on the heap
* If your MPU selects CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT,
large regions may cause unreasonably large maximum requested
region alignments
* Block size must also be equal to or a multiple of
LLEXT_PAGE_SIZE so each allocation is LLEXT page aligned
Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
Adds a Kconfig option to select LLEXT heap implementation.
Another choice, sys_mem_blocks, will be introduced in the
following commit.
Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
Add riscv_plic_irq_complete and make it available for kernel.
This is useful for Asymmetric MultiProcessing (AMP) configuration,
where the platform can be rebooted from the host side and the request
is processed in a interruption context.
Signed-off-by: Román Cárdenas Rodríguez <rcardenas.rod@gmail.com>
Signed-off-by: Pierre-Henry Moussay <pierre-henry.moussay@microchip.com>
Enhance the HL78xx public API header with comprehensive Doxygen
documentation. Replace legacy comments with structured Doxygen blocks,
expand enum and macro descriptions, and document API function pointer
signatures and GNSS callback types.
Group constants using @defgroup, add missing parameter docs, annotate
event structures, GNSS types, and RAT/CFUN definitions, and improve
readability of modem info and network APIs.
No functional changes; documentation only.
Signed-off-by: Zafer SEN <zafersn93@gmail.com>
Convert modem info enum comments from placeholder syntax to proper
Doxygen `/** ... */` style and replace angle‑bracket markers with
escaped forms inside inline documentation.
Also fix comment formatting in RSSI/RSRP parsing helpers so that
embedded AT command response formats render correctly in generated
docs.
No functional changes; documentation-only cleanup.
Signed-off-by: Zafer SEN <zafersn93@gmail.com>
Introduce optional Assisted GNSS (A-GNSS) support for HL78xx GNSS using
AT+GNSSAD commands (MODEM_HL78XX_12 only).
Add Kconfig to enable the feature, extend the GNSS driver state to keep
A-GNSS validity/expiry, and add chat parsing for +GNSSAD responses.
New public APIs allow applications to:
- query assistance status (AT+GNSSAD?)
- request assistance download for supported day values
(AT+GNSSAD=1,<days>)
- delete stored assistance data (AT+GNSSAD=0)
The feature is guarded by CONFIG_HL78XX_GNSS_SUPPORT_ASSISTED_MODE and
adds no behavior changes when disabled.
Signed-off-by: Zafer SEN <zafersn93@gmail.com>
Add comprehensive GNSS functionality to the HL78xx modem driver,
enabling GPS/GLONASS positioning for Sierra Wireless HL78xx modules.
Key features:
- GNSS data acquisition via NMEA0183 and proprietary GNSSLOC
- Automatic RF path management (GNSS requires airplane mode)
- State machine integration for LTE ↔ GNSS mode switching
- Configurable NMEA sentence output and satellite tracking
- Search timeout and configuration safety checks
- Event-based position updates and satellite info
Architecture:
The implementation uses explicit mode switching APIs
(hl78xx_enter_gnss_mode/hl78xx_exit_gnss_mode) to manage the
shared RF path between LTE and GNSS. The HL78xx hardware shares
RF components between the LTE and GNSS radios, preventing
simultaneous operation.
Currently, GNSS mode requires entering airplane mode (CFUN=4) to
disable the LTE radio. This approach is necessary because the
driver does not yet implement PSM (Power Saving Mode) or
Idle-eDRX, which would allow GNSS operation during LTE idle
periods. Future enhancements can leverage these power-saving modes
to enable GNSS searches without fully disabling LTE connectivity.
A pending request mechanism handles early GNSS mode requests that
arrive before modem initialization completes, ensuring reliable
startup behavior in both fully-functional and airplane boot modes.
The driver integrates with Zephyr's GNSS subsystem and provides
HL78xx-specific extensions through a dedicated API header.
New files:
- drivers/modem/hl78xx/hl78xx_gnss.c/h: Core GNSS driver
- drivers/modem/hl78xx/hl78xx_gnss_parsers.c/h: NMEA/GNSSLOC parsing
- include/zephyr/drivers/modem/hl78xx_apis.h: Extended public APIs
Tested on HL7802/HL7812 modules with various GNSS scenarios.
Signed-off-by: Zafer SEN <zafersn93@gmail.com>
Add support for ARMv8.5+ Branch Target Identification to protect against
Jump-Oriented Programming (JOP) attacks. This complements PAC to offer
complete protection against both ROP and JOP attacks, ensuring
comprehensive control flow integrity.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Add support for ARMv8.3+ Pointer Authentication to protect against
Return-Oriented Programming (ROP) attacks. This implementation provides
PAC functionality with per-thread key isolation, secure key management,
and integration with Zephyr's thread model.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Configure all nRF70 GPIO pins (BUCKEN, VDDIO_CTRL, SR RF switch) to
OUTPUT_INACTIVE state during driver initialization to prevent floating
pins from accidentally powering the module or affecting RF switch
before the interface is brought up.
This addresses an issue where GPIO configuration was delayed until
the interface was brought up for the first time, leaving voltage control
pins floating which could result in unintended power supply.
Fixes#100993.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
arch_irq_enable(), arch_irq_disable(), arch_irq_is_enabled() are
exported to assembly via GTEXT() but are implemented as C macro mappings
in some configurations. This can leave undefined symbol in objects that
include irq.h, which some linkers diagnose as errors as seen below with
armlink:
```
Error: L6218E: Undefined symbol arch_irq_enable (referred from reset.o).
Error: L6218E: Undefined symbol arch_irq_disable (referred from
reset.o).
Error: L6218E: Undefined symbol arch_irq_is_enabled (referred from
reset.o).
```
Map the arch_irq_* to appropriate underlying implementation in the
_ASMLANGUAGE path so that all assembly-visible exports resolve to real
symbols.
Signed-off-by: Sudan Landge <sudan.landge@arm.com>
The xen_sysctl_getdomaininfo function (which calls the
XEN_SYSCTL_getdomaininfolist hypercall) returned meaningless data
because the xen_domctl_getdomaininfo structure in Zephyr was 8 bits
smaller than in Xen.
This happened because the xen_arch_domainconfig structure, which is used
in both xen_domctl_getdomaininfo and xen_domctl_createdomain, was
missing the uint8_t sve_vl field introduced in Xen Domctl interface
version 0x16.
To fix this, the sve_vl field was added to xen_arch_domainconfig under
the appropriate config macro, synchronizing the structure with Xen and
resolving the data mismatch.
Signed-off-by: Svitlana Drozd <svitlana_drozd@epam.com>
There's a method to enable RX (`mctp_uart_start_rx`), but not one to
stop it. This patch adds `mctp_uart_stop_rx` to do so.
It will be handy at least for tests, as it allows two MCTP endpoints to
share a single UART device - as long as only one has RX enabled - and
"ping-pong" messages between them.
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
While currently it states that a single MCTP message will be read, one
could read *another* message on sequence without needing to enable RX
again. Make that clear in the documentation.
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
Commit 388725870f introduced thread-local
storage support for the ARM Cortex-M architecture. As part of this commit,
".TEXT.*" was added as input pattern for the `text` output section in the
Cortex-M architecture linker script, even though such a pattern is not
found in any other architecture.
I suspect this was done as a workaround for a bug in the very same commit:
a missing `#include` in __aeabi_read_tp.S results in the eponymous function
being placed in section `.TEXT.__aeabi_read_tp` (notice uppercase) instead
of `.text.__aeabi_read_tp`, which would trigger an "orphan section" linker
warning without the modified linker script. Over time, this workaround has
unfortunately allowed the same bug to appear in at least another file...
Realign Cortex-M with all other architectures and stop accepting ".TEXT.*"
as valid input section name for the `text` output section. This can be done
safely since all non-compliant code (in tree) has been fixed.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
The calculation of the sensor value uses the intermediate value of the
function `adc_raw_to_microvolts_dt`. This results in a sensor value
with a resolution that is not below `voltage-divider-scaling` millivolts
which can be too rough for some applications.
Using `adc_raw_to_microvolts_dt` and 64-bit-based scaling improves
the resulting voltage resolution.
Therefore, the public function `voltage_divider_scale64_dt()` is
introduced, which performs the same as `voltage_divider_scale_dt()`.
This decision does not affect implementations that use the current
32-bit implementation of `voltage_divider_scale_dt()`.
Signed-off-by: Stefan Schwendeler <Stefan.Schwendeler@husqvarnagroup.com>
Added FDB (Forward Database) table support for bridge.
Implemented very basic functions for adding/deleting
static <MAC + iface> FDB entry.
The dynamic FDB entry and hardware FDB configuration is
still TODO work.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
When the LLEXT subsystem detects that a symbol is marked for export from
the main image, but the symbol group in which the export belongs is not
enabled, add a marker in a special section in addition to not placing the
symbol in the final export table.
Add a post-build script which consumes the special section as post-build to
dump information about all discarded symbols in a build artifact, and also
check for common errors (missing Kconfig symbol / improperly named groups).
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Rename the indirect CSR access functions from icsr_* to micsr_* to
explicitly indicate they operate using M-mode CSRs (MISELECT/MIREG).
This prepares for future S-mode support where sicsr_* functions using
SISELECT/SIREG would be needed. The naming follows the RISC-V
convention of using 'm' and 's' prefixes to distinguish privilege
levels (e.g., mstatus/sstatus, mie/sie).
Signed-off-by: Afonso Oliveira <afonsoo@synopsys.com>
Add check for ACL connection before submitting recycled.
Since ISO and SCO connections do not trigger the disconnected
callback, nor affects e.g. advertising, they should not
trigger the recycled callback.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add missing return codes for can_add_rx_filter(), can_add_rx_filter_msgq(),
and can_recover() API calls.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This change introduces generating definitions corresponding to
`*-map` property, which was currently discarded.
For `*-map` properties are made able to be treated as a variation
of phandle-array, assign sequential cell names for each group of
specifiers (child_specifier_0, child_specifier_1, ...,
parent_specifier_0, ...).
The `*-map` data is like a two-dimensional array, so it is difficult to
handle with the existing APIs, so we will also provide new APIs.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Gets the specified number of elements from the beginning of the list.
This is the symmetircal operation as `GET_ARGS_LESS_N`.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
I don't know, why this was added originally, but there are many issues with
it:
- You can't really return NULL, because src_addr is a `void*`, not a
`void**`. The `src_addr = NULL` didn't do anything.
- The code was checking if the src_addr equals to the broadcast address,
but under normal conditions, that's always a unicast address.
- Even if we would check if the destination address was the bcaddr, I don't
see how that's useful. Currently, the address is only used for messages
of types advertise and gwinfo, which use it to create a new entry in the
gateway list. In that list, you always need the unicast address, never
the broadcast address.
Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
Adds support for using MCUmgr over UART (not via shell) in a raw
mode which does not include base64 and other SMP over console
encoding
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
The "init_called" flag needs to be per context and cannot be global
as it is meant to tell whether the context is initialized first time
or not.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Fixed multicast address checking.
- net_eth_is_addr_multicast() should be for multicast address checking
but not for only IP multicast address. Then net_eth_is_addr_group()
is no longer needed.
- LLDP and gPTP multicast address checking should not depend on Kconfig
option.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>