// SPDX-FileCopyrightText: 2024 Himbeer // // SPDX-License-Identifier: AGPL-3.0-or-later pub fn terminate() linksection(".rethooks") callconv(.Naked) noreturn { // Syscall #100001 is "open". // Use the "/process/self/terminate" hook to terminate the thread. asm volatile ( \\ mv a0, a2 \\ mv a1, a3 \\ mv t0, a0 \\ li a7, 100001 \\ ecall : : [path_c] "{t0}" ("/process/self/terminate\x00".ptr), : "a0", "a2", "a3", "a7" ); }