Module Name:    src
Committed By:   thorpej
Date:           Sun Sep 27 23:16:10 UTC 2020

Modified Files:
        src/sys/arch/alpha/alpha: machdep.c prom.c
        src/sys/arch/alpha/include: alpha.h

Log Message:
prom_is_qemu -> alpha_is_qemu, and export it outside of prom.c.


To generate a diff of this commit:
cvs rdiff -u -r1.364 -r1.365 src/sys/arch/alpha/alpha/machdep.c
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/alpha/alpha/prom.c
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/alpha/include/alpha.h

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/alpha/alpha/machdep.c
diff -u src/sys/arch/alpha/alpha/machdep.c:1.364 src/sys/arch/alpha/alpha/machdep.c:1.365
--- src/sys/arch/alpha/alpha/machdep.c:1.364	Fri Sep  4 03:53:12 2020
+++ src/sys/arch/alpha/alpha/machdep.c	Sun Sep 27 23:16:10 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.364 2020/09/04 03:53:12 thorpej Exp $ */
+/* $NetBSD: machdep.c,v 1.365 2020/09/27 23:16:10 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.364 2020/09/04 03:53:12 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.365 2020/09/27 23:16:10 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -150,6 +150,7 @@ int	unusedmem;		/* amount of memory for 
 int	unknownmem;		/* amount of memory with an unknown use */
 
 int	cputype;		/* system type, from the RPB */
+bool	alpha_is_qemu;		/* true if we've detected runnnig in qemu */
 
 int	bootdev_debug = 0;	/* patchable, or from DDB */
 

Index: src/sys/arch/alpha/alpha/prom.c
diff -u src/sys/arch/alpha/alpha/prom.c:1.56 src/sys/arch/alpha/alpha/prom.c:1.57
--- src/sys/arch/alpha/alpha/prom.c:1.56	Fri Sep  4 03:36:44 2020
+++ src/sys/arch/alpha/alpha/prom.c	Sun Sep 27 23:16:10 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: prom.c,v 1.56 2020/09/04 03:36:44 thorpej Exp $ */
+/* $NetBSD: prom.c,v 1.57 2020/09/27 23:16:10 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.56 2020/09/04 03:36:44 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: prom.c,v 1.57 2020/09/27 23:16:10 thorpej Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -61,7 +61,6 @@ extern struct prom_vec prom_dispatch_v;
 
 bool		prom_interface_initialized;
 int		prom_mapped = 1;	/* Is PROM still mapped? */
-static bool	prom_is_qemu;		/* XXX */
 
 static kmutex_t	prom_lock;
 
@@ -111,12 +110,12 @@ prom_init_cputype(const struct rpb * con
 static void
 prom_check_qemu(const struct rpb * const rpb)
 {
-	if (!prom_is_qemu) {
+	if (!alpha_is_qemu) {
 		if (rpb->rpb_ssn[0] == 'Q' &&
 		    rpb->rpb_ssn[1] == 'E' &&
 		    rpb->rpb_ssn[2] == 'M' &&
 		    rpb->rpb_ssn[3] == 'U') {
-			prom_is_qemu = true;
+			alpha_is_qemu = true;
 		}
 	}
 }
@@ -251,7 +250,7 @@ promcnputc(dev_t dev, int c)
 	unsigned char *to = (unsigned char *)0x20000000;
 
 	/* XXX */
-	if (prom_is_qemu)
+	if (alpha_is_qemu)
 		return;
 
 	prom_enter();
@@ -275,7 +274,7 @@ promcngetc(dev_t dev)
 	prom_return_t ret;
 
 	/* XXX */
-	if (prom_is_qemu)
+	if (alpha_is_qemu)
 		return 0;
 
 	for (;;) {
@@ -298,7 +297,7 @@ promcnlookc(dev_t dev, char *cp)
 	prom_return_t ret;
 
 	/* XXX */
-	if (prom_is_qemu)
+	if (alpha_is_qemu)
 		return 0;
 
 	prom_enter();
@@ -318,7 +317,7 @@ prom_getenv(int id, char *buf, int len)
 	prom_return_t ret;
 
 	/* XXX */
-	if (prom_is_qemu)
+	if (alpha_is_qemu)
 		return 0;
 
 	prom_enter();

Index: src/sys/arch/alpha/include/alpha.h
diff -u src/sys/arch/alpha/include/alpha.h:1.40 src/sys/arch/alpha/include/alpha.h:1.41
--- src/sys/arch/alpha/include/alpha.h:1.40	Fri Sep 18 00:07:22 2020
+++ src/sys/arch/alpha/include/alpha.h	Sun Sep 27 23:16:10 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: alpha.h,v 1.40 2020/09/18 00:07:22 thorpej Exp $ */
+/* $NetBSD: alpha.h,v 1.41 2020/09/27 23:16:10 thorpej Exp $ */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -67,6 +67,7 @@ struct reg;
 struct rpb;
 struct trapframe;
 
+extern bool alpha_is_qemu;
 extern u_long cpu_implver;		/* from IMPLVER instruction */
 extern u_long cpu_amask;		/* from AMASK instruction */
 extern int bootdev_debug;

Reply via email to