From nobody Fri Dec 24 11:59:59 2021 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 E20221908A11; Fri, 24 Dec 2021 11:59:59 +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 4JL5GR4fynz3NKM; Fri, 24 Dec 2021 11:59:59 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 6BCCB237C0; Fri, 24 Dec 2021 11:59:59 +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 1BOBxxEX085148; Fri, 24 Dec 2021 11:59:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BOBxx3W085147; Fri, 24 Dec 2021 11:59:59 GMT (envelope-from git) Date: Fri, 24 Dec 2021 11:59:59 GMT Message-Id: <202112241159.1BOBxx3W085147@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: 8ddb4b9b6668 - main - Extract the arm64 signal code to a new file 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: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8ddb4b9b6668f88acc70042923384383247340dc Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640347199; 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=SXZxmU9FtKpqqqDcP3xNcFtX1akgRk2Igxi1Nagy4qc=; b=n4k/rn+CJUvlBg/Py2weOba47DcaDvmmk1cIzy8RlYo+mV64KdQf3OhBzE/ACxW2wYigdz /relq4hoxZ3Nia/oD4OywIv2yUCLhXEMKuPukJpHL5dztA2uDOwoDwZIE92Pet1GY1S78V z7oQqGniC5d9QNdj+vYpQkAvd7OlngH9kCb+imzYlFyREpLDXqV7vmWqKPX9ci57/mOXQw Rhqs8w+otLIAIt8io/okglywckUKjp3HdgTfhnPSYUz20532lHvlrwYHe33l4FwVawWgO2 T3VAw5wpBpcMyFgCurwY+F1DW5OilrC/VfRdKMaySgfSZ5HwvMoWuIR6C1k7lw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640347199; a=rsa-sha256; cv=none; b=pX5+ev/B2IW8oFJAzSlpffsHzIbv2xjhBvIBqt8+0pM+GsWARnI0BEK4uxYBUBzyObGPuF ej8NFzjWnXvkQdCSQ8GyWMzYJbM+3Q24rmp/RSkot8A5Sg6KRTX1mKX/yn4NlnHT90gYag x/9nFh/8+8b5DBy20bxnv75m7oAMzdK0rW+Rp8s8QnVbuoucZNzoefYVBnlksYroN1GWyV zf/Eo2gD8zX3l5Xsz0gjFhLQF82ybVl1BLm9kB/bX0vJh5Yc+BvLR7ZhyFuLMaWV+IlunF GfAsh7u5dBW0aPGRYkdVPIRKUpaJ7mSwMW8bkhopNc5knQ9OQTrGuRCZMLXI6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=8ddb4b9b6668f88acc70042923384383247340dc commit 8ddb4b9b6668f88acc70042923384383247340dc Author: Andrew Turner AuthorDate: 2021-12-14 18:05:29 +0000 Commit: Andrew Turner CommitDate: 2021-12-24 11:59:43 +0000 Extract the arm64 signal code to a new file This will be used by the vdso signal trampoline on arm64. While here fix the license as this part of locore.S to correct the copyright owner. Sponsored by: The FreeBSD Foundation --- sys/arm64/arm64/locore.S | 25 +-------------------- sys/arm64/arm64/sigtramp.S | 55 ++++++++++++++++++++++++++++++++++++++++++++++ sys/conf/files.arm64 | 1 + 3 files changed, 57 insertions(+), 24 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index bc9a7271e93a..f5b8aec52897 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -790,30 +790,7 @@ initstack: initstack_end: -ENTRY(sigcode) - mov x0, sp - add x0, x0, #SF_UC - -1: - mov x8, #SYS_sigreturn - svc 0 - - /* sigreturn failed, exit */ - mov x8, #SYS_exit - svc 0 - - b 1b -END(sigcode) - /* This may be copied to the stack, keep it 16-byte aligned */ - .align 3 -esigcode: - - .data - .align 3 - .global szsigcode -szsigcode: - .quad esigcode - sigcode - +.text EENTRY(aarch32_sigcode) .word 0xe1a0000d // mov r0, sp .word 0xe2800040 // add r0, r0, #SIGF_UC diff --git a/sys/arm64/arm64/sigtramp.S b/sys/arm64/arm64/sigtramp.S new file mode 100644 index 000000000000..b06ec6fa109c --- /dev/null +++ b/sys/arm64/arm64/sigtramp.S @@ -0,0 +1,55 @@ +/*- + * Copyright (c) 2014 The FreeBSD Foundation + * + * This software was developed by Andrew Turner under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "assym.inc" +#include +#include + +ENTRY(sigcode) + mov x0, sp + add x0, x0, #SF_UC + +1: + mov x8, #SYS_sigreturn + svc 0 + + /* sigreturn failed, exit */ + mov x8, #SYS_exit + svc 0 + + b 1b +END(sigcode) + /* This may be copied to the stack, keep it 16-byte aligned */ + .align 3 +esigcode: + + .data + .align 3 + .global szsigcode +szsigcode: + .quad esigcode - sigcode diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index f941764ebd0f..56712d859d69 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -68,6 +68,7 @@ arm64/arm64/nexus.c standard arm64/arm64/ofw_machdep.c optional fdt arm64/arm64/pmap.c standard arm64/arm64/ptrace_machdep.c standard +arm64/arm64/sigtramp.S standard arm64/arm64/stack_machdep.c optional ddb | stack arm64/arm64/support.S standard arm64/arm64/swtch.S standard