Module: xenomai-3 Branch: stable-3.0.x Commit: 99ac573535c22e97605bd01b5eaa41c54ae927f6 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=99ac573535c22e97605bd01b5eaa41c54ae927f6
Author: Philippe Gerum <r...@xenomai.org> Date: Thu Mar 3 09:16:21 2016 +0100 cobalt/wrappers: add wrapper for reinit_completion() --- .../cobalt/include/asm-generic/xenomai/wrappers.h | 75 ++++++++++---------- 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/kernel/cobalt/include/asm-generic/xenomai/wrappers.h b/kernel/cobalt/include/asm-generic/xenomai/wrappers.h index f889a7d..060ce85 100644 --- a/kernel/cobalt/include/asm-generic/xenomai/wrappers.h +++ b/kernel/cobalt/include/asm-generic/xenomai/wrappers.h @@ -29,22 +29,34 @@ /* * To keep the #ifdefery as readable as possible, please: * - * - keep the conditional structure flat, no nesting (e.g. do not nest + * - keep the conditional structure flat, no nesting (e.g. do not fold * the pre-3.11 conditions into the pre-3.14 ones). - * - group all wrappers which share the same condition. + * - group all wrappers for a single kernel revision. + * - list conditional blocks in order of kernel release, latest first * - identify the first kernel release for which the wrapper should * be defined, instead of testing the existence of a preprocessor * symbol, so that obsolete wrappers can be spotted. - * - put the newer wrappers in front, so that old wrappers can be removed - * without side effects on newer wrappers. */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) +#define user_msghdr msghdr +#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0) #include <linux/netdevice.h> #undef alloc_netdev #define alloc_netdev(sizeof_priv, name, name_assign_type, setup) \ alloc_netdev_mqs(sizeof_priv, name, setup, 1, 1) + +#include <linux/trace_seq.h> + +static inline unsigned char * +trace_seq_buffer_ptr(struct trace_seq *s) +{ + return s->buffer + s->len; +} + #endif /* < 3.17 */ #if LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0) @@ -60,28 +72,30 @@ #include <linux/pci.h> #ifdef CONFIG_PCI -#define pci_enable_msix_range \ - COBALT_BACKPORT(pci_enable_msix_range) +#define pci_enable_msix_range COBALT_BACKPORT(pci_enable_msix_range) #ifdef CONFIG_PCI_MSI int pci_enable_msix_range(struct pci_dev *dev, - struct msix_entry *entries, - int minvec, int maxvec); -#else /* not pci msi */ -static inline int pci_enable_msix_range(struct pci_dev *dev, - struct msix_entry *entries, - int minvec, int maxvec) -{ return -ENOSYS; } -#endif /* not pci msi */ -#endif /* pci */ + struct msix_entry *entries, + int minvec, int maxvec); +#else /* !CONFIG_PCI_MSI */ +static inline +int pci_enable_msix_range(struct pci_dev *dev, + struct msix_entry *entries, + int minvec, int maxvec) +{ + return -ENOSYS; +} +#endif /* !CONFIG_PCI_MSI */ +#endif /* CONFIG_PCI */ #endif /* < 3.14 */ #if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0) #include <linux/dma-mapping.h> #include <linux/hwmon.h> -#define dma_set_mask_and_coherent \ - COBALT_BACKPORT(dma_set_mask_and_coherent) -static inline int dma_set_mask_and_coherent(struct device *dev, u64 mask) +#define dma_set_mask_and_coherent COBALT_BACKPORT(dma_set_mask_and_coherent) +static inline +int dma_set_mask_and_coherent(struct device *dev, u64 mask) { int rc = dma_set_mask(dev, mask); if (rc == 0) @@ -103,8 +117,11 @@ struct device * devm_hwmon_device_register_with_groups(struct device *dev, const char *name, void *drvdata, const struct attribute_group **groups); -#endif /* hwmon */ -#endif /* < 3,13 */ +#endif /* !CONFIG_HWMON */ + +#define reinit_completion(__x) INIT_COMPLETION(*(__x)) + +#endif /* < 3.13 */ #if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0) #define DEVICE_ATTR_RW(_name) __ATTR_RW(_name) @@ -116,22 +133,4 @@ devm_hwmon_device_register_with_groups(struct device *dev, const char *name, #error "Xenomai/cobalt requires Linux kernel 3.10 or above" #endif /* < 3.10 */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0) -#include <linux/trace_seq.h> - -static inline unsigned char * -trace_seq_buffer_ptr(struct trace_seq *s) -{ - return s->buffer + s->len; -} -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) -#define user_msghdr msghdr -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) -#define user_msghdr msghdr -#endif - #endif /* _COBALT_ASM_GENERIC_WRAPPERS_H */ _______________________________________________ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git