aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2023-04-23 18:54:28 +0000
committerGitHub <[email protected]>2023-04-23 18:54:28 +0000
commitd78edba0d4d73549e5f94f94049e6e4526e5a646 (patch)
tree9845a05192bcabe55596782842d952961d18f3eb
parentfb27594b2eb2cca2aea25dd92a7b730c185b6ecc (diff)
parentb283f213d99c5bfb888f450270dca699ae096fca (diff)
Merge #1392
1392: embassy-rp : Fix for division intrinsics clashing with rp2040-hal r=Dirbaio a=peterkrull Commit [7a682ec](https://github.com/embassy-rs/embassy/commit/7a682ec02af50026d31296ce5cac6383580f5e55#diff-f121955242a67342004444b26214e5d1d591c3182dcd0fedf4329ad472cd1200) may break compilation if also using `rp2040-hal`. It seems that the rp2040-hal does have a feature flag for [disabling intrinsics](https://github.com/rp-rs/rp-hal/blob/2c9921cdc578bfcbd5c6e0eb0085bb91f9a7e229/rp2040-hal/src/sio.rs#L323), but I still cannot seem to compile with that enabled. Adding these flags fixes it for me. Co-authored-by: Peter Krull <[email protected]>
-rw-r--r--embassy-rp/src/intrinsics.rs16
1 files changed, 9 insertions, 7 deletions
diff --git a/embassy-rp/src/intrinsics.rs b/embassy-rp/src/intrinsics.rs
index 3b63846d4..3baabb287 100644
--- a/embassy-rp/src/intrinsics.rs
+++ b/embassy-rp/src/intrinsics.rs
@@ -361,10 +361,11 @@ macro_rules! division_function {
361 #[cfg(all(target_arch = "arm", feature = "intrinsics"))] 361 #[cfg(all(target_arch = "arm", feature = "intrinsics"))]
362 core::arch::global_asm!( 362 core::arch::global_asm!(
363 // Mangle the name slightly, since this is a global symbol. 363 // Mangle the name slightly, since this is a global symbol.
364 concat!(".global _rphal_", stringify!($name)), 364 concat!(".section .text._erphal_", stringify!($name)),
365 concat!(".type _rphal_", stringify!($name), ", %function"), 365 concat!(".global _erphal_", stringify!($name)),
366 concat!(".type _erphal_", stringify!($name), ", %function"),
366 ".align 2", 367 ".align 2",
367 concat!("_rphal_", stringify!($name), ":"), 368 concat!("_erphal_", stringify!($name), ":"),
368 $( 369 $(
369 concat!(".global ", stringify!($intrinsic)), 370 concat!(".global ", stringify!($intrinsic)),
370 concat!(".type ", stringify!($intrinsic), ", %function"), 371 concat!(".type ", stringify!($intrinsic), ", %function"),
@@ -379,10 +380,11 @@ macro_rules! division_function {
379 #[cfg(all(target_arch = "arm", not(feature = "intrinsics")))] 380 #[cfg(all(target_arch = "arm", not(feature = "intrinsics")))]
380 core::arch::global_asm!( 381 core::arch::global_asm!(
381 // Mangle the name slightly, since this is a global symbol. 382 // Mangle the name slightly, since this is a global symbol.
382 concat!(".global _rphal_", stringify!($name)), 383 concat!(".section .text._erphal_", stringify!($name)),
383 concat!(".type _rphal_", stringify!($name), ", %function"), 384 concat!(".global _erphal_", stringify!($name)),
385 concat!(".type _erphal_", stringify!($name), ", %function"),
384 ".align 2", 386 ".align 2",
385 concat!("_rphal_", stringify!($name), ":"), 387 concat!("_erphal_", stringify!($name), ":"),
386 388
387 "hwdivider_head", 389 "hwdivider_head",
388 $($begin),+ , 390 $($begin),+ ,
@@ -392,7 +394,7 @@ macro_rules! division_function {
392 #[cfg(target_arch = "arm")] 394 #[cfg(target_arch = "arm")]
393 extern "aapcs" { 395 extern "aapcs" {
394 // Connect a local name to global symbol above through FFI. 396 // Connect a local name to global symbol above through FFI.
395 #[link_name = concat!("_rphal_", stringify!($name)) ] 397 #[link_name = concat!("_erphal_", stringify!($name)) ]
396 fn $name(n: $argty, d: $argty) -> u64; 398 fn $name(n: $argty, d: $argty) -> u64;
397 } 399 }
398 400