[Xenomai-git] Gilles Chanteperdrix : nucleus/shadow.c: fix for Linux 3.8
Module: xenomai-2.6 Branch: master Commit: a6e3ed59a578944e0e10bcd94d2e822735e79e76 URL: http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=a6e3ed59a578944e0e10bcd94d2e822735e79e76 Author: Gilles Chanteperdrix Date: Sat Mar 23 21:44:58 2013 +0100 nucleus/shadow.c: fix for Linux 3.8 --- include/asm-generic/wrappers.h |4 ksrc/nucleus/shadow.c |2 +- 2 files changed, 5 insertions(+), 1 deletions(-) diff --git a/include/asm-generic/wrappers.h b/include/asm-generic/wrappers.h index e71bcc3..0fb47a9 100644 --- a/include/asm-generic/wrappers.h +++ b/include/asm-generic/wrappers.h @@ -741,6 +741,10 @@ unsigned long vm_mmap(struct file *file, unsigned long addr, #endif /* LINUX_VERSION_CODE < 3.4.0 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0) +#define KGIDT_INIT(pid) (pid) +#endif /* LINUX < 3.8.0 */ + #include #ifndef SEQ_START_TOKEN #define SEQ_START_TOKEN ((void *)1) diff --git a/ksrc/nucleus/shadow.c b/ksrc/nucleus/shadow.c index ed3864b..7c4e032 100644 --- a/ksrc/nucleus/shadow.c +++ b/ksrc/nucleus/shadow.c @@ -1780,7 +1780,7 @@ static int xnshadow_sys_bind(struct pt_regs *regs) return -ENOEXEC; if (!capable(CAP_SYS_NICE) && - (xn_gid_arg == -1 || !in_group_p(xn_gid_arg))) + (xn_gid_arg == -1 || !in_group_p(KGIDT_INIT(xn_gid_arg return -EPERM; /* Raise capabilities for the caller in case they are lacking yet. */ ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : hal/arm: adapt to Linux 3.8
Module: xenomai-2.6 Branch: master Commit: c55bcadd2b01cb1159e1a2c54a705be3a2327eee URL: http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=c55bcadd2b01cb1159e1a2c54a705be3a2327eee Author: Gilles Chanteperdrix Date: Sat Mar 23 21:42:53 2013 +0100 hal/arm: adapt to Linux 3.8 --- include/asm-arm/calibration.h |5 + include/asm-arm/hal.h |4 +++- include/asm-arm/wrappers.h|4 3 files changed, 12 insertions(+), 1 deletions(-) diff --git a/include/asm-arm/calibration.h b/include/asm-arm/calibration.h index d9dd759..b0283c0 100644 --- a/include/asm-arm/calibration.h +++ b/include/asm-arm/calibration.h @@ -27,6 +27,11 @@ #error "please don't include asm/calibration.h directly" #endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0) +extern unsigned omap_rev(void); +#define cpu_is_omap44xx() ((omap_rev() & 0xff) == 0x44) +#endif + static inline unsigned long xnarch_get_sched_latency (void) { #if CONFIG_XENO_OPT_TIMING_SCHEDLAT != 0 diff --git a/include/asm-arm/hal.h b/include/asm-arm/hal.h index b6c5ac6..3d7e8e6 100644 --- a/include/asm-arm/hal.h +++ b/include/asm-arm/hal.h @@ -235,7 +235,9 @@ typedef struct rthal_fpenv { */ __u8used_cp[16];/* thread used copro */ unsigned long tp_value; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 18) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0) && defined(CONFIG_CRUNCH)) \ + || (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0) \ + && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 18)) struct crunch_state crunchstate; #endif /* Linux version >= 2.6.18 */ #if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 15) diff --git a/include/asm-arm/wrappers.h b/include/asm-arm/wrappers.h index 91a2ec4..b95801c 100644 --- a/include/asm-arm/wrappers.h +++ b/include/asm-arm/wrappers.h @@ -30,7 +30,11 @@ #define wrap_phys_mem_prot(filp,pfn,size,prot) (prot) +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0) #define wrap_strncpy_from_user(dstP, srcP, n) __strncpy_from_user(dstP, srcP, n) +#else +#define wrap_strncpy_from_user(dstP, srcP, n) strncpy_from_user(dstP, srcP, n) +#endif #define rthal_irq_desc_status(irq) (rthal_irq_descp(irq)->status) ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : nucleus: check for NULL u_mode
Module: xenomai-2.6 Branch: master Commit: 892c1bdc920f92696451f334ec4c7debeda8ebcf URL: http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=892c1bdc920f92696451f334ec4c7debeda8ebcf Author: Gilles Chanteperdrix Date: Sun Mar 10 21:14:22 2013 +0100 nucleus: check for NULL u_mode --- ksrc/nucleus/shadow.c | 10 ++ 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ksrc/nucleus/shadow.c b/ksrc/nucleus/shadow.c index c91a6f3..ed3864b 100644 --- a/ksrc/nucleus/shadow.c +++ b/ksrc/nucleus/shadow.c @@ -1430,8 +1430,10 @@ void xnshadow_unmap(xnthread_t *thread) rpi_pop(thread); sys_ppd = xnsys_ppd_get(0); - xnheap_free(&sys_ppd->sem_heap, thread->u_mode); - thread->u_mode = NULL; + if (thread->u_mode) { + xnheap_free(&sys_ppd->sem_heap, thread->u_mode); + thread->u_mode = NULL; + } xnarch_atomic_dec(&sys_ppd->refcnt); @@ -2379,7 +2381,7 @@ int do_hisyscall_event(unsigned event, rthal_pipeline_stage_t *stage, ret_handled: /* Update the userland-visible state. */ - if (thread) + if (thread && thread->u_mode) *thread->u_mode = thread->state; trace_mark(xn_nucleus, syscall_histage_exit, @@ -2549,7 +2551,7 @@ int do_losyscall_event(unsigned event, rthal_pipeline_stage_t *stage, ret_handled: /* Update the userland-visible state. */ - if (thread) + if (thread && thread->u_mode) *thread->u_mode = thread->state; trace_mark(xn_nucleus, syscall_lostage_exit, ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : nucleus: do not start host timer emulation if host timer is not shared
Module: xenomai-2.6 Branch: master Commit: 926f4fbc2e38c198eefda6f0a98a278588d421db URL: http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=926f4fbc2e38c198eefda6f0a98a278588d421db Author: Gilles Chanteperdrix Date: Sat Mar 23 21:45:39 2013 +0100 nucleus: do not start host timer emulation if host timer is not shared --- ksrc/nucleus/pod.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/ksrc/nucleus/pod.c b/ksrc/nucleus/pod.c index 868f98f..f977db3 100644 --- a/ksrc/nucleus/pod.c +++ b/ksrc/nucleus/pod.c @@ -2754,7 +2754,7 @@ int xnpod_enable_timesource(void) if (htickval > 1) xntimer_start(&sched->htimer, htickval, htickval, XN_RELATIVE); - else + else if (htickval == 1) xntimer_start(&sched->htimer, 0, 0, XN_RELATIVE); #if defined(CONFIG_XENO_OPT_WATCHDOG) ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : skins: avoid multiply defined symbols
Module: xenomai-2.6 Branch: master Commit: 93974a8d65e0c3c1e45cc40c6e3af41f90ab1a99 URL: http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=93974a8d65e0c3c1e45cc40c6e3af41f90ab1a99 Author: Gilles Chanteperdrix Date: Fri Mar 8 07:39:23 2013 +0100 skins: avoid multiply defined symbols By only including asm/xenomai/bits/bind.h in src/skins/common/bind.c. bind.c interface is declared in asm-generic/bids/bind.h so, skins can include thins file instead of the architecture-specific bind.h, so as to avoid symbols multiple definitions. --- include/asm-nios2/bits/bind.h |2 +- include/asm-sh/bits/bind.h|2 -- src/skins/native/init.c |2 +- src/skins/posix/init.c|2 +- src/skins/psos+/init.c|2 +- src/skins/rtdm/init.c |2 +- src/skins/uitron/init.c |2 +- src/skins/vrtx/init.c |2 +- src/skins/vxworks/init.c |2 +- 9 files changed, 8 insertions(+), 10 deletions(-) diff --git a/include/asm-nios2/bits/bind.h b/include/asm-nios2/bits/bind.h index 067e7e2..668d8b8 100644 --- a/include/asm-nios2/bits/bind.h +++ b/include/asm-nios2/bits/bind.h @@ -12,7 +12,7 @@ #include -__attribute__((weak)) volatile void *xeno_nios2_hrclock = NULL; +volatile void *xeno_nios2_hrclock = NULL; static inline void xeno_nios2_features_check(struct xnfeatinfo *finfo) { diff --git a/include/asm-sh/bits/bind.h b/include/asm-sh/bits/bind.h index 3b2b54d..bd25f80 100644 --- a/include/asm-sh/bits/bind.h +++ b/include/asm-sh/bits/bind.h @@ -14,10 +14,8 @@ struct xnarch_tsc_area; -__attribute__((weak)) volatile struct xnarch_tsc_area *xeno_sh_tsc = NULL; -__attribute__((weak)) volatile unsigned long *xeno_sh_tcnt = NULL; static volatile void *__xeno_kmem_map(unsigned long pa, unsigned int pagesz) diff --git a/src/skins/native/init.c b/src/skins/native/init.c index 2c36444..5d433b3 100644 --- a/src/skins/native/init.c +++ b/src/skins/native/init.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include int __native_muxid = -1; static int fork_handler_registered; diff --git a/src/skins/posix/init.c b/src/skins/posix/init.c index 332081a..83d27a6 100644 --- a/src/skins/posix/init.c +++ b/src/skins/posix/init.c @@ -30,7 +30,7 @@ #include #include -#include +#include int __pse51_muxid = -1; int __pse51_rtdm_muxid = -1; diff --git a/src/skins/psos+/init.c b/src/skins/psos+/init.c index b72825f..5098f91 100644 --- a/src/skins/psos+/init.c +++ b/src/skins/psos+/init.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include int __psos_muxid = -1; diff --git a/src/skins/rtdm/init.c b/src/skins/rtdm/init.c index dbbcbb1..9672486 100644 --- a/src/skins/rtdm/init.c +++ b/src/skins/rtdm/init.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include int __rtdm_muxid = -1; diff --git a/src/skins/uitron/init.c b/src/skins/uitron/init.c index a6cc77f..0ffc8bd 100644 --- a/src/skins/uitron/init.c +++ b/src/skins/uitron/init.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include int __uitron_muxid = -1; diff --git a/src/skins/vrtx/init.c b/src/skins/vrtx/init.c index 8a81660..d3d6cdb 100644 --- a/src/skins/vrtx/init.c +++ b/src/skins/vrtx/init.c @@ -23,7 +23,7 @@ #include #include #include -#include +#include int __vrtx_muxid = -1; diff --git a/src/skins/vxworks/init.c b/src/skins/vxworks/init.c index 181b575..b2cdad4 100644 --- a/src/skins/vxworks/init.c +++ b/src/skins/vxworks/init.c @@ -23,7 +23,7 @@ #include #include #include -#include +#include int __vxworks_muxid = -1; ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git