git: 1bce29bcf121 - main - LinuxKPI: Add some header pollution and dummy headers

From: Vladimir Kondratyev <wulf_at_FreeBSD.org>
Date: Sun, 24 Dec 2023 08:23:01 UTC
The branch main has been updated by wulf:

URL: https://cgit.FreeBSD.org/src/commit/?id=1bce29bcf121c1e16205fabb100f798d88f757c1

commit 1bce29bcf121c1e16205fabb100f798d88f757c1
Author:     Vladimir Kondratyev <wulf@FreeBSD.org>
AuthorDate: 2023-12-24 08:19:58 +0000
Commit:     Vladimir Kondratyev <wulf@FreeBSD.org>
CommitDate: 2023-12-24 08:19:58 +0000

    LinuxKPI: Add some header pollution and dummy headers
    
    required by recent drm-kmod to be succesfully compiled.
    
    Sponsored by:   Serenity Cyber Security, LLC
    Reviewed by:    manu, bz
    Obtained from:  OpenBSD (partially)
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D42798
---
 .../linuxkpi/common/include/linux/irqdomain.h      | 10 +++++++
 sys/compat/linuxkpi/common/include/linux/kobject.h |  2 ++
 sys/compat/linuxkpi/common/include/linux/of.h      | 33 ++++++++++++++++++++++
 .../linuxkpi/common/include/linux/shmem_fs.h       |  3 ++
 .../include/{linux/irqdomain.h => asm/neon.h}      |  0
 .../linuxkpi/dummy/include/linux/dev_printk.h      |  0
 .../linuxkpi/dummy/include/linux/device/bus.h      |  0
 sys/compat/linuxkpi/dummy/include/linux/mei_aux.h  |  0
 sys/compat/linuxkpi/dummy/include/linux/prandom.h  |  0
 sys/compat/linuxkpi/dummy/include/linux/sysfb.h    |  0
 .../linuxkpi/dummy/include/video/nomodeset.h       |  0
 11 files changed, 48 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/linux/irqdomain.h b/sys/compat/linuxkpi/common/include/linux/irqdomain.h
new file mode 100644
index 000000000000..c7788e51cc89
--- /dev/null
+++ b/sys/compat/linuxkpi/common/include/linux/irqdomain.h
@@ -0,0 +1,10 @@
+/* Public domain. */
+
+#ifndef _LINUXKPI_LINUX_IRQDOMAIN_H
+#define	_LINUXKPI_LINUX_IRQDOMAIN_H
+
+#include <linux/mutex.h>
+#include <linux/of.h>
+#include <linux/radix-tree.h>
+
+#endif
diff --git a/sys/compat/linuxkpi/common/include/linux/kobject.h b/sys/compat/linuxkpi/common/include/linux/kobject.h
index dadf3b3b0849..512f47f9e4b4 100644
--- a/sys/compat/linuxkpi/common/include/linux/kobject.h
+++ b/sys/compat/linuxkpi/common/include/linux/kobject.h
@@ -36,6 +36,8 @@
 #include <linux/list.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
+#include <linux/wait.h>
+#include <linux/workqueue.h>
 
 struct kobject;
 struct kset;
diff --git a/sys/compat/linuxkpi/common/include/linux/of.h b/sys/compat/linuxkpi/common/include/linux/of.h
new file mode 100644
index 000000000000..fb4554a8ddbc
--- /dev/null
+++ b/sys/compat/linuxkpi/common/include/linux/of.h
@@ -0,0 +1,33 @@
+/*-
+ * 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_OF_H
+#define	_LINUXKPI_LINUX_OF_H
+
+#include <linux/kobject.h>
+
+#endif
diff --git a/sys/compat/linuxkpi/common/include/linux/shmem_fs.h b/sys/compat/linuxkpi/common/include/linux/shmem_fs.h
index d373cfa1d611..efa2c855fe7d 100644
--- a/sys/compat/linuxkpi/common/include/linux/shmem_fs.h
+++ b/sys/compat/linuxkpi/common/include/linux/shmem_fs.h
@@ -29,7 +29,10 @@
 #ifndef	_LINUXKPI_LINUX_SHMEM_FS_H_
 #define	_LINUXKPI_LINUX_SHMEM_FS_H_
 
+#include <linux/file.h>
+#include <linux/mempolicy.h>
 #include <linux/pagemap.h>
+#include <linux/swap.h>
 
 /* Shared memory support */
 struct page *linux_shmem_read_mapping_page_gfp(vm_object_t obj, int pindex,
diff --git a/sys/compat/linuxkpi/dummy/include/linux/irqdomain.h b/sys/compat/linuxkpi/dummy/include/asm/neon.h
similarity index 100%
rename from sys/compat/linuxkpi/dummy/include/linux/irqdomain.h
rename to sys/compat/linuxkpi/dummy/include/asm/neon.h
diff --git a/sys/compat/linuxkpi/dummy/include/linux/dev_printk.h b/sys/compat/linuxkpi/dummy/include/linux/dev_printk.h
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/sys/compat/linuxkpi/dummy/include/linux/device/bus.h b/sys/compat/linuxkpi/dummy/include/linux/device/bus.h
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/sys/compat/linuxkpi/dummy/include/linux/mei_aux.h b/sys/compat/linuxkpi/dummy/include/linux/mei_aux.h
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/sys/compat/linuxkpi/dummy/include/linux/prandom.h b/sys/compat/linuxkpi/dummy/include/linux/prandom.h
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/sys/compat/linuxkpi/dummy/include/linux/sysfb.h b/sys/compat/linuxkpi/dummy/include/linux/sysfb.h
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/sys/compat/linuxkpi/dummy/include/video/nomodeset.h b/sys/compat/linuxkpi/dummy/include/video/nomodeset.h
new file mode 100644
index 000000000000..e69de29bb2d1