| 1 | /// Hook into .init_array to enable LSE atomic operations at startup, if |
| 2 | /// supported. |
| 3 | #[cfg (all(target_arch = "aarch64" , target_os = "linux" , not(feature = "compiler-builtins-c" )))] |
| 4 | #[used ] |
| 5 | #[unsafe(link_section = ".init_array.90" )] |
| 6 | static RUST_LSE_INIT: extern "C" fn() = { |
| 7 | extern "C" fn init_lse() { |
| 8 | use crate::arch; |
| 9 | |
| 10 | // This is provided by compiler-builtins::aarch64_linux. |
| 11 | unsafe extern "C" { |
| 12 | fn __rust_enable_lse(); |
| 13 | } |
| 14 | |
| 15 | if arch::is_aarch64_feature_detected!("lse" ) { |
| 16 | unsafe { |
| 17 | __rust_enable_lse(); |
| 18 | } |
| 19 | } |
| 20 | } |
| 21 | init_lse |
| 22 | }; |
| 23 | |