Thu Sep 3 02:09:09 2020 UTC ()
Clean up all of the _PMAP_MAY_USE_PROM_CONSOLE crapola, centralizing the
logic in prom.c, and rename it _PROM_MAY_USE_PROM_CONSOLE in a few places
it's still needed.


(thorpej)
diff -r1.125 -r1.126 src/sys/arch/alpha/alpha/locore.s
diff -r1.362 -r1.363 src/sys/arch/alpha/alpha/machdep.c
diff -r1.270 -r1.271 src/sys/arch/alpha/alpha/pmap.c
diff -r1.53 -r1.54 src/sys/arch/alpha/alpha/prom.c
diff -r1.40 -r1.41 src/sys/arch/alpha/alpha/promcons.c
diff -r1.38 -r1.39 src/sys/arch/alpha/include/alpha.h
diff -r1.83 -r1.84 src/sys/arch/alpha/include/pmap.h
diff -r1.14 -r1.15 src/sys/arch/alpha/include/prom.h

cvs diff -r1.125 -r1.126 src/sys/arch/alpha/alpha/locore.s (expand / switch to context diff)
--- src/sys/arch/alpha/alpha/locore.s 2020/06/30 16:20:00 1.125
+++ src/sys/arch/alpha/alpha/locore.s 2020/09/03 02:09:09 1.126
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.125 2020/06/30 16:20:00 maxv Exp $ */
+/* $NetBSD: locore.s,v 1.126 2020/09/03 02:09:09 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000, 2019 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include <machine/asm.h>
 
-__KERNEL_RCSID(0, "$NetBSD: locore.s,v 1.125 2020/06/30 16:20:00 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locore.s,v 1.126 2020/09/03 02:09:09 thorpej Exp $");
 
 #include "assym.h"
 
@@ -126,6 +126,7 @@
  *
  * All arguments are passed to alpha_init().
  */
+IMPORT(prom_mapped, 4)
 NESTED_NOPROFILE(locorestart,1,0,ra,0,0)
 	br	pv,1f
 1:	LDGP(pv)
@@ -156,6 +157,10 @@
 	lda	a0, lwp0
 	ldq	a0, L_MD_PCBPADDR(a0)		/* phys addr of PCB */
 	SWITCH_CONTEXT
+
+	/* PROM is no longer mapped. */
+	lda	t0, prom_mapped
+	stl	zero, 0(t0)
 
 	/*
 	 * We've switched to a new page table base, so invalidate the TLB

cvs diff -r1.362 -r1.363 src/sys/arch/alpha/alpha/machdep.c (expand / switch to context diff)
--- src/sys/arch/alpha/alpha/machdep.c 2020/09/02 17:40:23 1.362
+++ src/sys/arch/alpha/alpha/machdep.c 2020/09/03 02:09:09 1.363
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.362 2020/09/02 17:40:23 riastradh Exp $ */
+/* $NetBSD: machdep.c,v 1.363 2020/09/03 02:09:09 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2019 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.362 2020/09/02 17:40:23 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.363 2020/09/03 02:09:09 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -299,7 +299,7 @@
 			    uimin(sizeof v1p->booted_kernel,
 			      sizeof bootinfo.booted_kernel));
 			/* booted dev not provided in bootinfo */
-			init_prom_interface((struct rpb *)
+			init_prom_interface(ptb, (struct rpb *)
 			    ALPHA_PHYS_TO_K0SEG(bootinfo.hwrpb_phys));
 	        	prom_getenv(PROM_E_BOOTED_DEV, bootinfo.booted_dev,
 			    sizeof bootinfo.booted_dev);
@@ -316,7 +316,7 @@
 		bootinfo.esym = (u_long)_end;
 		bootinfo.hwrpb_phys = ((struct rpb *)HWRPB_ADDR)->rpb_phys;
 		bootinfo.hwrpb_size = ((struct rpb *)HWRPB_ADDR)->rpb_size;
-		init_prom_interface((struct rpb *)HWRPB_ADDR);
+		init_prom_interface(ptb, (struct rpb *)HWRPB_ADDR);
 		prom_getenv(PROM_E_BOOTED_OSFLAGS, bootinfo.boot_flags,
 		    sizeof bootinfo.boot_flags);
 		prom_getenv(PROM_E_BOOTED_FILE, bootinfo.booted_kernel,
@@ -375,17 +375,10 @@
 	uvm_md_init();
 
 	/*
-	 * Find out what hardware we're on, and do basic initialization.
+	 * cputype has been initialized in init_prom_interface().
+	 * Perform basic platform initialization using this info.
 	 */
-	cputype = hwrpb->rpb_type;
-	if (cputype < 0) {
-		/*
-		 * At least some white-box systems have SRM which
-		 * reports a systype that's the negative of their
-		 * blue-box counterpart.
-		 */
-		cputype = -cputype;
-	}
+	KASSERT(prom_interface_initialized);
 	c = platform_lookup(cputype);
 	if (c == NULL) {
 		platform_not_supported();
@@ -416,12 +409,7 @@
 #endif
 
 	/* NO MORE FIRMWARE ACCESS ALLOWED */
-#ifdef _PMAP_MAY_USE_PROM_CONSOLE
-	/*
-	 * XXX (unless _PMAP_MAY_USE_PROM_CONSOLE is defined and
-	 * XXX pmap_uses_prom_console() evaluates to non-zero.)
-	 */
-#endif
+	/* XXX Unless prom_uses_prom_console() evaluates to non-zero.) */
 
 	/*
 	 * Find the beginning and end of the kernel (and leave a
@@ -507,14 +495,12 @@
 		 * software use.  We must determine if this cluster
 		 * holds the kernel.
 		 */
-#ifdef _PMAP_MAY_USE_PROM_CONSOLE
+
 		/*
 		 * XXX If the kernel uses the PROM console, we only use the
 		 * XXX memory after the kernel in the first system segment,
 		 * XXX to avoid clobbering prom mapping, data, etc.
 		 */
-	    if (!pmap_uses_prom_console() || physmem == 0) {
-#endif /* _PMAP_MAY_USE_PROM_CONSOLE */
 		physmem += memc->mddt_pg_cnt;
 		pfn0 = memc->mddt_pfn;
 		pfn1 = memc->mddt_pfn + memc->mddt_pg_cnt;
@@ -526,10 +512,7 @@
 #if 0
 			printf("Cluster %d contains kernel\n", i);
 #endif
-#ifdef _PMAP_MAY_USE_PROM_CONSOLE
-		    if (!pmap_uses_prom_console()) {
-#endif /* _PMAP_MAY_USE_PROM_CONSOLE */
-			if (pfn0 < kernstartpfn) {
+			if (pfn0 < kernstartpfn && !prom_uses_prom_console()) {
 				/*
 				 * There is a chunk before the kernel.
 				 */
@@ -540,9 +523,6 @@
 				uvm_page_physload(pfn0, kernstartpfn,
 				    pfn0, kernstartpfn, VM_FREELIST_DEFAULT);
 			}
-#ifdef _PMAP_MAY_USE_PROM_CONSOLE
-		    }
-#endif /* _PMAP_MAY_USE_PROM_CONSOLE */
 			if (kernendpfn < pfn1) {
 				/*
 				 * There is a chunk after the kernel.
@@ -565,9 +545,6 @@
 			uvm_page_physload(pfn0, pfn1, pfn0, pfn1,
 			    VM_FREELIST_DEFAULT);
 		}
-#ifdef _PMAP_MAY_USE_PROM_CONSOLE
-	    }
-#endif /* _PMAP_MAY_USE_PROM_CONSOLE */
 	}
 
 	/*
@@ -813,9 +790,9 @@
 	 * Everything related to console initialization is done
 	 * in alpha_init().
 	 */
-#if defined(DIAGNOSTIC) && defined(_PMAP_MAY_USE_PROM_CONSOLE)
+#if defined(DIAGNOSTIC) && defined(_PROM_MAY_USE_PROM_CONSOLE)
 	printf("consinit: %susing prom console\n",
-	    pmap_uses_prom_console() ? "" : "not ");
+	    prom_uses_prom_console() ? "" : "not ");
 #endif
 }
 
@@ -965,15 +942,6 @@
 	printf("\n");
 	printf("%ld byte page size, %d processor%s.\n",
 	    hwrpb->rpb_page_size, ncpus, ncpus == 1 ? "" : "s");
-#if 0
-	/* this isn't defined for any systems that we run on? */
-	printf("serial number 0x%lx 0x%lx\n",
-	    ((long *)hwrpb->rpb_ssn)[0], ((long *)hwrpb->rpb_ssn)[1]);
-
-	/* and these aren't particularly useful! */
-	printf("variation: 0x%lx, revision 0x%lx\n",
-	    hwrpb->rpb_variation, *(long *)hwrpb->rpb_revision);
-#endif
 }
 
 int	waittime = -1;

cvs diff -r1.270 -r1.271 src/sys/arch/alpha/alpha/pmap.c (expand / switch to context diff)
--- src/sys/arch/alpha/alpha/pmap.c 2020/09/03 02:05:03 1.270
+++ src/sys/arch/alpha/alpha/pmap.c 2020/09/03 02:09:09 1.271
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.270 2020/09/03 02:05:03 thorpej Exp $ */
+/* $NetBSD: pmap.c,v 1.271 2020/09/03 02:09:09 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001, 2007, 2008, 2020
@@ -135,7 +135,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.270 2020/09/03 02:05:03 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.271 2020/09/03 02:09:09 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -150,7 +150,7 @@
 
 #include <uvm/uvm.h>
 
-#if defined(_PMAP_MAY_USE_PROM_CONSOLE) || defined(MULTIPROCESSOR)
+#if defined(MULTIPROCESSOR)
 #include <machine/rpb.h>
 #endif
 
@@ -1287,28 +1287,7 @@
 	kernel_lev1map[l1pte_index(VPTBASE)] = pte;
 	VPT = (pt_entry_t *)VPTBASE;
 
-#ifdef _PMAP_MAY_USE_PROM_CONSOLE
-    {
-	extern pt_entry_t prom_pte;			/* XXX */
-	extern int prom_mapped;				/* XXX */
-
-	if (pmap_uses_prom_console()) {
-		/*
-		 * XXX Save old PTE so we can remap the PROM, if
-		 * XXX necessary.
-		 */
-		prom_pte = *(pt_entry_t *)ptaddr & ~PG_ASM;
-	}
-	prom_mapped = 0;
-
 	/*
-	 * Actually, this code lies.  The prom is still mapped, and will
-	 * remain so until the context switch after alpha_init() returns.
-	 */
-    }
-#endif
-
-	/*
 	 * Set up level 2 page table.
 	 */
 	/* Map all of the level 3 pte pages */
@@ -1391,15 +1370,6 @@
 	struct cpu_info * const ci = curcpu();
 	pmap_init_cpu(ci);
 }
-
-#ifdef _PMAP_MAY_USE_PROM_CONSOLE
-int
-pmap_uses_prom_console(void)
-{
-
-	return (cputype == ST_DEC_21000);
-}
-#endif /* _PMAP_MAY_USE_PROM_CONSOLE */
 
 /*
  * pmap_virtual_space:		[ INTERFACE ]

cvs diff -r1.53 -r1.54 src/sys/arch/alpha/alpha/prom.c (expand / switch to context diff)
--- src/sys/arch/alpha/alpha/prom.c 2020/08/30 16:26:56 1.53
+++ src/sys/arch/alpha/alpha/prom.c 2020/09/03 02:09:09 1.54
@@ -1,4 +1,4 @@
-/* $NetBSD: prom.c,v 1.53 2020/08/30 16:26:56 thorpej Exp $ */
+/* $NetBSD: prom.c,v 1.54 2020/09/03 02:09:09 thorpej Exp $ */
 
 /*
  * Copyright (c) 1992, 1994, 1995, 1996 Carnegie Mellon University
@@ -27,7 +27,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: prom.c,v 1.53 2020/08/30 16:26:56 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: prom.c,v 1.54 2020/09/03 02:09:09 thorpej Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -54,17 +54,18 @@
 	.cn_pri = 1
 };
 
-struct rpb	*hwrpb;
+struct rpb	*hwrpb __read_mostly;
 int		alpha_console;
 
 extern struct prom_vec prom_dispatch_v;
 
-static int	prom_is_qemu;		/* XXX */
+bool		prom_interface_initialized;
+int		prom_mapped = 1;	/* Is PROM still mapped? */
+static bool	prom_is_qemu;		/* XXX */
 
 static kmutex_t	prom_lock;
 
-#ifdef _PMAP_MAY_USE_PROM_CONSOLE
-int		prom_mapped = 1;	/* Is PROM still mapped? */
+#ifdef _PROM_MAY_USE_PROM_CONSOLE
 
 pt_entry_t	prom_pte, saved_pte[1];	/* XXX */
 
@@ -80,9 +81,33 @@
 
 	return ((pt_entry_t *)ALPHA_PHYS_TO_K0SEG(apcb->apcb_ptbr << PGSHIFT));
 }
-#endif /* _PMAP_MAY_USE_PROM_CONSOLE */
+#endif /* _PROM_MAY_USE_PROM_CONSOLE */
 
+bool
+prom_uses_prom_console(void)
+{
+#ifdef _PROM_MAY_USE_PROM_CONSOLE
+	return (cputype == ST_DEC_21000);
+#else
+	return false;
+#endif
+}
+
 static void
+prom_init_cputype(const struct rpb * const rpb)
+{
+	cputype = rpb->rpb_type;
+	if (cputype < 0) {
+		/*
+		 * At least some white-box systems have SRM which
+		 * reports a systype that's the negative of their
+		 * blue-box counterpart.
+		 */
+		cputype = -cputype;
+	}
+}
+
+static void
 prom_check_qemu(const struct rpb * const rpb)
 {
 	if (!prom_is_qemu) {
@@ -90,21 +115,21 @@
 		    rpb->rpb_ssn[1] == 'E' &&
 		    rpb->rpb_ssn[2] == 'M' &&
 		    rpb->rpb_ssn[3] == 'U') {
-			prom_is_qemu = 1;
+			prom_is_qemu = true;
 		}
 	}
 }
 
 void
-init_prom_interface(struct rpb *rpb)
+init_prom_interface(u_long ptb_pfn, struct rpb *rpb)
 {
-	static bool prom_interface_initialized;
 
 	if (prom_interface_initialized)
 		return;
 
 	struct crb *c;
 
+	prom_init_cputype(rpb);
 	prom_check_qemu(rpb);
 
 	c = (struct crb *)((char *)rpb + rpb->rpb_crb_off);
@@ -112,6 +137,18 @@
 	prom_dispatch_v.routine_arg = c->crb_v_dispatch;
 	prom_dispatch_v.routine = c->crb_v_dispatch->entry_va;
 
+#ifdef _PROM_MAY_USE_PROM_CONSOLE
+	if (prom_uses_prom_console()) {
+		/*
+		 * XXX Save old PTE so we can remap the PROM, if
+		 * XXX necessary.
+		 */
+		pt_entry_t * const l1pt =
+		    (pt_entry_t *)ALPHA_PHYS_TO_K0SEG(ptb_pfn << PGSHIFT);
+		prom_pte = l1pt[0] & ~PG_ASM;
+	}
+#endif /* _PROM_MAY_USE_PROM_CONSOLE */
+
 	mutex_init(&prom_lock, MUTEX_DEFAULT, IPL_HIGH);
 	prom_interface_initialized = true;
 }
@@ -121,7 +158,10 @@
 {
 	char buf[4];
 
-	init_prom_interface(hwrpb);
+	/* init_prom_interface() has already been called. */
+	if (! prom_interface_initialized) {
+		prom_halt(1);
+	}
 
 	prom_getenv(PROM_E_TTY_DEV, buf, sizeof(buf));
 	alpha_console = buf[0] - '0';
@@ -130,7 +170,7 @@
 	cn_tab = &promcons;
 }
 
-#ifdef _PMAP_MAY_USE_PROM_CONSOLE
+#ifdef _PROM_MAY_USE_PROM_CONSOLE
 static void prom_cache_sync(void);
 #endif
 
@@ -140,14 +180,14 @@
 
 	mutex_enter(&prom_lock);
 
-#ifdef _PMAP_MAY_USE_PROM_CONSOLE
+#ifdef _PROM_MAY_USE_PROM_CONSOLE
 	/*
 	 * If we have not yet switched out of the PROM's context
 	 * (i.e. the first one after alpha_init()), then the PROM
 	 * is still mapped, regardless of the `prom_mapped' setting.
 	 */
 	if (prom_mapped == 0 && curpcb != 0) {
-		if (!pmap_uses_prom_console())
+		if (!prom_uses_prom_console())
 			panic("prom_enter");
 		{
 			pt_entry_t *lev1map;
@@ -165,12 +205,12 @@
 prom_leave(void)
 {
 
-#ifdef _PMAP_MAY_USE_PROM_CONSOLE
+#ifdef _PROM_MAY_USE_PROM_CONSOLE
 	/*
 	 * See comment above.
 	 */
 	if (prom_mapped == 0 && curpcb != 0) {
-		if (!pmap_uses_prom_console())
+		if (!prom_uses_prom_console())
 			panic("prom_leave");
 		{
 			pt_entry_t *lev1map;
@@ -184,7 +224,7 @@
 	mutex_exit(&prom_lock);
 }
 
-#ifdef _PMAP_MAY_USE_PROM_CONSOLE
+#ifdef _PROM_MAY_USE_PROM_CONSOLE
 static void
 prom_cache_sync(void)
 {

cvs diff -r1.40 -r1.41 src/sys/arch/alpha/alpha/promcons.c (expand / switch to context diff)
--- src/sys/arch/alpha/alpha/promcons.c 2019/08/09 08:05:57 1.40
+++ src/sys/arch/alpha/alpha/promcons.c 2020/09/03 02:09:09 1.41
@@ -1,4 +1,4 @@
-/* $NetBSD: promcons.c,v 1.40 2019/08/09 08:05:57 rin Exp $ */
+/* $NetBSD: promcons.c,v 1.41 2020/09/03 02:09:09 thorpej Exp $ */
 
 /*
  * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -29,7 +29,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: promcons.c,v 1.40 2019/08/09 08:05:57 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: promcons.c,v 1.41 2020/09/03 02:09:09 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -55,7 +55,7 @@
 #define	CONSPEED 9600
 #endif
 
-#ifdef _PMAP_MAY_USE_PROM_CONSOLE
+#ifdef _PROM_MAY_USE_PROM_CONSOLE
 
 dev_type_open(promopen);
 dev_type_close(promclose);
@@ -106,7 +106,7 @@
 		callo = true;
 	}
 
-	if (!pmap_uses_prom_console() || unit >= 1)
+	if (!prom_uses_prom_console() || unit >= 1)
 		return ENXIO;
 
 	s = spltty();
@@ -262,10 +262,10 @@
 	return prom_tty[0];
 }
 
-#else /* _PMAP_MAY_USE_PROM_CONSOLE */
+#else /* _PROM_MAY_USE_PROM_CONSOLE */
 
 /*
- * If not defined _PMAP_MAY_USE_PROM_CONSOLE,
+ * If not defined _PROM_MAY_USE_PROM_CONSOLE,
  * this fake prom_cdevsw is attached to the kernel.
  * NEVER REMOVE!
  */
@@ -284,4 +284,4 @@
 	.d_flag = 0
 };
 
-#endif /* _PMAP_MAY_USE_PROM_CONSOLE */
+#endif /* _PROM_MAY_USE_PROM_CONSOLE */

cvs diff -r1.38 -r1.39 src/sys/arch/alpha/include/alpha.h (expand / switch to context diff)
--- src/sys/arch/alpha/include/alpha.h 2019/04/06 03:06:24 1.38
+++ src/sys/arch/alpha/include/alpha.h 2020/09/03 02:09:09 1.39
@@ -1,4 +1,4 @@
-/* $NetBSD: alpha.h,v 1.38 2019/04/06 03:06:24 thorpej Exp $ */
+/* $NetBSD: alpha.h,v 1.39 2020/09/03 02:09:09 thorpej Exp $ */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -89,7 +89,7 @@
 void	exception_return(void);					/* MAGIC */
 void	frametoreg(const struct trapframe *, struct reg *);
 void	init_bootstrap_console(void);
-void	init_prom_interface(struct rpb *);
+void	init_prom_interface(unsigned long, struct rpb *);
 void	interrupt(unsigned long, unsigned long, unsigned long,
 	    struct trapframe *);
 void	machine_check(unsigned long, struct trapframe *, unsigned long,

cvs diff -r1.83 -r1.84 src/sys/arch/alpha/include/pmap.h (expand / switch to context diff)
--- src/sys/arch/alpha/include/pmap.h 2020/08/29 20:07:00 1.83
+++ src/sys/arch/alpha/include/pmap.h 2020/09/03 02:09:09 1.84
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.83 2020/08/29 20:07:00 thorpej Exp $ */
+/* $NetBSD: pmap.h,v 1.84 2020/09/03 02:09:09 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001, 2007 The NetBSD Foundation, Inc.
@@ -185,15 +185,6 @@
 
 #include <sys/atomic.h>
 
-#ifdef _KERNEL_OPT
-#include "opt_dec_kn8ae.h"			/* XXX */
-#if defined(DEC_KN8AE)
-#define	_PMAP_MAY_USE_PROM_CONSOLE
-#endif
-#else
-#define	_PMAP_MAY_USE_PROM_CONSOLE
-#endif
-
 struct cpu_info;
 struct trapframe;
 
@@ -255,9 +246,6 @@
 /* Machine-specific functions. */
 void	pmap_bootstrap(paddr_t, u_int, u_long);
 int	pmap_emulate_reference(struct lwp *, vaddr_t, int, int);
-#ifdef _PMAP_MAY_USE_PROM_CONSOLE
-int	pmap_uses_prom_console(void);
-#endif
 
 #define	pmap_pte_pa(pte)	(PG_PFNUM(*(pte)) << PGSHIFT)
 #define	pmap_pte_prot(pte)	(*(pte) & PG_PROT)

cvs diff -r1.14 -r1.15 src/sys/arch/alpha/include/prom.h (expand / switch to context diff)
--- src/sys/arch/alpha/include/prom.h 2012/02/06 02:14:13 1.14
+++ src/sys/arch/alpha/include/prom.h 2020/09/03 02:09:09 1.15
@@ -1,4 +1,4 @@
-/* $NetBSD: prom.h,v 1.14 2012/02/06 02:14:13 matt Exp $ */
+/* $NetBSD: prom.h,v 1.15 2020/09/03 02:09:09 thorpej Exp $ */
 
 /*
  * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -111,6 +111,19 @@
 
 #ifndef ASSEMBLER
 #ifdef _KERNEL
+
+#ifdef _KERNEL_OPT
+#include "opt_dec_kn8ae.h"
+
+#if defined(DEC_KN8AE)
+#define _PROM_MAY_USE_PROM_CONSOLE
+#endif /* DEC_KN8AE */
+#endif /* _KERNEL_OPT */
+
+extern bool prom_interface_initialized;
+
+bool	prom_uses_prom_console(void);
+
 void	prom_enter(void);
 void	prom_leave(void);