libmetal can be build without any machine support. It is possible that
vendors implement machine specific interfaces outside of libmetal and
link it with demos during build time. Hence, remove requirement to have
MACHINE and PROJECT_MACHINE variables from the build system. If vendor
prefer to choose 'template' machine, they can pass such option during
cmake configuration.
Signed-off-by: Tanmay Shah <tanmay.shah@amd.com>
To-be-expanded suite of tests for libmetal using
system-agnostic API instead of system specific tests.
Signed-off-by: Lefteris Ntafotis <lntaf@ics.forth.gr>
metal_run has been renamed to metal_test_run
metal_run_noblock has been renamed to metal_test_run_noblock
metal_finish_threads has been renamed to metal_test_finish_threads
Signed-off-by: Lefteris Ntafotis <lntaf@ics.forth.gr>
Do not rely on indirect includes since they may not be present on some
systems.
Signed-off-by: Vincenzo Calabretta <vincenzo.calabretta@embedded-brains.de>
Small change to solve the warning: function declaration isn't a
prototype when compiling tests with -Wstrict-prototypes gcc option
enabled.
Signed-off-by: Vincenzo Calabretta <vincenzo.calabretta@embedded-brains.de>
Remove all remaining instances of "# vim: ..." in files.
This vim settings were part of the initial commit. But no reason
to keep them.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
In Zephyr PR #63351 , commit:
a35e40f410750f3205f0d87489aa0dfa4006e1d3
Support for k_mem_block was removed which was used
by this Zephyr test.
Update the tets to just use a void* (which is what should be
used instead).
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Declare PROJECT_EC_FLAGS to be a global property
to simplify code for target_compile_options.
Signed-off-by: Sergei Korneichuk <sergei.korneichuk@amd.com>
Zephyr has prefixed all of its includes with <zephyr/...>. While the old
mode can still be used (CONFIG_LEGACY_INCLUDE_PATH) and is still enabled
by default, it's better to be prepared for its removal in the future.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
add .c file extension to build/test/metal-xxx-h generated file as
recommended by the Policy CMP0115
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
The return value should be negative.
Added inclusion of errno.h to avoid an unresolved symbol
error when linking the test.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Modify all the libmetal exemples and tests file to include <metal/errno.h>
instead of <errno.h>
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
In v2019.1, the xilmem and xilstandalone libraries were removed from
the standalone Xilinx BSP for the R5. This change adds a CMake
variable, XILINX_PRE_V2019, to conditionally add these libraries
to the link command for use with older BSPs.
Signed-off-by: Ed Mooring <ed.mooring@linaro.org>
libmetal's libmetal_sleep_usec() takes a sleep time in micro-seconds.
The FreeRTOS function underlying it takes a sleep time in task ticks.
This was not properly corrected for, resulting in sleep times that
were off by an order of magnitude. The test code attempted to
correct for this as well, in the same wrong way.
Lastly, the metal_get_timestamp() function returned a value in
task ticks alone. This is a configuration dependent value.
This patch changes all three places to use microseconds for the
input and output values.
Signed-off-by: Ed Mooring <ed.mooring@linaro.org>
During test we try to lock more memory than the limit
permitted.
This results in following traces:
metal: warning: failed to mlock shmem - Cannot allocate memory
metal: error: pagemap page not present, 3fd7560fd0 -> 80000000000000
metal: error: pagemap page not present, 3fd7560fd8 -> 80000000000000
metal: error: pagemap page not present, 3fd7560fe0 -> 80000000000000
metal: error: pagemap page not present, 3fd7560fe8 -> 80000000000000
[...]
This patch decreases the size of the shem to avoid to reach the limit
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
The API allows user to register IRQ handling after the 1st
registration.
It will be up to the user to make sure there is no double
registration.
Remove the checking from the unit test.
Signed-off-by: Wendy Liang <wendy.liang@xilinx.com>
The API allows user to register IRQ handling after the 1st
registration.
It will be up to the user to make sure there is no double
registration.
Remove the checking from the unit test.
Signed-off-by: Wendy Liang <wendy.liang@xilinx.com>
The API allows user to register IRQ handling after the 1st registration.
It will be up to the user to make sure there is no double registration.
Remove the checking from the unit test.
Signed-off-by: Wendy Liang <wendy.liang@xilinx.com>
As Zephyr's IRQ infrastructure is not lined up with libmetal
IRQ infrastructure. And the drivers in Zephyr declare ISR
at compile time, we can have libmetal IRQ handling on top of
of Zephyr, but it will introduce unnecessary overhead.
Signed-off-by: Wendy Liang <wendy.liang@xilinx.com>
The IRQ registration API has been updated to support single
handler per IRQ. The IRQ test is updated for this change.
Signed-off-by: Wendy Liang <wendy.liang@xilinx.com>
Now that we have a a zephyr specific METAL_INIT_DEFAULTS we can just
use the default param passed to metal_init like all the other systems do
rather than specifying a unique metal_params to Zephyr. This gets the
Zephyr logger used for output.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
There are assumptions that one could directly assign a value to init a
mutex which shouldn't be made. Instead we should use the
metal_mutex_init call to setup the mutex. Also for static or global
defines of a mutex we need a way to set them up. So we introduce
METAL_MUTEX_DEFINE(m) for that case.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Introduce a macro to abstract how we define a weak function as this
tends to be compiler specific.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Signed-off-by: Wendy Liang <jliang@xilinx.com>
In microblaze unit tests also provide setup for
axi interrupt controller and self test the controller
Signed-off-by: Ben Levinsky <ben.levinsky@xilinx.com>
Signed-off-by: Wendy Liang <jliang@xilinx.com>
Print error number if strerror() is not defined.
Not every system has strerror() defined.
Signed-off-by: Wendy Liang <jliang@xilinx.com>
test strerror
Signed-off-by: Wendy Liang <jliang@xilinx.com>
As different system may need different metal init parameters.
E.g. not every system has printf.
Add metal init params as input argument to metal_tests_run().
Signed-off-by: Wendy Liang <jliang@xilinx.com>
This change will save compilation time from looking into the directory
containing the current file for the header files.
Signed-off-by: Wendy Liang <jliang@xilinx.com>
There were three types of license text in some files in examples/
and test/. This patch is to clean those license text and only use
BSD license text.
Signed-off-by: Wendy Liang <jliang@xilinx.com>
Replace arm-specific instruction with externally defined
function for polling.
Signed-off-by: Ben Levinsky <ben.levinsky@xilinx.com>
Signed-off-by: Wendy Liang <jliang@xilinx.com>