Module: xenomai-forge
Branch: next
Commit: 29d02a8344fc1043abd575d9f26d57fead660bb7
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=29d02a8344fc1043abd575d9f26d57fead660bb7

Author: Philippe Gerum <r...@xenomai.org>
Date:   Sat Aug 30 19:12:01 2014 +0200

cobalt/kernel: use single switch for internal consistency checks

Now that we have a compact core system, having most of the internal
consistency checks enabled via a single switch is developer-friendly -
i.e. so that we don't inadvertently miss a disabled assertion -
provided this keeps the overhead low.

This patch merges the former NUCLEUS and RTDM debug levels into the
COBALT one.

---

 include/cobalt/kernel/assert.h         |   12 ++----------
 include/cobalt/kernel/bheap.h          |    2 +-
 include/cobalt/kernel/rtdm/driver.h    |    8 ++++----
 include/cobalt/kernel/sched-sporadic.h |    2 +-
 include/cobalt/kernel/sched.h          |    2 +-
 include/cobalt/kernel/thread.h         |    2 +-
 include/cobalt/kernel/tree.h           |    2 +-
 kernel/cobalt/Kconfig                  |   20 +-------------------
 kernel/cobalt/bufd.c                   |   12 ++++++------
 kernel/cobalt/clock.c                  |    2 +-
 kernel/cobalt/heap.c                   |   12 ++++++------
 kernel/cobalt/posix/cond.c             |    2 +-
 kernel/cobalt/posix/process.c          |   14 +++++++-------
 kernel/cobalt/posix/syscall.c          |    6 +++---
 kernel/cobalt/posix/thread.c           |    2 +-
 kernel/cobalt/procfs.c                 |    6 +++---
 kernel/cobalt/rtdm/core.c              |    4 ++--
 kernel/cobalt/rtdm/device.c            |    4 ++--
 kernel/cobalt/rtdm/drvlib.c            |   24 ++++++++++++------------
 kernel/cobalt/rtdm/fd.c                |   18 +++++++++---------
 kernel/cobalt/sched-quota.c            |    8 ++++----
 kernel/cobalt/sched-sporadic.c         |   12 ++++++------
 kernel/cobalt/sched-tp.c               |    6 +++---
 kernel/cobalt/sched.c                  |   12 ++++++------
 kernel/cobalt/synch.c                  |   16 ++++++++--------
 kernel/cobalt/thread.c                 |   16 ++++++++--------
 kernel/cobalt/timer.c                  |    2 +-
 kernel/cobalt/vfile.c                  |    8 ++++----
 kernel/drivers/ipc/bufp.c              |    4 ++--
 29 files changed, 107 insertions(+), 133 deletions(-)

diff --git a/include/cobalt/kernel/assert.h b/include/cobalt/kernel/assert.h
index 6cc5bfd..3510a8c 100644
--- a/include/cobalt/kernel/assert.h
+++ b/include/cobalt/kernel/assert.h
@@ -53,8 +53,8 @@
                                    __FILE__, __LINE__, (#__cond));     \
        } while (0)
 
-#ifndef CONFIG_XENO_OPT_DEBUG_NUCLEUS
-#define CONFIG_XENO_OPT_DEBUG_NUCLEUS 0
+#ifndef CONFIG_XENO_OPT_DEBUG_COBALT
+#define CONFIG_XENO_OPT_DEBUG_COBALT 0
 #endif
 
 #ifndef CONFIG_XENO_OPT_DEBUG_CONTEXT
@@ -69,14 +69,6 @@
 #define CONFIG_XENO_OPT_DEBUG_SYNCH_RELAX 0
 #endif
 
-#ifndef CONFIG_XENO_OPT_DEBUG_RTDM
-#define CONFIG_XENO_OPT_DEBUG_RTDM     0
-#endif
-
-#ifndef CONFIG_XENO_OPT_DEBUG_COBALT
-#define CONFIG_XENO_OPT_DEBUG_COBALT 0
-#endif
-
 #define primary_mode_only()    XENO_BUGON(CONTEXT, ipipe_root_p)
 #define secondary_mode_only()  XENO_BUGON(CONTEXT, !ipipe_root_p)
 #define interrupt_only()       XENO_BUGON(CONTEXT, !xnsched_interrupt_p())
diff --git a/include/cobalt/kernel/bheap.h b/include/cobalt/kernel/bheap.h
index 3a0c246..e04e694 100644
--- a/include/cobalt/kernel/bheap.h
+++ b/include/cobalt/kernel/bheap.h
@@ -63,7 +63,7 @@ static inline int bheap_ordered(bheap_t *heap)
 }
 
 #define BHEAP_CHECK(heap)                                              \
-       XENO_BUGON(NUCLEUS, ((heap)->sz == 0) || !bheap_ordered(heap))
+       XENO_BUGON(COBALT, ((heap)->sz == 0) || !bheap_ordered(heap))
 
 #define bheap_gethead(heap)                            \
        ({                                              \
diff --git a/include/cobalt/kernel/rtdm/driver.h 
b/include/cobalt/kernel/rtdm/driver.h
index 1b24cc7..12fb518 100644
--- a/include/cobalt/kernel/rtdm/driver.h
+++ b/include/cobalt/kernel/rtdm/driver.h
@@ -497,7 +497,7 @@ static inline void rtdm_lock_init(rtdm_lock_t *lock)
  */
 static inline void rtdm_lock_get(rtdm_lock_t *lock)
 {
-       XENO_BUGON(RTDM, !spltest());
+       XENO_BUGON(COBALT, !spltest());
        spin_lock(lock);
        __xnsched_lock();
 }
@@ -765,7 +765,7 @@ int rtdm_irq_request(rtdm_irq_t *irq_handle, unsigned int 
irq_no,
 #ifndef DOXYGEN_CPP /* Avoid static inline tags for RTDM in doxygen */
 static inline int rtdm_irq_free(rtdm_irq_t *irq_handle)
 {
-       if (!XENO_ASSERT(RTDM, xnsched_root_p()))
+       if (!XENO_ASSERT(COBALT, xnsched_root_p()))
                return -EPERM;
        xnintr_detach(irq_handle);
        return 0;
@@ -989,7 +989,7 @@ static inline rtdm_task_t *rtdm_task_current(void)
 
 static inline int rtdm_task_wait_period(void)
 {
-       if (!XENO_ASSERT(RTDM, !xnsched_unblockable_p()))
+       if (!XENO_ASSERT(COBALT, !xnsched_unblockable_p()))
                return -EPERM;
        return xnthread_wait_period(NULL);
 }
@@ -1211,7 +1211,7 @@ static inline int rtdm_strncpy_from_user(struct rtdm_fd 
*fd,
 
 static inline int rtdm_rt_capable(struct rtdm_fd *fd)
 {
-       if (!XENO_ASSERT(RTDM, !xnsched_interrupt_p()))
+       if (!XENO_ASSERT(COBALT, !xnsched_interrupt_p()))
                return 0;
 
        if (!rtdm_fd_is_user(fd))
diff --git a/include/cobalt/kernel/sched-sporadic.h 
b/include/cobalt/kernel/sched-sporadic.h
index a6aac77..a4b4434 100644
--- a/include/cobalt/kernel/sched-sporadic.h
+++ b/include/cobalt/kernel/sched-sporadic.h
@@ -56,7 +56,7 @@ struct xnsched_sporadic_data {
 };
 
 struct xnsched_sporadic {
-#if XENO_DEBUG(NUCLEUS)
+#if XENO_DEBUG(COBALT)
        unsigned long drop_retries;
 #endif
 };
diff --git a/include/cobalt/kernel/sched.h b/include/cobalt/kernel/sched.h
index 4350ecd..c54ece1 100644
--- a/include/cobalt/kernel/sched.h
+++ b/include/cobalt/kernel/sched.h
@@ -390,7 +390,7 @@ int xnsched_maybe_resched_after_unlocked_switch(struct 
xnsched *sched)
 static inline struct xnsched *
 xnsched_finish_unlocked_switch(struct xnsched *sched)
 {
-       XENO_BUGON(NUCLEUS, !hard_irqs_disabled());
+       XENO_BUGON(COBALT, !hard_irqs_disabled());
        return xnsched_current();
 }
 
diff --git a/include/cobalt/kernel/thread.h b/include/cobalt/kernel/thread.h
index 4c58629..056fe51 100644
--- a/include/cobalt/kernel/thread.h
+++ b/include/cobalt/kernel/thread.h
@@ -334,7 +334,7 @@ void xnthread_set_sync_window(struct xnthread *thread, int 
state_bits)
 static inline int xnthread_try_grab(struct xnthread *thread,
                                    struct xnsynch *synch)
 {
-       XENO_BUGON(NUCLEUS, xnsynch_fastlock_p(synch));
+       XENO_BUGON(COBALT, xnsynch_fastlock_p(synch));
 
        if (xnsynch_owner(synch) != NULL)
                return 0;
diff --git a/include/cobalt/kernel/tree.h b/include/cobalt/kernel/tree.h
index 90b5b4f..da7738c 100644
--- a/include/cobalt/kernel/tree.h
+++ b/include/cobalt/kernel/tree.h
@@ -76,7 +76,7 @@ struct xnid *xnid_fetch(struct rb_root *t, unsigned long long 
id)
 
 static inline int xnid_remove(struct rb_root *t, struct xnid *xnid)
 {
-#if XENO_DEBUG(NUCLEUS)
+#if XENO_DEBUG(COBALT)
        if (xnid_fetch(t, xnid->id) != xnid)
                return -ENOENT;
 #endif
diff --git a/kernel/cobalt/Kconfig b/kernel/cobalt/Kconfig
index cd4dea5..2d61b7e 100644
--- a/kernel/cobalt/Kconfig
+++ b/kernel/cobalt/Kconfig
@@ -360,7 +360,7 @@ menuconfig XENO_OPT_DEBUG
 
 if XENO_OPT_DEBUG
 
-config XENO_OPT_DEBUG_NUCLEUS
+config XENO_OPT_DEBUG_COBALT
        bool "Cobalt runtime assertions"
        help
 
@@ -447,22 +447,4 @@ config XENO_OPT_WATCHDOG_TIMEOUT
 
        Watchdog timeout value (in seconds).
 
-config XENO_OPT_DEBUG_COBALT
-       bool "Cobalt debugging support"
-       default n
-       help
-
-       This option activates various checks inside the POSIX API
-       implementation in the Cobalt kernel, mainly to help debugging
-       applications. This option has no significant overhead.
-
-config XENO_OPT_DEBUG_RTDM
-       bool "RTDM debugging checks"
-       default y
-       help
-
-       This option activates debugging checks for the RTDM subsystem.
-       It is a recommended option for analysing potential issues in
-       RTDM drivers. A marginal runtime overhead is added.
-
 endif # XENO_OPT_DEBUG
diff --git a/kernel/cobalt/bufd.c b/kernel/cobalt/bufd.c
index f6f0f4f..decd1bd 100644
--- a/kernel/cobalt/bufd.c
+++ b/kernel/cobalt/bufd.c
@@ -333,7 +333,7 @@ ssize_t xnbufd_copy_to_kmem(void *to, struct xnbufd *bufd, 
size_t len)
                goto advance_offset;
        }
 
-       XENO_BUGON(NUCLEUS, 1);
+       XENO_BUG(COBALT);
 
        return -EINVAL;
 
@@ -493,7 +493,7 @@ ssize_t xnbufd_unmap_uread(struct xnbufd *bufd)
 {
        preemptible_only();
 
-#if XENO_DEBUG(NUCLEUS)
+#if XENO_DEBUG(COBALT)
        bufd->b_ptr = (caddr_t)-1;
 #endif
        return bufd->b_off;
@@ -551,7 +551,7 @@ ssize_t xnbufd_unmap_uwrite(struct xnbufd *bufd)
        if (bufd->b_len > sizeof(bufd->b_buf))
                xnfree(bufd->b_carry);
 done:
-#if XENO_DEBUG(NUCLEUS)
+#if XENO_DEBUG(COBALT)
        bufd->b_ptr = (caddr_t)-1;
 #endif
        return ret ?: (ssize_t)len;
@@ -592,7 +592,7 @@ EXPORT_SYMBOL_GPL(xnbufd_unmap_uwrite);
  */
 void xnbufd_invalidate(struct xnbufd *bufd)
 {
-#if XENO_DEBUG(NUCLEUS)
+#if XENO_DEBUG(COBALT)
        bufd->b_ptr = (caddr_t)-1;
 #endif
        if (bufd->b_carry) {
@@ -620,7 +620,7 @@ EXPORT_SYMBOL_GPL(xnbufd_invalidate);
  */
 ssize_t xnbufd_unmap_kread(struct xnbufd *bufd)
 {
-#if XENO_DEBUG(NUCLEUS)
+#if XENO_DEBUG(COBALT)
        bufd->b_ptr = (caddr_t)-1;
 #endif
        return bufd->b_off;
@@ -643,7 +643,7 @@ EXPORT_SYMBOL_GPL(xnbufd_unmap_kread);
  */
 ssize_t xnbufd_unmap_kwrite(struct xnbufd *bufd)
 {
-#if XENO_DEBUG(NUCLEUS)
+#if XENO_DEBUG(COBALT)
        bufd->b_ptr = (caddr_t)-1;
 #endif
        return bufd->b_off;
diff --git a/kernel/cobalt/clock.c b/kernel/cobalt/clock.c
index 34bb425..962e1f9 100644
--- a/kernel/cobalt/clock.c
+++ b/kernel/cobalt/clock.c
@@ -669,7 +669,7 @@ void xnclock_deregister(struct xnclock *clock)
 
        for_each_online_cpu(cpu) {
                tmd = xnclock_percpu_timerdata(clock, cpu);
-               XENO_BUGON(NUCLEUS, !xntimerq_empty(&tmd->q));
+               XENO_BUGON(COBALT, !xntimerq_empty(&tmd->q));
                xntimerq_destroy(&tmd->q);
        }
 
diff --git a/kernel/cobalt/heap.c b/kernel/cobalt/heap.c
index a7eecdf..3a5522c 100644
--- a/kernel/cobalt/heap.c
+++ b/kernel/cobalt/heap.c
@@ -599,14 +599,14 @@ void *xnheap_alloc(struct xnheap *heap, unsigned long 
size)
                } else {
                        if (bsize <= heap->pagesize)
                                --heap->buckets[ilog].fcount;
-                       if (!XENO_ASSERT(NUCLEUS, !list_empty(&heap->extents)))
+                       if (!XENO_ASSERT(COBALT, !list_empty(&heap->extents)))
                                goto oops;
                        list_for_each_entry(extent, &heap->extents, link) {
                                if ((caddr_t) block >= extent->membase &&
                                    (caddr_t) block < extent->memlim)
                                        goto found;
                        }
-                       XENO_ASSERT(NUCLEUS, 0);
+                       XENO_ASSERT(COBALT, 0);
                oops:
                        block = NULL;
                        goto release_and_exit;
@@ -799,7 +799,7 @@ found:
                nextpage = freepage + heap->pagesize;
                nblocks = heap->pagesize >> log2size;
                heap->buckets[ilog].fcount -= (nblocks - 1);
-               XENO_BUGON(NUCLEUS, heap->buckets[ilog].fcount < 0);
+               XENO_BUGON(COBALT, heap->buckets[ilog].fcount < 0);
 
                /*
                 * Easy case: all free blocks are laid on a single
@@ -1254,9 +1254,9 @@ void xnheap_destroy_mapped(struct xnheap *heap,
         * Trying to unmap user memory without providing a release
         * handler for deferred cleanup is a bug.
         */
-       XENO_ASSERT(NUCLEUS, mapaddr == NULL || release);
+       XENO_ASSERT(COBALT, mapaddr == NULL || release);
 
-       if (XENO_DEBUG(NUCLEUS) && heap->ubytes != 0)
+       if (XENO_DEBUG(COBALT) && heap->ubytes != 0)
                printk(XENO_ERR "destroying shared heap '%s' "
                       "with %lu bytes still in use.\n",
                       heap->label, heap->ubytes);
@@ -1294,7 +1294,7 @@ void xnheap_destroy_mapped(struct xnheap *heap,
                /* The release handler is supposed to clean up the rest. */
                heap->release = release;
                spin_unlock(&kheapq_lock);
-               XENO_ASSERT(NUCLEUS, release != NULL);
+               XENO_ASSERT(COBALT, release != NULL);
                return;
        }
 
diff --git a/kernel/cobalt/posix/cond.c b/kernel/cobalt/posix/cond.c
index 92ddc6d..c0c4353 100644
--- a/kernel/cobalt/posix/cond.c
+++ b/kernel/cobalt/posix/cond.c
@@ -185,7 +185,7 @@ static inline int cobalt_cond_timedwait_prologue(struct 
xnthread *cur,
                goto unlock_and_return;
        }
 
-#if XENO_DEBUG(NUCLEUS)
+#if XENO_DEBUG(COBALT)
        if (cond->owningq != cobalt_kqueues(cond->attr.pshared)) {
                err = -EPERM;
                goto unlock_and_return;
diff --git a/kernel/cobalt/posix/process.c b/kernel/cobalt/posix/process.c
index 3721a77..ac0b96c 100644
--- a/kernel/cobalt/posix/process.c
+++ b/kernel/cobalt/posix/process.c
@@ -193,7 +193,7 @@ static void leave_personality(struct cobalt_process 
*process,
 {
        __clear_bit(personality->xid, &process->permap);
        atomic_dec(&personality->refcnt);
-       XENO_ASSERT(NUCLEUS, atomic_read(&personality->refcnt) >= 0);
+       XENO_ASSERT(COBALT, atomic_read(&personality->refcnt) >= 0);
        if (personality->module)
                module_put(personality->module);
 }
@@ -745,7 +745,7 @@ static inline int handle_exception(struct ipipe_trap_data 
*d)
         */
        thread->regs = xnarch_fault_regs(d);
 
-#if XENO_DEBUG(NUCLEUS)
+#if XENO_DEBUG(COBALT)
        if (!user_mode(d->regs)) {
                xntrace_panic_freeze();
                printk(XENO_WARN
@@ -762,7 +762,7 @@ static inline int handle_exception(struct ipipe_trap_data 
*d)
                       xnarch_fault_trap(d),
                       xnarch_fault_pc(d),
                       xnthread_host_pid(thread));
-#endif /* XENO_DEBUG(NUCLEUS) */
+#endif /* XENO_DEBUG(COBALT) */
 
        if (xnarch_fault_pf_p(d))
                /*
@@ -783,7 +783,7 @@ static int handle_mayday_event(struct pt_regs *regs)
        struct xnarchtcb *tcb = xnthread_archtcb(thread);
        struct xnsys_ppd *sys_ppd;
 
-       XENO_BUGON(NUCLEUS, !xnthread_test_state(thread, XNUSER));
+       XENO_BUGON(COBALT, !xnthread_test_state(thread, XNUSER));
 
        /* We enter the mayday handler with hw IRQs off. */
        sys_ppd = cobalt_ppd_get(0);
@@ -1076,7 +1076,7 @@ static inline void lock_timers(void)
 
 static inline void unlock_timers(void)
 {
-       XENO_BUGON(NUCLEUS, atomic_read(&nkclklk) == 0);
+       XENO_BUGON(COBALT, atomic_read(&nkclklk) == 0);
        smp_mb__before_atomic_dec();
        atomic_dec(&nkclklk);
        smp_mb__after_atomic_dec();
@@ -1094,7 +1094,7 @@ static int handle_taskexit_event(struct task_struct *p) 
/* p == current */
        secondary_mode_only();
 
        thread = xnthread_current();
-       XENO_BUGON(NUCLEUS, thread == NULL);
+       XENO_BUGON(COBALT, thread == NULL);
        trace_cobalt_shadow_unmap(thread);
 
        if (xnthread_test_state(thread, XNDEBUG))
@@ -1182,7 +1182,7 @@ static int handle_schedule_event(struct task_struct 
*next_task)
        }
 
 no_ptrace:
-       if (XENO_DEBUG(NUCLEUS)) {
+       if (XENO_DEBUG(COBALT)) {
                if (!xnthread_test_state(next, XNRELAX)) {
                        xntrace_panic_freeze();
                        show_stack(xnthread_host_task(next), NULL);
diff --git a/kernel/cobalt/posix/syscall.c b/kernel/cobalt/posix/syscall.c
index d5a8e45..ae8c52f 100644
--- a/kernel/cobalt/posix/syscall.c
+++ b/kernel/cobalt/posix/syscall.c
@@ -144,7 +144,7 @@ static int handle_head_syscall(struct ipipe_domain *ipd, 
struct pt_regs *regs)
                     (thread == NULL && (sysflags & __xn_exec_shadow) != 0) ||
                     (!cap_raised(current_cap(), CAP_SYS_NICE) &&
                      nr != sc_cobalt_bind))) {
-               if (XENO_DEBUG(NUCLEUS))
+               if (XENO_DEBUG(COBALT))
                        printk(XENO_WARN
                               "syscall <%d> denied to %s[%d]\n",
                               nr, current->comm, current->pid);
@@ -403,7 +403,7 @@ int ipipe_fastcall_hook(struct pt_regs *regs)
        int ret;
 
        ret = handle_head_syscall(&xnsched_realtime_domain, regs);
-       XENO_BUGON(NUCLEUS, ret == KEVENT_PROPAGATE);
+       XENO_BUGON(COBALT, ret == KEVENT_PROPAGATE);
 
        return ret;
 }
@@ -687,7 +687,7 @@ static int cobalt_sysconf(int option, void __user *u_buf, 
size_t u_bufsz)
                        val |= _SC_COBALT_SCHED_TP;
                break;
        case _SC_COBALT_DEBUG:
-               if (IS_ENABLED(CONFIG_XENO_OPT_DEBUG_NUCLEUS))
+               if (IS_ENABLED(CONFIG_XENO_OPT_DEBUG_COBALT))
                        val |= _SC_COBALT_DEBUG_ASSERT;
                if (IS_ENABLED(CONFIG_XENO_OPT_DEBUG_CONTEXT))
                        val |= _SC_COBALT_DEBUG_CONTEXT;
diff --git a/kernel/cobalt/posix/thread.c b/kernel/cobalt/posix/thread.c
index d8674f6..eb87caa 100644
--- a/kernel/cobalt/posix/thread.c
+++ b/kernel/cobalt/posix/thread.c
@@ -205,7 +205,7 @@ void cobalt_thread_map(struct xnthread *curr)
 
        thread = container_of(curr, struct cobalt_thread, threadbase);
        thread->process = cobalt_current_process();
-       XENO_BUGON(NUCLEUS, thread->process == NULL);
+       XENO_BUGON(COBALT, thread->process == NULL);
 }
 
 struct xnthread_personality *cobalt_thread_exit(struct xnthread *curr)
diff --git a/kernel/cobalt/procfs.c b/kernel/cobalt/procfs.c
index 2e8c3ce..be18630 100644
--- a/kernel/cobalt/procfs.c
+++ b/kernel/cobalt/procfs.c
@@ -215,12 +215,12 @@ static struct xnvfile_regular apc_vfile = {
 
 void xnprocfs_cleanup_tree(void)
 {
-#if XENO_DEBUG(NUCLEUS)
+#if XENO_DEBUG(COBALT)
 #if XENO_DEBUG(LOCKING)
        xnvfile_destroy_regular(&lock_vfile);
 #endif
        xnvfile_destroy_dir(&debug_vfroot);
-#endif /* XENO_DEBUG(NUCLEUS) */
+#endif /* XENO_DEBUG(COBALT) */
        xnvfile_destroy_regular(&apc_vfile);
        xnvfile_destroy_regular(&faults_vfile);
        xnvfile_destroy_regular(&version_vfile);
@@ -256,7 +256,7 @@ int __init xnprocfs_init_tree(void)
 #if XENO_DEBUG(LOCKING)
        xnvfile_init_regular("lock", &lock_vfile, &debug_vfroot);
 #endif
-#endif /* XENO_DEBUG(NUCLEUS) */
+#endif /* XENO_DEBUG(COBALT) */
 
        return 0;
 }
diff --git a/kernel/cobalt/rtdm/core.c b/kernel/cobalt/rtdm/core.c
index f89c6cd..0793b19 100644
--- a/kernel/cobalt/rtdm/core.c
+++ b/kernel/cobalt/rtdm/core.c
@@ -170,7 +170,7 @@ int __rt_dev_open(struct xnsys_ppd *p, int ufd, const char 
*path, int oflag)
 
        ret = device->ops.open(&context->fd, oflag);
 
-       if (!XENO_ASSERT(RTDM, !spltest()))
+       if (!XENO_ASSERT(COBALT, !spltest()))
                splnone();
 
        if (unlikely(ret < 0))
@@ -209,7 +209,7 @@ int __rt_dev_socket(struct xnsys_ppd *p, int ufd, int 
protocol_family,
 
        ret = device->ops.socket(&context->fd, protocol);
 
-       if (!XENO_ASSERT(RTDM, !spltest()))
+       if (!XENO_ASSERT(COBALT, !spltest()))
                splnone();
 
        if (unlikely(ret < 0))
diff --git a/kernel/cobalt/rtdm/device.c b/kernel/cobalt/rtdm/device.c
index 63f2e1b..14e4492 100644
--- a/kernel/cobalt/rtdm/device.c
+++ b/kernel/cobalt/rtdm/device.c
@@ -180,7 +180,7 @@ int rtdm_dev_register(struct rtdm_device *device)
                return -ENOSYS;
 
        /* Sanity check: structure version */
-       if (!XENO_ASSERT(RTDM, device->struct_version == 
RTDM_DEVICE_STRUCT_VER)) {
+       if (!XENO_ASSERT(COBALT, 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);
@@ -188,7 +188,7 @@ int rtdm_dev_register(struct rtdm_device *device)
        }
 
        /* Sanity check: proc_name specified? */
-       if (!XENO_ASSERT(RTDM, device->proc_name)) {
+       if (!XENO_ASSERT(COBALT, device->proc_name)) {
                printk(XENO_ERR "no vfile (/proc) name specified for RTDM 
device\n");
                return -EINVAL;
        }
diff --git a/kernel/cobalt/rtdm/drvlib.c b/kernel/cobalt/rtdm/drvlib.c
index a4feead..818625a 100644
--- a/kernel/cobalt/rtdm/drvlib.c
+++ b/kernel/cobalt/rtdm/drvlib.c
@@ -335,7 +335,7 @@ int __rtdm_task_sleep(xnticks_t timeout, xntmode_t mode)
 {
        struct xnthread *thread;
 
-       if (!XENO_ASSERT(RTDM, !xnsched_unblockable_p()))
+       if (!XENO_ASSERT(COBALT, !xnsched_unblockable_p()))
                return -EPERM;
 
        thread = xnthread_current();
@@ -598,7 +598,7 @@ int device_service_routine(...)
  */
 void rtdm_toseq_init(rtdm_toseq_t *timeout_seq, nanosecs_rel_t timeout)
 {
-       XENO_ASSERT(RTDM, !xnsched_unblockable_p()); /* only warn here */
+       XENO_ASSERT(COBALT, !xnsched_unblockable_p()); /* only warn here */
 
        *timeout_seq = xnclock_read_monotonic(&nkclock) + timeout;
 }
@@ -771,7 +771,7 @@ int rtdm_event_timedwait(rtdm_event_t *event, 
nanosecs_rel_t timeout,
        spl_t s;
        int err = 0;
 
-       if (!XENO_ASSERT(RTDM, !xnsched_unblockable_p()))
+       if (!XENO_ASSERT(COBALT, !xnsched_unblockable_p()))
                return -EPERM;
 
        trace_cobalt_driver_event_wait(event, xnthread_current());
@@ -1006,7 +1006,7 @@ int rtdm_sem_timeddown(rtdm_sem_t *sem, nanosecs_rel_t 
timeout,
        spl_t s;
        int err = 0;
 
-       if (!XENO_ASSERT(RTDM, !xnsched_unblockable_p()))
+       if (!XENO_ASSERT(COBALT, !xnsched_unblockable_p()))
                return -EPERM;
 
        trace_cobalt_driver_sem_wait(sem, xnthread_current());
@@ -1182,7 +1182,7 @@ EXPORT_SYMBOL_GPL(rtdm_mutex_destroy);
  */
 void rtdm_mutex_unlock(rtdm_mutex_t *mutex)
 {
-       if (!XENO_ASSERT(RTDM, !xnsched_interrupt_p()))
+       if (!XENO_ASSERT(COBALT, !xnsched_interrupt_p()))
                return;
 
        trace_cobalt_driver_mutex_release(mutex);
@@ -1251,7 +1251,7 @@ int rtdm_mutex_timedlock(rtdm_mutex_t *mutex, 
nanosecs_rel_t timeout,
        int err = 0;
        spl_t s;
 
-       if (!XENO_ASSERT(RTDM, !xnsched_unblockable_p()))
+       if (!XENO_ASSERT(COBALT, !xnsched_unblockable_p()))
                return -EPERM;
 
        curr_thread = xnthread_current();
@@ -1264,7 +1264,7 @@ int rtdm_mutex_timedlock(rtdm_mutex_t *mutex, 
nanosecs_rel_t timeout,
        else if (!xnthread_try_grab(curr_thread, &mutex->synch_base)) {
                /* Redefinition to clarify XENO_ASSERT output */
                #define mutex_owner xnsynch_owner(&mutex->synch_base)
-               if (!XENO_ASSERT(RTDM, mutex_owner != curr_thread)) {
+               if (!XENO_ASSERT(COBALT, mutex_owner != curr_thread)) {
                        err = -EDEADLK;
                        goto unlock_out;
                }
@@ -1339,7 +1339,7 @@ int rtdm_irq_request(rtdm_irq_t *irq_handle, unsigned int 
irq_no,
 {
        int err;
 
-       if (!XENO_ASSERT(RTDM, xnsched_root_p()))
+       if (!XENO_ASSERT(COBALT, xnsched_root_p()))
                return -EPERM;
 
        err = xnintr_init(irq_handle, device_name, irq_no, handler, NULL, 
flags);
@@ -1504,13 +1504,13 @@ static int mmap_kmem_helper(struct vm_area_struct *vma, 
void *va)
        maddr = vma->vm_start;
        len = vma->vm_end - vma->vm_start;
 
-       if (!XENO_ASSERT(RTDM, vaddr == PAGE_ALIGN(vaddr)))
+       if (!XENO_ASSERT(COBALT, vaddr == PAGE_ALIGN(vaddr)))
                return -EINVAL;
 
 #ifdef CONFIG_MMU
        /* Catch vmalloc memory */
        if (vaddr >= VMALLOC_START && vaddr < VMALLOC_END) {
-               if (!XENO_ASSERT(RTDM, (len & ~PAGE_MASK) == 0))
+               if (!XENO_ASSERT(COBALT, (len & ~PAGE_MASK) == 0))
                        return -EINVAL;
 
                while (len >= PAGE_SIZE) {
@@ -1634,7 +1634,7 @@ static int rtdm_mmap(struct mmap_tramp_data *tramp_data,
        void *old_priv_data;
        struct file *filp;
 
-       if (!XENO_ASSERT(RTDM, xnsched_root_p()))
+       if (!XENO_ASSERT(COBALT, xnsched_root_p()))
                return -EPERM;
 
        filp = filp_open(XNHEAP_DEV_NAME, O_RDWR, 0);
@@ -1902,7 +1902,7 @@ EXPORT_SYMBOL_GPL(rtdm_mmap_iomem);
  */
 int rtdm_munmap(void *ptr, size_t len)
 {
-       if (!XENO_ASSERT(RTDM, xnsched_root_p()))
+       if (!XENO_ASSERT(COBALT, xnsched_root_p()))
                return -EPERM;
 
        return vm_munmap((unsigned long)ptr, len);
diff --git a/kernel/cobalt/rtdm/fd.c b/kernel/cobalt/rtdm/fd.c
index 7bea06b..655a5e7 100644
--- a/kernel/cobalt/rtdm/fd.c
+++ b/kernel/cobalt/rtdm/fd.c
@@ -197,7 +197,7 @@ static void rtdm_fd_do_close(struct rtdm_fd *fd)
 
        fd->ops->close(fd);
 
-       if (!XENO_ASSERT(NUCLEUS, !spltest()))
+       if (!XENO_ASSERT(COBALT, !spltest()))
                splnone();
 }
 
@@ -327,7 +327,7 @@ void rtdm_fd_unlock(struct rtdm_fd *fd)
 
        xnlock_get_irqsave(&__rtdm_fd_lock, s);
        /* Warn if fd was unreferenced. */
-       XENO_ASSERT(NUCLEUS, fd->refs > 0);
+       XENO_ASSERT(COBALT, fd->refs > 0);
        rtdm_fd_put_inner(fd, s);
 }
 EXPORT_SYMBOL_GPL(rtdm_fd_unlock);
@@ -356,7 +356,7 @@ int rtdm_fd_ioctl(struct xnsys_ppd *p, int ufd, unsigned 
int request, ...)
        else
                err = fd->ops->ioctl_rt(fd, request, arg);
 
-       if (!XENO_ASSERT(NUCLEUS, !spltest()))
+       if (!XENO_ASSERT(COBALT, !spltest()))
                    splnone();
 
        if (err < 0) {
@@ -393,7 +393,7 @@ rtdm_fd_read(struct xnsys_ppd *p, int ufd, void __user 
*buf, size_t size)
        else
                err = fd->ops->read_rt(fd, buf, size);
 
-       if (!XENO_ASSERT(NUCLEUS, !spltest()))
+       if (!XENO_ASSERT(COBALT, !spltest()))
                    splnone();
 
        rtdm_fd_put(fd);
@@ -425,7 +425,7 @@ ssize_t rtdm_fd_write(struct xnsys_ppd *p, int ufd,
        else
                err = fd->ops->write_rt(fd, buf, size);
 
-       if (!XENO_ASSERT(NUCLEUS, !spltest()))
+       if (!XENO_ASSERT(COBALT, !spltest()))
                    splnone();
 
        rtdm_fd_put(fd);
@@ -457,7 +457,7 @@ rtdm_fd_recvmsg(struct xnsys_ppd *p, int ufd, struct msghdr 
*msg, int flags)
        else
                err = fd->ops->recvmsg_rt(fd, msg, flags);
 
-       if (!XENO_ASSERT(NUCLEUS, !spltest()))
+       if (!XENO_ASSERT(COBALT, !spltest()))
                    splnone();
 
        rtdm_fd_put(fd);
@@ -489,7 +489,7 @@ rtdm_fd_sendmsg(struct xnsys_ppd *p, int ufd, const struct 
msghdr *msg, int flag
        else
                err = fd->ops->sendmsg_rt(fd, msg, flags);
 
-       if (!XENO_ASSERT(NUCLEUS, !spltest()))
+       if (!XENO_ASSERT(COBALT, !spltest()))
                    splnone();
 
        rtdm_fd_put(fd);
@@ -614,8 +614,8 @@ int rtdm_fd_select(int ufd, struct xnselector *selector,
 
        rc = fd->ops->select(fd, selector, type, ufd);
 
-       if (!XENO_ASSERT(RTDM, !spltest()))
-                   splnone();
+       if (!XENO_ASSERT(COBALT, !spltest()))
+               splnone();
 
        rtdm_fd_put(fd);
 
diff --git a/kernel/cobalt/sched-quota.c b/kernel/cobalt/sched-quota.c
index 2e0e649..8a72819 100644
--- a/kernel/cobalt/sched-quota.c
+++ b/kernel/cobalt/sched-quota.c
@@ -151,7 +151,7 @@ static void quota_refill_handler(struct xntimer *timer)
        struct xnsched *sched;
 
        qs = container_of(timer, struct xnsched_quota, refill_timer);
-       XENO_BUGON(NUCLEUS, list_empty(&qs->groups));
+       XENO_BUGON(COBALT, list_empty(&qs->groups));
        sched = container_of(qs, struct xnsched, quota);
 
        list_for_each_entry(tg, &qs->groups, next) {
@@ -260,7 +260,7 @@ static void xnsched_quota_setparam(struct xnthread *thread,
                return;
        }
 
-       XENO_BUG(NUCLEUS);
+       XENO_BUG(COBALT);
 }
 
 static void xnsched_quota_getparam(struct xnthread *thread,
@@ -275,7 +275,7 @@ static void xnsched_quota_trackprio(struct xnthread *thread,
 {
        if (p) {
                /* We should not cross groups during PIP boost. */
-               XENO_WARNON(NUCLEUS,
+               XENO_WARNON(COBALT,
                           thread->base_class == &xnsched_class_quota &&
                           thread->quota->tgid != p->quota.tgid);
                thread->cprio = p->quota.prio;
@@ -321,7 +321,7 @@ static int xnsched_quota_declare(struct xnthread *thread,
 static void xnsched_quota_forget(struct xnthread *thread)
 {
        thread->quota->nr_threads--;
-       XENO_BUGON(NUCLEUS, thread->quota->nr_threads < 0);
+       XENO_BUGON(COBALT, thread->quota->nr_threads < 0);
        list_del(&thread->quota_next);
        thread->quota = NULL;
 }
diff --git a/kernel/cobalt/sched-sporadic.c b/kernel/cobalt/sched-sporadic.c
index 18356cf..e1cb141 100644
--- a/kernel/cobalt/sched-sporadic.c
+++ b/kernel/cobalt/sched-sporadic.c
@@ -23,7 +23,7 @@
 
 static void sporadic_post_recharge(struct xnthread *thread, xnticks_t budget);
 
-#if XENO_DEBUG(NUCLEUS)
+#if XENO_DEBUG(COBALT)
 
 static inline void sporadic_note_late_drop(struct xnsched *sched)
 {
@@ -33,7 +33,7 @@ static inline void sporadic_note_late_drop(struct xnsched 
*sched)
         * hundred times in a row. This normally reveals a time budget
         * which is too tight.
         */
-       XENO_BUGON(NUCLEUS, ++sched->pss.drop_retries > 100);
+       XENO_BUGON(COBALT, ++sched->pss.drop_retries > 100);
 }
 
 static inline void sporadic_note_valid_drop(struct xnsched *sched)
@@ -41,7 +41,7 @@ static inline void sporadic_note_valid_drop(struct xnsched 
*sched)
        sched->pss.drop_retries = 0;
 }
 
-#else /* !XENO_BUGON(NUCLEUS) */
+#else /* !XENO_BUGON(COBALT) */
 
 static inline void sporadic_note_late_drop(struct xnsched *sched)
 {
@@ -51,7 +51,7 @@ static inline void sporadic_note_valid_drop(struct xnsched 
*sched)
 {
 }
 
-#endif /* !XENO_BUGON(NUCLEUS) */
+#endif /* !XENO_BUGON(COBALT) */
 
 static inline xnticks_t sporadic_diff_time(xnticks_t start, xnticks_t end)
 {
@@ -124,7 +124,7 @@ static void sporadic_replenish_handler(struct xntimer 
*timer)
 
        pss = container_of(timer, struct xnsched_sporadic_data, repl_timer);
        thread = pss->thread;
-       XENO_BUGON(NUCLEUS, pss->repl_pending <= 0);
+       XENO_BUGON(COBALT, pss->repl_pending <= 0);
 
 retry:
        now = xnclock_read_monotonic(&nkclock);
@@ -233,7 +233,7 @@ static void xnsched_sporadic_init(struct xnsched *sched)
         * share the same priority scale, with the addition of budget
         * management for the sporadic ones.
         */
-#if XENO_DEBUG(NUCLEUS)
+#if XENO_DEBUG(COBALT)
        sched->pss.drop_retries = 0;
 #endif
 }
diff --git a/kernel/cobalt/sched-tp.c b/kernel/cobalt/sched-tp.c
index 4efed95..484e339 100644
--- a/kernel/cobalt/sched-tp.c
+++ b/kernel/cobalt/sched-tp.c
@@ -146,7 +146,7 @@ static void xnsched_tp_trackprio(struct xnthread *thread,
         */
        if (p) {
                /* We should never cross partition boundaries. */
-               XENO_WARNON(NUCLEUS,
+               XENO_WARNON(COBALT,
                           thread->base_class == &xnsched_class_tp &&
                           thread->tps - thread->sched->tp.partitions != 
p->tp.ptid);
                thread->cprio = p->tp.prio;
@@ -240,8 +240,8 @@ xnsched_tp_set_schedule(struct xnsched *sched,
        union xnsched_policy_param param;
        struct xnthread *thread, *tmp;
 
-       XENO_BUGON(NUCLEUS, gps != NULL &&
-                   (gps->pwin_nr <= 0 || gps->pwins[0].w_offset != 0));
+       XENO_BUGON(COBALT, gps != NULL &&
+                  (gps->pwin_nr <= 0 || gps->pwins[0].w_offset != 0));
 
        xnsched_tp_stop_schedule(sched);
 
diff --git a/kernel/cobalt/sched.c b/kernel/cobalt/sched.c
index 203a66d..73e8f12 100644
--- a/kernel/cobalt/sched.c
+++ b/kernel/cobalt/sched.c
@@ -62,7 +62,7 @@ static void xnsched_register_class(struct xnsched_class 
*sched_class)
         * Classes shall be registered by increasing priority order,
         * idle first and up.
         */
-       XENO_BUGON(NUCLEUS, sched_class->next &&
+       XENO_BUGON(COBALT, sched_class->next &&
                   sched_class->next->weight > sched_class->weight);
 
        printk(XENO_INFO "scheduling class %s registered.\n", 
sched_class->name);
@@ -335,7 +335,7 @@ void ___xnsched_unlock(struct xnsched *sched)
 {
        struct xnthread *curr = sched->curr;
 
-       if (!XENO_ASSERT(NUCLEUS, xnthread_lock_count(curr) > 0))
+       if (!XENO_ASSERT(COBALT, xnthread_lock_count(curr) > 0))
                return;
 
        if (--xnthread_lock_count(curr) == 0) {
@@ -514,7 +514,7 @@ void xnsched_initq(struct xnsched_mlq *q)
 
 static inline int get_qindex(struct xnsched_mlq *q, int prio)
 {
-       XENO_BUGON(NUCLEUS, prio < 0 || prio >= XNSCHED_MLQ_LEVELS);
+       XENO_BUGON(COBALT, prio < 0 || prio >= XNSCHED_MLQ_LEVELS);
        /*
         * BIG FAT WARNING: We need to rescale the priority level to a
         * 0-based range. We use find_first_bit() to scan the bitmap
@@ -582,7 +582,7 @@ struct xnthread *xnsched_getq(struct xnsched_mlq *q)
 
        idx = xnsched_weightq(q);
        head = q->heads + idx;
-       XENO_BUGON(NUCLEUS, list_empty(head));
+       XENO_BUGON(COBALT, list_empty(head));
        thread = list_first_entry(head, struct xnthread, rlink);
        del_q(q, &thread->rlink, idx);
 
@@ -623,7 +623,7 @@ struct xnthread *xnsched_rt_pick(struct xnsched *sched)
         */
        idx = xnsched_weightq(q);
        head = q->heads + idx;
-       XENO_BUGON(NUCLEUS, list_empty(head));
+       XENO_BUGON(COBALT, list_empty(head));
 
        /*
         * The active class (i.e. ->sched_class) is the one currently
@@ -909,7 +909,7 @@ shadow_epilogue:
         * handler that hit before we call xnsched_run in
         * xnthread_suspend() when relaxing a thread.
         */
-       XENO_BUGON(NUCLEUS, !hard_irqs_disabled());
+       XENO_BUGON(COBALT, !hard_irqs_disabled());
 
        return 1;
 }
diff --git a/kernel/cobalt/synch.c b/kernel/cobalt/synch.c
index 712e986..7d4130f 100644
--- a/kernel/cobalt/synch.c
+++ b/kernel/cobalt/synch.c
@@ -140,7 +140,7 @@ int xnsynch_sleep_on(struct xnsynch *synch, xnticks_t 
timeout,
 
        primary_mode_only();
 
-       XENO_BUGON(NUCLEUS, synch->status & XNSYNCH_OWNER);
+       XENO_BUGON(COBALT, synch->status & XNSYNCH_OWNER);
 
        thread = xnthread_current();
 
@@ -186,7 +186,7 @@ struct xnthread *xnsynch_wakeup_one_sleeper(struct xnsynch 
*synch)
        struct xnthread *thread;
        spl_t s;
 
-       XENO_BUGON(NUCLEUS, synch->status & XNSYNCH_OWNER);
+       XENO_BUGON(COBALT, synch->status & XNSYNCH_OWNER);
 
        xnlock_get_irqsave(&nklock, s);
 
@@ -213,7 +213,7 @@ int xnsynch_wakeup_many_sleepers(struct xnsynch *synch, int 
nr)
        int nwakeups = 0;
        spl_t s;
 
-       XENO_BUGON(NUCLEUS, synch->status & XNSYNCH_OWNER);
+       XENO_BUGON(COBALT, synch->status & XNSYNCH_OWNER);
 
        xnlock_get_irqsave(&nklock, s);
 
@@ -261,7 +261,7 @@ void xnsynch_wakeup_this_sleeper(struct xnsynch *synch, 
struct xnthread *sleeper
 {
        spl_t s;
 
-       XENO_BUGON(NUCLEUS, synch->status & XNSYNCH_OWNER);
+       XENO_BUGON(COBALT, synch->status & XNSYNCH_OWNER);
 
        xnlock_get_irqsave(&nklock, s);
 
@@ -343,7 +343,7 @@ int xnsynch_acquire(struct xnsynch *synch, xnticks_t 
timeout,
 
        primary_mode_only();
 
-       XENO_BUGON(NUCLEUS, (synch->status & XNSYNCH_OWNER) == 0);
+       XENO_BUGON(COBALT, (synch->status & XNSYNCH_OWNER) == 0);
 
        thread = xnthread_current();
        threadh = xnthread_handle(thread);
@@ -491,7 +491,7 @@ static void clear_boost(struct xnsynch *synch, struct 
xnthread *owner)
        } else {
                /* Find the highest priority needed to enforce the PIP. */
                hsynch = list_first_entry(&owner->claimq, struct xnsynch, link);
-               XENO_BUGON(NUCLEUS, list_empty(&hsynch->pendq));
+               XENO_BUGON(COBALT, list_empty(&hsynch->pendq));
                target = list_first_entry(&hsynch->pendq, struct xnthread, 
plink);
                if (target->wprio > wprio)
                        wprio = target->wprio;
@@ -579,7 +579,7 @@ struct xnthread *xnsynch_release(struct xnsynch *synch,
        atomic_long_t *lockp;
        xnhandle_t threadh;
 
-       XENO_BUGON(NUCLEUS, (synch->status & XNSYNCH_OWNER) == 0);
+       XENO_BUGON(COBALT, (synch->status & XNSYNCH_OWNER) == 0);
 
        trace_cobalt_synch_release(synch);
 
@@ -735,7 +735,7 @@ int xnsynch_flush(struct xnsynch *synch, int reason)
        trace_cobalt_synch_flush(synch);
 
        if (list_empty(&synch->pendq)) {
-               XENO_BUGON(NUCLEUS, synch->status & XNSYNCH_CLAIMED);
+               XENO_BUGON(COBALT, synch->status & XNSYNCH_CLAIMED);
                ret = XNSYNCH_DONE;
        } else {
                ret = XNSYNCH_RESCHED;
diff --git a/kernel/cobalt/thread.c b/kernel/cobalt/thread.c
index 5de967f..91baafc 100644
--- a/kernel/cobalt/thread.c
+++ b/kernel/cobalt/thread.c
@@ -435,7 +435,7 @@ static inline void cleanup_tcb(struct xnthread *thread) /* 
nklock held, irqs off
        xnvfile_touch_tag(&nkthreadlist_tag);
 
        if (xnthread_test_state(thread, XNREADY)) {
-               XENO_BUGON(NUCLEUS, xnthread_test_state(thread, 
XNTHREAD_BLOCK_BITS));
+               XENO_BUGON(COBALT, xnthread_test_state(thread, 
XNTHREAD_BLOCK_BITS));
                xnsched_dequeue(thread);
                xnthread_clear_state(thread, XNREADY);
        }
@@ -814,9 +814,9 @@ void xnthread_suspend(struct xnthread *thread, int mask,
        spl_t s;
 
        /* No, you certainly do not want to suspend the root thread. */
-       XENO_BUGON(NUCLEUS, xnthread_test_state(thread, XNROOT));
+       XENO_BUGON(COBALT, xnthread_test_state(thread, XNROOT));
        /* No built-in support for conjunctive wait. */
-       XENO_BUGON(NUCLEUS, wchan && thread->wchan);
+       XENO_BUGON(COBALT, wchan && thread->wchan);
 
        xnlock_get_irqsave(&nklock, s);
 
@@ -1438,7 +1438,7 @@ void xnthread_cancel(struct xnthread *thread)
        spl_t s;
 
        /* Right, so you want to kill the kernel?! */
-       XENO_BUGON(NUCLEUS, xnthread_test_state(thread, XNROOT));
+       XENO_BUGON(COBALT, xnthread_test_state(thread, XNROOT));
 
        xnlock_get_irqsave(&nklock, s);
 
@@ -1517,7 +1517,7 @@ int xnthread_join(struct xnthread *thread, bool 
uninterruptible)
        spl_t s;
        int ret;
 
-       XENO_BUGON(NUCLEUS, xnthread_test_state(thread, XNROOT));
+       XENO_BUGON(COBALT, xnthread_test_state(thread, XNROOT));
 
        xnlock_get_irqsave(&nklock, s);
 
@@ -1807,7 +1807,7 @@ void __xnthread_test_cancel(struct xnthread *curr)
 
        do_exit(0);
        /* ... won't return ... */
-       XENO_BUGON(NUCLEUS, 1);
+       XENO_BUG(COBALT);
 }
 EXPORT_SYMBOL_GPL(__xnthread_test_cancel);
 
@@ -1970,7 +1970,7 @@ void xnthread_relax(int notify, int reason)
        xnthread_suspend(thread, XNRELAX, XN_INFINITE, XN_RELATIVE, NULL);
        splnone();
 
-       if (XENO_DEBUG(NUCLEUS) && !ipipe_root_p)
+       if (XENO_DEBUG(COBALT) && !ipipe_root_p)
                xnsys_fatal("xnthread_relax() failed for thread %s[%d]",
                            thread->name, xnthread_host_pid(thread));
 
@@ -2410,7 +2410,7 @@ void xnthread_call_mayday(struct xnthread *thread, int 
reason)
        struct task_struct *p = xnthread_host_task(thread);
 
        /* Mayday traps are available to userland threads only. */
-       XENO_BUGON(NUCLEUS, !xnthread_test_state(thread, XNUSER));
+       XENO_BUGON(COBALT, !xnthread_test_state(thread, XNUSER));
        xnthread_set_info(thread, XNKICKED);
        xnthread_signal(thread, SIGDEBUG, reason);
        ipipe_raise_mayday(p);
diff --git a/kernel/cobalt/timer.c b/kernel/cobalt/timer.c
index 360ce86..9e6f8e5 100644
--- a/kernel/cobalt/timer.c
+++ b/kernel/cobalt/timer.c
@@ -643,7 +643,7 @@ static void switch_htick_mode(enum clock_event_mode mode,
                xntimer_stop(&sched->htimer);
                break;
        default:
-               XENO_BUGON(NUCLEUS, 1);
+               XENO_BUG(COBALT);
        }
 
        xnlock_put_irqrestore(&nklock, s);
diff --git a/kernel/cobalt/vfile.c b/kernel/cobalt/vfile.c
index 7816e75..925f2f6 100644
--- a/kernel/cobalt/vfile.c
+++ b/kernel/cobalt/vfile.c
@@ -223,7 +223,7 @@ redo:
         * errors in all other cases.
         */
        if (ops->begin) {
-               XENO_BUGON(NUCLEUS, ops->end == NULL);
+               XENO_BUGON(COBALT, ops->end == NULL);
                data = ops->begin(it);
                if (data == NULL) {
                        kfree(it);
@@ -300,7 +300,7 @@ static int vfile_snapshot_release(struct inode *inode, 
struct file *file)
                it = seq->private;
                if (it) {
                        --xnvfile_nref(it->vfile);
-                       XENO_BUGON(NUCLEUS, it->vfile->entry.refcnt < 0);
+                       XENO_BUGON(COBALT, it->vfile->entry.refcnt < 0);
                        if (it->databuf)
                                it->endfn(it, it->databuf);
                        kfree(it);
@@ -401,7 +401,7 @@ int xnvfile_init_snapshot(const char *name,
        struct proc_dir_entry *ppde, *pde;
        int mode;
 
-       XENO_BUGON(NUCLEUS, vfile->tag == NULL);
+       XENO_BUGON(COBALT, vfile->tag == NULL);
 
        if (vfile->entry.lockops == NULL)
                /* Defaults to nucleus lock */
@@ -555,7 +555,7 @@ static int vfile_regular_release(struct inode *inode, 
struct file *file)
                it = seq->private;
                if (it) {
                        --xnvfile_nref(it->vfile);
-                       XENO_BUGON(NUCLEUS, xnvfile_nref(it->vfile) < 0);
+                       XENO_BUGON(COBALT, xnvfile_nref(it->vfile) < 0);
                        kfree(it);
                }
 
diff --git a/kernel/drivers/ipc/bufp.c b/kernel/drivers/ipc/bufp.c
index bc3a407..1e5ecf3 100644
--- a/kernel/drivers/ipc/bufp.c
+++ b/kernel/drivers/ipc/bufp.c
@@ -243,7 +243,7 @@ redo:
                        goto out;
 
                wc = rtipc_get_wait_context(waiter);
-               XENO_BUGON(NUCLEUS, wc == NULL);
+               XENO_BUGON(COBALT, wc == NULL);
                bufwc = container_of(wc, struct bufp_wait_context, wc);
                if (bufwc->len + sk->fillsz <= sk->bufsz)
                        /* This call rescheds internally. */
@@ -494,7 +494,7 @@ redo:
                        goto out;
 
                wc = rtipc_get_wait_context(waiter);
-               XENO_BUGON(NUCLEUS, wc == NULL);
+               XENO_BUGON(COBALT, wc == NULL);
                bufwc = container_of(wc, struct bufp_wait_context, wc);
                if (bufwc->len <= rsk->fillsz)
                        rtdm_event_pulse(&rsk->i_event);


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to