[Xenomai-git] Philippe Gerum : cobalt/arm: upgrade I-pipe support
Module: xenomai-forge Branch: next Commit: ed6f9bfefce8269a46f94f4febb623571e350cd3 URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=ed6f9bfefce8269a46f94f4febb623571e350cd3 Author: Philippe Gerum r...@xenomai.org Date: Sun Feb 16 16:53:26 2014 +0100 cobalt/arm: upgrade I-pipe support --- .../arm/patches/ipipe-core-3.10.18-arm-1.patch |20870 1 file changed, 20870 insertions(+) Diff: http://git.xenomai.org/?p=xenomai-forge.git;a=commitdiff;h=ed6f9bfefce8269a46f94f4febb623571e350cd3 ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : lib/cobalt: Flush print buffer on fclose
Module: xenomai-forge Branch: master Commit: b0a867efad33ddeaeb7d1daa4b98defc039f6da1 URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=b0a867efad33ddeaeb7d1daa4b98defc039f6da1 Author: Jan Kiszka jan.kis...@siemens.com Date: Wed Feb 12 18:48:58 2014 +0100 lib/cobalt: Flush print buffer on fclose As we keep a reference to the stream that was written to via fwrite Co., we need to flush our buffers before closing streams. Otherwise, we risk that print_buffers crashes while trying to use a stale FILE object. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- include/cobalt/stdio.h |2 ++ lib/cobalt/cobalt.wrappers |1 + lib/cobalt/printf.c|6 ++ lib/cobalt/wrappers.c |6 ++ 4 files changed, 15 insertions(+) diff --git a/include/cobalt/stdio.h b/include/cobalt/stdio.h index d2c2e43..b7407fd 100644 --- a/include/cobalt/stdio.h +++ b/include/cobalt/stdio.h @@ -82,6 +82,8 @@ int __wrap_putchar(int c); COBALT_DECL(size_t, fwrite(const void *ptr, size_t sz, size_t nmemb, FILE *stream)); +COBALT_DECL(int, fclose(FILE *stream)); + int rt_vfprintf(FILE *stream, const char *format, va_list args); int rt_vprintf(const char *format, va_list args); diff --git a/lib/cobalt/cobalt.wrappers b/lib/cobalt/cobalt.wrappers index dae8c11..ef5f8ba 100644 --- a/lib/cobalt/cobalt.wrappers +++ b/lib/cobalt/cobalt.wrappers @@ -95,6 +95,7 @@ --wrap fputc --wrap putchar --wrap fwrite +--wrap fclose --wrap syslog --wrap vsyslog --wrap malloc diff --git a/lib/cobalt/printf.c b/lib/cobalt/printf.c index 2e2bbe5..ba75ef5 100644 --- a/lib/cobalt/printf.c +++ b/lib/cobalt/printf.c @@ -921,6 +921,12 @@ COBALT_IMPL(size_t, fwrite, (const void *ptr, size_t size, size_t nmemb, FILE *s } +COBALT_IMPL(int, fclose, (FILE *stream)) +{ + rt_print_flush_buffers(); + return __STD(fclose(stream)); +} + COBALT_IMPL(void, vsyslog, (int priority, const char *fmt, va_list ap)) { if (cobalt_get_current() != XN_NO_HANDLE diff --git a/lib/cobalt/wrappers.c b/lib/cobalt/wrappers.c index a4f643e..bf07a04 100644 --- a/lib/cobalt/wrappers.c +++ b/lib/cobalt/wrappers.c @@ -368,6 +368,12 @@ size_t __real_fwrite(const void *ptr, size_t sz, size_t nmemb, FILE *stream) } __attribute__ ((weak)) +int __real_fclose(FILE *stream) +{ + return fclose(stream); +} + +__attribute__ ((weak)) void __real_syslog(int priority, const char *fmt, ...) { va_list args; ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : cobalt/x86: upgrade I-pipe support
Module: xenomai-forge Branch: master Commit: a55a763e3dd04f031018b7bcb7e54af214532e23 URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=a55a763e3dd04f031018b7bcb7e54af214532e23 Author: Philippe Gerum r...@xenomai.org Date: Sun Feb 16 16:54:08 2014 +0100 cobalt/x86: upgrade I-pipe support --- .../x86/patches/ipipe-core-3.10.18-x86-1.patch |14738 1 file changed, 14738 insertions(+) Diff: http://git.xenomai.org/?p=xenomai-forge.git;a=commitdiff;h=a55a763e3dd04f031018b7bcb7e54af214532e23 ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : cobalt/sched: fix non-SMP build
Module: xenomai-forge Branch: master Commit: 5ce1e1c69f81a004a78d1208c9aecef74d0cf493 URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=5ce1e1c69f81a004a78d1208c9aecef74d0cf493 Author: Philippe Gerum r...@xenomai.org Date: Sun Feb 16 17:33:53 2014 +0100 cobalt/sched: fix non-SMP build --- include/cobalt/kernel/sched.h |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/cobalt/kernel/sched.h b/include/cobalt/kernel/sched.h index d96eef0..f4a47f9 100644 --- a/include/cobalt/kernel/sched.h +++ b/include/cobalt/kernel/sched.h @@ -209,6 +209,8 @@ static inline void xnsched_set_self_resched(struct xnsched *sched) sched-status |= XNRESCHED; } +#define xnsched_realtime_domain xnarch_machdata.domain + /* Set resched flag for the given scheduler. */ #ifdef CONFIG_SMP @@ -226,7 +228,6 @@ static inline void xnsched_set_resched(struct xnsched *sched) } #define xnsched_realtime_cpusxnarch_machdata.supported_cpus -#define xnsched_realtime_domain xnarch_machdata.domain static inline int xnsched_supported_cpu(int cpu) { ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : cobalt/arm: upgrade I-pipe support
Module: xenomai-forge Branch: next Commit: 261255d54ef81127d26427f6f54e18f29738c190 URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=261255d54ef81127d26427f6f54e18f29738c190 Author: Philippe Gerum r...@xenomai.org Date: Sun Feb 16 16:53:26 2014 +0100 cobalt/arm: upgrade I-pipe support --- .../arm/patches/ipipe-core-3.10.18-arm-1.patch |20870 1 file changed, 20870 insertions(+) Diff: http://git.xenomai.org/?p=xenomai-forge.git;a=commitdiff;h=261255d54ef81127d26427f6f54e18f29738c190 ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : lib/cobalt: Flush print buffer on fclose
Module: xenomai-forge Branch: next Commit: b0a867efad33ddeaeb7d1daa4b98defc039f6da1 URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=b0a867efad33ddeaeb7d1daa4b98defc039f6da1 Author: Jan Kiszka jan.kis...@siemens.com Date: Wed Feb 12 18:48:58 2014 +0100 lib/cobalt: Flush print buffer on fclose As we keep a reference to the stream that was written to via fwrite Co., we need to flush our buffers before closing streams. Otherwise, we risk that print_buffers crashes while trying to use a stale FILE object. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- include/cobalt/stdio.h |2 ++ lib/cobalt/cobalt.wrappers |1 + lib/cobalt/printf.c|6 ++ lib/cobalt/wrappers.c |6 ++ 4 files changed, 15 insertions(+) diff --git a/include/cobalt/stdio.h b/include/cobalt/stdio.h index d2c2e43..b7407fd 100644 --- a/include/cobalt/stdio.h +++ b/include/cobalt/stdio.h @@ -82,6 +82,8 @@ int __wrap_putchar(int c); COBALT_DECL(size_t, fwrite(const void *ptr, size_t sz, size_t nmemb, FILE *stream)); +COBALT_DECL(int, fclose(FILE *stream)); + int rt_vfprintf(FILE *stream, const char *format, va_list args); int rt_vprintf(const char *format, va_list args); diff --git a/lib/cobalt/cobalt.wrappers b/lib/cobalt/cobalt.wrappers index dae8c11..ef5f8ba 100644 --- a/lib/cobalt/cobalt.wrappers +++ b/lib/cobalt/cobalt.wrappers @@ -95,6 +95,7 @@ --wrap fputc --wrap putchar --wrap fwrite +--wrap fclose --wrap syslog --wrap vsyslog --wrap malloc diff --git a/lib/cobalt/printf.c b/lib/cobalt/printf.c index 2e2bbe5..ba75ef5 100644 --- a/lib/cobalt/printf.c +++ b/lib/cobalt/printf.c @@ -921,6 +921,12 @@ COBALT_IMPL(size_t, fwrite, (const void *ptr, size_t size, size_t nmemb, FILE *s } +COBALT_IMPL(int, fclose, (FILE *stream)) +{ + rt_print_flush_buffers(); + return __STD(fclose(stream)); +} + COBALT_IMPL(void, vsyslog, (int priority, const char *fmt, va_list ap)) { if (cobalt_get_current() != XN_NO_HANDLE diff --git a/lib/cobalt/wrappers.c b/lib/cobalt/wrappers.c index a4f643e..bf07a04 100644 --- a/lib/cobalt/wrappers.c +++ b/lib/cobalt/wrappers.c @@ -368,6 +368,12 @@ size_t __real_fwrite(const void *ptr, size_t sz, size_t nmemb, FILE *stream) } __attribute__ ((weak)) +int __real_fclose(FILE *stream) +{ + return fclose(stream); +} + +__attribute__ ((weak)) void __real_syslog(int priority, const char *fmt, ...) { va_list args; ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : cobalt/sched: fix non-SMP build
Module: xenomai-forge Branch: next Commit: 5ce1e1c69f81a004a78d1208c9aecef74d0cf493 URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=5ce1e1c69f81a004a78d1208c9aecef74d0cf493 Author: Philippe Gerum r...@xenomai.org Date: Sun Feb 16 17:33:53 2014 +0100 cobalt/sched: fix non-SMP build --- include/cobalt/kernel/sched.h |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/cobalt/kernel/sched.h b/include/cobalt/kernel/sched.h index d96eef0..f4a47f9 100644 --- a/include/cobalt/kernel/sched.h +++ b/include/cobalt/kernel/sched.h @@ -209,6 +209,8 @@ static inline void xnsched_set_self_resched(struct xnsched *sched) sched-status |= XNRESCHED; } +#define xnsched_realtime_domain xnarch_machdata.domain + /* Set resched flag for the given scheduler. */ #ifdef CONFIG_SMP @@ -226,7 +228,6 @@ static inline void xnsched_set_resched(struct xnsched *sched) } #define xnsched_realtime_cpusxnarch_machdata.supported_cpus -#define xnsched_realtime_domain xnarch_machdata.domain static inline int xnsched_supported_cpu(int cpu) { ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : cobalt: require kernel version = 3.10
Module: xenomai-forge Branch: next Commit: 6e78e8462746a0efaa05dbf5839e97fc40e1309b URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=6e78e8462746a0efaa05dbf5839e97fc40e1309b Author: Philippe Gerum r...@xenomai.org Date: Sun Feb 16 17:03:19 2014 +0100 cobalt: require kernel version = 3.10 --- .../cobalt/include/asm-generic/xenomai/wrappers.h | 62 1 file changed, 12 insertions(+), 50 deletions(-) diff --git a/kernel/cobalt/include/asm-generic/xenomai/wrappers.h b/kernel/cobalt/include/asm-generic/xenomai/wrappers.h index 601fc30..b357545 100644 --- a/kernel/cobalt/include/asm-generic/xenomai/wrappers.h +++ b/kernel/cobalt/include/asm-generic/xenomai/wrappers.h @@ -23,65 +23,27 @@ #endif #include linux/version.h + +#if LINUX_VERSION_CODE KERNEL_VERSION(3,10,0) +#error Xenomai/cobalt requires Linux kernel 3.10 or above +#endif + +#ifdef CONFIG_IPIPE_LEGACY +#error CONFIG_IPIPE_LEGACY must be switched off +#endif + #include linux/module.h #include linux/slab.h #include linux/ipipe.h #include linux/ipipe_tickdev.h #include linux/sched.h -#include asm/io.h +#include linux/sched/rt.h #include linux/pid.h - -#ifdef CONFIG_IPIPE_LEGACY -#error CONFIG_IPIPE_LEGACY must be switched off -#endif - #include linux/mm.h +#include asm/io.h + #ifndef pgprot_noncached #define pgprot_noncached(p) (p) #endif /* !pgprot_noncached */ - -#if LINUX_VERSION_CODE KERNEL_VERSION(3,4,0) - -#include linux/smp.h - -#ifndef cpu_online_map -#define cpu_online_mask (cpu_online_map) -#endif - -static inline -unsigned long vm_mmap(struct file *file, unsigned long addr, - unsigned long len, unsigned long prot, - unsigned long flag, unsigned long offset) -{ - struct mm_struct *mm = current-mm; - unsigned long ret; - - down_write(mm-mmap_sem); - ret = do_mmap(file, addr, len, prot, flag, offset); - up_write(mm-mmap_sem); - - return ret; -} - -#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 */ - -#if LINUX_VERSION_CODE = KERNEL_VERSION(3,9,0) -#include linux/sched/rt.h -#endif /* LINUX = 3.9.0 */ -#if LINUX_VERSION_CODE KERNEL_VERSION(3,10,0) -#include linux/proc_fs.h - -#define PDE_DATA(inode)PROC_I(inode)-pde-data - -static inline void proc_remove(struct proc_dir_entry *pde) -{ - remove_proc_entry(pde-name, pde-parent); -} -#endif /* 3.10 */ - #endif /* _COBALT_ASM_GENERIC_WRAPPERS_H */ ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : cobalt/sched: fix non-SMP build
Module: xenomai-forge Branch: next Commit: 89603393865dca1608fdd73fefb02dc3a9f3c2bd URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=89603393865dca1608fdd73fefb02dc3a9f3c2bd Author: Philippe Gerum r...@xenomai.org Date: Sun Feb 16 17:33:53 2014 +0100 cobalt/sched: fix non-SMP build --- include/cobalt/kernel/sched.h |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/cobalt/kernel/sched.h b/include/cobalt/kernel/sched.h index d96eef0..f4a47f9 100644 --- a/include/cobalt/kernel/sched.h +++ b/include/cobalt/kernel/sched.h @@ -209,6 +209,8 @@ static inline void xnsched_set_self_resched(struct xnsched *sched) sched-status |= XNRESCHED; } +#define xnsched_realtime_domain xnarch_machdata.domain + /* Set resched flag for the given scheduler. */ #ifdef CONFIG_SMP @@ -226,7 +228,6 @@ static inline void xnsched_set_resched(struct xnsched *sched) } #define xnsched_realtime_cpusxnarch_machdata.supported_cpus -#define xnsched_realtime_domain xnarch_machdata.domain static inline int xnsched_supported_cpu(int cpu) { ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git