Module Name: src Committed By: cherry Date: Thu Aug 11 19:52:53 UTC 2011
Modified Files: src/sys/arch/amd64/amd64: db_interface.c src/sys/arch/i386/i386: db_interface.c Log Message: make ddb minimally MP aware To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sys/arch/amd64/amd64/db_interface.c cvs rdiff -u -r1.66 -r1.67 src/sys/arch/i386/i386/db_interface.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/amd64/amd64/db_interface.c diff -u src/sys/arch/amd64/amd64/db_interface.c:1.23 src/sys/arch/amd64/amd64/db_interface.c:1.24 --- src/sys/arch/amd64/amd64/db_interface.c:1.23 Sun Apr 3 22:29:25 2011 +++ src/sys/arch/amd64/amd64/db_interface.c Thu Aug 11 19:52:52 2011 @@ -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; Index: src/sys/arch/i386/i386/db_interface.c diff -u src/sys/arch/i386/i386/db_interface.c:1.66 src/sys/arch/i386/i386/db_interface.c:1.67 --- src/sys/arch/i386/i386/db_interface.c:1.66 Sun Apr 3 22:29:26 2011 +++ src/sys/arch/i386/i386/db_interface.c Thu Aug 11 19:52:52 2011 @@ -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;