Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch make ddb minimally MP aware



details:   https://anonhg.NetBSD.org/src/rev/7c7b47e4eb34
branches:  trunk
changeset: 768203:7c7b47e4eb34
user:      cherry <cherry%NetBSD.org@localhost>
date:      Thu Aug 11 19:52:52 2011 +0000

description:
make ddb minimally MP aware

diffstat:

 sys/arch/amd64/amd64/db_interface.c |  17 +++++++++++++++--
 sys/arch/i386/i386/db_interface.c   |  16 ++++++++++++++--
 2 files changed, 29 insertions(+), 4 deletions(-)

diffs (130 lines):

diff -r 6d5a60f84bff -r 7c7b47e4eb34 sys/arch/amd64/amd64/db_interface.c
--- a/sys/arch/amd64/amd64/db_interface.c       Thu Aug 11 18:36:13 2011 +0000
+++ b/sys/arch/amd64/amd64/db_interface.c       Thu Aug 11 19:52:52 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_interface.c,v 1.23 2011/04/03 22:29:25 dyoung Exp $ */
+/*     $NetBSD: db_interface.c,v 1.24 2011/08/11 19:52:52 cherry Exp $ */
 
 /*
  * Mach Operating System
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.23 2011/04/03 22:29:25 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.24 2011/08/11 19:52:52 cherry Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -82,7 +82,9 @@
 #ifdef MULTIPROCESSOR
 extern void ddb_ipi(struct trapframe);
 static void ddb_suspend(struct trapframe *);
+#ifndef XEN
 int ddb_vec;
+#endif /* XEN */
 static bool ddb_mp_online;
 #endif
 
@@ -98,9 +100,13 @@
 {
 
 #ifdef MULTIPROCESSOR
+#ifndef XEN
        ddb_vec = idt_vec_alloc(0xf0, 0xff);
        setgate((struct gate_descriptor *)&idt[ddb_vec], &Xintrddb, 1,
            SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
+#else
+       /* Initialised as part of xen_ipi_init() */
+#endif /* XEN */
 #endif
 }
 
@@ -114,8 +120,10 @@
        int cpu_me = cpu_number();
        int win;
 
+#ifndef XEN
        if (ddb_vec == 0)
                return 1;
+#endif /* XEN */
 
        __cpu_simple_lock(&db_lock);
        if (ddb_cpu == NOCPU)
@@ -123,7 +131,12 @@
        win = (ddb_cpu == cpu_me);
        __cpu_simple_unlock(&db_lock);
        if (win) {
+#ifdef XEN
+               xen_broadcast_ipi(XEN_IPI_DDB);
+#else
                x86_ipi(ddb_vec, LAPIC_DEST_ALLEXCL, LAPIC_DLMODE_FIXED);
+#endif /* XEN */
+
        }
        ddb_mp_online = x86_mp_online;
        x86_mp_online = false;
diff -r 6d5a60f84bff -r 7c7b47e4eb34 sys/arch/i386/i386/db_interface.c
--- a/sys/arch/i386/i386/db_interface.c Thu Aug 11 18:36:13 2011 +0000
+++ b/sys/arch/i386/i386/db_interface.c Thu Aug 11 19:52:52 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_interface.c,v 1.66 2011/04/03 22:29:26 dyoung Exp $ */
+/*     $NetBSD: db_interface.c,v 1.67 2011/08/11 19:52:52 cherry Exp $ */
 
 /*
  * Mach Operating System
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.66 2011/04/03 22:29:26 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.67 2011/08/11 19:52:52 cherry Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -86,7 +86,9 @@
 extern void ddb_ipi(int, struct trapframe);
 extern void ddb_ipi_tss(struct i386tss *);
 static void ddb_suspend(struct trapframe *);
+#ifndef XEN
 int ddb_vec;
+#endif /* XEN */
 static bool ddb_mp_online;
 #endif
 
@@ -104,8 +106,12 @@
 {
 
 #ifdef MULTIPROCESSOR
+#ifndef XEN
        ddb_vec = idt_vec_alloc(0xf0, 0xff);
        idt_vec_set(ddb_vec, &Xintrddbipi);
+#else
+       /* Initialised as part of xen_ipi_init() */
+#endif /* XEN */
 #endif
 }
 
@@ -119,8 +125,10 @@
        int cpu_me = cpu_number();
        int win;
 
+#ifndef XEN
        if (ddb_vec == 0)
                return 1;
+#endif /* XEN */
 
        __cpu_simple_lock(&db_lock);
        if (ddb_cpu == NOCPU)
@@ -128,7 +136,11 @@
        win = (ddb_cpu == cpu_me);
        __cpu_simple_unlock(&db_lock);
        if (win) {
+#ifdef XEN
+               xen_broadcast_ipi(XEN_IPI_DDB);
+#else
                x86_ipi(ddb_vec, LAPIC_DEST_ALLEXCL, LAPIC_DLMODE_FIXED);
+#endif /* XEN */
        }
        ddb_mp_online = x86_mp_online;
        x86_mp_online = false;



Home | Main Index | Thread Index | Old Index