Commit Graph

28 Commits

Author SHA1 Message Date
Andrew Boie 16317c1a9f lib: cmsis_v2: set default dynamic stack size
Set to same default as regular stacks. This doesn't use
any extra memory until CMSIS_V2_THREAD_DYNAMIC_MAX_COUNT
is set. 0 is not a valid default if that is set.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-05-02 15:42:33 -04:00
Andrew Boie 81a556688a tests: cmsis_v2: don't hard-code stack sizes
Just use the configured value.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-05-02 15:42:33 -04:00
Anas Nashif 3ae52624ff license: cleanup: add SPDX Apache-2.0 license identifier
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier.  Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.

By default all files without license information are under the default
license of Zephyr, which is Apache version 2.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-07 08:45:22 -04:00
Andrew Boie 3f2d2f1d54 tests: cmsis_rtos_v2: fix thread checks
It's really not possible to design a test where we can
enforce expectations on real vs. expected stack size:

- Some platforms may increase stack size over what is expected
  due to rounding up the stack buffer area to the next power
  of two.

- Some configuration options like CONFIG_STACK_RANDOM
  carve out space in the stack buffer, resulting in a stack
  size less than what is expected.

Best we can do is just assert that the amount of space
available should be less than the total size reported.

Fixes: #14640

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-04-02 20:11:06 -04:00
Patrik Flykt 24d71431e9 all: Add 'U' suffix when using unsigned variables
Add a 'U' suffix to values when computing and comparing against
unsigned variables.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-28 17:15:58 -05:00
Patrik Flykt 4344e27c26 all: Update reserved function names
Update reserved function names starting with one underscore, replacing
them as follows:
   '_k_' with 'z_'
   '_K_' with 'Z_'
   '_handler_' with 'z_handl_'
   '_Cstart' with 'z_cstart'
   '_Swap' with 'z_swap'

This renaming is done on both global and those static function names
in kernel/include and include/. Other static function names in kernel/
are renamed by removing the leading underscore. Other function names
not starting with any prefix listed above are renamed starting with
a 'z_' or 'Z_' prefix.

Function names starting with two or three leading underscores are not
automatcally renamed since these names will collide with the variants
with two or three leading underscores.

Various generator scripts have also been updated as well as perf,
linker and usb files. These are
   drivers/serial/uart_handlers.c
   include/linker/kobject-text.ld
   kernel/include/syscall_handler.h
   scripts/gen_kobject_list.py
   scripts/gen_syscall_header.py

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-11 13:48:42 -04:00
Carlos Stuart ae07bd4725 tests: cmsis_rtos_v2: Join and detach tests
Implemented tests for the new join and detach features.

 - The first tests multiple join operations.
 - The second tests trying to join a detached thread.
 - The third tests abandoning a join when the thread is detached after
creation.

Signed-off-by: Carlos Stuart <carlosstuart1970@gmail.com>
2019-02-08 11:59:38 -05:00
Andrew Boie 84c808918b tests: set CONFIG_MAX_THREAD_BYTES for a few tests
Some tests instantiate a lot of thread objects. These
were not tagged with __kernel, and
CONFIG_APPLICATION_MEMORY was enabled, so the kernel was
not adding them to the kernel object database.

However, with CONFIG_APPLICATION_MEMORY disabled, this
overflowed the default max number of thread objects (16).
Increase the max to 32 for these particular tests.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-02-08 07:04:30 -05:00
Carlos Stuart c6375729ff tests: cmsis_rtos_v2: Dynamic thread stack tests
Added a set of tests that use the default thread stacks to ensure they
work the same as the passed in stacks. Abstracted the common
functionality into functions.

Signed-off-by: Carlos Stuart <carlosstuart1970@gmail.com>
2019-02-06 10:20:17 -05:00
Carlos Stuart db24367652 tests: cmsis_rtos_v2: Dynamic memory pool tests
Implemented a second set of memory pool tests that function on a
dynamically allocated memory pool. Abstracted some of the common
functionality to a common function.

Signed-off-by: Carlos Stuart <carlosstuart1970@gmail.com>
2019-02-06 10:20:17 -05:00
Carlos Stuart b484884c1e tests: cmsis_rtos_v2: Uncrustify source files
Ran uncrustify on all test source files to ensure a compliant base to
work from.

Signed-off-by: Carlos Stuart <carlosstuart1970@gmail.com>
2019-02-06 10:20:17 -05:00
Andy Ross c2c9265b7d tests: cmsis: Disable two cmsis portability tests on x86_64
These two tests are hitting a stack overflow on x86_64 (not entirely
surprisingly), but can't just increase stack size because there is an
assert in the CMSIS compatibility layer that stacks be under 512
bytes.  Just disable for now.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-01-11 15:18:52 -05:00
Alberto Escolar Piedras 32bd2df029 tests: cmsis_rtos_v2: Bugfix in test which leads to random errors
Fix a quite silly bug in the testcase which led to random failures
on execution.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-01-04 11:50:51 -05:00
Spoorthi K 319e87a78c tests: cmsis_rtos_v2: Enhance semaphore tests
Add negative tests for semaphore APIs supported in
CMSIS RTOS V2 layer.

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2019-01-03 12:39:39 -05:00
Spoorthi K 9bf535eede tests: cmsis_rtos_v2: Enhance msgq tests
Add negative tests for msgq APIs supported
in CMSIS RTOS v2 layer.

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2019-01-03 12:39:39 -05:00
Spoorthi K 9296114fc2 tests: cmsis_rtos_v2: Enhance mempool tests
Add negative tests for mempool APIs supported
in CMSIS RTOS V2 layer.

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2019-01-03 12:39:39 -05:00
Spoorthi K f45eb2ac6f tests: cmsis_rtos_v2: Enhance event flags tests
Add negative tests for event flags supported in
CMSIS RTOS V2 layer.

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2019-01-03 12:39:39 -05:00
Spoorthi K 0f375034da tests: cmsis_rtos_v2: Add tests for kernel management APIs
Add negative scenarios, API tests and improve
test coverage for kernel management APIs supported
in CMSIS RTOS V2 portability layer.

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2019-01-03 12:39:39 -05:00
Anas Nashif 5060ca6a30 cmake: increase minimal required version to 3.13.1
Move to latest cmake version with many bug fixes and enhancements.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-01-03 11:51:29 -05:00
Rajavardhan Gundi b6ab4e8a7f tests/cmsis_rtos_v2: Use CONFIG_SCHED_SCALABLE
Using multi-queue scheduler doesn't work for cmsis_rtos_v2 as it
supports a max of only 32 priority levels which is less than the
total priority levels required by cmsis_rtos_v2 (which is 56).
Hence explicitly asking the tests to use the scalable scheduler.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-12-20 12:23:22 +01:00
Rajavardhan Gundi 50d321943e tests/cmsis_rtos_v2: Introduce tests to make use of ThreadFlags APIs
Some test programs to illustrate the usage of ThreadFlags APIs.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-12-20 12:23:22 +01:00
Rajavardhan Gundi 7ffa3455fb tests/cmsis_rtos_v2: Introduce tests to make use of EventFlag APIs
Some test programs to illustrate the usage of EventFlag APIs.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-12-20 12:23:22 +01:00
Rajavardhan Gundi ff911f7fdf tests/cmsis_rtos_v2: Introduce tests to make use of messageQ APIs
Some test programs to illustrate the usage of msgq APIs.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-12-20 12:23:22 +01:00
Rajavardhan Gundi 00ffaed189 tests/cmsis_rtos_v2: Introduce tests to make use of mempool APIs
Some test programs to illustrate the usage of mempool APIs.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-12-20 12:23:22 +01:00
Rajavardhan Gundi c58733c302 tests/cmsis_rtos_v2: Introduce tests to make use of Semaphore APIs
Some test programs to illustrate the usage of Semaphore APIs.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-12-20 12:23:22 +01:00
Rajavardhan Gundi a1eaa23fe3 tests/cmsis_rtos_v2: Introduce tests to make use of Mutex APIs
Some test programs to illustrate the usage of Mutex APIs.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-12-20 12:23:22 +01:00
Rajavardhan Gundi 2b22e30888 tests/cmsis_rtos_v2: Introduce tests to make use of Timer APIs
Some test programs to illustrate the usage of timer APIs.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-12-20 12:23:22 +01:00
Rajavardhan Gundi d6c50517d9 tests/cmsis_rtos_v2: Introduce tests to make use of Thread APIs
Some test programs to illustrate the usage of thread APIs.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-12-20 12:23:22 +01:00