From nobody Tue Apr 05 05:10:08 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 62EF11AA3D36; Tue, 5 Apr 2022 05:10:11 +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 4KXbLT5xGqz3hnx; Tue, 5 Apr 2022 05:10:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649135409; 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=1x/KjnW/omhKVh+XpGHjxSfJ4BShlBDyrS7xsFiIRCE=; b=jF/1x3+6mIcPf6L8aZiG/Yrgq4Ru5/8XP2ENqXqk87EqEqSlHMS2UuFV2MlvtDaFGolSll URnF0DYja1rGLdtV8NoYVKczYf2EOPmJY3Zz3k8Gm52qJpRzojRqy0vvgS3La+SrLNakW+ PjLc63esez01dd7/HKdBnrwE6NjiaAyyCnS6980MepEt7V7uuaw2YgDhYHlxRKOIRNLLS5 iIYzHjhiLOQyDXoZ2U3pXMxGKBfLKQoujVcIUme4w9FBMjdIoS6CmtlrqajMdIqt/6BkOx 7IzCy+VXWoYQGjnTJIPR7abhK+z0zSB4xSF8fBazt7uuu6N9UQ0bOuhnJ1uhxg== 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 180C720599; Tue, 5 Apr 2022 05:10:09 +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 2355A95b054569; Tue, 5 Apr 2022 05:10:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2355A8CB054566; Tue, 5 Apr 2022 05:10:08 GMT (envelope-from git) Date: Tue, 5 Apr 2022 05:10:08 GMT Message-Id: <202204050510.2355A8CB054566@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 132b00f90613 - main - linuxkpi: move io_mapping_create_wc to .c 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 132b00f90613d8cc797137d4c3d2dcb99ba3c690 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649135409; 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=1x/KjnW/omhKVh+XpGHjxSfJ4BShlBDyrS7xsFiIRCE=; b=vICIuQ1cCO0cdsBsSPpjoU9znI/X2Cd1DuSfqr2kNWEehNkY7LFX3/KasdIZimu36B4cR4 9tkURKwkbKNjv4gETBMAqqbW9te6ORxG7L7bWoRp/M3NVuybAJPEK+emwV0gyDQzX32iS+ fQmgtHSYDTnzFRwjsQ1GNt1KzsYBljK8tiQ3xUIrTvtoOkIIU7y2f9tWfwWQpWRStGajz/ uuQ33bmUPb67ncqV7Nno7/zxAfchYEhbmX/gGpUxg5QGC0gw8i//QhxTjbesAbK830qSyF XLBTuQ8OS/fxYD077YECepPOb8ehES3qmUABlnwGS2DNWzGPOzJiEH15alex/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1649135409; a=rsa-sha256; cv=none; b=UkUMwv7PInAJJfkRkpDi23JjICmkG3VUxCcXeteGOSkrvke3PQpjoVaR7YTDnaH13GYrS4 3uMoTuYYpvJcuWyI2w4cW8p1Qp+UbOeIH4P9VpuIPTP72944bm+nlXfp9J79cbsTOeuJOU iWFt9DLRDId90Px2NGmK5iuBzYJ4WUS5bX6oR6j7Xl5Vima4Y3RyNZdmGAPKJrstzSMYC1 NuR/i04j8Zu8mIU7+BfH+NeLt/yG0Vu2u06cYs6idAZUZpX3r1WQSJMRe0bXhYiogZnaZO lPDVvwD6elDc0cj603BTJT2tv5Aybw/ucUNMCoigAzV6NOrrqJkxcCfrcEuihA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=132b00f90613d8cc797137d4c3d2dcb99ba3c690 commit 132b00f90613d8cc797137d4c3d2dcb99ba3c690 Author: Warner Losh AuthorDate: 2022-04-05 05:06:37 +0000 Commit: Warner Losh CommitDate: 2022-04-05 05:06:37 +0000 linuxkpi: move io_mapping_create_wc to .c Move io_mapping_create_wc to .c because it encodes the size of struct io_mapping so we move this from the client module to the linuxkpi module. Sponsored by: Netflix Reviewed by: hselasky, emaste Differential Revision: https://reviews.freebsd.org/D34776 --- sys/compat/linuxkpi/common/include/linux/io-mapping.h | 13 ++----------- sys/compat/linuxkpi/common/src/linux_compat.c | 12 ++++++++++++ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/io-mapping.h b/sys/compat/linuxkpi/common/include/linux/io-mapping.h index 9c7ad5095bf3..5c24f1ff8659 100644 --- a/sys/compat/linuxkpi/common/include/linux/io-mapping.h +++ b/sys/compat/linuxkpi/common/include/linux/io-mapping.h @@ -46,6 +46,8 @@ struct io_mapping { vm_memattr_t attr; }; +struct io_mapping *io_mapping_create_wc(resource_size_t base, unsigned long size); + static inline struct io_mapping * io_mapping_init_wc(struct io_mapping *mapping, resource_size_t base, unsigned long size) @@ -63,17 +65,6 @@ io_mapping_init_wc(struct io_mapping *mapping, resource_size_t base, return (mapping); } -static inline struct io_mapping * -io_mapping_create_wc(resource_size_t base, unsigned long size) -{ - struct io_mapping *mapping; - - mapping = kmalloc(sizeof(*mapping), GFP_KERNEL); - if (mapping == NULL) - return (NULL); - return (io_mapping_init_wc(mapping, base, size)); -} - static inline void io_mapping_fini(struct io_mapping *mapping) { diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 52dc010b100f..8644f67762d9 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -87,6 +87,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -2716,6 +2717,17 @@ linuxkpi_net_ratelimit(void) lkpi_net_maxpps)); } +struct io_mapping * +io_mapping_create_wc(resource_size_t base, unsigned long size) +{ + struct io_mapping *mapping; + + mapping = kmalloc(sizeof(*mapping), GFP_KERNEL); + if (mapping == NULL) + return (NULL); + return (io_mapping_init_wc(mapping, base, size)); +} + #if defined(__i386__) || defined(__amd64__) bool linux_cpu_has_clflush; #endif