From nobody Mon Sep 02 08:50:40 2024 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 4Wy2XJ4Bj7z5MnlX; Mon, 02 Sep 2024 08:50:40 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wy2XJ1v72z42Kc; Mon, 2 Sep 2024 08:50:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267040; 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=EDY6P4x/Yb+NUxWfGkFZP8Xp0o+4NERKtG9oGe/Ze5Y=; b=C3UuszD1hrYDag1hS4IG+RZFd5JqAdTqMx2ybvce8viBtHkJBluHIrynJLUVsSVZmYK+mT wmXmrm9LnVNVeEDHK24tvSSrhUVG4XvvqEKD/iVvtEzrxDQhBn+C6n8D1qcwaaCzr8AOWk nWnVh30BnlIbUMeC3YoEMOJbLDfnCQ7sEPxvPD55/cYrfIWr+VEUJIEuPqYbfT4QFiAm9w nqG3Gn5nhfQmohcDdyqgaSDhYBIsNOXY6RvShFqgVOOkNKYO2upC2Xd8MYkoLXuZ0pUvTL VRPHxfliRoLMeuArYM6Atgm1vwdRVXVKbxmgdHrGvBKjua8T0TLqY0lr3x5Gcw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725267040; a=rsa-sha256; cv=none; b=XqYvNaJs5edpxVCI+RIxYg80a/+RKSnIiwoq5K0Te80rCkTqKRQ+4/ahOdwhlfxY+NFf63 c8GHeh8gOKaMoU9B56mMCBwebxkvt5fwq1JmJB0ZRk+635Qclqrp9vRsLaRxXYBXE0QUg8 wgbrd2QzdwsK7hcqbHaVlI2fyvvRct9JTiCVYGskIcbCnHY7IVcSY6F5bSpvKUQUtlDuaK ZWZJvKWftQPF3/APb/SLM5ftM+dIO002R0fCBulW9mxptlUis/8FtzvOSfrUM/6IRfS4JW G21FI+UupnPvigmj+94l9TihSOu32XCEyzwvnTc/oAJ+08i+xXCWLpPwQtoXUA== 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=1725267040; 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=EDY6P4x/Yb+NUxWfGkFZP8Xp0o+4NERKtG9oGe/Ze5Y=; b=Sfnr7s/jnKYNgZEm403DpvWRPlBc/ZYYBOfr0U+7+RJFI+XLWw5Gr0wPS6qXK5hqtTPHhv YYcP0Dvh2Qfj1FMLX++Auaez9kqH8ljJ0ttu5Oy+ITpMltL+HA34uQq7Jm2UBwFeirAQwk l/WR9l4gGiEey7JefJ3zALPQVPKw/OaJgJow2mOr37+CRim3BtLIPLrHSUn90MjR4gsSYK +ivoAeyZOYNlF1GnNdtsM6+zNUMV7lkpivFGSonyELhGpD0MWCpc7zxE5wpFOA5z14Mj2/ muBP5TkbgKB+c/uN8ltb/beDU4992s89ThaKovaeGtt7qT4HylAMwQ2bGbr/vQ== 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 4Wy2XJ1BKDz15Nv; Mon, 2 Sep 2024 08:50:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4828oeDV006995; Mon, 2 Sep 2024 08:50:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4828oewO006992; Mon, 2 Sep 2024 08:50:40 GMT (envelope-from git) Date: Mon, 2 Sep 2024 08:50:40 GMT Message-Id: <202409020850.4828oewO006992@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 519141de7e66 - stable/14 - libc/aarch64: Add a non-trivial getcontextx 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 519141de7e6639e4df3485073d2521dc95b60207 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=519141de7e6639e4df3485073d2521dc95b60207 commit 519141de7e6639e4df3485073d2521dc95b60207 Author: Andrew Turner AuthorDate: 2024-03-06 12:51:18 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 08:44:40 +0000 libc/aarch64: Add a non-trivial getcontextx Add support for extra registers to the arm64 getcontextx. As no registers are defined this just adds the extra register list and an end context. Reviewed by: kib Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D44255 (cherry picked from commit 5202ca77aaf552310bcbaccba750ee9f0888d0d8) --- lib/libc/aarch64/gen/getcontextx.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/lib/libc/aarch64/gen/getcontextx.c b/lib/libc/aarch64/gen/getcontextx.c index b9d4522d96ee..9972d3208d08 100644 --- a/lib/libc/aarch64/gen/getcontextx.c +++ b/lib/libc/aarch64/gen/getcontextx.c @@ -32,13 +32,26 @@ int __getcontextx_size(void) { + size_t size; - return (sizeof(ucontext_t)); + size = sizeof(ucontext_t); + size += sizeof(struct arm64_reg_context); /* Space for ARM64_CTX_END */ + + return (size); } int __fillcontextx2(char *ctx) { + struct arm64_reg_context *reg_ctx; + ucontext_t *ucp; + + ucp = (ucontext_t *)ctx; + ucp->uc_mcontext.mc_ptr = (uint64_t)(ucp + 1); + + reg_ctx = (struct arm64_reg_context *)ucp->uc_mcontext.mc_ptr; + reg_ctx->ctx_id = ARM64_CTX_END; + reg_ctx->ctx_size = sizeof(struct arm64_reg_context); return (0); } @@ -49,7 +62,10 @@ __fillcontextx(char *ctx) ucontext_t *ucp; ucp = (ucontext_t *)ctx; - return (getcontext(ucp)); + if (getcontext(ucp) == -1) + return (-1); + __fillcontextx2(ctx); + return (0); } __weak_reference(__getcontextx, getcontextx);