From nobody Fri Jun 17 19:38:21 2022 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 E3A7B85B174; Fri, 17 Jun 2022 19:38:24 +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 4LPq8Z1hvTz3QDC; Fri, 17 Jun 2022 19:38:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494703; 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=WIiNmB260iQwVOXw1Bxfj0g1bpAYHNPv8v/jZleSYSA=; b=LKtLuijOIZR7zXrRjgK/BaWOuQ2DLM6Zu6GZikbjoS0JzmNkt2cuBDUxdhisfwf6xzzjaH khJCqvjk+pLUMKGiNC9ZS3MtUoXCmpuFdf+Lu0bqk4+pCy8eto/JojSsxkw7txtXv8xNsP 01GbUU3jqN2cugs4ev/lYsd9WsUWv/IxGnuIFaEBVLs1SCNInJQA4jtuL1hfCqJsx9zfIr XmXxW6PgrrYe5lzr5eF5djhhGqMg4M1+Ot+UEjnwFBLRIWFaDyIq5aGJ0m/UZ8pPu8qd9x yqhqp6N9lHmU9P3q5QWQ8VUlW+sq+Jj/dlHGU4Oa32m0MGnYji5DpX1vDoioRA== 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 995F825A3D; Fri, 17 Jun 2022 19:38:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 25HJcLZW014575; Fri, 17 Jun 2022 19:38:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25HJcLsc014574; Fri, 17 Jun 2022 19:38:21 GMT (envelope-from git) Date: Fri, 17 Jun 2022 19:38:21 GMT Message-Id: <202206171938.25HJcLsc014574@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: b04e157ce9ea - stable/13 - linux: Implement linux_to_bsd_regset() on arm64 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b04e157ce9eaea73d9aca3840d3d8db9c2c8ba32 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494703; 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=WIiNmB260iQwVOXw1Bxfj0g1bpAYHNPv8v/jZleSYSA=; b=HIzf6ROjcoKndGAjtViSeNTe0/AdRKpzNBaEEnBQckt7c6Q5P72YMTYGkrh3R1Zs/mGqEX yUv1rvVmmMSwiCJWSftoVkbsBSuTWM/1D+UNr9G6McceheW9n5B1IvBBFB8bBJ6VHfQopM cCE8W3LpUjNq5CA8vj6n6q1czfZiHS7/XhCYthedhPk4AuUrZhbXubx+1W+cgbEWpdht5A WqrWjY/h1+lvFh1j0R/O34qTvJ03gWcEWGJBCGxxFem67mf+Jr5HC9qVoIZN8GcYMix6mW Kv3BkWV7DhD4Iv7xbZPA3yzKsp/2W3dKGntzhKcShPw3WDjOFGm5EKmqdQ7tAw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655494703; a=rsa-sha256; cv=none; b=n5pVqUT0qfzwBxHtEZHuqxJc/IBC70pTYbZFPYsAfP4PFjm2Gpd+hmFSuQQIkG2RtNjPnS yMgPBjXwqwIUb8aHtWkDoDakxfAvEHr28R91HYrGNWwvoVUn+ZKNaUtlF4FfTBCyQdi0gV Tq0dcZQdf9460Rl6PHjIMVXv8l2kda3PCFtqk/V8IWgghX8/j4Abjuz01mVXl28JbuJJXR a77M+/x6uLmzowj59cF59SVWanTzbhuoSbSiV5X4c2BZw5IFKsYl61MWdkREFh2MJ7VZIZ eQmXHul5yiyrJnn/CxL1MRvsIwNuQSOAA0YPwCX4cKS4k1eDzP4GccEjYH47JQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=b04e157ce9eaea73d9aca3840d3d8db9c2c8ba32 commit b04e157ce9eaea73d9aca3840d3d8db9c2c8ba32 Author: Edward Tomasz Napierala AuthorDate: 2021-11-06 08:35:04 +0000 Commit: Dmitry Chagin CommitDate: 2022-06-17 19:33:36 +0000 linux: Implement linux_to_bsd_regset() on arm64 This will be used by ptrace. Sponsored By: EPSRC (cherry picked from commit 6f397bc0fbe378664bbbc7c2296043e3b9673e2a) --- sys/arm64/linux/linux.h | 2 ++ sys/arm64/linux/linux_machdep.c | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/sys/arm64/linux/linux.h b/sys/arm64/linux/linux.h index 5e4bf3ae0680..05e5bd189b36 100644 --- a/sys/arm64/linux/linux.h +++ b/sys/arm64/linux/linux.h @@ -324,5 +324,7 @@ struct reg; void bsd_to_linux_regset(const struct reg *b_reg, struct linux_pt_regset *l_regset); +void linux_to_bsd_regset(struct reg *b_reg, + const struct linux_pt_regset *l_regset); #endif /* _ARM64_LINUX_H_ */ diff --git a/sys/arm64/linux/linux_machdep.c b/sys/arm64/linux/linux_machdep.c index 9172b10a5876..746c93bb86c8 100644 --- a/sys/arm64/linux/linux_machdep.c +++ b/sys/arm64/linux/linux_machdep.c @@ -147,3 +147,16 @@ bsd_to_linux_regset(const struct reg *b_reg, struct linux_pt_regset *l_regset) l_regset->pc = b_reg->elr; l_regset->cpsr = b_reg->spsr; } + +void +linux_to_bsd_regset(struct reg *b_reg, const struct linux_pt_regset *l_regset) +{ + + KASSERT(sizeof(l_regset->x) == sizeof(b_reg->x) + sizeof(l_ulong), + ("%s: size mismatch\n", __func__)); + + memcpy(b_reg->x, l_regset->x, sizeof(b_reg->x)); + b_reg->sp = l_regset->sp; + b_reg->elr = l_regset->pc; + b_reg->spsr = l_regset->cpsr; +}