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>
User mode needs to be able to read this value in
compiler generated function prologues/epilogues.
Special handling in init.c for arches that use
_data_copy. This happens before _Cstart() gets
called. We need to make sure that the compiler
stack canary checks in _data_copy itself do not
fail.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
We need a generic name for the partition containing
essential C library globals. We're going to need to
add the stack canary guard to this area so user mode
can read it.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
We'd like these macros to simply do nothing if the
feature isn't enabled rather than erroring out.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Instead of having to enable ramfunc support manually, just make it
transparently available to users, keeping the MPU region disabled if not
used to not waste a MPU region. This however wastes 24 bytes of code
area when the MPU is disabled and 48 bytes when it is enabled, and
probably a dozen of CPU cycles during boot. I believe it is something
acceptable.
Note that when XIP is used, code is already in RAM, so the __ramfunc
keyword does nothing, but does not generate an error.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
The linker file defines the __ramfunc_ram_size symbols to get the size
of the __ramfunc_ram section. Use that instead of computing the value at
runtime from the start and end symbols. This saves 16 bytes of code with
CONFIG_RAM_FUNCTION=y.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Using __ramfunc to places a function in RAM instead of Flash.
Code that for example reprograms flash at runtime can't execute
from flash, in that case must placing code into RAM.
This commit create a new section named '.ramfunc' in link scripts,
all functions has __ramfunc keyword saved in thats sections and
will load from flash to sram after the system booted.
Fixes: #10253
Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
No functionality changes, just doxygen additions and some
things are hidden from document generation.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add some short doc comments at the beginning so that people can quickly
get an idea of what they're about.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
It's confusing that "address" is often used within the same function to
refer to both node paths and e.g. address cells.
Make things easier to understand by calling /foo/bar a path instead.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
extract_property() is meant to generate #defines for a single property,
like 'foo = <1 2 3>'. Currently, it also generates node-level #defines
related to parent buses.
That makes the intent of the code hard to understand, and also means
that identical node-level #defines get redundantly added multiple times
(once per property).
Generate the node-level bus #defines before processing properties, in
generate_node_defines(). Use a new generate_bus_defines() helper.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Due to the way the code was structured,
flash.extract_partition(node_path) was called multiple times for the
same 'node_path'.
That must've been a mistake to begin with (but was hard to spot before
the code was cleaned up). Move the generation of per-node #defines out
of the property loop.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This commit fixes a test in kernel/mem_protect/userspace,
which was attempting to read from an address that was not
necessarily within the image memory range, causing faults
in ARM TrustZone-enabled builds.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Group the networking chapters for reference document so that the
layout is more logical and easier to read.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit adds sys_set_power_state() function with support for EM1
Sleep, EM2 Deep Sleep, EM3 Stop power modes on Silabs SoCs.
Tested on efr32_slwstk6061a board.
Note: No support for efm32hg, efm32wg series at this point due to the
missing possibility of placing function code in RAM, required by errata
in SiLabs library code.
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
'soc' logger module may be used by any SoC related code located in soc/.
An implementation file requiring logger services should include
LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
to use the 'soc' logger instance.
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
Recent versions of GCC won't build grub-2.02 because they're more
pedantic about warnings. This has been fixed upstream but is not
yet part of any release. The build script is modified to apply the
relevant commits before building.
Signed-off-by: Charles E. Youse <charles.youse@intel.com>
Both SDK 0.10.0-beta2 and the ARM gcc 2018q2 run into a build issue with
newlib and conflict definitions of mode_t type.
First we need to add some ifdef protection if mode_t is already defined
and set _MODE_T_DECLARED if we are the first to define it.
Secondarily, we rename include/posix/sys/types.h to
include/posix/posix_types.h so that we aren't getting a name collusion
with the system sys/types.h and that we can easily and clearily include
it (which we need to do to pull in the info from newlib).
Fixes: #12224
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
For now we are disabling support for POSIX lib on native posix arch. We
need to cleanup and support POSIX lib cleanly for hardware targets.
Once that is working properly we can look to support the feature on
native posix arch.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This fix allows Renode to resemble the time flow of the hardware more
precisely. The performance value was established manually, there is no
indication in the docs on what is the average performance.
It allows tests/posix/common/portability.posix to pass, but fails on
tests/kernel/lifo/lifo_usage/kernel.lifo.usage.
The latter also fails on hardware.
Signed-off-by: Piotr Zierhoffer <pzierhoffer@antmicro.com>
The extra check for CONFIG_NET_OFFLOAD is not needed as it
prevents documentation generation for this API.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit adds a patch in the Kconfig.defconfig file of
nRF9160_pca10090 board, that instructs the linker to restrict
the Secure image to the size of its code partition, if the
image is to be combined with a Non-Secure image. Secure images
without accompanying Non-Secure firmware (i.e. with symbol
TRUSTED_EXECUTION_SECURE not set) can use the entire flash.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
We do not need to overwrite the reg property of flash0
in nrf9160_pca10090 default partitioning. The property
reflects the flash resources of the SOC, and is passed
in the .dtsi file of nRF9160 SOC definition.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit fixes a bug that was always propagating the
default error reason (_NANO_ERR_HW_EXCEPTION) to the
system fatal error handler for (strictly) Secure and
for Non-Secure FW builds on ARMv8-M.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Include the EXC_RETURN payload flag macro definitions into
compilation when building for Non-Secure firmware, too.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Move test related code and the testsuite away from tests/ and make it a
proper subsystem.
The way tests were integrate in the tree was not obvious and actual
tests were intermixed with the testsuite code.
This will allow us to have trees with the testcode and without the
samples by just remove the folders tests/ and samples, needed for
isolating actual code from test/sample code.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Most of the other nRF52832 boards have the following settings for
scratch and storage partitions:
scratch_partition: partition@70000 {
label = "image-scratch";
reg = <0x00070000 0xa000>;
};
storage_partition: partition@7a000 {
label = "storage";
reg = <0x0007a000 0x00006000>;
};
Let's adjust the scratch size to align with the others and add the
storage partition so that settings and FS samples will work.
Signed-off-by: Michael Scott <mike@foundries.io>