Skip to content

Commit

Permalink
std.Thread: Merge riscv32/riscv64 assembly in freeAndExit().
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrp authored and andrewrk committed Aug 14, 2024
1 parent 1018cdc commit dc77d1b
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions lib/std/Thread.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1175,20 +1175,7 @@ const LinuxThreadImpl = struct {
[len] "r" (self.mapped.len),
: "memory"
),
.riscv32 => asm volatile (
\\ li a7, 215 # SYS_munmap
\\ mv a0, %[ptr]
\\ mv a1, %[len]
\\ ecall
\\ li a7, 93 # SYS_exit
\\ mv a0, zero
\\ ecall
:
: [ptr] "r" (@intFromPtr(self.mapped.ptr)),
[len] "r" (self.mapped.len),
: "memory"
),
.riscv64 => asm volatile (
.riscv32, .riscv64 => asm volatile (
\\ li a7, 215 # SYS_munmap
\\ mv a0, %[ptr]
\\ mv a1, %[len]
Expand Down

0 comments on commit dc77d1b

Please sign in to comment.