From nobody Wed Sep 07 15:10:07 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 4MN5KD2p2pz4bPGj; Wed, 7 Sep 2022 15:10:08 +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 4MN5KC74skz3Y4H; Wed, 7 Sep 2022 15:10:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662563408; 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=x6xCh50lTE0DLvdsj8p3mZubGDhHccPhzH6vE5antbA=; b=Cr4VmDhbmc/a0cza8+7DtBzmgouPmElbHR0IGDfaRVwO4mmNKKysFbqZGDoRtS6Qe71gMs nmDYR1kI0RXmxxAhnHiYlL5Zqnq85CYQ4wNVGfr+RoE0HQbF5hJxvmG6bdCve3eJE8ZF/j 2d0XUmompsu370uVeVuSiBptVrZyZUQ1+mVM64SURO/FpPV17Ziu9rAN3a9FAMgvh/6zvZ aAUCpHW9dGYFtdlmn8e2oMH0GzCKQHul26ARBo19rhK8KrCON+zVdKAQh6fCNT+1xHgkms t1ypjYGZ5GZBi2vfChfQVREUPAbA5k1uzfgr5y8q8qJI0gxYSk/K+drhzXa0bA== 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 4MN5KC67yFzZ8l; Wed, 7 Sep 2022 15:10:07 +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 287FA7eS020276; Wed, 7 Sep 2022 15:10:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 287FA79C020273; Wed, 7 Sep 2022 15:10:07 GMT (envelope-from git) Date: Wed, 7 Sep 2022 15:10:07 GMT Message-Id: <202209071510.287FA79C020273@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: e82a5dd0e6cf - stable/13 - linuxkpi: Add pagevec implementation 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: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e82a5dd0e6cffd3c50213ced73ce6105e2fa8a8c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662563408; 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=x6xCh50lTE0DLvdsj8p3mZubGDhHccPhzH6vE5antbA=; b=B8gcxxIZ63I6XsrgHV7DRhLrwIHZaMVxHCW9jGq9q5PvatCuPAwQKeXZj2DVHk2r42rW0o Vhrcw6KJ9QaodJIGIBxo2d2yfDgl16t9/8s7/kw9kyibw47nE5f0vnBgvIPTbXGx2N4mb0 b6dlsPLrB7LNsM1zAgTC5JB3s2lgn7P5grqdBGAAkJVCtqxwnZnRfY/4E99EVSdZS++COT +eUmGlvm2n/fuw8O+wkEN2v4uqlLC2LEFzGKj3jSp/RP80Tk0EPGDlxHVn+AgJpRMnsn++ V3AvRdfF2cKOkcDq8EAi6jgInO7ptDGXgwfP1OwIUcviBzYiGfeqOO6pHcyM5Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1662563408; a=rsa-sha256; cv=none; b=HGKz9Ma7nQO0mN2s7IKsDF/5P9+TCP6y5fcF4M69wC4hKuiSvYufiZ5omCeMyjV4SrC4lg JOcW1Mb/6CjpToxQ7sIeET3DQtkRz6PLHxjoGz465Ksh7IGEtZHEFHoupU2TfdQvhSRvNq md0o0/rn2N1rUiFdwv+DAVWcIIDTlM2pfZcm6Y1OTFBpl/A1YValH+gi8U99CHtEvOqi9E A3avtQPjlH46TXB1pyaf2R8o1JpZheU0nIzjv4sNxXbcoDrQx4onmodWJSwyWIIj0aNlti YPc/v1etIhQiCcsXatmvGE+MoI9hAOhwbE3yJBR9lEFR3ySntsJ6xmrXd0aaaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=e82a5dd0e6cffd3c50213ced73ce6105e2fa8a8c commit e82a5dd0e6cffd3c50213ced73ce6105e2fa8a8c Author: Emmanuel Vadot AuthorDate: 2022-07-26 08:15:12 +0000 Commit: Emmanuel Vadot CommitDate: 2022-09-07 15:09:03 +0000 linuxkpi: Add pagevec implementation Needed by drm-kmod. Reviewed by: hselasky Obtained from: OpenBSD Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D35941 (cherry picked from commit a0c171328f6689fb88e3881b8b5ee61d813b8c6d) --- sys/compat/linuxkpi/common/include/linux/pagevec.h | 69 ++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/pagevec.h b/sys/compat/linuxkpi/common/include/linux/pagevec.h new file mode 100644 index 000000000000..4224124c4fe4 --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/pagevec.h @@ -0,0 +1,69 @@ +/* Public domain. */ + +#ifndef _LINUXKPI_LINUX_PAGEVEC_H_ +#define _LINUXKPI_LINUX_PAGEVEC_H_ + +#include +#include +#include + +#include + +#define PAGEVEC_SIZE 15 + +struct pagevec { + uint8_t nr; + struct vm_page *pages[PAGEVEC_SIZE]; +}; + +static inline unsigned int +pagevec_space(struct pagevec *pvec) +{ + return PAGEVEC_SIZE - pvec->nr; +} + +static inline void +pagevec_init(struct pagevec *pvec) +{ + pvec->nr = 0; +} + +static inline void +pagevec_reinit(struct pagevec *pvec) +{ + pvec->nr = 0; +} + +static inline unsigned int +pagevec_count(struct pagevec *pvec) +{ + return pvec->nr; +} + +static inline unsigned int +pagevec_add(struct pagevec *pvec, struct vm_page *page) +{ + pvec->pages[pvec->nr++] = page; + return PAGEVEC_SIZE - pvec->nr; +} + +static inline void +__pagevec_release(struct pagevec *pvec) +{ + release_pages(pvec->pages, pagevec_count(pvec)); + pagevec_reinit(pvec); +} + +static inline void +pagevec_release(struct pagevec *pvec) +{ + if (pagevec_count(pvec)) + __pagevec_release(pvec); +} + +static inline void +check_move_unevictable_pages(struct pagevec *pvec) +{ +} + +#endif /* _LINUXKPI_LINUX_PAGEVEC_H_ */