From 7e1a02baa5df99c8bfd727e34aa150a0c05a6ffc Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Tue, 22 Aug 2017 17:13:28 +0000 Subject: [PATCH] Add some miscellaneous definitions to support the DRM drivers. MFC after: 1 week --- sys/compat/linuxkpi/common/include/linux/device.h | 4 ++++ sys/compat/linuxkpi/common/include/linux/fs.h | 3 +++ sys/compat/linuxkpi/common/include/linux/kobject.h | 5 +++++ sys/compat/linuxkpi/common/include/linux/lockdep.h | 2 ++ sys/compat/linuxkpi/common/include/linux/module.h | 2 ++ 5 files changed, 16 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/device.h b/sys/compat/linuxkpi/common/include/linux/device.h index 7cf5b07327c..edc6cd8d9e0 100644 --- a/sys/compat/linuxkpi/common/include/linux/device.h +++ b/sys/compat/linuxkpi/common/include/linux/device.h @@ -50,12 +50,14 @@ enum irqreturn { IRQ_NONE = 0, IRQ_HANDLED, IRQ_WAKE_THREAD, }; typedef enum irqreturn irqreturn_t; struct device; +struct fwnode_handle; struct class { const char *name; struct module *owner; struct kobject kobj; devclass_t bsdclass; + const struct dev_pm_ops *pm; void (*class_release)(struct class *class); void (*dev_release)(struct device *dev); char * (*devnode)(struct device *dev, umode_t *mode); @@ -113,6 +115,7 @@ struct device { unsigned int msix; unsigned int msix_max; const struct attribute_group **groups; + struct fwnode_handle *fwnode; spinlock_t devres_lock; struct list_head devres_head; @@ -179,6 +182,7 @@ show_class_attr_string(struct class *class, #define dev_warn(dev, fmt, ...) device_printf((dev)->bsddev, fmt, ##__VA_ARGS__) #define dev_info(dev, fmt, ...) device_printf((dev)->bsddev, fmt, ##__VA_ARGS__) #define dev_notice(dev, fmt, ...) device_printf((dev)->bsddev, fmt, ##__VA_ARGS__) +#define dev_dbg(dev, fmt, ...) do { } while (0) #define dev_printk(lvl, dev, fmt, ...) \ device_printf((dev)->bsddev, fmt, ##__VA_ARGS__) diff --git a/sys/compat/linuxkpi/common/include/linux/fs.h b/sys/compat/linuxkpi/common/include/linux/fs.h index 6b163f57d23..ff0311b14da 100644 --- a/sys/compat/linuxkpi/common/include/linux/fs.h +++ b/sys/compat/linuxkpi/common/include/linux/fs.h @@ -53,9 +53,11 @@ struct pipe_inode_info; struct vm_area_struct; struct poll_table_struct; struct files_struct; +struct pfs_node; #define inode vnode #define i_cdev v_rdev +#define i_private v_data #define S_IRUGO (S_IRUSR | S_IRGRP | S_IROTH) #define S_IWUGO (S_IWUSR | S_IWGRP | S_IWOTH) @@ -65,6 +67,7 @@ typedef struct files_struct *fl_owner_t; struct dentry { struct inode *d_inode; + struct pfs_node *d_pfs_node; }; struct file_operations; diff --git a/sys/compat/linuxkpi/common/include/linux/kobject.h b/sys/compat/linuxkpi/common/include/linux/kobject.h index 261f3553946..f7280ff951b 100644 --- a/sys/compat/linuxkpi/common/include/linux/kobject.h +++ b/sys/compat/linuxkpi/common/include/linux/kobject.h @@ -135,6 +135,11 @@ kobject_create_and_add(const char *name, struct kobject *parent) return (NULL); } +static inline void +kobject_del(struct kobject *kobj __unused) +{ +} + static inline char * kobject_name(const struct kobject *kobj) { diff --git a/sys/compat/linuxkpi/common/include/linux/lockdep.h b/sys/compat/linuxkpi/common/include/linux/lockdep.h index ef562e300cd..4bf902de0f8 100644 --- a/sys/compat/linuxkpi/common/include/linux/lockdep.h +++ b/sys/compat/linuxkpi/common/include/linux/lockdep.h @@ -47,4 +47,6 @@ struct lock_class_key { #define lockdep_is_held(m) (sx_xholder(&(m)->sx) == curthread) +#define might_lock(m) do { } while (0) + #endif /* _LINUX_LOCKDEP_H_ */ diff --git a/sys/compat/linuxkpi/common/include/linux/module.h b/sys/compat/linuxkpi/common/include/linux/module.h index 13e5e0012d8..d3eecc8e1f2 100644 --- a/sys/compat/linuxkpi/common/include/linux/module.h +++ b/sys/compat/linuxkpi/common/include/linux/module.h @@ -102,4 +102,6 @@ _module_run(void *arg) #define module_put(module) #define try_module_get(module) 1 +#define postcore_initcall(fn) module_init(fn) + #endif /* _LINUX_MODULE_H_ */