Re: [PATCH v6 5/5] rust: add arch_static_branch

From
Peter Zijlstra <peterz@infradead.org>
Date
2024-08-10 21:04:35
Also in
linux-arch, linux-riscv, lkml, loongarch, rust-for-linux
Reply to
Alice Ryhl, 2024-08-08
On Thu, Aug 08, 2024 at 05:23:41PM +0000, Alice Ryhl wrote:
quoted hunk ↗ jump to hunk
+/// Wrapper around `asm!` that uses at&t syntax on x86.
+// Uses a semicolon to avoid parsing ambiguities, even though this does not match native `asm!`
+// syntax.
+#[cfg(target_arch = "x86_64")]
+#[macro_export]
+macro_rules! asm {
+    ($($asm:expr),* ; $($rest:tt)*) => {
+        ::core::arch::asm!( $($asm)*, options(att_syntax), $($rest)* )
+    };
+}
+
+/// Wrapper around `asm!` that uses at&t syntax on x86.
^ the above line seems out of place given the 'not' below.
+// For non-x86 arches we just pass through to `asm!`.
+#[cfg(not(target_arch = "x86_64"))]
         ^^^
quoted hunk ↗ jump to hunk
+#[macro_export]
+macro_rules! asm {
+    ($($asm:expr),* ; $($rest:tt)*) => {
+        ::core::arch::asm!( $($asm)*, $($rest)* )
+    };
+}
Thread (14 messages) 14 messages, 3 authors, last reply 2024-08-12
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help