Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/x86/x86 - Add lapic_dump() to print lapic's setting.
details: https://anonhg.NetBSD.org/src/rev/55f0ef7c09d4
branches: trunk
changeset: 339338:55f0ef7c09d4
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Wed Jul 15 04:49:02 2015 +0000
description:
- Add lapic_dump() to print lapic's setting.
- Add mpacpi_dump() to dump mp_intrs[].
diffstat:
sys/arch/x86/x86/lapic.c | 37 +++++++++++++++++++++++--------------
sys/arch/x86/x86/mpacpi.c | 19 +++++++++++++++++--
2 files changed, 40 insertions(+), 16 deletions(-)
diffs (116 lines):
diff -r 2b8969b83416 -r 55f0ef7c09d4 sys/arch/x86/x86/lapic.c
--- a/sys/arch/x86/x86/lapic.c Wed Jul 15 04:10:02 2015 +0000
+++ b/sys/arch/x86/x86/lapic.c Wed Jul 15 04:49:02 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lapic.c,v 1.48 2015/05/18 13:04:21 msaitoh Exp $ */
+/* $NetBSD: lapic.c,v 1.49 2015/07/15 04:49:02 msaitoh Exp $ */
/*-
* Copyright (c) 2000, 2008 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lapic.c,v 1.48 2015/05/18 13:04:21 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lapic.c,v 1.49 2015/07/15 04:49:02 msaitoh Exp $");
#include "opt_ddb.h"
#include "opt_mpbios.h" /* for MPDEBUG */
@@ -76,6 +76,8 @@
static void lapic_hwmask(struct pic *, int);
static void lapic_hwunmask(struct pic *, int);
static void lapic_setup(struct pic *, struct cpu_info *, int, int, int);
+/* Make it public to call via ddb */
+void lapic_dump(void);
struct pic local_pic = {
.pic_name = "lapic",
@@ -194,18 +196,8 @@
}
#ifdef MULTIPROCESSOR
- if (mp_verbose) {
- apic_format_redir (device_xname(ci->ci_dev), "timer", 0, 0,
- i82489_readreg(LAPIC_LVTT));
- apic_format_redir (device_xname(ci->ci_dev), "pcint", 0, 0,
- i82489_readreg(LAPIC_PCINT));
- apic_format_redir (device_xname(ci->ci_dev), "lint", 0, 0,
- i82489_readreg(LAPIC_LVINT0));
- apic_format_redir (device_xname(ci->ci_dev), "lint", 1, 0,
- i82489_readreg(LAPIC_LVINT1));
- apic_format_redir (device_xname(ci->ci_dev), "err", 0, 0,
- i82489_readreg(LAPIC_LVERR));
- }
+ if (mp_verbose)
+ lapic_dump();
#endif
}
@@ -616,3 +608,20 @@
int pin, int idtvec, int type)
{
}
+
+void
+lapic_dump(void)
+{
+ struct cpu_info *ci = curcpu();
+
+ apic_format_redir (device_xname(ci->ci_dev), "timer", 0, 0,
+ i82489_readreg(LAPIC_LVTT));
+ apic_format_redir (device_xname(ci->ci_dev), "pcint", 0, 0,
+ i82489_readreg(LAPIC_PCINT));
+ apic_format_redir (device_xname(ci->ci_dev), "lint", 0, 0,
+ i82489_readreg(LAPIC_LVINT0));
+ apic_format_redir (device_xname(ci->ci_dev), "lint", 1, 0,
+ i82489_readreg(LAPIC_LVINT1));
+ apic_format_redir (device_xname(ci->ci_dev), "err", 0, 0,
+ i82489_readreg(LAPIC_LVERR));
+}
diff -r 2b8969b83416 -r 55f0ef7c09d4 sys/arch/x86/x86/mpacpi.c
--- a/sys/arch/x86/x86/mpacpi.c Wed Jul 15 04:10:02 2015 +0000
+++ b/sys/arch/x86/x86/mpacpi.c Wed Jul 15 04:49:02 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mpacpi.c,v 1.98 2015/06/22 07:26:52 msaitoh Exp $ */
+/* $NetBSD: mpacpi.c,v 1.99 2015/07/15 04:49:02 msaitoh Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,10 +36,11 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mpacpi.c,v 1.98 2015/06/22 07:26:52 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mpacpi.c,v 1.99 2015/07/15 04:49:02 msaitoh Exp $");
#include "acpica.h"
#include "opt_acpi.h"
+#include "opt_ddb.h"
#include "opt_mpbios.h"
#include "opt_multiprocessor.h"
#include "pchb.h"
@@ -123,6 +124,10 @@
static void mpacpi_user_continue(const char *fmt, ...);
+#ifdef DDB
+void mpacpi_dump(void);
+#endif
+
int mpacpi_nioapic; /* number of ioapics */
int mpacpi_ncpu; /* number of cpus */
int mpacpi_nintsrc; /* number of non-device interrupts */
@@ -1080,3 +1085,13 @@
printf("<press any key to continue>\n>");
cngetc();
}
+
+#ifdef DDB
+void
+mpacpi_dump(void)
+{
+ int i;
+ for (i = 0; i < mp_nintr; i++)
+ mpacpi_print_intr(&mp_intrs[i]);
+}
+#endif
Home |
Main Index |
Thread Index |
Old Index