summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2008-12-15 22:33:07 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2008-12-15 22:33:07 +0000
commit4147e68756ffa79f657d530a43c5d206cd38e80f (patch)
tree35afe2282e14e36f581bd203f585c06c03d56bac /sys
parent72525cc252e39e0a580d412ff35c0f1d81ba9d81 (diff)
Make the "machine xir" ddb command work on machines with uperf(4) on ebus(4).
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sparc64/dev/uperf_ebus.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/sys/arch/sparc64/dev/uperf_ebus.c b/sys/arch/sparc64/dev/uperf_ebus.c
index 08b1bd73130..9a3349a46b1 100644
--- a/sys/arch/sparc64/dev/uperf_ebus.c
+++ b/sys/arch/sparc64/dev/uperf_ebus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uperf_ebus.c,v 1.4 2003/06/02 20:02:49 jason Exp $ */
+/* $OpenBSD: uperf_ebus.c,v 1.5 2008/12/15 22:33:06 kettenis Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -43,6 +43,10 @@
#include <machine/autoconf.h>
#include <machine/openfirm.h>
+#ifdef DDB
+#include <machine/db_machdep.h>
+#endif
+
#include <sparc64/dev/ebusreg.h>
#include <sparc64/dev/ebusvar.h>
#include <dev/sun/uperfio.h>
@@ -73,6 +77,10 @@ int uperf_ebus_clrcnt(void *, int);
int uperf_ebus_getcntsrc(void *, int, u_int *, u_int *);
int uperf_ebus_setcntsrc(void *, int, u_int, u_int);
+#ifdef DDB
+void uperf_ebus_xir(void *, int);
+#endif
+
struct uperf_src uperf_ebus_srcs[] = {
{ UPERFSRC_SDVRA, UPERF_CNT0|UPERF_CNT1, PSY_PMCRSEL_SDVRA },
{ UPERFSRC_SDVWA, UPERF_CNT0|UPERF_CNT1, PSY_PMCRSEL_SDVWA },
@@ -153,6 +161,10 @@ uperf_ebus_attach(parent, self, aux)
(id & USC_ID_IMPL_M) >> USC_ID_IMPL_S,
(id & USC_ID_VERS_M) >> USC_ID_VERS_S,
(id & USC_ID_UPANUM_M) >> USC_ID_UPANUM_S);
+
+#ifdef DDB
+ db_register_xir(uperf_ebus_xir, sc);
+#endif
}
/*
@@ -311,3 +323,13 @@ uperf_ebus_getcnt(vsc, flags, cntp0, cntp1)
*cntp1 = c1;
return (0);
}
+
+#ifdef DDB
+void
+uperf_ebus_xir(void *arg, int cpu)
+{
+ struct uperf_ebus_softc *sc = arg;
+
+ uperf_ebus_write_reg(sc, USC_CTRL, USC_CTRL_XIR);
+}
+#endif