From 5f49e3a00e34eaa7700f3341220ffccd7b300daa Mon Sep 17 00:00:00 2001 From: Nick Spinale Date: Wed, 20 May 2026 00:42:39 -0700 Subject: [PATCH] Support aarch32 without requiring codegen flags For aarch32, using the 'hvc' and 'smc' instructions in 'asm!()' requires '-C target-feature=+virtualization,+trustzone'. By replacing 'hvc #0' and 'smc #0' with their corresponding opcodes (one instance each), we can support aarch32 without requiring these codegen flags. Signed-off-by: Nick Spinale --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index b016bf4..807be22 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -94,7 +94,7 @@ pub fn hvc32(function: u32, args: [u32; 7]) -> [u32; 8] { "mov {tmp7}, r7", "mov r6, {r6_value}", "mov r7, {r7_value}", - "hvc #0", + ".inst 0xe1400070", // hvc #0, without requiring -C target-feature=+virtualization "mov {r6_value}, r6", "mov {r7_value}, r7", "mov r6, {tmp6}", @@ -144,7 +144,7 @@ pub fn smc32(function: u32, args: [u32; 7]) -> [u32; 8] { "mov {tmp7}, r7", "mov r6, {r6_value}", "mov r7, {r7_value}", - "smc #0", + ".inst 0xe1600070", // smc #0, without requiring -C target-feature=+trustzone "mov {r6_value}, r6", "mov {r7_value}, r7", "mov r6, {tmp6}",