Commit Graph

9 Commits

Author SHA1 Message Date
Carles Cufi e83a13aabf kconfig: Rename the TEST_EXTRA stack size option to align with the rest
All stack sizes should end with STACK_SIZE.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-02-22 08:23:05 -05:00
Daniel Leung ae415272c1 sys: heap_listener: extend to cover more events
This extends the heap_listener to cover more events,
specifically, allocation, free and realloc.

Note that typedef are used so the callback can be
documented.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-01-10 10:28:04 -05:00
Daniel Leung 39d17a180a sys: heap_listener: resize_cb to also take heap ID
Add a parameter to the resize callback to also take the heap ID.
This allows a single callback to be used for multiple heaps if
so desired.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-01-10 10:28:04 -05:00
Damian Krolik 3aedda9852 lib: os: add heap event listener
* add generic heap event listener module that can be used
  for notifying an application of heap-related events
* use the listener module in newlib libc hooks
* add a unit test

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
2021-12-18 07:49:15 -05:00
Stephanos Ioannidis fa7959c197 tests: newlib: thread_safety: Disable minimum newlib heap size check
This commit disables the "minimum required newlib heap size" check for
the newlib thread safety tests since they do not make use of any newlib
functions that require large heap.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-09-08 10:32:45 -04:00
Torsten Rasmussen 1cccc8a8fe cmake: increase minimal required version to 3.20.0
Move to CMake 3.20.0.

At the Toolchain WG it was decided to move to CMake 3.20.0.

The main reason for increasing CMake version is better toolchain
support.

Better toolchain support is added in the following CMake versions:
- armclang, CMake 3.15
- Intel oneAPI, CMake 3.20
- IAR, CMake 3.15 and 3.20

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-08-20 09:47:34 +02:00
Stephanos Ioannidis fb4325ea32 tests: newlib: thread_safety: Add internal lock and userspace tests
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>
2021-08-09 08:51:24 -05:00
Stephanos Ioannidis b37ee6998d tests: newlib: thread_safety: Fix test function scope
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>
2021-08-09 08:51:24 -05:00
Stephanos Ioannidis 6bc42ae309 tests: lib: Add newlib thread safety test
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>
2021-05-13 07:30:43 -05:00