aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Thread.zig
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2024-06-22 14:54:03 +0200
committerAlex Rønne Petersen <alex@alexrp.com>2024-07-29 09:50:09 +0200
commitb83d10214bf723c21a912e809fb39f4407dae927 (patch)
tree0fbccbb3f33f4e2fe928d12c2d3a674c18b44682 /lib/std/Thread.zig
parentb958225e687c3b044d52a5adcb58dfb413ee141a (diff)
downloadzig-b83d10214bf723c21a912e809fb39f4407dae927.tar.gz
zig-b83d10214bf723c21a912e809fb39f4407dae927.zip
std.Thread: Implement LinuxThreadImpl.ThreadCompletion.freeAndExit() for riscv32.
Diffstat (limited to 'lib/std/Thread.zig')
-rw-r--r--lib/std/Thread.zig13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/std/Thread.zig b/lib/std/Thread.zig
index e19f473e44..2c724b3b75 100644
--- a/lib/std/Thread.zig
+++ b/lib/std/Thread.zig
@@ -1171,6 +1171,19 @@ const LinuxThreadImpl = struct {
[len] "r" (self.mapped.len),
: "memory"
),
+ .riscv32 => asm volatile (
+ \\ li a7, 215
+ \\ mv a0, %[ptr]
+ \\ mv a1, %[len]
+ \\ ecall
+ \\ li a7, 93
+ \\ mv a0, zero
+ \\ ecall
+ :
+ : [ptr] "r" (@intFromPtr(self.mapped.ptr)),
+ [len] "r" (self.mapped.len),
+ : "memory"
+ ),
.riscv64 => asm volatile (
\\ li a7, 215
\\ mv a0, %[ptr]