diff options
| author | Robin Mueller <[email protected]> | 2025-11-02 19:06:05 +0100 |
|---|---|---|
| committer | Robin Mueller <[email protected]> | 2025-11-02 19:30:23 +0100 |
| commit | fd40f3e2f2efb67434a9e7d90eb35a30e30d1736 (patch) | |
| tree | d0dc8ffcdc6ae4dc20a2b92477f34ea3e113544a /embassy-executor | |
| parent | 3ff0b2c5971e72a93bd37d7f8fecbc8e64421360 (diff) | |
Migrate from cortex-ar to aarch32-cpu
- Feature name `arch-cortex-ar` remains the same.
- Legacy ARM architectures are not supported.
Diffstat (limited to 'embassy-executor')
| -rw-r--r-- | embassy-executor/CHANGELOG.md | 3 | ||||
| -rw-r--r-- | embassy-executor/Cargo.toml | 9 | ||||
| -rw-r--r-- | embassy-executor/build.rs | 5 | ||||
| -rw-r--r-- | embassy-executor/src/arch/cortex_ar.rs | 7 |
4 files changed, 18 insertions, 6 deletions
diff --git a/embassy-executor/CHANGELOG.md b/embassy-executor/CHANGELOG.md index 47a8ae995..5fbb8cf13 100644 --- a/embassy-executor/CHANGELOG.md +++ b/embassy-executor/CHANGELOG.md | |||
| @@ -13,7 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
| 13 | - Upgraded rtos-trace | 13 | - Upgraded rtos-trace |
| 14 | - Added optional "highest priority" scheduling | 14 | - Added optional "highest priority" scheduling |
| 15 | - Added optional "earliest deadline first" EDF scheduling | 15 | - Added optional "earliest deadline first" EDF scheduling |
| 16 | - Bump `cortex-ar` to v0.3 | 16 | - Migrate `cortex-ar` to `aarch32-cpu`. The feature name `arch-cortex-ar` remains the same and |
| 17 | legacy ARM architectures are not supported. | ||
| 17 | 18 | ||
| 18 | ## 0.9.1 - 2025-08-31 | 19 | ## 0.9.1 - 2025-08-31 |
| 19 | 20 | ||
diff --git a/embassy-executor/Cargo.toml b/embassy-executor/Cargo.toml index e500833c0..d3e5b241a 100644 --- a/embassy-executor/Cargo.toml +++ b/embassy-executor/Cargo.toml | |||
| @@ -102,7 +102,7 @@ portable-atomic = { version = "1.5", optional = true } | |||
| 102 | cortex-m = { version = "0.7.6", optional = true } | 102 | cortex-m = { version = "0.7.6", optional = true } |
| 103 | 103 | ||
| 104 | # arch-cortex-ar dependencies | 104 | # arch-cortex-ar dependencies |
| 105 | cortex-ar = { version = "0.3", optional = true } | 105 | aarch32-cpu = { version = "0.1", optional = true } |
| 106 | 106 | ||
| 107 | # arch-wasm dependencies | 107 | # arch-wasm dependencies |
| 108 | wasm-bindgen = { version = "0.2.82", optional = true } | 108 | wasm-bindgen = { version = "0.2.82", optional = true } |
| @@ -130,7 +130,7 @@ nightly = ["embassy-executor-macros/nightly"] | |||
| 130 | ## Enable defmt logging | 130 | ## Enable defmt logging |
| 131 | defmt = ["dep:defmt"] | 131 | defmt = ["dep:defmt"] |
| 132 | 132 | ||
| 133 | ## Enable log logging | 133 | ## Enable log logging |
| 134 | log = ["dep:log"] | 134 | log = ["dep:log"] |
| 135 | 135 | ||
| 136 | # Enables turbo wakers, which requires patching core. Not surfaced in the docs by default due to | 136 | # Enables turbo wakers, which requires patching core. Not surfaced in the docs by default due to |
| @@ -145,7 +145,7 @@ arch-std = ["_arch"] | |||
| 145 | ## Cortex-M | 145 | ## Cortex-M |
| 146 | arch-cortex-m = ["_arch", "dep:cortex-m"] | 146 | arch-cortex-m = ["_arch", "dep:cortex-m"] |
| 147 | ## Cortex-A/R | 147 | ## Cortex-A/R |
| 148 | arch-cortex-ar = ["_arch", "dep:cortex-ar"] | 148 | arch-cortex-ar = ["_arch", "dep:aarch32-cpu", "dep:arm-targets"] |
| 149 | ## RISC-V 32 | 149 | ## RISC-V 32 |
| 150 | arch-riscv32 = ["_arch"] | 150 | arch-riscv32 = ["_arch"] |
| 151 | ## WASM | 151 | ## WASM |
| @@ -182,3 +182,6 @@ scheduler-priority = [] | |||
| 182 | ## Enable the embassy_time_driver dependency. | 182 | ## Enable the embassy_time_driver dependency. |
| 183 | ## This can unlock extra APIs, for example for the `sheduler-deadline` | 183 | ## This can unlock extra APIs, for example for the `sheduler-deadline` |
| 184 | embassy-time-driver = ["dep:embassy-time-driver"] | 184 | embassy-time-driver = ["dep:embassy-time-driver"] |
| 185 | |||
| 186 | [build-dependencies] | ||
| 187 | arm-targets = { version = "0.4", optional = true } | ||
diff --git a/embassy-executor/build.rs b/embassy-executor/build.rs index 37becde3e..36e23a632 100644 --- a/embassy-executor/build.rs +++ b/embassy-executor/build.rs | |||
| @@ -4,4 +4,9 @@ mod common; | |||
| 4 | fn main() { | 4 | fn main() { |
| 5 | let mut rustc_cfgs = common::CfgSet::new(); | 5 | let mut rustc_cfgs = common::CfgSet::new(); |
| 6 | common::set_target_cfgs(&mut rustc_cfgs); | 6 | common::set_target_cfgs(&mut rustc_cfgs); |
| 7 | |||
| 8 | // This is used to exclude legacy architecture support. The raw executor needs to be used for | ||
| 9 | // those architectures because SEV/WFE are not supported. | ||
| 10 | #[cfg(feature = "arch-cortex-ar")] | ||
| 11 | arm_targets::process(); | ||
| 7 | } | 12 | } |
diff --git a/embassy-executor/src/arch/cortex_ar.rs b/embassy-executor/src/arch/cortex_ar.rs index a9be3d323..ce572738a 100644 --- a/embassy-executor/src/arch/cortex_ar.rs +++ b/embassy-executor/src/arch/cortex_ar.rs | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | #[cfg(arm_profile = "legacy")] | ||
| 2 | compile_error!("`arch-cortex-ar` does not support the legacy ARM profile, WFE/SEV are not available."); | ||
| 3 | |||
| 1 | #[cfg(feature = "executor-interrupt")] | 4 | #[cfg(feature = "executor-interrupt")] |
| 2 | compile_error!("`executor-interrupt` is not supported with `arch-cortex-ar`."); | 5 | compile_error!("`executor-interrupt` is not supported with `arch-cortex-ar`."); |
| 3 | 6 | ||
| @@ -10,7 +13,7 @@ fn __pender(context: *mut ()) { | |||
| 10 | #[cfg(feature = "executor-thread")] | 13 | #[cfg(feature = "executor-thread")] |
| 11 | // Try to make Rust optimize the branching away if we only use thread mode. | 14 | // Try to make Rust optimize the branching away if we only use thread mode. |
| 12 | if !cfg!(feature = "executor-interrupt") || context == THREAD_PENDER { | 15 | if !cfg!(feature = "executor-interrupt") || context == THREAD_PENDER { |
| 13 | cortex_ar::asm::sev(); | 16 | aarch32_cpu::asm::sev(); |
| 14 | return; | 17 | return; |
| 15 | } | 18 | } |
| 16 | } | 19 | } |
| @@ -23,7 +26,7 @@ mod thread { | |||
| 23 | 26 | ||
| 24 | use core::marker::PhantomData; | 27 | use core::marker::PhantomData; |
| 25 | 28 | ||
| 26 | use cortex_ar::asm::wfe; | 29 | use aarch32_cpu::asm::wfe; |
| 27 | pub use embassy_executor_macros::main_cortex_ar as main; | 30 | pub use embassy_executor_macros::main_cortex_ar as main; |
| 28 | 31 | ||
| 29 | use crate::{Spawner, raw}; | 32 | use crate::{Spawner, raw}; |
