From owner-dev-commits-src-main@freebsd.org Tue Mar 23 17:38:59 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9E94C5B62AE; Tue, 23 Mar 2021 17:38: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 4F4drz46Zvz3h5k; Tue, 23 Mar 2021 17:38: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 75AE425205; Tue, 23 Mar 2021 17:38: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 12NHcxex042513; Tue, 23 Mar 2021 17:38:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12NHcxBd042512; Tue, 23 Mar 2021 17:38:59 GMT (envelope-from git) Date: Tue, 23 Mar 2021 17:38:59 GMT Message-Id: <202103231738.12NHcxBd042512@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: df7549775c4e - main - Replace the arm64 initial_fpcr with a macro 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: df7549775c4e36d8ac0ed6cce2525203beb2b32c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2021 17:38:59 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=df7549775c4e36d8ac0ed6cce2525203beb2b32c commit df7549775c4e36d8ac0ed6cce2525203beb2b32c Author: Andrew Turner AuthorDate: 2021-03-23 15:28:20 +0000 Commit: Andrew Turner CommitDate: 2021-03-23 17:12:43 +0000 Replace the arm64 initial_fpcr with a macro This value was never changed from its default value. Replace it with a macro. Sponsored by: Innovate UK --- sys/arm64/arm64/vfp.c | 4 ++-- sys/arm64/arm64/vm_machdep.c | 2 -- sys/arm64/include/md_var.h | 2 -- sys/arm64/include/vfp.h | 1 + 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/sys/arm64/arm64/vfp.c b/sys/arm64/arm64/vfp.c index 5fa420e668c1..4935946d2430 100644 --- a/sys/arm64/arm64/vfp.c +++ b/sys/arm64/arm64/vfp.c @@ -212,7 +212,7 @@ vfp_reset_state(struct thread *td, struct pcb *pcb) bzero(&pcb->pcb_fpustate.vfp_regs, sizeof(pcb->pcb_fpustate.vfp_regs)); KASSERT(pcb->pcb_fpusaved == &pcb->pcb_fpustate, ("pcb_fpusaved should point to pcb_fpustate.")); - pcb->pcb_fpustate.vfp_fpcr = initial_fpcr; + pcb->pcb_fpustate.vfp_fpcr = VFPCR_INIT; pcb->pcb_fpustate.vfp_fpsr = 0; pcb->pcb_vfpcpu = UINT_MAX; pcb->pcb_fpflags = 0; @@ -262,7 +262,7 @@ vfp_init(void) vfp_disable(); if (PCPU_GET(cpuid) == 0) - thread0.td_pcb->pcb_fpusaved->vfp_fpcr = initial_fpcr; + thread0.td_pcb->pcb_fpusaved->vfp_fpcr = VFPCR_INIT; } SYSINIT(vfp, SI_SUB_CPU, SI_ORDER_ANY, vfp_init, NULL); diff --git a/sys/arm64/arm64/vm_machdep.c b/sys/arm64/arm64/vm_machdep.c index 0193048e2697..c37f1d849359 100644 --- a/sys/arm64/arm64/vm_machdep.c +++ b/sys/arm64/arm64/vm_machdep.c @@ -55,8 +55,6 @@ __FBSDID("$FreeBSD$"); #include #endif -uint32_t initial_fpcr = VFPCR_DN; - #include /* diff --git a/sys/arm64/include/md_var.h b/sys/arm64/include/md_var.h index 73cf642148b5..0132ab0dd8fd 100644 --- a/sys/arm64/include/md_var.h +++ b/sys/arm64/include/md_var.h @@ -54,6 +54,4 @@ void generic_bs_poke_2(void) __asm(__STRING(generic_bs_poke_2)); void generic_bs_poke_4(void) __asm(__STRING(generic_bs_poke_4)); void generic_bs_poke_8(void) __asm(__STRING(generic_bs_poke_8)); -extern uint32_t initial_fpcr; - #endif /* !_MACHINE_MD_VAR_H_ */ diff --git a/sys/arm64/include/vfp.h b/sys/arm64/include/vfp.h index 3632e5eaa396..6689be1b15d7 100644 --- a/sys/arm64/include/vfp.h +++ b/sys/arm64/include/vfp.h @@ -36,6 +36,7 @@ #define VFPCR_AHP (0x04000000) /* alt. half-precision: */ #define VFPCR_DN (0x02000000) /* default NaN enable */ #define VFPCR_FZ (0x01000000) /* flush to zero enabled */ +#define VFPCR_INIT VFPCR_DN /* Default fpcr after exec */ #define VFPCR_RMODE_OFF 22 /* rounding mode offset */ #define VFPCR_RMODE_MASK (0x00c00000) /* rounding mode mask */