hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/include/linux/uio_driver.h
....@@ -1,3 +1,4 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * include/linux/uio_driver.h
34 *
....@@ -7,8 +8,6 @@
78 * Copyright(C) 2006, Greg Kroah-Hartman <greg@kroah.com>
89 *
910 * Userspace IO driver.
10
- *
11
- * Licensed under the GPLv2 only.
1211 */
1312
1413 #ifndef _UIO_DRIVER_H_
....@@ -17,6 +16,7 @@
1716 #include <linux/device.h>
1817 #include <linux/fs.h>
1918 #include <linux/interrupt.h>
19
+#include <linux/android_kabi.h>
2020
2121 struct module;
2222 struct uio_map;
....@@ -25,10 +25,10 @@
2525 * struct uio_mem - description of a UIO memory region
2626 * @name: name of the memory region for identification
2727 * @addr: address of the device's memory rounded to page
28
- * size (phys_addr is used since addr can be
29
- * logical, virtual, or physical & phys_addr_t
30
- * should always be large enough to handle any of
31
- * the address types)
28
+ * size (phys_addr is used since addr can be
29
+ * logical, virtual, or physical & phys_addr_t
30
+ * should always be large enough to handle any of
31
+ * the address types)
3232 * @offs: offset of device memory within the page
3333 * @size: size of IO (multiple of page size)
3434 * @memtype: type of memory addr points to
....@@ -68,16 +68,18 @@
6868 #define MAX_UIO_PORT_REGIONS 5
6969
7070 struct uio_device {
71
- struct module *owner;
71
+ struct module *owner;
7272 struct device dev;
73
- int minor;
74
- atomic_t event;
75
- struct fasync_struct *async_queue;
76
- wait_queue_head_t wait;
77
- struct uio_info *info;
73
+ int minor;
74
+ atomic_t event;
75
+ struct fasync_struct *async_queue;
76
+ wait_queue_head_t wait;
77
+ struct uio_info *info;
7878 struct mutex info_lock;
79
- struct kobject *map_dir;
80
- struct kobject *portio_dir;
79
+ struct kobject *map_dir;
80
+ struct kobject *portio_dir;
81
+
82
+ ANDROID_KABI_RESERVE(1);
8183 };
8284
8385 /**
....@@ -110,6 +112,7 @@
110112 int (*open)(struct uio_info *info, struct inode *inode);
111113 int (*release)(struct uio_info *info, struct inode *inode);
112114 int (*irqcontrol)(struct uio_info *info, s32 irq_on);
115
+ ANDROID_KABI_RESERVE(1);
113116 };
114117
115118 extern int __must_check
....@@ -124,6 +127,15 @@
124127 extern void uio_unregister_device(struct uio_info *info);
125128 extern void uio_event_notify(struct uio_info *info);
126129
130
+extern int __must_check
131
+ __devm_uio_register_device(struct module *owner,
132
+ struct device *parent,
133
+ struct uio_info *info);
134
+
135
+/* use a define to avoid include chaining to get THIS_MODULE */
136
+#define devm_uio_register_device(parent, info) \
137
+ __devm_uio_register_device(THIS_MODULE, parent, info)
138
+
127139 /* defines for uio_info->irq */
128140 #define UIO_IRQ_CUSTOM -1
129141 #define UIO_IRQ_NONE 0
....@@ -133,6 +145,7 @@
133145 #define UIO_MEM_PHYS 1
134146 #define UIO_MEM_LOGICAL 2
135147 #define UIO_MEM_VIRTUAL 3
148
+#define UIO_MEM_IOVA 4
136149
137150 /* defines for uio_port->porttype */
138151 #define UIO_PORT_NONE 0