From nobody Thu Mar 21 10:13:45 2024 X-Original-To: dev-commits-src-main@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 4V0hBK66kyz5FkRP; Thu, 21 Mar 2024 10:13:45 +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 4V0hBK4RmMz457k; Thu, 21 Mar 2024 10:13:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711016025; 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=Vt6ICX5uyutDcrhtOQVvDO1sU83HVtKf+VOsD/vzz24=; b=c+mhOHh43IDCdP9fR0OiOmeJSmUsouenlxmL0XLDV+WFXy/h9TjK/850/CsHpfDsUkesfq A8k15pHND+r5+te0+8ezC6QJmGlFpaBVOatUV32k4WkvU/YEofDpToRggwj6CMKJdX/LZm vad7mlu6mZS1tssXqdrJBi4sCNMWNsMW3T6kk4DiohO6QaV8P85tMApfupgscn6kenh74A FOtzFuiwEIBkwHUKmY7uXnNsfjoXsDB420682YvCKqsUixo2u/iXgyuV34uCYUHi9r6PZE +2WsjQOxKdkFKOz0CF58FDEj6uFcpQaKXieVYvQlzhDITtFgebKqncU0e8jz+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711016025; a=rsa-sha256; cv=none; b=KYzUgiB5FjQ5hHUjtv54G8NjQXk6QVemcjE5AMxijveJUmswSluOy1Id8X5pJy3MkDgWwX WWH162kq0EuZ9B/N5YB3d+SE939R0sWhbaJx1WtzaAtPMvlStTuCU/vqYsNZJ/fHdtserj L94vvMyXMkGHIYLGZrP46jVBTb8XCFrLwUkwCOmZBSkz2kQJ6Zr8CVJXeynOC7+n5llzEo ca/ijIB/pJJ1oh9JbhgB0RhKkyZ6bQKR+ojUSti2ENM0DsDEiZ+mbq0bJ2GUzQ4xa6a3ME Hb6UlmUeSMl3LY0DdhpJc7F3LkVkkKHAGlIdLet1TH636o2DQwzZj/hW9KRcbQ== 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=1711016025; 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=Vt6ICX5uyutDcrhtOQVvDO1sU83HVtKf+VOsD/vzz24=; b=MeFstHbyXCm6IWPV+a4GE/o9voUM6KXV2mu9aFZnGy4vizwWg/JcM1WelNxfKdHcDgXuUs o7SwtOBOTN8E3cnn3ZG0IhOLC8BHb2CkWSYug733dRaxfuMxW00EAdT1GHEIw4wVpo2nQK zYVrmW1HowPZJhYFCoF+kF0fgvA2C0VJ3Bk+fC9N3hGs04Bj1KF7lrT1V9bUCeKslb8VIV JAAmGm2EbG6Nzznh0eMXcbFFvEG18h+JMLNGb08IYkHRu1TtH2qjSplOlkQFlSzZ5bOQvg 9H5zeFW1jpy9GZ8A3Esit+xvTD7vWmOkLdb35JM/v/3yuvUcZxlhUJwQf1KPYg== 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 4V0hBK4316zXR5; Thu, 21 Mar 2024 10:13:45 +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 42LADjFS032302; Thu, 21 Mar 2024 10:13:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42LADjc8032299; Thu, 21 Mar 2024 10:13:45 GMT (envelope-from git) Date: Thu, 21 Mar 2024 10:13:45 GMT Message-Id: <202403211013.42LADjc8032299@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 5202ca77aaf5 - main - libc/aarch64: Add a non-trivial getcontextx List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 5202ca77aaf552310bcbaccba750ee9f0888d0d8 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=5202ca77aaf552310bcbaccba750ee9f0888d0d8 commit 5202ca77aaf552310bcbaccba750ee9f0888d0d8 Author: Andrew Turner AuthorDate: 2024-03-06 12:51:18 +0000 Commit: Andrew Turner CommitDate: 2024-03-21 10:13:24 +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 --- 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);