mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-19 14:25:18 +01:00
Prepare for new riscv ecosystem
This commit is contained in:
parent
bac77de9bc
commit
183e73904a
14 changed files with 164 additions and 134 deletions
|
|
@ -1,16 +1,27 @@
|
|||
use syn::{
|
||||
parse::{Parse, ParseStream},
|
||||
Ident, Result,
|
||||
Result,
|
||||
};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct BackendArgs {
|
||||
pub hart_id: Ident,
|
||||
#[cfg(feature = "riscv-clint")]
|
||||
pub hart_id: syn::Ident,
|
||||
}
|
||||
|
||||
impl Parse for BackendArgs {
|
||||
fn parse(input: ParseStream) -> Result<Self> {
|
||||
let hart_id = input.parse()?;
|
||||
Ok(BackendArgs { hart_id })
|
||||
match () {
|
||||
#[cfg(feature = "riscv-clint")]
|
||||
() => {
|
||||
let hart_id = input.parse()?;
|
||||
Ok(BackendArgs { hart_id })
|
||||
}
|
||||
#[cfg(feature = "riscv-mecall")]
|
||||
() => Err(syn::Error::new(
|
||||
input.span(),
|
||||
"riscv-mecall backend does not accept any arguments",
|
||||
)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue