aboutsummaryrefslogtreecommitdiff
path: root/macros/src/codegen/util.rs
diff options
context:
space:
mode:
Diffstat (limited to 'macros/src/codegen/util.rs')
-rw-r--r--macros/src/codegen/util.rs58
1 files changed, 5 insertions, 53 deletions
diff --git a/macros/src/codegen/util.rs b/macros/src/codegen/util.rs
index f4dbca39..2f9f3cce 100644
--- a/macros/src/codegen/util.rs
+++ b/macros/src/codegen/util.rs
@@ -25,24 +25,7 @@ pub fn capacity_typenum(capacity: u8, round_up_to_power_of_two: bool) -> TokenSt
quote!(rtic::export::consts::#ident)
}
-/*
-/// Generates a `#[cfg(core = "0")]` attribute if we are in multi-core mode
-pub fn cfg_core(core: Core, cores: u8) -> Option<TokenStream2> {
- if cores == 1 {
- None
- } else if cfg!(feature = "heterogeneous") {
- let core = core.to_string();
- Some(quote!(#[cfg(core = #core)]))
- } else {
- None
- }
-}
-*/
-
/// Identifier for the free queue
-///
-/// There may be more than one free queue per task because we need one for each sender core so we
-/// include the sender (e.g. `S0`) in the name
pub fn fq_ident(task: &Ident) -> Ident {
Ident::new(&format!("{}_FQ", task.to_string()), Span::call_site())
}
@@ -51,7 +34,6 @@ pub fn fq_ident(task: &Ident) -> Ident {
pub fn impl_mutex(
extra: &Extra,
cfgs: &[Attribute],
- //cfg_core: Option<&TokenStream2>,
resources_prefix: bool,
name: &Ident,
ty: TokenStream2,
@@ -67,7 +49,6 @@ pub fn impl_mutex(
let device = extra.device;
quote!(
#(#cfgs)*
- //#cfg_core
impl<'a> rtic::Mutex for #path<'a> {
type T = #ty;
@@ -90,13 +71,6 @@ pub fn impl_mutex(
)
}
-/*
-/// Generates an identifier for a cross-initialization barrier
-pub fn init_barrier(initializer: Core) -> Ident {
- Ident::new(&format!("IB{}", initializer), Span::call_site())
-}
-*/
-
/// Generates an identifier for the `INPUTS` buffer (`spawn` & `schedule` API)
pub fn inputs_ident(task: &Ident) -> Ident {
Ident::new(&format!("{}_INPUTS", task), Span::call_site())
@@ -138,18 +112,6 @@ fn link_section_index() -> usize {
INDEX.fetch_add(1, Ordering::Relaxed)
}
-pub fn link_section(_section: &str) -> Option<TokenStream2> {
- /*
- if cfg!(feature = "homogeneous") {
- let section = format!(".{}_{}.rtic{}", section, core, link_section_index());
- Some(quote!(#[link_section = #section]))
- } else {
- None
- }
- */
- None
-}
-
// NOTE `None` means in shared memory
pub fn link_section_uninit(empty_expr: bool) -> Option<TokenStream2> {
let section = if empty_expr {
@@ -175,13 +137,6 @@ pub fn locals_ident(ctxt: Context, app: &App) -> Ident {
Ident::new(&s, Span::call_site())
}
-/*
-/// Generates an identifier for a rendezvous barrier
-pub fn rendezvous_ident() -> Ident {
- Ident::new(&format!("RV"), Span::call_site())
-}
-*/
-
// Regroups the inputs of a task
//
// `inputs` could be &[`input: Foo`] OR &[`mut x: i32`, `ref y: i64`]
@@ -246,17 +201,15 @@ pub fn resources_ident(ctxt: Context, app: &App) -> Ident {
/// Generates an identifier for a ready queue
///
-/// Each core may have several task dispatchers, one for each priority level. Each task dispatcher
-/// in turn may use more than one ready queue because the queues are SPSC queues so one is needed
-/// per sender core.
+/// There may be several task dispatchers, one for each priority level.
+/// The ready queues are SPSC queues
pub fn rq_ident(priority: u8) -> Ident {
Ident::new(&format!("P{}_RQ", priority), Span::call_site())
}
/// Generates an identifier for a "schedule" function
///
-/// The methods of the `Schedule` structs invoke these functions. As one task may be `schedule`-ed
-/// by different cores we need one "schedule" function per possible task-sender pair
+/// The methods of the `Schedule` structs invoke these functions.
pub fn schedule_ident(name: &Ident) -> Ident {
Ident::new(&format!("schedule_{}", name.to_string()), Span::call_site())
}
@@ -268,8 +221,7 @@ pub fn schedule_t_ident() -> Ident {
/// Generates an identifier for a "spawn" function
///
-/// The methods of the `Spawn` structs invoke these functions. As one task may be `spawn`-ed by
-/// different cores we need one "spawn" function per possible task-sender pair
+/// The methods of the `Spawn` structs invoke these functions.
pub fn spawn_ident(name: &Ident) -> Ident {
Ident::new(&format!("spawn_{}", name.to_string()), Span::call_site())
}
@@ -289,7 +241,7 @@ pub fn suffixed(name: &str) -> Ident {
/// Generates an identifier for a timer queue
///
-/// At most there's one timer queue per core
+/// At most there is one timer queue
pub fn tq_ident() -> Ident {
Ident::new(&format!("TQ"), Span::call_site())
}