Module: xenomai-forge Branch: master Commit: a7b059b096941946b7a889570268575e32fe7e22 URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=a7b059b096941946b7a889570268575e32fe7e22
Author: Philippe Gerum <r...@xenomai.org> Date: Thu Dec 20 10:36:57 2012 +0100 cobalt: sanitize kernel console output --- include/cobalt/nucleus/assert.h | 2 +- include/cobalt/nucleus/types.h | 8 ++---- kernel/cobalt/cond.c | 2 +- kernel/cobalt/module.c | 4 +- kernel/cobalt/mq.c | 8 +++--- kernel/cobalt/mutex.c | 3 +- kernel/cobalt/nucleus/intr.c | 21 +++++++-------- kernel/cobalt/nucleus/module.c | 5 +-- kernel/cobalt/nucleus/pipe.c | 16 ++++++------ kernel/cobalt/nucleus/pod.c | 32 ++++++++++++------------ kernel/cobalt/nucleus/registry.c | 15 ++++------- kernel/cobalt/nucleus/sched.c | 11 ++++---- kernel/cobalt/nucleus/shadow.c | 4 +- kernel/cobalt/nucleus/thread.c | 10 ++++--- kernel/cobalt/nucleus/timer.c | 4 +-- kernel/cobalt/registry.c | 6 ++-- kernel/cobalt/rtdm/core.c | 4 +- kernel/cobalt/rtdm/device.c | 41 ++++++++++++++++--------------- kernel/cobalt/rtdm/module.c | 4 +- kernel/cobalt/rtdm/proc.c | 2 +- kernel/cobalt/sem.c | 8 +++--- kernel/cobalt/thread.c | 2 +- kernel/cobalt/timer.c | 2 +- kernel/drivers/testing/sigtest_module.c | 4 +- 24 files changed, 107 insertions(+), 111 deletions(-) diff --git a/include/cobalt/nucleus/assert.h b/include/cobalt/nucleus/assert.h index e5a3e3b..f0f53ea 100644 --- a/include/cobalt/nucleus/assert.h +++ b/include/cobalt/nucleus/assert.h @@ -29,7 +29,7 @@ #define XENO_ASSERT(subsystem,cond,action) do { \ if (unlikely(XENO_DEBUG(subsystem) && !(cond))) { \ xntrace_panic_freeze(); \ - xnlogerr("assertion failed at %s:%d (%s)\n", \ + printk(XENO_ERR "assertion failed at %s:%d (%s)\n", \ __FILE__, __LINE__, (#cond)); \ xntrace_panic_dump(); \ action; \ diff --git a/include/cobalt/nucleus/types.h b/include/cobalt/nucleus/types.h index ef6b402..ab44d45 100644 --- a/include/cobalt/nucleus/types.h +++ b/include/cobalt/nucleus/types.h @@ -122,11 +122,9 @@ typedef atomic_flags_t xnflags_t; #define minval(a,b) ((a) < (b) ? (a) : (b)) #define maxval(a,b) ((a) > (b) ? (a) : (b)) -#define xnprintf(fmt,args...) printk(KERN_INFO "Xenomai: " fmt , ##args) -#define xnloginfo(fmt,args...) printk(KERN_INFO "Xenomai: " fmt , ##args) -#define xnlogwarn(fmt,args...) printk(KERN_WARNING "Xenomai: " fmt , ##args) -#define xnlogerr(fmt,args...) printk(KERN_ERR "Xenomai: " fmt , ##args) -#define xnlogerr_noprompt(fmt,args...) printk(KERN_ERR fmt , ##args) +#define XENO_INFO KERN_INFO "[Xenomai] " +#define XENO_WARN KERN_WARNING "[Xenomai] " +#define XENO_ERR KERN_ERR "[Xenomai] " void xnpod_fatal(const char *format, ...); diff --git a/kernel/cobalt/cond.c b/kernel/cobalt/cond.c index d47c50a..1cb2cc7 100644 --- a/kernel/cobalt/cond.c +++ b/kernel/cobalt/cond.c @@ -477,7 +477,7 @@ void cobalt_condq_cleanup(cobalt_kqueues_t *q) xnlock_put_irqrestore(&nklock, s); cond_destroy_internal(link2cond(holder), q); #if XENO_DEBUG(POSIX) - xnprintf("Posix: destroying condition variable %p.\n", + printk(XENO_INFO "deleting Cobalt condvar %p\n", link2cond(holder)); #endif /* XENO_DEBUG(POSIX) */ xnlock_get_irqsave(&nklock, s); diff --git a/kernel/cobalt/module.c b/kernel/cobalt/module.c index 5adef21..e06a4b0 100644 --- a/kernel/cobalt/module.c +++ b/kernel/cobalt/module.c @@ -66,7 +66,7 @@ static int __init __cobalt_init(void) { int ret; - xnprintf("starting Cobalt services.\n"); + printk(XENO_INFO "starting Cobalt services.\n"); ret = xnpod_init(); if (ret) @@ -76,7 +76,7 @@ static int __init __cobalt_init(void) if (ret) { xnpod_shutdown(ret); fail: - xnlogerr("Cobalt init failed, code %d.\n", ret); + printk(XENO_INFO "Cobalt init failed, code %d.\n", ret); return ret; } diff --git a/kernel/cobalt/mq.c b/kernel/cobalt/mq.c index 6caec1d..b46a8fd 100644 --- a/kernel/cobalt/mq.c +++ b/kernel/cobalt/mq.c @@ -1041,8 +1041,8 @@ static void uqd_cleanup(cobalt_assoc_t *assoc) { cobalt_ufd_t *ufd = assoc2ufd(assoc); #if XENO_DEBUG(POSIX) - xnprintf("Posix: closing message queue descriptor %lu.\n", - cobalt_assoc_key(assoc)); + printk(XENO_INFO "closing Cobalt mq descriptor 0x%lu\n", + cobalt_assoc_key(assoc)); #endif /* XENO_DEBUG(POSIX) */ mq_close(ufd->kfd); xnfree(ufd); @@ -1417,8 +1417,8 @@ void cobalt_mq_pkg_cleanup(void) xnlock_put_irqrestore(&nklock, s); cobalt_mq_destroy(mq); #if XENO_DEBUG(POSIX) - xnprintf("Posix: unlinking message queue \"%s\".\n", - mq->nodebase.name); + printk(XENO_INFO "unlinking Cobalt mq \"%s\"\n", + mq->nodebase.name); #endif /* XENO_DEBUG(POSIX) */ xnfree(mq); xnlock_get_irqsave(&nklock, s); diff --git a/kernel/cobalt/mutex.c b/kernel/cobalt/mutex.c index 99f65c0..fa6a89a 100644 --- a/kernel/cobalt/mutex.c +++ b/kernel/cobalt/mutex.c @@ -398,7 +398,8 @@ void cobalt_mutexq_cleanup(cobalt_kqueues_t *q) xnlock_put_irqrestore(&nklock, s); cobalt_mutex_destroy_inner(link2mutex(holder), q); #if XENO_DEBUG(POSIX) - xnprintf("Posix: destroying mutex %p.\n", link2mutex(holder)); + printk(XENO_INFO "deleting Cobalt mutex %p\n", + link2mutex(holder)); #endif /* XENO_DEBUG(POSIX) */ xnlock_get_irqsave(&nklock, s); } diff --git a/kernel/cobalt/nucleus/intr.c b/kernel/cobalt/nucleus/intr.c index c3fb8ed..3cb5c75 100644 --- a/kernel/cobalt/nucleus/intr.c +++ b/kernel/cobalt/nucleus/intr.c @@ -207,8 +207,8 @@ static void xnintr_shirq_handler(unsigned irq, void *cookie) if (unlikely(s == XN_ISR_NONE)) { if (++shirq->unhandled == XNINTR_MAX_UNHANDLED) { - xnlogerr("%s: IRQ%d not handled. Disabling IRQ " - "line.\n", __FUNCTION__, irq); + printk(XENO_ERR "%s: IRQ%d not handled. Disabling IRQ line\n" + __FUNCTION__, irq); s |= XN_ISR_NOENABLE; } } else @@ -285,14 +285,13 @@ static void xnintr_edge_shirq_handler(unsigned irq, void *cookie) xnlock_put(&shirq->lock); if (counter > MAX_EDGEIRQ_COUNTER) - xnlogerr - ("xnintr_edge_shirq_handler() : failed to get the IRQ%d line free.\n", - irq); + printk(XENO_ERR "%s: failed to get the IRQ%d line free\n", + __FUNCTION__, irq); if (unlikely(s == XN_ISR_NONE)) { if (++shirq->unhandled == XNINTR_MAX_UNHANDLED) { - xnlogerr("%s: IRQ%d not handled. Disabling IRQ " - "line.\n", __FUNCTION__, irq); + printk(XENO_ERR "%s: IRQ%d not handled. Disabling IRQ line\n", + __FUNCTION__, irq); s |= XN_ISR_NOENABLE; } } else @@ -383,8 +382,8 @@ static inline void xnintr_irq_detach(xnintr_t *intr) p = &e->next; } - xnlogerr("attempted to detach a non previously attached interrupt " - "object.\n"); + printk(XENO_ERR "attempted to detach a non previously attached interrupt " + "object\n"); } #else /* !CONFIG_XENO_OPT_SHIRQ */ @@ -470,8 +469,8 @@ static void xnintr_irq_handler(unsigned irq, void *cookie) s = intr->isr(intr); if (unlikely(s == XN_ISR_NONE)) { if (++intr->unhandled == XNINTR_MAX_UNHANDLED) { - xnlogerr("%s: IRQ%d not handled. Disabling IRQ " - "line.\n", __FUNCTION__, irq); + printk(XENO_ERR "%s: IRQ%d not handled. Disabling IRQ line\n", + __FUNCTION__, irq); s |= XN_ISR_NOENABLE; } } else { diff --git a/kernel/cobalt/nucleus/module.c b/kernel/cobalt/nucleus/module.c index dca46a2..3b319e8 100644 --- a/kernel/cobalt/nucleus/module.c +++ b/kernel/cobalt/nucleus/module.c @@ -199,8 +199,7 @@ static int __init xenomai_init(void) if (ret) goto cleanup_shadow; - xnloginfo("Xenomai/cobalt v%s enabled%s\n", - XENO_VERSION_STRING, boot_notice); + printk(XENO_INFO "Cobalt v%s enabled%s\n", XENO_VERSION_STRING, boot_notice); xeno_nucleus_status = 0; @@ -232,7 +231,7 @@ cleanup_mach: mach_cleanup(); fail: - xnlogerr("system init failed, code %d.\n", ret); + printk(XENO_ERR "system init failed, code %d\n", ret); xeno_nucleus_status = ret; diff --git a/kernel/cobalt/nucleus/pipe.c b/kernel/cobalt/nucleus/pipe.c index 720d6a0..9ecbd2a 100644 --- a/kernel/cobalt/nucleus/pipe.c +++ b/kernel/cobalt/nucleus/pipe.c @@ -1090,8 +1090,8 @@ int xnpipe_mount(void) xnpipe_class = class_create(THIS_MODULE, "rtpipe"); if (IS_ERR(xnpipe_class)) { - xnlogerr("error creating rtpipe class, err=%ld.\n", - PTR_ERR(xnpipe_class)); + printk(XENO_ERR "error creating rtpipe class, err=%ld\n", + PTR_ERR(xnpipe_class)); return -EBUSY; } @@ -1100,18 +1100,18 @@ int xnpipe_mount(void) MKDEV(XNPIPE_DEV_MAJOR, i), NULL, "rtp%d", i); if (IS_ERR(cldev)) { - xnlogerr - ("can't add device class, major=%d, minor=%d, err=%ld\n", - XNPIPE_DEV_MAJOR, i, PTR_ERR(cldev)); + printk(XENO_ERR + "can't add device class, major=%d, minor=%d, err=%ld\n", + XNPIPE_DEV_MAJOR, i, PTR_ERR(cldev)); class_destroy(xnpipe_class); return -EBUSY; } } if (register_chrdev(XNPIPE_DEV_MAJOR, "rtpipe", &xnpipe_fops)) { - xnlogerr - ("unable to reserve major #%d for message pipe support.\n", - XNPIPE_DEV_MAJOR); + printk(XENO_ERR + "unable to reserve major #%d for message pipe support\n", + XNPIPE_DEV_MAJOR); return -EBUSY; } diff --git a/kernel/cobalt/nucleus/pod.c b/kernel/cobalt/nucleus/pod.c index e7c619e..fbd6aa8 100644 --- a/kernel/cobalt/nucleus/pod.c +++ b/kernel/cobalt/nucleus/pod.c @@ -2421,10 +2421,10 @@ int xnpod_handle_exception(struct ipipe_trap_data *d) } if (!xnpod_userspace_p()) { - xnprintf - ("suspending kernel thread %p ('%s') at 0x%lx after exception #0x%x\n", - thread, thread->name, xnarch_fault_pc(d), - xnarch_fault_trap(d)); + printk(XENO_WARN + "suspending kernel thread %p ('%s') at 0x%lx after exception #0x%x\n", + thread, thread->name, xnarch_fault_pc(d), + xnarch_fault_trap(d)); xnpod_suspend_thread(thread, XNSUSP, XN_INFINITE, XN_RELATIVE, NULL); return 1; @@ -2442,20 +2442,20 @@ int xnpod_handle_exception(struct ipipe_trap_data *d) #if XENO_DEBUG(NUCLEUS) if (!user_mode(d->regs)) { xntrace_panic_freeze(); - xnprintf - ("Switching %s to secondary mode after exception #%u in " - "kernel-space at 0x%lx (pid %d)\n", thread->name, - xnarch_fault_trap(d), - xnarch_fault_pc(d), - xnthread_user_pid(thread)); + printk(XENO_WARN + "switching %s to secondary mode after exception #%u in " + "kernel-space at 0x%lx (pid %d)\n", thread->name, + xnarch_fault_trap(d), + xnarch_fault_pc(d), + xnthread_user_pid(thread)); xntrace_panic_dump(); } else if (xnarch_fault_notify(d)) /* Don't report debug traps */ - xnprintf - ("Switching %s to secondary mode after exception #%u from " - "user-space at 0x%lx (pid %d)\n", thread->name, - xnarch_fault_trap(d), - xnarch_fault_pc(d), - xnthread_user_pid(thread)); + printk(XENO_WARN + "switching %s to secondary mode after exception #%u from " + "user-space at 0x%lx (pid %d)\n", thread->name, + xnarch_fault_trap(d), + xnarch_fault_pc(d), + xnthread_user_pid(thread)); #endif /* XENO_DEBUG(NUCLEUS) */ if (xnarch_fault_pf_p(d)) /* The page fault counter is not SMP-safe, but it's a diff --git a/kernel/cobalt/nucleus/registry.c b/kernel/cobalt/nucleus/registry.c index 4385905..824b9c3 100644 --- a/kernel/cobalt/nucleus/registry.c +++ b/kernel/cobalt/nucleus/registry.c @@ -714,13 +714,11 @@ unlock_and_exit: #if XENO_DEBUG(REGISTRY) if (ret) - xnlogerr("FAILED to register object %s (%s), status %d\n", - key, - pnode ? pnode->dirname : "unknown type", - ret); + printk(XENO_ERR "FAILED to register object %s (%s), status %d\n", + key, pnode ? pnode->dirname : "unknown type", ret); else if (pnode) - xnloginfo("registered exported object %s (%s)\n", - key, pnode->dirname); + printk(XENO_INFO "registered exported object %s (%s)\n", + key, pnode->dirname); #endif return ret; @@ -889,9 +887,8 @@ int xnregistry_remove(xnhandle_t handle) * slot is still valid. Note: we only report about exported * objects. */ if (object->pnode) - xnloginfo("unregistered exported object %s (%s)\n", - object->key, - object->pnode->dirname); + printk(XENO_INFO "unregistered exported object %s (%s)\n", + object->key, object->pnode->dirname); #endif object->objaddr = NULL; diff --git a/kernel/cobalt/nucleus/sched.c b/kernel/cobalt/nucleus/sched.c index 803a852..226a88b 100644 --- a/kernel/cobalt/nucleus/sched.c +++ b/kernel/cobalt/nucleus/sched.c @@ -47,7 +47,7 @@ static void xnsched_register_class(struct xnsched_class *sched_class) XENO_BUGON(NUCLEUS, sched_class->next && sched_class->next->weight > sched_class->weight); - xnloginfo("scheduling class %s registered.\n", sched_class->name); + printk(XENO_INFO "scheduling class %s registered.\n", sched_class->name); } void xnsched_register_classes(void) @@ -96,14 +96,15 @@ static void xnsched_watchdog_handler(struct xntimer *timer) trace_mark(xn_nucleus, watchdog_signal, "thread %p thread_name %s", thread, xnthread_name(thread)); - xnprintf("watchdog triggered -- signaling runaway thread " - "'%s'\n", xnthread_name(thread)); + printk(XENO_WARN "watchdog triggered -- signaling runaway thread " + "'%s'\n", xnthread_name(thread)); xnshadow_call_mayday(thread, SIGDEBUG_WATCHDOG); } else { trace_mark(xn_nucleus, watchdog, "thread %p thread_name %s", thread, xnthread_name(thread)); - xnprintf("watchdog triggered -- killing runaway thread '%s'\n", - xnthread_name(thread)); + printk(XENO_WARN + "watchdog triggered -- killing runaway thread '%s'\n", + xnthread_name(thread)); xnpod_delete_thread(thread); } xnsched_reset_watchdog(sched); diff --git a/kernel/cobalt/nucleus/shadow.c b/kernel/cobalt/nucleus/shadow.c index c2ccfc9..07f3d2f 100644 --- a/kernel/cobalt/nucleus/shadow.c +++ b/kernel/cobalt/nucleus/shadow.c @@ -2067,8 +2067,8 @@ restart: */ goto propagate_syscall; - xnlogwarn("bad syscall %ld/%ld -- no skin loaded.\n", - __xn_mux_id(regs), __xn_mux_op(regs)); + printk(XENO_WARN "bad syscall %ld/%ld\n", + __xn_mux_id(regs), __xn_mux_op(regs)); __xn_error_return(regs, -ENOSYS); return EVENT_STOP; diff --git a/kernel/cobalt/nucleus/thread.c b/kernel/cobalt/nucleus/thread.c index b3eecd5..47053a1 100644 --- a/kernel/cobalt/nucleus/thread.c +++ b/kernel/cobalt/nucleus/thread.c @@ -87,15 +87,17 @@ int xnthread_init(struct xnthread *thread, #if CONFIG_XENO_OPT_SYS_STACKPOOLSZ == 0 if (stacksize > 0) { - xnlogerr("%s: cannot create kernel thread '%s' (CONFIG_XENO_OPT_SYS_STACKPOOLSZ == 0)\n", - __FUNCTION__, attr->name); + printk(XENO_ERR + "%s: cannot create kernel thread '%s' (CONFIG_XENO_OPT_SYS_STACKPOOLSZ == 0)\n", + __FUNCTION__, attr->name); return -ENOMEM; } #else ret = xnarch_alloc_stack(tcb, stacksize); if (ret) { - xnlogerr("%s: no stack for kernel thread '%s' (raise CONFIG_XENO_OPT_SYS_STACKPOOLSZ)\n", - __FUNCTION__, attr->name); + printk(XENO_ERR + "%s: no stack for kernel thread '%s' (raise CONFIG_XENO_OPT_SYS_STACKPOOLSZ)\n", + __FUNCTION__, attr->name); return ret; } #endif diff --git a/kernel/cobalt/nucleus/timer.c b/kernel/cobalt/nucleus/timer.c index 08a3fcb..6e64a08 100644 --- a/kernel/cobalt/nucleus/timer.c +++ b/kernel/cobalt/nucleus/timer.c @@ -926,14 +926,12 @@ static void switch_htick_mode(enum clock_event_mode mode, tickval = 1000000000UL / HZ; xntimer_start(&sched->htimer, tickval, tickval, XN_RELATIVE); break; - case CLOCK_EVT_MODE_SHUTDOWN: xntimer_stop(&sched->htimer); break; - default: #if XENO_DEBUG(TIMERS) - xnlogerr("host tick: invalid mode `%d'?\n", mode); + printk(XENO_ERR "host tick: invalid mode `%d'?\n", mode); #endif ; } diff --git a/kernel/cobalt/registry.c b/kernel/cobalt/registry.c index 7f4341e..367e0e0 100644 --- a/kernel/cobalt/registry.c +++ b/kernel/cobalt/registry.c @@ -432,7 +432,7 @@ void cobalt_reg_pkg_cleanup(void) for (i = 0; i < cobalt_reg.maxfds; i++) if (cobalt_reg.descs[i]) { #if XENO_DEBUG(POSIX) - xnprintf("Posix: destroying descriptor %d.\n", i); + printk(XENO_INFO "releasing descriptor %d\n", i); #endif /* XENO_DEBUG(POSIX) */ cobalt_desc_destroy(cobalt_reg.descs[i]); } @@ -442,8 +442,8 @@ void cobalt_reg_pkg_cleanup(void) for (node = cobalt_reg.node_buckets[i]; node; node = node->next) - xnprintf("Posix: node \"%s\" left aside.\n", - node->name); + printk(XENO_WARN "node \"%s\" left aside\n", + node->name); } #endif /* XENO_DEBUG(POSIX) */ diff --git a/kernel/cobalt/rtdm/core.c b/kernel/cobalt/rtdm/core.c index 1138fa9..a8eba3a 100644 --- a/kernel/cobalt/rtdm/core.c +++ b/kernel/cobalt/rtdm/core.c @@ -462,8 +462,8 @@ void cleanup_owned_contexts(void *owner) if (context) { if (XENO_DEBUG(RTDM_APPL)) - xnprintf("RTDM: closing file descriptor %d.\n", - fd); + printk(XENO_INFO "closing RTDM file descriptor %d\n", + fd); ret = __rt_dev_close(NULL, fd); XENO_ASSERT(RTDM, ret == 0 || ret == -EBADF, diff --git a/kernel/cobalt/rtdm/device.c b/kernel/cobalt/rtdm/device.c index 865b5f1..c551d13 100644 --- a/kernel/cobalt/rtdm/device.c +++ b/kernel/cobalt/rtdm/device.c @@ -204,26 +204,26 @@ int rtdm_dev_register(struct rtdm_device *device) /* Sanity check: structure version */ XENO_ASSERT(RTDM, device->struct_version == RTDM_DEVICE_STRUCT_VER, - xnlogerr("RTDM: invalid rtdm_device version (%d, " - "required %d)\n", device->struct_version, - RTDM_DEVICE_STRUCT_VER); + printk(XENO_ERR "invalid rtdm_device version (%d, " + "required %d)\n", device->struct_version, + RTDM_DEVICE_STRUCT_VER); return -EINVAL;); /* Sanity check: proc_name specified? */ XENO_ASSERT(RTDM, device->proc_name, - xnlogerr("RTDM: no vfile (/proc) name specified\n"); + printk(XENO_ERR "no vfile (/proc) name specified for RTDM device\n"); return -EINVAL;); switch (device->device_flags & RTDM_DEVICE_TYPE_MASK) { case RTDM_NAMED_DEVICE: /* Sanity check: any open handler? */ XENO_ASSERT(RTDM, ANY_HANDLER(*device, open), - xnlogerr("RTDM: missing open handler\n"); + printk(XENO_ERR "missing open handler for RTDM device\n"); return -EINVAL;); if (device->open_rt && device->socket_rt != (void *)rtdm_no_support) - xnlogerr("RTDM: RT open handler is deprecated, " - "driver requires update.\n"); + printk(XENO_ERR "RT open handler is deprecated, " + "RTDM driver requires update\n"); SET_DEFAULT_OP_IF_NULL(*device, open); SET_DEFAULT_OP(*device, socket); break; @@ -231,12 +231,12 @@ int rtdm_dev_register(struct rtdm_device *device) case RTDM_PROTOCOL_DEVICE: /* Sanity check: any socket handler? */ XENO_ASSERT(RTDM, ANY_HANDLER(*device, socket), - xnlogerr("RTDM: missing socket handler\n"); + printk(XENO_ERR "missing socket handler for RTDM device\n"); return -EINVAL;); if (device->socket_rt && device->socket_rt != (void *)rtdm_no_support) - xnlogerr("RTDM: RT socket creation handler is " - "deprecated, driver requires update.\n"); + printk(XENO_ERR "RT socket creation handler is " + "deprecated, RTDM driver requires update\n"); SET_DEFAULT_OP_IF_NULL(*device, socket); SET_DEFAULT_OP(*device, open); break; @@ -248,13 +248,13 @@ int rtdm_dev_register(struct rtdm_device *device) /* Sanity check: non-RT close handler? * (Always required for forced cleanup) */ if (!device->ops.close_nrt) { - xnlogerr("RTDM: missing non-RT close handler\n"); + printk(XENO_ERR "missing non-RT close handler for RTDM device\n"); return -EINVAL; } if (device->ops.close_rt && device->ops.close_rt != (void *)rtdm_no_support) - xnlogerr("RTDM: RT close handler is deprecated, driver " - "requires update.\n"); + printk(XENO_ERR "RT close handler is deprecated, RTDM driver " + "requires update\n"); else device->ops.close_rt = (void *)rtdm_no_support; @@ -274,8 +274,8 @@ int rtdm_dev_register(struct rtdm_device *device) kmalloc(sizeof(struct rtdm_dev_context) + device->context_size, GFP_KERNEL); if (!device->reserved.exclusive_context) { - xnlogerr("RTDM: no memory for exclusive context " - "(context size: %ld)\n", + printk(XENO_ERR "no memory for exclusive context of RTDM device " + "(context size: %ld)\n", (long)device->context_size); return -ENOMEM; } @@ -339,9 +339,10 @@ int rtdm_dev_register(struct rtdm_device *device) existing_dev->protocol_family) && (device->socket_type == existing_dev->socket_type)) { - xnlogerr("RTDM: protocol %u:%u already " - "exists\n", device->protocol_family, - device->socket_type); + printk(XENO_ERR "protocol %u:%u already " + "registered by RTDM device\n", + device->protocol_family, + device->socket_type); ret = -EEXIST; goto err; } @@ -426,8 +427,8 @@ int rtdm_dev_unregister(struct rtdm_device *device, unsigned int poll_delay) } if (!__test_and_set_bit(0, &warned)) - xnlogwarn("RTDM: device %s still in use - waiting for " - "release...\n", reg_dev->device_name); + printk(XENO_WARN "RTDM device %s still in use - waiting for" + "release...\n", reg_dev->device_name); msleep(poll_delay); trace_mark(xn_rtdm, dev_poll, "device %p", device); diff --git a/kernel/cobalt/rtdm/module.c b/kernel/cobalt/rtdm/module.c index fc81c48..43c1210 100644 --- a/kernel/cobalt/rtdm/module.c +++ b/kernel/cobalt/rtdm/module.c @@ -61,7 +61,7 @@ static int __init __rtdm_init(void) rtdm_initialised = 1; - xnprintf("starting RTDM services.\n"); + printk(KERN_INFO "starting RTDM services\n"); return 0; @@ -75,7 +75,7 @@ cleanup_pod: xnpod_shutdown(err); fail: - xnlogerr("RTDM init failed, code %d.\n", err); + printk(XENO_ERR "RTDM init failed, code %d\n", err); return err; } device_initcall(__rtdm_init); diff --git a/kernel/cobalt/rtdm/proc.c b/kernel/cobalt/rtdm/proc.c index 37883d4..6d617db 100644 --- a/kernel/cobalt/rtdm/proc.c +++ b/kernel/cobalt/rtdm/proc.c @@ -388,7 +388,7 @@ int rtdm_proc_register_device(struct rtdm_device *device) return 0; err_out: - xnlogerr("RTDM: error while creating device vfile\n"); + printk(XENO_ERR "error while creating RTDM device vfile\n"); return ret; } diff --git a/kernel/cobalt/sem.c b/kernel/cobalt/sem.c index 13cbd30..32edafe 100644 --- a/kernel/cobalt/sem.c +++ b/kernel/cobalt/sem.c @@ -1027,7 +1027,7 @@ static void usem_cleanup(cobalt_assoc_t *assoc) nsem_t *nsem = sem2named_sem(sem); #if XENO_DEBUG(POSIX) - xnprintf("Posix: closing semaphore \"%s\".\n", nsem->nodebase.name); + printk(KERN_INFO "closing Cobalt semaphore \"%s\"\n", nsem->nodebase.name); #endif /* XENO_DEBUG(POSIX) */ sem_close(&nsem->descriptor.shadow_sem); xnfree(usem); @@ -1051,10 +1051,10 @@ void cobalt_semq_cleanup(cobalt_kqueues_t *q) xnlock_put_irqrestore(&nklock, s); #if XENO_DEBUG(POSIX) if (sem->flags & SEM_NAMED) - xnprintf("Posix: unlinking semaphore \"%s\".\n", - sem2named_sem(sem)->nodebase.name); + printk(XENO_INFO "unlinking Cobalt semaphore \"%s\"\n", + sem2named_sem(sem)->nodebase.name); else - xnprintf("Posix: destroying semaphore %p.\n", sem); + printk(XENO_INFO "deleting Cobalt semaphore %p\n", sem); #endif /* XENO_DEBUG(POSIX) */ xnlock_get_irqsave(&nklock, s); if (sem->flags & SEM_NAMED) diff --git a/kernel/cobalt/thread.c b/kernel/cobalt/thread.c index fbb4d37..8051471 100644 --- a/kernel/cobalt/thread.c +++ b/kernel/cobalt/thread.c @@ -1369,7 +1369,7 @@ void cobalt_threadq_cleanup(cobalt_kqueues_t *q) thread_destroy(thread); xnlock_put_irqrestore(&nklock, s); #if XENO_DEBUG(POSIX) - xnprintf("POSIX: destroyed thread %p\n", thread); + printk(XENO_INFO "destroyed Cobalt thread %p\n", thread); #endif /* XENO_DEBUG(POSIX) */ xnlock_get_irqsave(&nklock, s); } diff --git a/kernel/cobalt/timer.c b/kernel/cobalt/timer.c index abcf3c4..3631631 100644 --- a/kernel/cobalt/timer.c +++ b/kernel/cobalt/timer.c @@ -597,7 +597,7 @@ void cobalt_timerq_cleanup(cobalt_kqueues_t *q) cobalt_timer_delete_inner(tm, q, 1); xnlock_put_irqrestore(&nklock, s); #if XENO_DEBUG(POSIX) - xnprintf("Posix timer %u deleted\n", (unsigned) tm); + printk(XENO_INFO "deleting Cobalt timer %u\n", (unsigned)tm); #endif /* XENO_DEBUG(POSIX) */ xnlock_get_irqsave(&nklock, s); } diff --git a/kernel/drivers/testing/sigtest_module.c b/kernel/drivers/testing/sigtest_module.c index 5707c56..e3ebc2d 100644 --- a/kernel/drivers/testing/sigtest_module.c +++ b/kernel/drivers/testing/sigtest_module.c @@ -103,7 +103,7 @@ int SKIN_INIT(sigtest) { int err; - xnprintf("starting sigtest services\n"); + printk(XENO_INFO "starting sigtest services\n"); err = xnpod_init(); if (err) @@ -125,7 +125,7 @@ int SKIN_INIT(sigtest) void SKIN_EXIT(sigtest) { - xnprintf("stopping sigtest services\n"); + printk(XENO_INFO "stopping sigtest services\n"); xntimer_destroy(&sigtest_timer); xnshadow_unregister_interface(muxid); xnpod_shutdown(XNPOD_NORMAL_EXIT); _______________________________________________ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git