[Xenomai-git] Philippe Gerum : cobalt/kernel: convert to current cpumask operators
Module: xenomai-3 Branch: stable-3.0.x Commit: 1dfe87355429f9d08eb5837b1f56f5de96a8dc95 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=1dfe87355429f9d08eb5837b1f56f5de96a8dc95 Author: Philippe GerumDate: Sun Nov 8 20:45:12 2015 +0100 cobalt/kernel: convert to current cpumask operators --- include/cobalt/kernel/sched.h |4 ++-- kernel/cobalt/clock.c |3 +-- kernel/cobalt/init.c|4 ++-- kernel/cobalt/posix/process.c |8 kernel/cobalt/sched.c | 22 +++--- kernel/cobalt/thread.c | 18 +- kernel/cobalt/timer.c |2 +- kernel/drivers/testing/switchtest.c |6 +++--- 8 files changed, 33 insertions(+), 34 deletions(-) diff --git a/include/cobalt/kernel/sched.h b/include/cobalt/kernel/sched.h index 1c11756..fe1df7d 100644 --- a/include/cobalt/kernel/sched.h +++ b/include/cobalt/kernel/sched.h @@ -221,7 +221,7 @@ static inline void xnsched_set_resched(struct xnsched *sched) if (current_sched == sched) current_sched->status |= XNRESCHED; else if (!xnsched_resched_p(sched)) { - cpu_set(xnsched_cpu(sched), current_sched->resched); + cpumask_set_cpu(xnsched_cpu(sched), _sched->resched); sched->status |= XNRESCHED; current_sched->status |= XNRESCHED; } @@ -231,7 +231,7 @@ static inline void xnsched_set_resched(struct xnsched *sched) static inline int xnsched_supported_cpu(int cpu) { - return cpu_isset(cpu, xnsched_realtime_cpus); + return cpumask_test_cpu(cpu, _realtime_cpus); } #else /* !CONFIG_SMP */ diff --git a/kernel/cobalt/clock.c b/kernel/cobalt/clock.c index e75d296..5ee3eeb 100644 --- a/kernel/cobalt/clock.c +++ b/kernel/cobalt/clock.c @@ -188,8 +188,7 @@ void xnclock_core_local_shot(struct xnsched *sched) #ifdef CONFIG_SMP void xnclock_core_remote_shot(struct xnsched *sched) { - cpumask_t mask = cpumask_of_cpu(xnsched_cpu(sched)); - ipipe_send_ipi(IPIPE_HRTIMER_IPI, mask); + ipipe_send_ipi(IPIPE_HRTIMER_IPI, *cpumask_of(xnsched_cpu(sched))); } #endif diff --git a/kernel/cobalt/init.c b/kernel/cobalt/init.c index d89e21d..cc77b37 100644 --- a/kernel/cobalt/init.c +++ b/kernel/cobalt/init.c @@ -339,10 +339,10 @@ static int __init xenomai_init(void) } #ifdef CONFIG_SMP - cpus_clear(xnsched_realtime_cpus); + cpumask_clear(_realtime_cpus); for_each_online_cpu(cpu) { if (supported_cpus_arg & (1UL << cpu)) - cpu_set(cpu, xnsched_realtime_cpus); + cpumask_set_cpu(cpu, _realtime_cpus); } if (cpumask_empty(_realtime_cpus)) { printk(XENO_WARNING "disabled via empty real-time CPU mask\n"); diff --git a/kernel/cobalt/posix/process.c b/kernel/cobalt/posix/process.c index a9aeee5..788a24a 100644 --- a/kernel/cobalt/posix/process.c +++ b/kernel/cobalt/posix/process.c @@ -841,7 +841,7 @@ static int handle_setaffinity_event(struct ipipe_cpu_migration_data *d) * affinity mask accordingly. */ xnlock_get_irqsave(, s); - cpus_and(thread->affinity, p->cpus_allowed, cobalt_cpu_affinity); + cpumask_and(>affinity, >cpus_allowed, _cpu_affinity); xnthread_run_handler_stack(thread, move_thread, d->dest_cpu); xnlock_put_irqrestore(, s); @@ -857,7 +857,7 @@ static int handle_setaffinity_event(struct ipipe_cpu_migration_data *d) * (i.e. fully cleared) affinity mask until it leaves primary * mode then switches back to it, in SMP configurations. */ - if (cpus_empty(thread->affinity)) + if (cpumask_empty(>affinity)) printk(XENO_WARNING "thread %s[%d] changed CPU affinity inconsistently\n", thread->name, xnthread_host_pid(thread)); else { @@ -917,8 +917,8 @@ static inline void check_affinity(struct task_struct *p) /* nklocked, IRQs off * * which is not part of its original affinity mask * though. Assume user wants to extend this mask. */ - if (!cpu_isset(cpu, thread->affinity)) - cpu_set(cpu, thread->affinity); + if (!cpumask_test_cpu(cpu, >affinity)) + cpumask_set_cpu(cpu, >affinity); xnthread_migrate_passive(thread, sched); } diff --git a/kernel/cobalt/sched.c b/kernel/cobalt/sched.c index fab0d7c..0b7b93c 100644 --- a/kernel/cobalt/sched.c +++ b/kernel/cobalt/sched.c @@ -162,7 +162,7 @@ void xnsched_init(struct xnsched *sched, int cpu) ksformat(htimer_name, sizeof(htimer_name), "[host-timer/%u]", cpu); ksformat(rrbtimer_name, sizeof(rrbtimer_name), "[rrb-timer/%u]", cpu); ksformat(root_name, sizeof(root_name), "ROOT/%u", cpu); - cpus_clear(sched->resched); + cpumask_clear(>resched); #else strcpy(htimer_name, "[host-timer]");
[Xenomai-git] Philippe Gerum : cobalt/kernel: fixup for v4.1+ (TRACE_SYSTEM)
Module: xenomai-3 Branch: stable-3.0.x Commit: ea0f00789d028b48ed2abd045d8c3a369d2da9fb URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=ea0f00789d028b48ed2abd045d8c3a369d2da9fb Author: Philippe GerumDate: Sun Nov 8 21:16:04 2015 +0100 cobalt/kernel: fixup for v4.1+ (TRACE_SYSTEM) --- kernel/cobalt/trace/cobalt-core.h |4 +++- kernel/cobalt/trace/cobalt-posix.h |4 +++- kernel/cobalt/trace/cobalt-rtdm.h |4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/kernel/cobalt/trace/cobalt-core.h b/kernel/cobalt/trace/cobalt-core.h index d2b1c7e..d9875b9 100644 --- a/kernel/cobalt/trace/cobalt-core.h +++ b/kernel/cobalt/trace/cobalt-core.h @@ -18,7 +18,9 @@ * 02111-1307, USA. */ #undef TRACE_SYSTEM -#define TRACE_SYSTEM cobalt-core +#define TRACE_SYSTEM cobalt_core +#undef TRACE_INCLUDE_FILE +#define TRACE_INCLUDE_FILE cobalt-core #if !defined(_TRACE_COBALT_CORE_H) || defined(TRACE_HEADER_MULTI_READ) #define _TRACE_COBALT_CORE_H diff --git a/kernel/cobalt/trace/cobalt-posix.h b/kernel/cobalt/trace/cobalt-posix.h index d87582f..92f7245 100644 --- a/kernel/cobalt/trace/cobalt-posix.h +++ b/kernel/cobalt/trace/cobalt-posix.h @@ -18,7 +18,9 @@ * 02111-1307, USA. */ #undef TRACE_SYSTEM -#define TRACE_SYSTEM cobalt-posix +#define TRACE_SYSTEM cobalt_posix +#undef TRACE_INCLUDE_FILE +#define TRACE_INCLUDE_FILE cobalt-posix #if !defined(_TRACE_COBALT_POSIX_H) || defined(TRACE_HEADER_MULTI_READ) #define _TRACE_COBALT_POSIX_H diff --git a/kernel/cobalt/trace/cobalt-rtdm.h b/kernel/cobalt/trace/cobalt-rtdm.h index bef2d2c..5113f92 100644 --- a/kernel/cobalt/trace/cobalt-rtdm.h +++ b/kernel/cobalt/trace/cobalt-rtdm.h @@ -18,7 +18,9 @@ * 02111-1307, USA. */ #undef TRACE_SYSTEM -#define TRACE_SYSTEM cobalt-rtdm +#define TRACE_SYSTEM cobalt_rtdm +#undef TRACE_INCLUDE_FILE +#define TRACE_INCLUDE_FILE cobalt-rtdm #if !defined(_TRACE_COBALT_RTDM_H) || defined(TRACE_HEADER_MULTI_READ) #define _TRACE_COBALT_RTDM_H ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : cobalt/kernel: fixup for v3.19+ (user_msghdr)
Module: xenomai-3 Branch: stable-3.0.x Commit: 5a9d7c638798a328e8d0634ab9bcd455bf492c10 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=5a9d7c638798a328e8d0634ab9bcd455bf492c10 Author: Philippe GerumDate: Mon Nov 2 20:45:10 2015 +0100 cobalt/kernel: fixup for v3.19+ (user_msghdr) --- kernel/cobalt/include/asm-generic/xenomai/wrappers.h |4 1 file changed, 4 insertions(+) diff --git a/kernel/cobalt/include/asm-generic/xenomai/wrappers.h b/kernel/cobalt/include/asm-generic/xenomai/wrappers.h index f43b8fb..f889a7d 100644 --- a/kernel/cobalt/include/asm-generic/xenomai/wrappers.h +++ b/kernel/cobalt/include/asm-generic/xenomai/wrappers.h @@ -130,4 +130,8 @@ trace_seq_buffer_ptr(struct trace_seq *s) #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 http://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : cobalt/wrappers: fix backport prefix
Module: xenomai-3 Branch: next Commit: c46f586ad286667ce72ee53be96ff7fafef9fb54 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=c46f586ad286667ce72ee53be96ff7fafef9fb54 Author: Philippe GerumDate: Fri Nov 27 12:21:26 2015 +0100 cobalt/wrappers: fix backport prefix --- kernel/cobalt/include/asm-generic/xenomai/wrappers.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kernel/cobalt/include/asm-generic/xenomai/wrappers.h b/kernel/cobalt/include/asm-generic/xenomai/wrappers.h index d1c23e2..8ceed3a 100644 --- a/kernel/cobalt/include/asm-generic/xenomai/wrappers.h +++ b/kernel/cobalt/include/asm-generic/xenomai/wrappers.h @@ -24,7 +24,7 @@ #error "CONFIG_IPIPE_LEGACY must be switched off" #endif -#define XENO_BACKPORT(__sym) xeno_backport_ ##__sym +#define COBALT_BACKPORT(__sym) __cobalt_backport_ ##__sym /* * To keep the #ifdefery as readable as possible, please: @@ -72,7 +72,7 @@ trace_seq_buffer_ptr(struct trace_seq *s) #ifdef CONFIG_PCI #define pci_enable_msix_range \ - XENO_BACKPORT(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, @@ -91,7 +91,7 @@ static inline int pci_enable_msix_range(struct pci_dev *dev, #include #define dma_set_mask_and_coherent \ - XENO_BACKPORT(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); @@ -102,14 +102,14 @@ static inline int dma_set_mask_and_coherent(struct device *dev, u64 mask) #ifdef CONFIG_HWMON #define hwmon_device_register_with_groups \ - XENO_BACKPORT(hwmon_device_register_with_groups) + COBALT_BACKPORT(hwmon_device_register_with_groups) struct device * hwmon_device_register_with_groups(struct device *dev, const char *name, void *drvdata, const struct attribute_group **groups); #define devm_hwmon_device_register_with_groups \ - XENO_BACKPORT(devm_hwmon_device_register_with_groups) + COBALT_BACKPORT(devm_hwmon_device_register_with_groups) struct device * devm_hwmon_device_register_with_groups(struct device *dev, const char *name, void *drvdata, ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : cobalt/wrappers: fix backport prefix
Module: xenomai-3 Branch: stable-3.0.x Commit: ccfb012e7580ac2340a2de8f61cfccde2aabccd1 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=ccfb012e7580ac2340a2de8f61cfccde2aabccd1 Author: Philippe GerumDate: Fri Nov 27 12:21:26 2015 +0100 cobalt/wrappers: fix backport prefix --- kernel/cobalt/include/asm-generic/xenomai/wrappers.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kernel/cobalt/include/asm-generic/xenomai/wrappers.h b/kernel/cobalt/include/asm-generic/xenomai/wrappers.h index 0c5ce69..f43b8fb 100644 --- a/kernel/cobalt/include/asm-generic/xenomai/wrappers.h +++ b/kernel/cobalt/include/asm-generic/xenomai/wrappers.h @@ -24,7 +24,7 @@ #error "CONFIG_IPIPE_LEGACY must be switched off" #endif -#define XENO_BACKPORT(__sym) xeno_backport_ ##__sym +#define COBALT_BACKPORT(__sym) __cobalt_backport_ ##__sym /* * To keep the #ifdefery as readable as possible, please: @@ -61,7 +61,7 @@ #ifdef CONFIG_PCI #define pci_enable_msix_range \ - XENO_BACKPORT(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, @@ -80,7 +80,7 @@ static inline int pci_enable_msix_range(struct pci_dev *dev, #include #define dma_set_mask_and_coherent \ - XENO_BACKPORT(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); @@ -91,14 +91,14 @@ static inline int dma_set_mask_and_coherent(struct device *dev, u64 mask) #ifdef CONFIG_HWMON #define hwmon_device_register_with_groups \ - XENO_BACKPORT(hwmon_device_register_with_groups) + COBALT_BACKPORT(hwmon_device_register_with_groups) struct device * hwmon_device_register_with_groups(struct device *dev, const char *name, void *drvdata, const struct attribute_group **groups); #define devm_hwmon_device_register_with_groups \ - XENO_BACKPORT(devm_hwmon_device_register_with_groups) + COBALT_BACKPORT(devm_hwmon_device_register_with_groups) struct device * devm_hwmon_device_register_with_groups(struct device *dev, const char *name, void *drvdata, ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://xenomai.org/mailman/listinfo/xenomai-git