summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/dcons/dcons.h3
-rw-r--r--sys/dev/dcons/dcons_crom.c24
2 files changed, 27 insertions, 0 deletions
diff --git a/sys/dev/dcons/dcons.h b/sys/dev/dcons/dcons.h
index daf9cb4..49ef869 100644
--- a/sys/dev/dcons/dcons.h
+++ b/sys/dev/dcons/dcons.h
@@ -65,6 +65,8 @@ struct dcons_buf {
#define DCONS_CSR_VAL_VER 0x64636f /* "dco" */
#define DCONS_CSR_KEY_HI 0x3a
#define DCONS_CSR_KEY_LO 0x3b
+#define DCONS_CSR_KEY_RESET_HI 0x3c
+#define DCONS_CSR_KEY_RESET_LO 0x3d
#define DCONS_HEADER_SIZE sizeof(struct dcons_buf)
#define DCONS_MAKE_PTR(x) htonl(((x)->gen << DCONS_GEN_SHIFT) | (x)->pos)
@@ -88,6 +90,7 @@ struct dcons_ch {
#define STATE0 0
#define STATE1 1
#define STATE2 2
+#define STATE3 3
#if defined(_KERNEL) || defined(_BOOT)
struct dcons_softc {
diff --git a/sys/dev/dcons/dcons_crom.c b/sys/dev/dcons/dcons_crom.c
index 290c80a..290bb1e 100644
--- a/sys/dev/dcons/dcons_crom.c
+++ b/sys/dev/dcons/dcons_crom.c
@@ -62,6 +62,14 @@
#include <sys/cons.h>
+#define EXPOSE_IDT_ADDR 1
+
+#if (defined(__i386__) || defined(__amd64__)) && defined(EXPOSE_IDT_ADDR)
+#include <vm/vm.h>
+#include <vm/vm_param.h>
+#include <vm/pmap.h>
+#include <machine/segments.h> /* for idt */
+#endif
static bus_addr_t dcons_paddr;
#if __FreeBSD_version >= 500000
@@ -108,6 +116,19 @@ dcons_crom_probe(device_t dev)
}
#ifndef NEED_NEW_DRIVER
+#if (defined(__i386__) || defined(__amd64__)) && defined(EXPOSE_IDT_ADDR)
+static void
+dcons_crom_expose_idt(struct dcons_crom_softc *sc)
+{
+ static off_t idt_paddr;
+
+ /* XXX */
+ idt_paddr = (char *)idt - (char *)KERNBASE;
+
+ crom_add_entry(&sc->unit, DCONS_CSR_KEY_RESET_HI, ADDR_HI(idt_paddr));
+ crom_add_entry(&sc->unit, DCONS_CSR_KEY_RESET_LO, ADDR_LO(idt_paddr));
+}
+#endif
static void
dcons_crom_post_busreset(void *arg)
{
@@ -128,6 +149,9 @@ dcons_crom_post_busreset(void *arg)
crom_add_simple_text(src, &sc->unit, &sc->ver, "dcons");
crom_add_entry(&sc->unit, DCONS_CSR_KEY_HI, ADDR_HI(dcons_paddr));
crom_add_entry(&sc->unit, DCONS_CSR_KEY_LO, ADDR_LO(dcons_paddr));
+#if (defined(__i386__) || defined(__amd64__)) && defined(EXPOSE_IDT_ADDR)
+ dcons_crom_expose_idt(sc);
+#endif
}
#endif
OpenPOWER on IntegriCloud