19 #ifndef _COBALT_ASM_GENERIC_WRAPPERS_H 21 #include <linux/version.h> 23 #ifdef CONFIG_IPIPE_LEGACY 24 #error "CONFIG_IPIPE_LEGACY must be switched off" 27 #define COBALT_BACKPORT(__sym) __cobalt_backport_ ##__sym 41 #if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) 42 #define in_ia32_syscall() (current_thread_info()->status & TS_COMPAT) 45 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) 46 #define user_msghdr msghdr 49 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0) 50 #include <linux/netdevice.h> 53 #define alloc_netdev(sizeof_priv, name, name_assign_type, setup) \ 54 alloc_netdev_mqs(sizeof_priv, name, setup, 1, 1) 56 #include <linux/trace_seq.h> 58 static inline unsigned char *
59 trace_seq_buffer_ptr(
struct trace_seq *s)
61 return s->buffer + s->len;
66 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0) 67 #define smp_mb__before_atomic() smp_mb() 68 #define smp_mb__after_atomic() smp_mb() 71 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0) 72 #define raw_cpu_ptr(v) __this_cpu_ptr(v) 75 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0) 76 #include <linux/pci.h> 79 #define pci_enable_msix_range COBALT_BACKPORT(pci_enable_msix_range) 81 int pci_enable_msix_range(
struct pci_dev *dev,
82 struct msix_entry *entries,
83 int minvec,
int maxvec);
86 int pci_enable_msix_range(
struct pci_dev *dev,
87 struct msix_entry *entries,
88 int minvec,
int maxvec)
96 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0) 97 #include <linux/dma-mapping.h> 98 #include <linux/hwmon.h> 100 #define dma_set_mask_and_coherent COBALT_BACKPORT(dma_set_mask_and_coherent) 102 int dma_set_mask_and_coherent(
struct device *dev, u64 mask)
104 int rc = dma_set_mask(dev, mask);
106 dma_set_coherent_mask(dev, mask);
111 #define hwmon_device_register_with_groups \ 112 COBALT_BACKPORT(hwmon_device_register_with_groups) 114 hwmon_device_register_with_groups(
struct device *dev,
const char *name,
116 const struct attribute_group **groups);
118 #define devm_hwmon_device_register_with_groups \ 119 COBALT_BACKPORT(devm_hwmon_device_register_with_groups) 121 devm_hwmon_device_register_with_groups(
struct device *dev,
const char *name,
123 const struct attribute_group **groups);
126 #define reinit_completion(__x) INIT_COMPLETION(*(__x)) 130 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0) 131 #define DEVICE_ATTR_RW(_name) __ATTR_RW(_name) 132 #define DEVICE_ATTR_RO(_name) __ATTR_RO(_name) 133 #define DEVICE_ATTR_WO(_name) __ATTR_WO(_name) 136 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) 137 #error "Xenomai/cobalt requires Linux kernel 3.10 or above" 140 #if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0) 141 #define cobalt_get_restart_block(p) (&task_thread_info(p)->restart_block) 143 #define cobalt_get_restart_block(p) (&(p)->restart_block)