-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for hosted test environments
Add a new hosted test environment "processor". This is meant as a build target used when the code is not built for a real target but as part of a test in a hosted environment (for ex. as a test environment like Zephyr's native_sim target). When building for this target PROJECT_PROCESSOR should be set as "hosted". In this, the "metal_sleep_usec()" call is expected to be provided by the system folder headers. Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
- Loading branch information
Showing
3 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
collect (PROJECT_LIB_HEADERS atomic.h) | ||
collect (PROJECT_LIB_HEADERS cpu.h) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Copyright (c) 2023 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
|
||
/* | ||
* @file hosted/atomic.h | ||
* @brief Hosted environment atomic primitives for libmetal. | ||
*/ | ||
|
||
#ifndef __METAL_HOSTED_ATOMIC__H__ | ||
#define __METAL_HOSTED_ATOMIC__H__ | ||
|
||
#endif /* __METAL_HOSTED_ATOMIC__H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright (c) 2023 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
|
||
/* | ||
* @file hosted/cpu.h | ||
* @brief Hosted environment CPU specific primitives | ||
*/ | ||
|
||
#include <metal/sys.h> | ||
|
||
#ifndef __METAL_HOSTED_CPU__H__ | ||
#define __METAL_HOSTED_CPU__H__ | ||
|
||
static inline void metal_cpu_yield(void) | ||
{ | ||
metal_wait_usec(); | ||
} | ||
|
||
#endif /* __METAL_HOSTED_CPU__H__ */ |