-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make libmetal usable also for RISCV targets. Signed-off-by: Carlo Caione <ccaione@baylibre.com>
- Loading branch information
1 parent
210b9ec
commit c6ae2c6
Showing
4 changed files
with
54 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
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 sys.h) | ||
collect (PROJECT_LIB_SOURCES sys.c) |
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) 2021 Carlo Caione <ccaione@baylibre.com> | ||
* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
|
||
/* | ||
* @file zephyr/riscv/sys.c | ||
* @brief machine specific system primitives implementation. | ||
*/ | ||
|
||
#include <metal/io.h> | ||
#include <metal/sys.h> | ||
#include <stdint.h> | ||
|
||
/** | ||
* @brief poll function until some event happens | ||
*/ | ||
void metal_weak metal_generic_default_poll(void) | ||
{ | ||
metal_asm __volatile__("wfi"); | ||
} |
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,27 @@ | ||
/* | ||
* Copyright (c) 2021 Carlo Caione <ccaione@baylibre.com> | ||
* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
|
||
/* | ||
* @file zephyr/riscv/sys.h | ||
* @brief Zephyr riscv system primitives for libmetal. | ||
*/ | ||
|
||
#ifndef __METAL_ZEPHYR_SYS__H__ | ||
#error "Include metal/sys.h instead of metal/generic/@PROJECT_MACHINE@/sys.h" | ||
#endif | ||
|
||
#ifndef __METAL_ZEPHYR_RISCV_SYS__H__ | ||
#define __METAL_ZEPHYR_RISCV_SYS__H__ | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* __METAL_ZEPHYR_RISCV_SYS__H__ */ |