From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 23153 invoked from network); 9 Feb 2023 16:34:45 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 9 Feb 2023 16:34:45 -0000 Received: (qmail 30263 invoked by uid 550); 9 Feb 2023 16:34:43 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 30225 invoked from network); 9 Feb 2023 16:34:42 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ZAstqV8/+QYl2xtzr4s4f74cxfXifbOX0Pe/JQ0uxTI=; b=PDKlIzxzAsE7fwGq/a655UO/1Y4yYEXx51Re1ZYInfgqnMNRDemXXNQREdnXckGVjO jdn/Zcbk1zWmOtVZoKdAh0uJHunK6Ng+55VaOpPvS8C3d3YKvVGWQLh1eT4S79ZbH/Jh gXWTivhJCuRAXYN+Mu5t6y2bpmVocNBduSqFnbFMKdwu6Pk/ARem+p+iTQqOnKCHunP9 C8f0De6O7owBn8AmNW7hG2eTK/hORfOvqZAsGl/Ml/rGk9ynmX/pt4CB976wHjjTdDYG ucgHzJ6a7ujdlVKx/pbgqReffx5AS8HyDTOkEwY76TKZTPrtzA5ngCUr3VkMBnXlTYfp c2Tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZAstqV8/+QYl2xtzr4s4f74cxfXifbOX0Pe/JQ0uxTI=; b=p/ASz9dIp0GU1cTMtDc7SXivLxMG3ExSO2E9ju7IRveNu4muz4vN+nDZJYYOXIhxFM 9O5G2UKExf3xhbMxvEQZR7bCj76x6nDqk8bPjBxU4fqhugrcMQ5dV5JNVgVYUjcd8mqF 6h01FMFRdw4DtUZEUavA3pYwaNDza9QbDAMGePOvLsoQVp5iA8RAtqM+HAu6MS42Hdaj qt2N05BMc1T1CSZvtlEKaGZQ/PJRDpvESoWll9atFfRnrrbMBveeoZ206hXkhwwzL2Ye NR8DyJQi0yDalYK6mtmrQEBjH/AakKc8z+9P2fND3vN5eg7Pzqa3zrosQdNMZ9FA8aAQ oL0Q== X-Gm-Message-State: AO0yUKW/OEBZ/bceYCNLNbXcQb3hB0Zf+NKt/fbcrqtY9iccuJEXx7qG vShJKmwvku6SnUI9w5XD8WyDij67JRk= X-Google-Smtp-Source: AK7set80xXAU2PSPMfOYw6w3A/je+qwVb8jYX9N1f9ESPxheJ/MehhQ04zuxiGp4tui9kVgAVdsy7Q== X-Received: by 2002:a05:600c:210d:b0:3df:eedf:f378 with SMTP id u13-20020a05600c210d00b003dfeedff378mr10432106wml.24.1675960470259; Thu, 09 Feb 2023 08:34:30 -0800 (PST) From: Pedro Falcato To: musl@lists.openwall.com Cc: Pedro Falcato Date: Thu, 9 Feb 2023 16:34:12 +0000 Message-Id: <20230209163412.266391-1-pedro.falcato@gmail.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [musl] [PATCH v2] riscv64: Add vfork Implement vfork() using clone(CLONE_VM | CLONE_VFORK | ...). --- src/process/riscv64/vfork.s | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/process/riscv64/vfork.s diff --git a/src/process/riscv64/vfork.s b/src/process/riscv64/vfork.s new file mode 100644 index 00000000..c93dca23 --- /dev/null +++ b/src/process/riscv64/vfork.s @@ -0,0 +1,12 @@ +.global vfork +.type vfork,@function +vfork: + /* riscv does not have SYS_vfork, so we must use clone instead */ + /* note: riscv's clone = clone(flags, sp, ptidptr, tls, ctidptr) */ + li a7, 220 + li a0, 0x100 | 0x4000 | 17 /* flags = CLONE_VM | CLONE_VFORK | SIGCHLD */ + mv a1, sp + /* the other arguments are ignoreable */ + ecall + .hidden __syscall_ret + j __syscall_ret -- 2.39.1