All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: xenomai-core <xenomai@xenomai.org>
Cc: adeos-main@gna.org
Subject: [Xenomai-core] Re: [patch] kgdb for ipipe - updated version
Date: Sun, 14 May 2006 21:41:57 +0200	[thread overview]
Message-ID: <44678805.2000904@domain.hid> (raw)
In-Reply-To: <4467860A.9020103@domain.hid>


[-- Attachment #1.1: Type: text/plain, Size: 1024 bytes --]

Jan Kiszka wrote:
> Hi all,
> 
> here is an improved version of the kgdb-over-ipipe patch. This version
> specifically addresses the concerns Gilles brought up recently:
> 
> o No more dependencies on Xenomai, thus also no need to have the nucleus
>   compiled into the kernel. There is now a registrable handler,
>   ipipe_safe_current, which is invoked by the kgdb code to obtain
>   "current". When the xeno nucleus arms its services, it overloads this
>   handler to always provide a valid current (either the real one or
>   init_task for kernel-only threads).
> 
> o Replaced smp_processor_id with ipipe_processor_id in critical kgdb
>   code. I haven't tested this replacement, so no guarantees here. But so
>   far it looks consistent - at least for me.
> 
> To use the kernel debugger with Xenomai, you need the latest kgdb
> patches [1] and have to follow the attached patch series.
> 

Oops, one patch was missing: the one to add the handler registration to
Xenomai. See attachment.

Jan

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: xeno-kgdb.patch --]
[-- Type: text/x-patch; name="xeno-kgdb.patch", Size: 1755 bytes --]

Index: ksrc/nucleus/pod.c
===================================================================
--- ksrc/nucleus/pod.c	(Revision 1095)
+++ ksrc/nucleus/pod.c	(Arbeitskopie)
@@ -43,6 +43,9 @@
 #include <nucleus/registry.h>
 #include <nucleus/module.h>
 #include <nucleus/ltt.h>
+#ifdef CONFIG_KGDB
+#include <linux/kgdb.h>
+#endif /* CONFIG_KGDB */
 
 /* NOTE: We need to initialize the globals: remember that this code
    also runs over user-space VMs... */
@@ -234,6 +237,13 @@ static void xnpod_flush_heap(xnheap_t * 
     xnarch_sysfree(extaddr, extsize);
 }
 
+#ifdef CONFIG_KGDB
+static struct task_struct *xnpod_safe_current(void)
+{
+    return xnpod_userspace_p() ? current : &init_task;
+}
+#endif /* CONFIG_KGDB */
+
 /*! 
  * \fn int xnpod_init(xnpod_t *pod,int minpri,int maxpri,xnflags_t flags)
  * \brief Initialize a new pod.
@@ -373,6 +383,9 @@ int xnpod_init(xnpod_t *pod, int minpri,
        the remaining operations. */
 
     nkpod = pod;
+#ifdef CONFIG_KGDB
+    ipipe_safe_current = xnpod_safe_current;
+#endif /* CONFIG_KGDB */
 
     /* No direct handler here since the host timer processing is
        postponed to xnintr_irq_handler(), as part of the interrupt
@@ -477,6 +490,9 @@ int xnpod_init(xnpod_t *pod, int minpri,
 
         if (err) {
           fail:
+#ifdef CONFIG_KGDB
+            ipipe_safe_current = ipipe_default_current;
+#endif /* CONFIG_KGDB */
             nkpod = NULL;
             return err;
         }
@@ -607,6 +623,9 @@ void xnpod_shutdown(int xtype)
 
     xnheap_destroy(&kheap, &xnpod_flush_heap, NULL);
 
+#ifdef CONFIG_KGDB
+    ipipe_safe_current = ipipe_default_current;
+#endif /* CONFIG_KGDB */
     nkpod = NULL;
 
   unlock_and_exit:

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

  reply	other threads:[~2006-05-14 19:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-14 19:33 [Xenomai-core] [patch] kgdb for ipipe - updated version Jan Kiszka
2006-05-14 19:41 ` Jan Kiszka [this message]
2006-05-14 20:20   ` [Xenomai-core] Re: [Adeos-main] " Philippe Gerum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44678805.2000904@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=adeos-main@gna.org \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.