Declutter `fatal.c` by moving the stack unwinding logic into
`stacktrace.c` and guard its compilation with `CMakeLists.txt`.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
The script runs as part of the build now. Use that feature and
remove the old static file from the manually-run script.
Signed-off-by: Andy Ross <andyross@google.com>
The original code would (unsurprisingly) only emit handler functions
for interrupt levels with interrupts associated with them. But it
turns out that it's possible to configure an xtensa device with an
empty-but-otherwise-real interrupt level (specifically mt8195 has a
"Level 3" interrupt not associated with any input IRQS, it's one level
above EXCM_LEVEL and one level below the DEBUG exception).
This script is old, and not set up to parse the full core-isa.h
directly, so modifying it to detect this condition is difficult.
Instead, just emit all 15 possible interrupt handlers, even empty
ones. The extra stubs are harmless as they'll be dropped if uncalled.
Signed-off-by: Andy Ross <andyross@google.com>
Some oddballs cores can be generated without an "NMI" interrupt, in
which case core-isa.h will not define XCHAL_NMILEVEL. This code is
trying to unconditionally mask interrupts, so XCHAL_EXCM_LEVEL is the
pedantically correct choice anyway (NMI's by definition, cannot be
masked).
Signed-off-by: Andy Ross <andyross@google.com>
The script to generate the _soc_inthandlers.h header has been run
manually for years, only because I was a cmake novice at the time and
unsure how to integrate it into the build. So every new platform has
to find the script and template file and figure out how to generate
the file. And in a few cases it looks like we've tried to EDIT the
resulting files in the tree.
Let's finally do this right. The file is now dropped (for every
xtensa platform) as a "xtensa_handlers.h" file, and there is a Kconfig
to control whether the original/manual file or the new one is used by
the platform code. We can migrate the other platforms slowly as
people have time to validate.
Signed-off-by: Andy Ross <andyross@google.com>
The temperature being computed using a float variable, use
sensor_value_from_float() instead of sensor_value_from_double(). This
saves some flash.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This commit updates the codecov workflow to specify the full coverage
report file path under `files` because codecov-action v4 does not correctly
process the `directory` parameter.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Previous value just activated the ability to trigger for both edges,
without (de)-activating the gpio. This caused an assrtion error in GPIO.h.
Fixes#71227
Signed-off-by: Juliane Schulze <juliane.schulze@deveritec.com>
Currently __INT64_C() doesn't add any suffix to provided constant which
causes the constant to have 'int' type. On the other side, __UINT64_C()
adds ULL suffix which makes the constant 'unsigned long long'.
Of course, __INT64_C() is wrong here because 'int' type, in most cases,
has 32 bit width.
According to the C standard, these macros are for minimum-width integer
constants. For example, it means that using INT16_C() macro will give
you constant with type the same as 'int_least16_t' type.
Clang doesn't provide defines like __INT_LEAST16_C_SUFFIX__, which makes
implementation difficult, because we need to determine appropriate type
first.
Signed-off-by: Patryk Duda <patrykd@google.com>
Using '#ifndef' before defining a macro is a good way to provide default
version of the macro if not defined elsewhere. But it has some
disadvantages:
- It hides information about the users of these macros. It's hard to
determine when this implementation is used.
- Correctness depends on file including order.
It looks like these macros are used only by minimal libc and only if
ENFORCE_ZEPHYR_STDINT is not selected. We expect other libc to provide
their own implementation.
Signed-off-by: Patryk Duda <patrykd@google.com>
Zephyr minimal libc implements integer constant macros using internal
headers provided by GCC, for example INT64_C(x) is just a __INT64_C(x)
which is implemented by the GCC.
Clang compiler doesn't provide these definitions, so we define them
(__INT64_C() and INT64_C()) in zephyr/toolchain/llvm.h, but it looks
like INT64_C() definition doesn't come from llvm.h, but from stdlib.h
despite of checking if __GNUC__ is defined.
This is because Clang sometimes pretends to be GNU compiler:
$ x86_64-pc-linux-gnu-clang -dM -E - < /dev/null | grep "GNU"
#define __GNUC_MINOR__ 2
#define __GNUC_PATCHLEVEL__ 1
#define __GNUC_STDC_INLINE__ 1
#define __GNUC__ 4
Let's keep the integer constant macros in stdlib.h and their
actual implementation in llvm.h. Also define these macros if __clang__
is defined, just in case.
Signed-off-by: Patryk Duda <patrykd@google.com>
Terminate QEMU earlier if the test finishes and no output data is
received for 1 second. This new timeout operates in parallel with the
global test timeout.
For coverage testing, this can reduce the time spent running individual
tests by up to 29 seconds, while still giving the full 30 extra seconds
to dump gcov data if needed.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Let the callback execute after the interrupt status has cleared.
Because if the callback is executed before the interrupt status
is cleared, it might cause subsequent counter interrupts to fail to
trigger due to the callback function taking too long to execute.
Signed-off-by: Kevin Wang <kevinwang821020@google.com>
Add a new option to split off the building of the HCI layer of the
controller. This layer is not needed by the controller unit tests, and
becomes problematic with the planned change to use devicetree for HCI
drivers.
Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
The adv auto resume feature is planned for deprecation. This new define
is the new default applications should use.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Fix undefined reference to mbedtls_pk_ecc_xxx functions following update
to latest mbedtls version.
Signed-off-by: Joel Guittet <joelguittet@gmail.com>
select modem backend statistics and enable shell in cellular
modem sample. This will help advertise the feature, and can
help quickly identify issues with to small buffers.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
Add statistics module which tracks the usage of modem backend
transmit/receive buffers if implemented by a backend.
A modem backend may register itself to the modem backend
stat module, and advertise its transmit and receive buffer
sizes and momentary usage (length).
The modem backend module tracks the maximum usage, which can be
output to the shell using the "modem_stats buffer" shell command.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
Changes the log level from ERR to DBG for element_model_recv for the
following cases:
- Element does not have the appkey for incoming message.
- Element does not have destination address for incoming meesage.
When the received message is for a group address, element_model_recv
is called for all elements on the device. One or more elements may contain
a model that is subscribing to this address. If more than one element
contains the same model. but they do not all share the same application
key as the incoming message is encrypted with, or they do not all
subscribe to the same group address, then the log will show error
message for these elements, which is misleading.
Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
Add tests verifying valid IPv6 ND behaviors on interface state changes,
specifically:
* Verify RS is sent, and upon RA reception prefix and autoconf address
added accordingly.
* DAD is triggered for autoconf, static and LL IPv6 addresses.
* IPv6 address is not used upon DAD conflict.
* IPv6 neighbor discovery works as expected.
* Multicast transmission/reception is functional after interface state
changes.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
One of the test interfaces is defined as Ethernet interface, however it
was missing ethernet_init() call, hence for example interface flags were
uninitialized. This can cause issues with multicast tests, as
NET_L2_MULTICAST flag was missing on the interface.
Additionally, Ethernet-type interfaces should use struct
ethernet_context as a base for their context data, otherwise Ethernet L2
will reach to some rubbish memory locations.
Finally, since the interface now defines correct flags, all-nodes
multicast address is now added to the interface automatically as a part
of ND logic. Therefore, skip adding that address manually from
ipv6_setup().
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Restore the original LL address on the interface after tests, instead of
generating a new one, to avoid dangling link-local IPv6 on the
interface.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add more test cases verifying that MLD events/reports are sent
accordingly when interface state changes.
Introduce separate semaphores for waiting for network events, as having
a single one for transmit and events is ambiguous in tests.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Filtering out received packets which source address matches one of our
own addresses has broken the duplicate address detection conflict
reporting.
In case Neighbor Advertisement is sent during DAD collision, the source
address of such packet might be set to the address that triggered the
collision. This address would also be set on our interface, marked as
tentative. Therefore in order to make duplicate address detection work,
we cannot filter out packets in case our own address is still in
tentative state.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This fixes the SPI DTS bug on the nrf5340_audio_dk board
which was introduced by b8978e9:
unit address and first address in 'reg' (0x0) don't match
for /soc/peripheral@50000000/spi@a000/sdhc@1
unit address and first address in 'reg' (0x1) don't match
for /soc/peripheral@50000000/spi@a000/cs47l63@2
Signed-off-by: Tim Sørensen <tims@demant.com>
A support for RDNSS option should not force DNS subsystem being enabled
in the system, especially that the option is enabled by default. It
should work the other way around - the option is supported only if DNS
was enabled by the user.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Because of include file changes, we now need to include both
hostname.h and net_if.h in the syslog logging module directly.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The native_posix board does not work well with eventfd so disable
it with tests that use socket service API.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>