Offloaded socket implementations need to create the socket operations
vtable, therefore need access to struct socket_op_vtable. So far this
has been defined in a private header, so implementations needed to add
the header location to the include path in CMake.
Therefore, move struct socket_op_vtable definition to the internal part
of the public socket header, so it's no longer needed to include a
private header. This is also more consistent with the rest of the public
header content, as for example macros needed to register a socket
implementation are already there.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The .rodata_in_data section is produced by MWDT toolchain with -Hccm
option enabled. This option moves read-only data from the executable
memory (ICCM) to the data memory (DCCM), improving performance by
reducing conflicts between instruction fetches and data fetches.
Signed-off-by: Ilya Tagunov <Ilya.Tagunov@synopsys.com>
clang-tidy reports a bugprone-sizeof-expression warning for
sizeof((__v)) when __v is a pointer type. This is a false-positive
in contexts like logging with %p, where using a pointer is
intentional and expected.
Add a NOLINT comment to suppress the warning in static analysis.
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
clang-tidy reports a performance-no-int-to-ptr warning due to the cast
(const char *)(uintptr_t)(v).
Previously, only char * was cast to const char *, but there's no downside
to constifying all pointer types.
This change updates the Z_CONSTIFY macro to apply const consistently,
which even aligns better with its name and resolves the warning.
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
During #89407 a driver-specific header stm32_dcmipp.h got introduced to
support new functionnalities not yet covered by video APIs.
Move this header into a new <include/zephyr/drivers/video/> include
direcctory like what other driver classes do.
Signed-off-by: Josuah Demangeon <me@josuah.net>
Move `@cond INTERNAL_HIDDEN` comment where it belongs (fixing what was
probably a copy-paste/refactoring error).
This also makes the previously `bap_iso`, `group`, `_prev_seq_num`
visible again.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
add doxygen groups to include/zephyr/math header files and fold them
under Utilities top-level group.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
moved docs to Utilities group (vs. top-level)
cleaned several incorrect Doxygen group definitions
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Previously, ZRESTRICT was used in aio.h without also including
zephyr/toolchain.h.
Tests may have compiled because the toolchain header was included by
some other means.
We should explicitly include it to ensure that ZRESTRICT is defined.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
When a function pointer is `NULL`, it could be that the underlying
hardware doesn't support it, or it isn't implemented.
If a function isn't supported by the hardware, its driver should
return `-ENOTSUP`, the API layer should return `-ENOSYS` when a
function isn't implemented.
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
Virtio headers are moved to zephyr/drivers/ as they have no reason to be
top-level headers since virtio is a driver class.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
To avoid misalignment errors when casting between
sockaddr_storage/sockaddr and specialied sockaddr_* variants, specify
alignment for the former to match the alignment of the others.
The issue was reported by UBSAN:
utils.c:802:8: runtime error: member access within misaligned
address 0xf4aff186 for type 'struct sockaddr_in6', which requires
4 byte alignment
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
To address the misaligned access issues reported by UBSAN, introduce raw
variant of certain IPv4 functions used in the critical data path of the
network stack, operating on plain uint8_t buffers in stead of IPv4
address struct.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
To address the misaligned access issues reported by UBSAN, introduce raw
variant of certain IPv6 functions used in the critical data path of the
network stack, operating on plain uint8_t buffers in stead of IPv6
address struct.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Description of parameters in st,control property didn't match the values
used in the code.
Modify the description to match with the current driver implementation.
Also add a description for reg property to help setting it properly and
add corresponding dt-bindings.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
The struct video_buffer are currently used with `struct k_fifo`, which
require them to preserve the first word of data for use by the kernel.
Move the first fields to make it possible to keep using video buffers in
FIFO safely.
Fixes#92526
Signed-off-by: Josuah Demangeon <me@josuah.net>
Rename and clarify the @defgroup SENSOR_AXIS_ALIGN to better reflect its
purpose. Replace the vague "DT Options" title with a more descriptive
name: "Sensor axis alignment DT options".
This improves documentation clarity for developers configuring sensor
orientation via Device Tree.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
Some boards fail to build arch.interrupt.gen_isr_table_local.riscv test
since this region is too small:
riscv64-zephyr-elf/bin/ld.bfd: zephyr/zephyr_pre0.elf section `.intList'
will not fit in region `IDT_LIST'
riscv64-zephyr-elf/bin/ld.bfd: region `IDT_LIST' overflowed by 239 bytes
This is a bogus memory region, so increasing it has no effect on the
final binary size.
Issue #92194
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Move the IronSide APIs to soc/nordic from drivers/firmware since
these are vendor specific APIs. The header files are now included
from <nrf_ironside/*.h>. Adjust code that uses these APIs accordingly.
Also move the DT binding for "nordic,ironside-call" from
bindings/firmware to bindings/misc.
Signed-off-by: Jonathan Nilsen <jonathan.nilsen@nordicsemi.no>
SonarQube reports: cast from 'const struct _snode *' to 'struct _snode *'
drops const qualifier. Fix it by removing the const.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
(cherry picked from commit 7982ee0df13b7f9e54595f799e32f38c464b0f9e)
In principle getting the address of an unaligned structure member
is undefined behaviour, and clang warns as much.
Let's provide a macro which can return such an address.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The GRTC counter is not cleared at startup, therefore the
`last_count` variable needs to be initialized accordingly.
This change:
- Prevents overflow of the `sys_clock_announce()` int32_t parameter
- Ensures the correct uptime value, which should be reset during
initialization
Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
net_event.h header makes use of macros defined in net_mgmt.h, therefore
it should include that header.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Per section 5.6.4 of the USB 2.0 standard, Isochronous Endpoints
are derived by the (2^(bInterval-1) * F) formula. The current
implementation uses the formula intended for Interrupt Endpoints.
Signed-off-by: Victor Brzeski <vbrzeski@gmail.com>
Add member in mipi_dsi_msg structure to store user data, incase the high
level driver or application needs to pass down extra configuration.
Signed-off-by: Kate Wang <yumeng.wang@nxp.com>
This change adds two macros that allow the user to specify the section
the memslab buffer should be allocated from. This is useful for systems
where memory must reside in DMA-able memory like USB.
Signed-off-by: Victor Brzeski <vbrzeski@gmail.com>
Add driver for Microchip PolarFire SoC (MPFS) peripheral clock and soft
reset control.
Normally, the peripheral clocks and reset state are controlled by the
Hart Software Services (HSS) running on the Monitor processor. As an
alternative to using HSS services, applications can now enable the reset
controller in a device tree overly, for example:
&reset {
status = "okay";
};
&uart4 {
resets = <&reset MSS_RESET_ID_MMUART4>;
};
Embedded the reset controller node in system controller node.
Signed-off-by: Frank Kühndel <frank.kuehndel@embedded-brains.de>
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
Signed-off-by: Conor Paxton <conor.paxton@microchip.com>
According to the C standard it is undefined behavior to use preprocessor
directives inside macro invocations.
Cppcheck stops when it see this UB with an error message, and so this
change will improve Cppcheck analysis
This is a refactoring to fix UB, no logical change is intended.
Signed-off-by: Daniel Marjamäki <daniel.marjamaki@cppchecksolutions.com>