From nobody Fri Sep 9 15:00:28 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 4MPK1915JJz4bbmv; Fri, 9 Sep 2022 15:00:29 +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 4MPK190YfTz3pcC; Fri, 9 Sep 2022 15:00:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662735629; 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=GcSqvRx8upJsKchPyCGo0x60ricO1b19cxaBk+oJEcg=; b=cu1yqmOGxuL+kMxlZ6LRyxKIWUFerAjrg7RXhgcuRBQe8TOYB67qRZZvAjsLj4lMBBVlWy J23EoMNOs+6bvvSUZZje/klLmTMN470eHEAjHKgDmVeG17ofgd9Xw+Oshi7jzn9cjU15pL vpra8Hcy2TLSmEBffkHBzHNHK2/gtPElg+OFc6pEzCxYJci7WMXiRQBfKTHIUlKPrvqa2w 61KwARGNzaCuOvE0uN8IJ3qT0qBa8hviWGJtzTkAB0YBDoTPTeOfSEkqoRcjOsQNnCnVky pZ9bIkBOailKzBOxXi0vQPWnYZOq+Vp6AXrfAPQPhfTmaT0kQwnkU2AzRScCrQ== 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 4MPK186hJ3z1FDb; Fri, 9 Sep 2022 15:00:28 +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 289F0S69079465; Fri, 9 Sep 2022 15:00:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 289F0SY9079464; Fri, 9 Sep 2022 15:00:28 GMT (envelope-from git) Date: Fri, 9 Sep 2022 15:00:28 GMT Message-Id: <202209091500.289F0SY9079464@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Felix Palmen Subject: git: 600f16129510 - main - linuxkpi: Add non-atomic readq()/writeq() 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: zirias X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 600f161295107d4d26f9a0551fc8160ee9dd0dd5 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662735629; 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=GcSqvRx8upJsKchPyCGo0x60ricO1b19cxaBk+oJEcg=; b=hujnwmTbnobAUAINdEk2FFJY5aXQMFkPyaiZ5VgwACprEHcB1PlUK3x1BoMHvqP4Pc7K+l xh+d7aFmcYr5ZnLRYNrZjfK+14cXma/J+L+/KZFiWAEdKAhRj0XMCtVX32pu//2Sy7CW4Y KmQBvFBDGdBXde07O4bceDeWrcz/ENxBg5uDZACtbfi0A/c0oiVBvsaYgBiMf/WQD1+v97 jxVjLZqgbAlNROWrP57elHbo/u8S+ozSBEA9hHbylmtvje7q1mxnUuNCcm+O+fBDj4h7mt FrcaCFbzvc0Vx+yGYMNbVLL57sYfoVBB3yAi/eQvWLT8oUDJCtMpzQXO5pTvrw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1662735629; a=rsa-sha256; cv=none; b=oquBi1xCy/D6b/WtOVSvunmTmraTJiTP22dhaQyZMSr6uY7y0PXijfCCJzlRixYUYysbFx QXtIPCIGmAocryvDxeJAmmg02FUuwjAajCHwnRBVb3q9tr2FEC6V3tRqoDjPTEQ89jbceY 5tDLm8fVU48ur+oP1Z0/hnq9LTMpqodQRBy/NhE6n9AsJZdDv9v/bG3i7YxCqb+MgaR2tI hQFJ3upKjr3inL8/YPS24LCpr4KBND6HxfCrBW/lAz4Uojsm0Or9xQXFZlYk/NwSmuoIKM x9RSupRkCyoFyu0vfsBJbGDsKT1gurRm0QCYutGHLc0bv+DEBxY8VuQP4R2+7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by zirias (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=600f161295107d4d26f9a0551fc8160ee9dd0dd5 commit 600f161295107d4d26f9a0551fc8160ee9dd0dd5 Author: Felix Palmen AuthorDate: 2022-09-09 14:01:22 +0000 Commit: Felix Palmen CommitDate: 2022-09-09 14:59:41 +0000 linuxkpi: Add non-atomic readq()/writeq() The non-atomic versions are required by drm-510-kmod to build on 32-bit architectures. Approved by: hselasky, manu, tcberner (mentor) Differential Revision: https://reviews.freebsd.org/D36507 --- .../common/include/linux/io-64-nonatomic-lo-hi.h | 65 ++++++++++++++++++++++ .../dummy/include/linux/io-64-nonatomic-lo-hi.h | 0 2 files changed, 65 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/io-64-nonatomic-lo-hi.h b/sys/compat/linuxkpi/common/include/linux/io-64-nonatomic-lo-hi.h new file mode 100644 index 000000000000..c9cf0befec79 --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/io-64-nonatomic-lo-hi.h @@ -0,0 +1,65 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2022 Felix Palmen + * + * 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. + */ +#ifndef _LINUXKPI_LINUX_IO_64_NONATOMIC_LO_HI_H_ +#define _LINUXKPI_LINUX_IO_64_NONATOMIC_LO_HI_H_ + +#include + +static inline uint64_t +lo_hi_readq(const volatile void *addr) +{ + const volatile uint32_t *p = addr; + uint32_t l, h; + + __io_br(); + l = le32toh(__raw_readl(p)); + h = le32toh(__raw_readl(p + 1)); + __io_ar(); + + return (l + ((uint64_t)h << 32)); +} + +static inline void +lo_hi_writeq(uint64_t v, volatile void *addr) +{ + volatile uint32_t *p = addr; + + __io_bw(); + __raw_writel(htole32(v), p); + __raw_writel(htole32(v >> 32), p + 1); + __io_aw(); +} + +#ifndef readq +#define readq(addr) lo_hi_readq(addr) +#endif + +#ifndef writeq +#define writeq(v, addr) lo_hi_writeq(v, addr) +#endif + +#endif /* _LINUXKPI_LINUX_IO_64_NONATOMIC_LO_HI_H_ */ diff --git a/sys/compat/linuxkpi/dummy/include/linux/io-64-nonatomic-lo-hi.h b/sys/compat/linuxkpi/dummy/include/linux/io-64-nonatomic-lo-hi.h deleted file mode 100644 index e69de29bb2d1..000000000000