aboutsummaryrefslogtreecommitdiff
path: root/lib/std/debug.zig
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2024-08-12 03:51:48 +0200
committerAndrew Kelley <andrew@ziglang.org>2024-08-13 23:54:20 -0700
commitb470d2a7de20f8036c8976ec18ed1fb16a15c662 (patch)
treeeade5bfb856a092c8cb1305fa7746a0daebd6ee5 /lib/std/debug.zig
parentdc77d1b66dc67c6fcfeafdfd079dab79c320d2b1 (diff)
downloadzig-b470d2a7de20f8036c8976ec18ed1fb16a15c662.tar.gz
zig-b470d2a7de20f8036c8976ec18ed1fb16a15c662.zip
std.debug: Support sparc32 in StackIterator.init().
Diffstat (limited to 'lib/std/debug.zig')
-rw-r--r--lib/std/debug.zig8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig
index a3a8a533ee..5ddc751f3d 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");
}