Commit Graph

14 Commits

Author SHA1 Message Date
Aastha Grover 6f5c26d71e samples: kernel: condvar: add README
Add readme for the sample for conditional variables in kernel.

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
2022-07-08 21:06:33 -04:00
Stephanos Ioannidis ac04889ee0 samples: kernel: condition_variables: Remove unneeded `tstack` extern
This commit removes the `tstack` symbol extern that is not used
anywhere in this sample.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-06-20 10:25:52 +02:00
Gerard Marull-Paretas c7b5b3c419 samples: migrate includes to contain <zephyr/...> prefix
In order to bring consistency in-tree, migrate all samples to the use
the new prefix <zephyr/...>. Note that the conversion has been scripted:

```python
from pathlib import Path
import re

EXTENSIONS = ("c", "h", "cpp", "rst")

for p in Path(".").glob("samples/**/*"):
    if not p.is_file() or p.suffix and p.suffix[1:] not in EXTENSIONS:
        continue

    content = ""
    with open(p) as f:
        for line in f:
            m = re.match(r"^(.*)#include <(.*)>(.*)$", line)
            if (m and
                not m.group(2).startswith("zephyr/") and
                (Path(".") / "include" / "zephyr" / m.group(2)).exists()):
                content += (
                    m.group(1) +
                    "#include <zephyr/" + m.group(2) +">" +
                    m.group(3) + "\n"
                )
            else:
                content += line

    with open(p, "w") as f:
        f.write(content)
```

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 11:29:59 +02:00
Nazar Kazakov f483b1bc4c everywhere: fix typos
Fix a lot of typos

Signed-off-by: Nazar Kazakov <nazar.kazakov.work@gmail.com>
2022-03-18 13:24:08 -04:00
Enjia Mai 8300ffd302 samples: fix the metairq_dispatch sample sporadically failed on ehl_crb
The metairq sample sometimes failed due to stuck because it has a
potential race when recording the latencies. The previous solution
checks whether the stats.mirq greater than MAX_EVENT. But stats.mirq
might also have a race here. So we change to check the msg sequence,
its correctness ensured by the kernel's message queue.

And also remove the spinlock in previous fix because tests only use
1 CPU, no need to add this. It also improves the fix for #40889,
to prevent test failed sporadically on acrn_ehl_crb and ehl_crb.

Fix #42874.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-03-09 14:09:12 -05:00
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
Enjia Mai 6bec54401b samples: fix the metairq_dispatch sample failed on acrn_ehl_crb
The samples/kernel/metairq_dispatch runs failed on acrn_ehl_crb
due to the potential race condition in accessing the global stat
data. Add a spinlock to prevent this.

Fixes #40889

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-02-10 08:55:39 -05:00
Christopher Friedt 7ea93a8853 tests: kernel: cycle64: mark test as slow
Previously cycle64 was under `samples/`. It's been moved to
`tests/` and has been marked with `slow: True` so that it
will not disrupt CI by adding excessive delays.

Fixes #40367

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-11-29 10:35:49 -05:00
Christopher Friedt 43856f2dc6 samples: kernel: add cycle64 sample
The cycle64 sample is intended to complement
`test_clock_cycle_64()` in `tests/kernel/common`.

The sample demonstrates the upper 32-bits of the 64-bit cycle
counter incrementing when the bottom 32-bits roll over from
`UINT32_MAX` to 0.

If the upper 32-bits of the 64-bit cycle counter does not
increment, then an error message is printed.

```
west build -p auto -b qemu_cortex_a53 -t run \
	samples/kernel/cycle64
...
*** Booting Zephyr OS build v2.7.99-1124-gd7ba4e394832  ***
wrap-around should occur in 68s
[ddd:hh:mm:ss.0ms]
[000:00:00:00.020]: c64: 0000000000174258
[000:00:01:08.760]: c64: 000000010027f8bb
[000:00:02:17.490]: c64: 0000000200348c85
```

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-11-08 13:41:53 -05: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
Paul He d61f3a7562 samples: metairq_dispatch: use name msgdev.h instead of main.h
Normally main.c file doesn't have a header, beacuse it doesn't need to
be declared to other modules.

And in this sample it makes more sense to use name msgdev.h instead of
main.h as the header file for msgdev.c.

Signed-off-by: Paul He <pawpawhe@gmail.com>
2021-04-19 10:32:39 +02:00
Anas Nashif 364c0bee31 samples: move kernel samples into one folder
Move kenrel samples into one directory.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-09 17:48:18 -05:00
Kumar Gala ca3bf282b6 samples: condition_variables: set integration_platforms to native_posix
Set integration_platforms on these samples to just native_posix.  This
should be sufficient to make sure these tests build and run.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-25 10:36:02 -05:00
Anas Nashif 930789dbe7 samples: kernel: add condition variable samples
Add a few samples for using condition variables..

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-01-19 08:55:47 -05:00