From b470d2a7de20f8036c8976ec18ed1fb16a15c662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Mon, 12 Aug 2024 03:51:48 +0200 Subject: [PATCH] std.debug: Support sparc32 in StackIterator.init(). --- lib/std/debug.zig | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/std/debug.zig b/lib/std/debug.zig index a3a8a533eed0..5ddc751f3d4e 100644 --- a/lib/std/debug.zig +++ b/lib/std/debug.zig @@ -567,10 +567,12 @@ pub const StackIterator = struct { } else void = if (have_ucontext) null else {}, pub fn init(first_address: ?usize, fp: ?usize) StackIterator { - if (native_arch == .sparc64) { + if (native_arch.isSPARC()) { // Flush all the register windows on stack. - asm volatile ( - \\ flushw + asm volatile (if (std.Target.sparc.featureSetHas(builtin.cpu.features, .v9)) + "flushw" + else + "ta 3" // ST_FLUSH_WINDOWS ::: "memory"); }