Fix in command line parsing common functions, to prevent
a possible segfault when handling string type arguments
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
A few function prototypes were missing in the native_posix
board and its drivers.
Let's add them.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
For each driver/model with command line options.
Move its code for the board file into the driver/model file.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Allow command line arguments to be registered dynamically
instead of being statically defined.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Some drivers or tests need to execute some code before Zephyr is
booted, dynamically register command line arguments, etc.
For this purpose, we generalize the NATIVE_EXIT_TASK to also
provide hooks to run a function at a given point during the startup
of native_posix.
Also, test/boards/native_posix/exit_tasks is generalized to cover
this new functionality.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
For native_posix:
Added the option to control the speed of the simualated time vs
the real(host) time.
Added a model of a real time clock with an API.
In the documentation we clarify the relationship between simulated
time and real time, and include documentaion of this new RTC.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Until now, command line options switches which matched the
begining of other options with argumentes needed to be listed
after those. After this fix this is not neccessary anymore.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Let the HW events which would have executed right at the
stop-at time happen, as this produces a more intuitive runtime.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Some of the native application components or drivers need to
do a proper cleanup before the executable exits.
So we provide a macro similar to SYS_INIT but which will be
called just before exiting.
This can be used for freeing up resources, closing descriptors,
or doing any neccessary signaling to any other host process.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Override the C standard used for compilation to C 2011
This is due to some tests using _Static_assert which is a 2011
feature, but otherwise relying on compilers supporting it also
when set to C99.
This was in general ok, but with some host compilers and C
library versions it led to problems. So we override it to 2011
for native_posix board.
Fixes: #8529
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Now that it is possible to easily add Kconfig options from command
line, we do not need to always compile native_posix with coverage.
This was done only to have it set easily for sanity_check.
So do not select it anymore, and let users choose if they
want coverage dumps or not.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Bool symbols implicitly default to 'n'.
A 'default n' can make sense e.g. in a Kconfig.defconfig file, if you
want to override a 'default y' on the base definition of the symbol. It
isn't used like that for any of the removed properties though.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
native_posix relies on the host C library even if users think
they are selecting one of the lib/libc C libraries.
For the math functions to be available at link time we need
to link to the host math library when building for this board
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Fixed the BT_USERCHAN config warning
by setting it only if BT_HCI is selected,
instead of setting it always and relying on it
being set to "no" by not meeting that dependency.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Fixed the FAKE_ENTROPY_NATIVE_POSIX config warning
by setting it only if the entropy generator is used,
instead of setting it always and relying on it
being set to "no" by not meeting that dependency.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
For the native_posix board,
added the command line options -rt and -no-rt to control
if the execution should be slowed down to real time or not.
CONFIG_NATIVE_POSIX_SLOWDOWN_TO_REAL_TIME still works, but
now it just sets a default.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Fix in interrupt wrapping for native_posix so it also
supports meta-interrupts.
Related to commit:
3a0cb2d35d
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
New tests rely on irq_offload() actually being based on an
interrupt.
So let's base it on a new SW interrupt.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Introduce a custom HCI driver for the native POSIX port, which opens a
HCI User Channel socket to the Linux kernel to gain access to a local
Bluetooth controller.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Be more obvious about the entropy_native_posix driver
being only a test utility which does not generate real
entropy.
Fixes: #6388
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
The zephyr.exe created when building a native POSIX application can take
some parameters that are documented in the "board" document, so add a
reference to that documentation here.
fixes: #6384
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Refer to the samples/net/eth_native_posix sample app
and mention that this driver only works on Linux
with admin rights
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
As the native_posix board has ethernet driver, then enable it by
default if networking is enabled in prj.conf file. This way we can
use generic networking config file when running the application
for native_posix board.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This creates zeth network interface in your host and allows user
to send and receive data sent to this network interface.
Fixes#6007
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Added a basic command line parameter parsing framework
Added the following options by now:
--stop-at=<time>: Auto-stop after <time> seconds
--seed=<seed> : random seed for entropy device
--testargs : any argument that follows is ignored in top level
and made available thru
native_get_test_cmd_line_args()
All command line parameters are still avaliable by calling
native_get_cmd_line_args(), but now you can also call
native_get_test_cmd_line_args() to get whatever was set after
--testargs
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
The xtensa-asm2 work included a patch that added nano_internal.h
includes in lots of places that needed to have _Swap defined, because
it had to break a cycle and this no longer got pulled in from the arch
headers.
Unfortunately those new includes created new and more amusing cycles
elsewhere which led to breakage on other platforms.
Break out the _Swap definition (only) into a separate header and use
that instead. Cleaner. Seems not to have any more hidden gotchas.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Bugfix in the tickless mode part:
During _time_idle_exit it was not announcing to the kernel the
already passed silent ticks, but it was left for the tick interrupt
itself.
This did not cause any trouble so far as there was only the timer
interrupt in this board.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Just some exclusions to coverage in code which cannot be
reached, or can only be reached in error conditions
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Added possibility to reconfigure CONFIG_SYS_CLOCK_TICKS_PER_SEC
for the native_posix board (before it could only be 100)
+
Fixed tickless idle support
+
Minor fixes in irq wrapping
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
To avoid indeterministic behaviour of the tests
which leads to changing coverage reports, let's
finish the tests exectuion as soon as they pass
or fail.
Also let's return 0 to the shell if the test passed,
and 1 if it failed.
(Reverting
f9af42f078 and
07c9163f67
)
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Now the native console driver also handles stdin
so we can drive the shell from the command line,
a pipe or a file
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
rename main_clean_up() to posix_exit() for consistency
with all other global functions of this architecture
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Corrected the board name in the configuration short
description string. It was the old Simple_process name which was
replaced with native_posix
Corrected also the comment/title in the "Board Options" menu
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
The native SOC Kconfig file was still referring to the old
configuration option SOC_INF_CLOCK which was replaced with
SOC_POSIX.
This produced a warning on configuration which is now fixed
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
To get coverage data from all samples and tests, enable this by default.
Right now we only get coverage data from tests, however many samples we
currently have can run natively and can generate more coverage and
testing.
This should be removed once we have tests provide better coverage.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Quite a lot of improvements in the native_posix board
documentation:
* Added TOC
* Reordered
* Given much more emphasis to its limitation
* Added subsection explaining how to overcome some of these
limitations
* Added rationale section
* Added section comparing this port with QEMU and ISSs
* Corrected build example (this port cannot be compiled on
Windows, regression from commit
e62ee6ab3c )
* Added note about it not working on W10 WSL (#5762)
* Several other minor fixes
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
For tests (CONFIG_TESTS) do not slow down the execution
to real time.
For samples, we assume they are interactive and therefore it is
still preferred to run them at real time.
This speeds up the native_posix part of sanitycheck
by ~50% (more the faster the computer)
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
* Added a figure explaining how layering of the posix arch
compares to the embedded builds
* One minor grammar change in last paragraph
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
The native_posix board will accept command line arguments
which the application / test may pick by calling
native_get_cmd_line_args()
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>