So instead of building the net_pkt by itself, dns will pass its message
buffer to net_context_sendto_new(), which in turn will build the net_pkt
relevantly.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Since net_context_sendto_new() does not take a net_pkt anymore, the only
way to set net_pkt's ttl/hop_limit is to pass it through net_context.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
dns_write was in the middle of this, let's just move it to a more
relevant place so we logically have macros, then local variables then
functions.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Some of dns_pack.c macros are also used in resolve.c, so let's just put
the macros in dns_pack.h
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Once the fraction value has been assigned a value, we can't move
the exponent any more.
Fixes erroneous values the binary32/64 formats.
Signed-off-by: Michael Scott <mike@foundries.io>
The command to create the board image binary file assumes the input
is always called zephyr.bin. This is not always the case if custom
name is defined in CONFIG_KERNEL_BIN_NAME. So update the call of
command to use CONFIG_KERNEL_BIN_NAME.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
We can just implement this as a macro and not needlessly
run afoul of MISRC-C rule 17.1
Fixes: #10012
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
We don't need the build system to pull out the mmu
region specifiers from the kernel binary when the
script can just as easily do this itself.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Follow the pattern we have for other peripherals in that if the driver
class (CAN) is enabled than enable the driver for that class
(CAN_STM32). Also have the STM32 CAN driver depend on being on a STM32
SoC.
Remove setting of CONFIG_CAN_STM32 in any .conf files as it will get set
of CONFIG_CAN is set/enabled.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
RTC_Alarm IRQ is mentioned as an exti interrupt in documentation,
so it was available in exti handler.
Though, in Zephyr it is used driectly in RTC driver.
Having it in exti generates and issue when activating RTC driver,
so remove its handling from exti driver.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
IRQ lines definition in function __stm32_exti_connect_irqs ifdefery
does not match __stm32_exti_isr_x_y functions definitions.
Fix this.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
The name of the CAN message and filter was changed so this
needs to be changed too here.
Fixes#13716
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
- newlib needs c standard includes (so no -nostdinc)
- xcc needs toolchain headers (so no -nostdinc)
- with host gcc:
- x86_64 should not build with standard includes (-nostdinc needed)
- native_posix should build with standard include (no -nostdinc)
..
..
To simplify, abstract this and move it to compilers/toolchains and still
depend on what the application wants.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Also, for now x86_64 does not support newlib, so do not enable newlib
for this arch until we have a solution.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
XCC is based on xcc, but is nothing like gcc and his many differences.
Instead of ifdeffing the gcc code with Xcc specifics, maintain it
standalone.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add missing CONFIG_GPIO required by the nRF52 board-specific Bluetooth
Mesh On/Off application sample.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
This test is breaking CI, we need a fix first before we go and enable
tests.
This reverts commit dc39a9adcf.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Some older variants of newlib (like what we have on xtensa or riscv in
SDK 0.9.5) define timespec and itimerspec in sys/types.h. The timespec
can be handled by a check of __timespec_defined. However itimerspec
doesn't have anything similar so we have to do it by newlib version
info.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
With newer newlib we get a build error with mqueue.h realted to mode_t.
Let's just let newlib define mode_t and have minimal libc also define
it in sys/types.h. So we remove the duplicated definition in
posix/unistd.h.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Add a build variant of the posix tests with newlib enabled. Since the
interation of posix is greatly related to the libc we should have these
tests build with and without newlib support.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Some mcux gpio instances do not have dedicated interrupt vectors and
therefore conditionalize out the IRQ_CONNECT() and irq_enable() calls
during driver initialization. The driver initialization incorrectly
returned an error in this case, when really it just has nothing to do.
The driver can still be used without interrupts, and the gpio configure
function returns an error if an application tries otherwise.
Commit a68120de6d introduced a check on
the init return value to prevent applications from using drivers that
fail to initialize. This in turn caused zephyr/samples/basic/threads to
assert on the frdm_kl25z board. Fix this by modifying the mcux gpio
driver to return success when there is no interrupt to connect.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
- differentiating actual "fragment" to buffer element from a net_pkt
- instead of copying data (and thus allocating buffer) let's just take
the fragment buffer and put it into result packet.
- fixing compilation issue in relevant test
It's more efficient that way, as we use already allocated fragment
buffer instead of reallocating/deallocating after each fragment
reception.
A possible optimization would be to calculate the actual size + header
difference if only the actual size is close to the target size.
It would avoid to get a dry run of the header decompression for each
fragment received. The difficulty being in finding the sweet spot when
it is relevant to calculate the header difference.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Since we don't want to redo the complex calculation, let's reuse the
uncompress functions, adding a dry_run possibility to those.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This is an integral part of userspace and cannot be used
on its own. Fold into the main userspace configuration.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
When DTLS client was added to `poll` before/during the handshake, it
could throw errors and in some circumstances (when polling thread was
cooperative and had higher or equal priority to the handshake thread)
could lead to a deadlock in the application.
Prevent that, by blocking on handshake semaphore instead of fifo. Poll
will start using fifo for data poll only after handshake is complete.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Instead of simple bool value, use a semaphore to notify that TLS
handshake is complete. This way, we can monitor this value with k_poll.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
System workqueue stack was not large enough to handle DTLS handshake,
which lead to system crash.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Errno value is only significant when `recvfrom` function indicated an
error (by returning -1). We should not depend on it's value if no error
is notified.
As the return value of `recvfrom` is already checked, misused errno
verification can simply be removed.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Introduce toolchain_cc_asm macro to capture toolchain specific flags
related to assembly.
-D_ASMLANGUAGE is kept common for all, assuming -D as define flag is
supported by all compilers (which is almost the case).
No functional change expected.
Clang's flags are compatible with gcc, and are thus inherited.
This is motivated by the wish to abstract Zephyr's usage of toolchains,
permitting easier porting to other (commercial) toolchains.
Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
The macro RB_FOR_EACH_CONTAINER could run infinitely when the function
_rb_foreach_next returns NULL.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Functions which have to be located in RAM are placed by SiLabs library
code in section '.ram'. Corresponding section used by Zephyr is called
'.ramfunc'. This patch renames SiLabs naming to match Zephyr's.
This solution was chosen over adding '.ram' function to Zephyr linker
scripts not to pollute them. However, this patch needs to be reapplied
every time SiLabs library version is updated.
Fixes#13192
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
This is an application facing define, specific to this
driver, for the public uart_drv_cmd() API. Put it with
public headers.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Test was failing on nios2 with:
../app/libapp.a(test_stack_contexts.c.obj): in function `tstack_pop':
/home/galak/git/zephyr/tests/kernel/stack/stack_api/src/test_stack_contexts.c:31:
warning: unable to reach (null) (at 0x004002f4) from the global pointer
(at 0x004082fc) because the offset (-32776) is out of the allowed range,
-32678 to 32767
Fixes#13595
Signed-off-by: Anas Nashif <anas.nashif@intel.com>