From nobody Mon Dec 18 22:28:57 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SvDy22TZMz54BfL; Mon, 18 Dec 2023 22:28:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SvDy217Qqz4cGC; Mon, 18 Dec 2023 22:28:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702938538; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EjJ3ijMX9WmpXrtW0tX5wT3cuTaorjphDeudvyiyJMc=; b=Vk/GmkrtD9v6xxyWBo0z0jnzpF0ZqPtQ7ujvutC6TwV6zw9p//MKSJs4Ts2YUmoF8TaBHc 8TthdCEMkaO5kaypZYbe/6IBKOzzJW9VMN4n9iWDKAXzkLQcS8BPfzXxWGZ4T0PGnhUC6k Sc0SwDANCIXfh4GrGS17rFFoMLGkRyJNP04FDfW2X2ArpcJxkhVcPurryqD8yUU5Xb19Uy 2Nn0FhYbZTuKikHZjfWAbkqE6enbvASyJrv/sFvKj0mnOaLN4Oe8q+VC9dmc+AWEjiyD83 Gtser6rvnq3UkckRqH3KzaveoP5AVV1vblfj3TT9oBufgf8B0uLWMnpqltNW2Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702938538; a=rsa-sha256; cv=none; b=E80Srai5cOjhExQZ/RFF/W8ucIwDrG4VnecjBUQT2+P5h0z1TIZSoDqfFeHPK1HaoszFnE 8LnyqZgGkQG4BvzhWMdexiQoDIPBIuRO8PHyCQBKy73T54rN5Y0/0xFTr019cDHiUfDJHH Ns8Y+XYQ13PcOALDxzdKH/N/whQXvNKnhqpbT6MOBZRxTpQFob89H9ltAzlD6aiQZJQ6GR 4+Mv44RtlZgPZpUp6FX4LlRiPor6PWiv4ho5TAE5e88vnAcNJq1Xepfh0B/7wehFH9XI8P AfXBAQuMukS2izpngdp5eP4+0G9trBlzuk6F6EyBrBp0PP4M7q6wxFiAr0fE6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702938538; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EjJ3ijMX9WmpXrtW0tX5wT3cuTaorjphDeudvyiyJMc=; b=wGfEnauqF7MgRGbGqFmoBAYPMnmYJ9xg5UqXeUQXYXqDNT99merVFin3VyE8BQT3thUHgJ Ki6dccebnMGGhXgHTlmOGkNA6YlreIzcR+v1mNjBongVbTL8wmcMyyWfqqtGfzIBTEaGZ6 neewRJ3v3U/GqtC0+3JawQbnOnUjhHnpP7Ic1r/yFd8OidtZOM0It3ZYzqeeuRkYAisZO/ ds1u31fh7d6Je1K45Chh5pzpf6R19gPcZQJSYivg6sRfaVUSoqI3iMDWOhX1M1WabVmFW1 GioK/HwPWVCYqWVJKC3E7XPVb+tXbCS6ZdbPL9b08W1eU7vMmoQH2PdEYhz2OQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SvDy174pqzfNW; Mon, 18 Dec 2023 22:28:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BIMSvYB007848; Mon, 18 Dec 2023 22:28:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BIMSvRC007845; Mon, 18 Dec 2023 22:28:57 GMT (envelope-from git) Date: Mon, 18 Dec 2023 22:28:57 GMT Message-Id: <202312182228.3BIMSvRC007845@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 300bbb3a43e3 - main - riscv/SYS.h: implement _SYSCALL_BODY() macro List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 300bbb3a43e3cc1337b827b72ff5a22c4321a317 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=300bbb3a43e3cc1337b827b72ff5a22c4321a317 commit 300bbb3a43e3cc1337b827b72ff5a22c4321a317 Author: Brooks Davis AuthorDate: 2023-12-18 22:28:42 +0000 Commit: Brooks Davis CommitDate: 2023-12-18 22:28:42 +0000 riscv/SYS.h: implement _SYSCALL_BODY() macro Add _SYSCALL_BODY() macro which invokes the syscall via _SYCALL() and calls cerror as required. Use to implement PSEUDO() and RSYSCALL(). Reviewed by: imp, markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D43057 --- lib/libc/riscv/SYS.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/libc/riscv/SYS.h b/lib/libc/riscv/SYS.h index 1e3e67834494..47c79e38f916 100644 --- a/lib/libc/riscv/SYS.h +++ b/lib/libc/riscv/SYS.h @@ -40,23 +40,22 @@ li t0, SYS_ ## name; \ ecall -#define PSEUDO(name) \ -ENTRY(__sys_##name); \ - WEAK_REFERENCE(__sys_##name, _##name); \ +#define _SYSCALL_BODY(name) \ _SYSCALL(name); \ bnez t0, 1f; \ ret; \ 1: la t1, cerror; \ - jr t1; \ + jr t1 + +#define PSEUDO(name) \ +ENTRY(__sys_##name); \ + WEAK_REFERENCE(__sys_##name, _##name); \ + _SYSCALL_BODY(name); \ END(__sys_##name) #define RSYSCALL(name) \ ENTRY(__sys_##name); \ WEAK_REFERENCE(__sys_##name, name); \ WEAK_REFERENCE(__sys_##name, _##name); \ - _SYSCALL(name); \ - bnez t0, 1f; \ - ret; \ -1: la t1, cerror; \ - jr t1; \ + _SYSCALL_BODY(name); \ END(__sys_##name)