From nobody Mon Aug 08 14:04:28 2022 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 4M1dHJ4218z4Y4Yy; Mon, 8 Aug 2022 14:04:28 +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 4M1dHJ1fgVz3vxG; Mon, 8 Aug 2022 14:04:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659967468; 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=n4ahmZc0vrUOC8Gl5F+Yc44PCXxwxTmA7ZtPdbRwiFM=; b=krPg+WRB9Ni7NbMUPJFyquNtbNz+eWib9iuChqJPn4mYF6PoV8fmibqBl3vA0aO97XOl/q Khn2wc10mDrxuwD+0LBtKO85cTst3nTwGnEXIEqniG7GZtLE6y9QsF8BdPcBsEEMY2aH5f 9G+wRjmH62sIHUVsJSRLOsXr2OcwILHfPBCzChgIikR3x/dbp8OHetsKHSbc3A+L/XpcY2 UgpMDvZ9U3xfliw+rGLOPSY8lVRmQw7fWQ1EinTz+PmgGHVlaGWyHNyvJglTOSi3Dy6p+m 2xjk7cNsPp+VhcFIsPl/44Wo6s1opUmLMw5EnKZhYzy4hlD7LlZ5A3ypySH1GA== 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 4M1dHJ0m8tztgV; Mon, 8 Aug 2022 14:04: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 278E4S2Z089037; Mon, 8 Aug 2022 14:04:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 278E4SlJ089036; Mon, 8 Aug 2022 14:04:28 GMT (envelope-from git) Date: Mon, 8 Aug 2022 14:04:28 GMT Message-Id: <202208081404.278E4SlJ089036@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 789dbdbb4857 - main - linuxkpi: Add arch_io_{reserve,free}_memtype_wc 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: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 789dbdbb485749340110be550a03c6df22bc9c9c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659967468; 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=n4ahmZc0vrUOC8Gl5F+Yc44PCXxwxTmA7ZtPdbRwiFM=; b=WuMLgWPUtO98U/NcINOLoUVAwc0Hm9qyYt8WozVX/UnD4VqH4bYGaqSBZG3xiob3gx3FMd uxWAETxPTrk8aBjj5H1HAniEtd9eTLlAKdOQtrdwBsxGo4tEZy3kJDPd+11CWUwcC/d1pS WfF16HOC9XNwjnL9c6JMJ8i0+QC73xMuis3ShDKRvYZYnQTIJOzvHYCFIHzxDAC/WFJflr l+l5+38RNKgDrJmVPXx1vbo+Vo0hPHzWLl2yeSYLFPAfQ2eDTHjGOpANavrdFYKTB8kcZc Z48es9XZlTtXBRyrC5msWfFO2dzUAjxCaoFGrsps8/xq1NH4Uj3+3WkU0VHlaQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1659967468; a=rsa-sha256; cv=none; b=SghLQ7/SW/0UUpzV0gw8FuDYO+hYqfmDB1VuRQjCp7VWSDjZjG+23ZvrjlRhYeFEaLp5mF Iwd8qULEa7xIFrinlMy59z/YNJRfbJK+j1+wZRN1O7VXxKxxpi6v8kH+MWjeiKEFnFPCvj 8otgGSvZCjCzdhPztmr++QDFl6GwIcjD6vbq1yAWvPcZ1ipocZpaRoeZynohLHv7LNLg4B keZTT0T+tjYBr2OXSZrCKrs/xuGdDjOrEJPiLEWvjngCjUREKc47QtKRq5XUqGKeeS5HET nDoRQmIUqEFejhSgwaLHJMPvh+CXv7mcsomryXwEjyrNfbDWVwb7t7O54JHbbA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=789dbdbb485749340110be550a03c6df22bc9c9c commit 789dbdbb485749340110be550a03c6df22bc9c9c Author: Emmanuel Vadot AuthorDate: 2022-08-02 08:27:00 +0000 Commit: Emmanuel Vadot CommitDate: 2022-08-08 13:22:36 +0000 linuxkpi: Add arch_io_{reserve,free}_memtype_wc Reviewed by: hselasky Obtained from: drm-kmod Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D36022 --- sys/compat/linuxkpi/common/include/linux/io.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/io.h b/sys/compat/linuxkpi/common/include/linux/io.h index 0790e518a1a3..32183707c255 100644 --- a/sys/compat/linuxkpi/common/include/linux/io.h +++ b/sys/compat/linuxkpi/common/include/linux/io.h @@ -38,6 +38,7 @@ #include #include +#include /* * XXX This is all x86 specific. It should be bus space access. @@ -494,4 +495,19 @@ void lkpi_arch_phys_wc_del(int); #define arch_phys_wc_index(x) \ (((x) < __MTRR_ID_BASE) ? -1 : ((x) - __MTRR_ID_BASE)) +#if defined(__amd64__) || defined(__i386__) || defined(__aarch64__) || defined(__powerpc__) || defined(__riscv) +static inline int +arch_io_reserve_memtype_wc(resource_size_t start, resource_size_t size) +{ + + return (set_memory_wc(start, size >> PAGE_SHIFT)); +} + +static inline void +arch_io_free_memtype_wc(resource_size_t start, resource_size_t size) +{ + set_memory_wb(start, size >> PAGE_SHIFT); +} +#endif + #endif /* _LINUXKPI_LINUX_IO_H_ */