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>
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>
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>
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>
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>