From nobody Sun Dec 24 08:23:17 2023 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 4SyYvV4KYKz54HXy; Sun, 24 Dec 2023 08:23:18 +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 4SyYvV1Zfmz4Y2p; Sun, 24 Dec 2023 08:23:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703406198; 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=s3q5zm0/88o6kxDwFIOn8ceob/+Cj3XXm3WWHCZXZ48=; b=QYpQCklKkDDpNWzRgR3DaP+bG1SfwRCAyOz9mmYrr2b89JBi8qa5Ov/NrgMv/XCxGPnwSW yXX2qXAX/4adfeww6PbsSMpA8pXex+MSfSipEOY2Cg4V0vuepVjQHxkKKuhD6cN91vbCEu dev/F3Hu2MMEBN6iW2/18Lwfh7HJl3Fe9kcxNT0cSpZm2+0hvciuycOKvh6f2a9IWdomWD 4YBYDjrcFrUJBC0ju+W+WI7TDCI8pMFA+zkK++grzXM0BasIV/5lqZCRmP4hdAZkuJiC/H GLervU/EzPbZJ4+q/X9QTKkJQn12JlhoH4+b+JglCbzKSFvby2I7GYJ7K0722g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703406198; a=rsa-sha256; cv=none; b=sqr+/OZc6QFblSTu/pxyb3G0qpuhFEG0ATkQGYLVq2utuRCKopQlDR9i4y1pJoxDaxO0kl fzGT0HA+Rpdrq8lfxIXdKUzX1FXgBW48qZJB2XlyveFNMqp8FxrPP3mEzS7fUjSzu/y4cP ccxRD5j7ByO/NtL4r/g2V5X8pOK6utHXoQXk95UXL5IVhEuclfcxJ7/9+A6crBommFOUCw E9I1FUgj+HJmSn6JNfdpJV/3QbrgYF/2fEC6klOtCR1ilGu2VqNZs9xvzXgoVAWY4eru6g pPcKeKqZF8InfOgf7iRdtB4p/5SkHPORg4WPozlCO1E78cIQtrr79v/qPAKJcw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703406198; 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=s3q5zm0/88o6kxDwFIOn8ceob/+Cj3XXm3WWHCZXZ48=; b=XTzd2ME+Nfud958ANyZmkdmbWVilJTWsS57OaKr1gB+laCN3TXwGEVdgs6g4QpecdZt8uU 4YzI4kNSi2X+sdvwBBjb2aDJjv/vFVNEm/miFBMmeUAacLsFjKMZuX2bS3n66BDeK5gtYT k4yViyNmevvSbZigo9EK0fbVOfHQKwY4eh3A7e8MXxA87y+zj4JuLLupavnFNo5A1dKNJp RND4rUuNKi471CjnjvuhO+nbYsduTT5lWSYDdgp5UhpBkrLemcKe3/cx0OEJMjswvTSwC8 KhAMLPCV+k1UP54rOxbPtxxFrRU5EwyQKS4db7Ek2n1yFK5lLQLt/F0dz/em4w== 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 4SyYvV0HyHz5Th; Sun, 24 Dec 2023 08:23:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BO8NHQb087517; Sun, 24 Dec 2023 08:23:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BO8NHSS087514; Sun, 24 Dec 2023 08:23:17 GMT (envelope-from git) Date: Sun, 24 Dec 2023 08:23:17 GMT Message-Id: <202312240823.3BO8NHSS087514@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 9903d83d67ea - main - LinuxKPI: Add linux/ioport.h header 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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9903d83d67ea5eed7c36fbe8b4afe6c4dd148d0e Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=9903d83d67ea5eed7c36fbe8b4afe6c4dd148d0e commit 9903d83d67ea5eed7c36fbe8b4afe6c4dd148d0e Author: Vladimir Kondratyev AuthorDate: 2023-12-24 08:20:00 +0000 Commit: Vladimir Kondratyev CommitDate: 2023-12-24 08:20:00 +0000 LinuxKPI: Add linux/ioport.h header Sponsored by: Serenity Cyber Security, LLC MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42817 --- sys/compat/linuxkpi/common/include/linux/ioport.h | 57 +++++++++++++++++++++++ sys/compat/linuxkpi/dummy/include/linux/ioport.h | 0 2 files changed, 57 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/ioport.h b/sys/compat/linuxkpi/common/include/linux/ioport.h new file mode 100644 index 000000000000..444f3ad94602 --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/ioport.h @@ -0,0 +1,57 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2023 Serenity Cyber Security, LLC. + * + * 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_IOPORT_H +#define _LINUXKPI_LINUX_IOPORT_H + +#include +#include + +#define DEFINE_RES_MEM(_start, _size) \ + (struct resource) { \ + .start = (_start), \ + .end = (_start) + (_size) - 1, \ + } + +struct resource { + resource_size_t start; + resource_size_t end; +}; + +static inline resource_size_t +resource_size(const struct resource *r) +{ + return (r->end - r->start + 1); +} + +static inline bool +resource_contains(struct resource *a, struct resource *b) +{ + return (a->start <= b->start && a->end >= b->end); +} + +#endif diff --git a/sys/compat/linuxkpi/dummy/include/linux/ioport.h b/sys/compat/linuxkpi/dummy/include/linux/ioport.h deleted file mode 100644 index e69de29bb2d1..000000000000