Module: xenomai-forge
Branch: master
Commit: 3831102200d1444b64f53d6cadec01ac265c4c31
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=3831102200d1444b64f53d6cadec01ac265c4c31

Author: Jan Kiszka <jan.kis...@siemens.com>
Date:   Wed Jan  9 14:07:52 2013 +0100

nucleus: use separate SIGDEBUG reason code for rescnt imbalance

If user space caused an imbalance of the resource counter that the
kernel tracks for XNOTHER threads, report this error via a separate
SIGDEBUG reason code to avoid confusions.

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>

---

 include/asm-generic/syscall.h |    1 +
 kernel/cobalt/nucleus/debug.c |    1 +
 kernel/cobalt/nucleus/synch.c |    2 +-
 3 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/include/asm-generic/syscall.h b/include/asm-generic/syscall.h
index 17002c1..1fc5dcc 100644
--- a/include/asm-generic/syscall.h
+++ b/include/asm-generic/syscall.h
@@ -68,6 +68,7 @@ struct xnsysinfo {
 #define SIGDEBUG_MIGRATE_PRIOINV       4
 #define SIGDEBUG_NOMLOCK               5
 #define SIGDEBUG_WATCHDOG              6
+#define SIGDEBUG_RESCNT_IMBALANCE      7
 
 #define sigdebug_code(si)      ((si)->si_value.sival_int)
 #define sigdebug_reason(si)    (sigdebug_code(si) & 0xff)
diff --git a/kernel/cobalt/nucleus/debug.c b/kernel/cobalt/nucleus/debug.c
index 5ab381a..b7c3c3c 100644
--- a/kernel/cobalt/nucleus/debug.c
+++ b/kernel/cobalt/nucleus/debug.c
@@ -429,6 +429,7 @@ static const char *reason_str[] = {
     [SIGDEBUG_MIGRATE_PRIOINV] = "pi-error",
     [SIGDEBUG_NOMLOCK] = "mlock-check",
     [SIGDEBUG_WATCHDOG] = "runaway-break",
+    [SIGDEBUG_RESCNT_IMBALANCE] = "resource-count-imbalance",
 };
 
 static int relax_vfile_show(struct xnvfile_regular_iterator *it, void *data)
diff --git a/kernel/cobalt/nucleus/synch.c b/kernel/cobalt/nucleus/synch.c
index 6e611c8..21ca9aa 100644
--- a/kernel/cobalt/nucleus/synch.c
+++ b/kernel/cobalt/nucleus/synch.c
@@ -714,7 +714,7 @@ void __xnsynch_fixup_rescnt(struct xnthread *thread)
 {
        if (xnthread_get_rescnt(thread) == 0)
                xnshadow_send_sig(thread, SIGDEBUG,
-                                 SIGDEBUG_MIGRATE_PRIOINV);
+                                 SIGDEBUG_RESCNT_IMBALANCE);
        else
                xnthread_dec_rescnt(thread);
 }


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

Reply via email to