As of today <zephyr/zephyr.h> is 100% equivalent to <zephyr/kernel.h>.
This patch proposes to then include <zephyr/kernel.h> instead of
<zephyr/zephyr.h> since it is more clear that you are including the
Kernel APIs and (probably) nothing else. <zephyr/zephyr.h> sounds like a
catch-all header that may be confusing. Most applications need to
include a bunch of other things to compile, e.g. driver headers or
subsystem headers like BT, logging, etc.
The idea of a catch-all header in Zephyr is probably not feasible
anyway. Reason is that Zephyr is not a library, like it could be for
example `libpython`. Zephyr provides many utilities nowadays: a kernel,
drivers, subsystems, etc and things will likely grow. A catch-all header
would be massive, difficult to keep up-to-date. It is also likely that
an application will only build a small subset. Note that subsystem-level
headers may use a catch-all approach to make things easier, though.
NOTE: This patch is **NOT** removing the header, just removing its usage
in-tree. I'd advocate for its deprecation (add a #warning on it), but I
understand many people will have concerns.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Add a bunch of missing "zephyr/" prefixes to #include statements in
various test and test framework files.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
In order to bring consistency in-tree, migrate all tests to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to #45388 for more details.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit adds the tests for the newlib retargetable locking
interface, as well as the tests for the internal lock functions that
are supposed to internally invoke the retargetable locking interface.
All of these tests must pass when the toolchain newlib is compiled with
the `retargetable-locking` and `multithread` options, which are
required to ensure that the newlib is thread-safe, enabled. If the
toolchain newlib is compiled with either of these options disabled,
this test will fail.
This commit also adds the userspace testcases to ensure that the newlib
is thread-safe in the user mode.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit adds the `static` keyword to the test functions that are
not intended to be globally available.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit adds a new test to verify the thread safety of the C
standard functions provided by newlib.
Only the memory management functions (malloc and free) are tested at
this time; this test will be further extended in the future, to verify
the thread safety and re-entrancy of all supported newlib functions.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>