Module: xenomai-forge Branch: next Commit: 4b6515176fc009e6adde07857c17945ba6d98e26 URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=4b6515176fc009e6adde07857c17945ba6d98e26
Author: Philippe Gerum <r...@xenomai.org> Date: Fri Jun 7 08:58:47 2013 +0200 drivers: remove obsolete sigtest module --- include/testing/sigtest_syscall.h | 16 ---- kernel/drivers/testing/Makefile | 3 - kernel/drivers/testing/sigtest_module.c | 134 ------------------------------- 3 files changed, 0 insertions(+), 153 deletions(-) diff --git a/include/testing/sigtest_syscall.h b/include/testing/sigtest_syscall.h deleted file mode 100644 index b260cc5..0000000 --- a/include/testing/sigtest_syscall.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef SIGTEST_SYSCALL_H -#define SIGTEST_SYSCALL_H - -#include <asm/xenomai/syscall.h> - -#define SIGTEST_SKIN_MAGIC 0x53494754 - -#define __NR_sigtest_queue 0 /* sigtest_queue(int *, size_t) */ -#define __NR_sigtest_wait_pri 1 /* sigtest_wait_pri(void) */ -#define __NR_sigtest_wait_sec 2 /* sigtest_wait_sec(void) */ - -struct sigtest_siginfo { - int sig_nr; -}; - -#endif /* SIGTEST_SYSCALL_H */ diff --git a/kernel/drivers/testing/Makefile b/kernel/drivers/testing/Makefile index 498a399..db99d98 100644 --- a/kernel/drivers/testing/Makefile +++ b/kernel/drivers/testing/Makefile @@ -1,15 +1,12 @@ obj-$(CONFIG_XENO_DRIVERS_TIMERBENCH) += xeno_timerbench.o obj-$(CONFIG_XENO_DRIVERS_SWITCHTEST) += xeno_switchtest.o -obj-$(CONFIG_XENO_DRIVERS_SIGTEST) += xeno_sigtest.o obj-$(CONFIG_XENO_DRIVERS_RTDMTEST) += xeno_rtdmtest.o xeno_timerbench-y := timerbench.o xeno_switchtest-y := switchtest.o -xeno_sigtest-y := sigtest_module.o - xeno_rtdmtest-y := rtdmtest.o ccflags-y := -D__IN_XENOMAI__ -Iinclude/xenomai/cobalt -Iinclude/xenomai diff --git a/kernel/drivers/testing/sigtest_module.c b/kernel/drivers/testing/sigtest_module.c deleted file mode 100644 index e3ebc2d..0000000 --- a/kernel/drivers/testing/sigtest_module.c +++ /dev/null @@ -1,134 +0,0 @@ -#include <nucleus/clock.h> -#include <nucleus/timer.h> -#include <nucleus/shadow.h> -#include <nucleus/thread.h> -#include <nucleus/heap.h> -#include <nucleus/pod.h> -#include <nucleus/types.h> -#include <testing/sigtest_syscall.h> - -static int muxid; - -static int *sigs, next_sig; -static size_t nr_sigs; -static xnthread_t *target; -static xntimer_t sigtest_timer; - -MODULE_DESCRIPTION("signals testing interface"); -MODULE_AUTHOR("gilles.chanteperd...@xenomai.org"); -MODULE_LICENSE("GPL"); - -static void sigtest_timer_handler(xntimer_t *timer) -{ - xnshadow_mark_sig(target, muxid); - /* xnpod_schedule called later. */ -} - -static int __sigtest_queue(struct pt_regs *regs) -{ - target = xnshadow_current(); - if (!target) - return -EPERM; - - nr_sigs = (size_t)__xn_reg_arg2(regs); - sigs = xnmalloc(sizeof(*sigs) * nr_sigs); - next_sig = 0; - - if (__xn_copy_from_user(sigs, (void __user *)__xn_reg_arg1(regs), - sizeof(*sigs) * nr_sigs)) { - xnfree(sigs); - return -EFAULT; - } - - xntimer_set_sched(&sigtest_timer, xnpod_current_sched()); - xntimer_start(&sigtest_timer, 10000000, 0, 0); - - return 0; -} - -static int __sigtest_wait_pri(struct pt_regs *regs) -{ - xnthread_t *thread = xnshadow_current(); - xnticks_t ticks = 20000000; - - xnpod_suspend_thread(thread, XNDELAY, ticks, XN_RELATIVE, NULL); - if (xnthread_test_info(thread, XNBREAK)) - return -EINTR; - - return 0; -} - -static int __sigtest_wait_sec(struct pt_regs *regs) -{ - schedule_timeout_interruptible(20 * HZ / 1000 + 1); - if (signal_pending(current)) - return -EINTR; - return 0; -} - -static xnsysent_t __systab[] = { - [__NR_sigtest_queue] = {&__sigtest_queue, __xn_exec_any}, - [__NR_sigtest_wait_pri] = {&__sigtest_wait_pri, __xn_exec_primary}, - [__NR_sigtest_wait_sec] = {&__sigtest_wait_sec, __xn_exec_secondary}, -}; - -static int sigtest_unqueue(xnthread_t *thread, union xnsiginfo __user *si) -{ - struct sigtest_siginfo __user *mysi = (struct sigtest_siginfo __user *)si; - int status = sigs[next_sig]; - - __xn_put_user(next_sig, &mysi->sig_nr); - if (++next_sig == nr_sigs) { - spl_t s; - - xnfree(sigs); - xnlock_get_irqsave(&nklock, s); - xnshadow_clear_sig(thread, muxid); - xnlock_put_irqrestore(&nklock, s); - } - return status; -} - -static struct xnskin_props __props = { - .name = "sigtest", - .magic = SIGTEST_SKIN_MAGIC, - .nrcalls = ARRAY_SIZE(__systab), - .systab = __systab, - .eventcb = NULL, - .sig_unqueue = sigtest_unqueue, - .module = THIS_MODULE -}; - -int SKIN_INIT(sigtest) -{ - int err; - - printk(XENO_INFO "starting sigtest services\n"); - - err = xnpod_init(); - if (err) - goto fail; - - muxid = xnshadow_register_interface(&__props); - if (muxid < 0) { - err = muxid; - fail_shutdown_pod: - xnpod_shutdown(err); - fail: - return err; - } - - xntimer_init(&sigtest_timer, sigtest_timer_handler); - - return 0; -} - -void SKIN_EXIT(sigtest) -{ - printk(XENO_INFO "stopping sigtest services\n"); - xntimer_destroy(&sigtest_timer); - xnshadow_unregister_interface(muxid); - xnpod_shutdown(XNPOD_NORMAL_EXIT); -} -module_init(__sigtest_skin_init); -module_exit(__sigtest_skin_exit); _______________________________________________ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git