Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/alpha prom_is_qemu -> alpha_is_qemu, and export it ...



details:   https://anonhg.NetBSD.org/src/rev/073c183cc7fc
branches:  trunk
changeset: 939703:073c183cc7fc
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Sep 27 23:16:10 2020 +0000

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

diffstat:

 sys/arch/alpha/alpha/machdep.c |   5 +++--
 sys/arch/alpha/alpha/prom.c    |  17 ++++++++---------
 sys/arch/alpha/include/alpha.h |   3 ++-
 3 files changed, 13 insertions(+), 12 deletions(-)

diffs (120 lines):

diff -r 6dc2c07e4826 -r 073c183cc7fc sys/arch/alpha/alpha/machdep.c
--- a/sys/arch/alpha/alpha/machdep.c    Sun Sep 27 23:12:12 2020 +0000
+++ b/sys/arch/alpha/alpha/machdep.c    Sun Sep 27 23:16:10 2020 +0000
@@ -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    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 */
 
diff -r 6dc2c07e4826 -r 073c183cc7fc sys/arch/alpha/alpha/prom.c
--- a/sys/arch/alpha/alpha/prom.c       Sun Sep 27 23:12:12 2020 +0000
+++ b/sys/arch/alpha/alpha/prom.c       Sun Sep 27 23:16:10 2020 +0000
@@ -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 @@
 
 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 @@
 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 @@
        unsigned char *to = (unsigned char *)0x20000000;
 
        /* XXX */
-       if (prom_is_qemu)
+       if (alpha_is_qemu)
                return;
 
        prom_enter();
@@ -275,7 +274,7 @@
        prom_return_t ret;
 
        /* XXX */
-       if (prom_is_qemu)
+       if (alpha_is_qemu)
                return 0;
 
        for (;;) {
@@ -298,7 +297,7 @@
        prom_return_t ret;
 
        /* XXX */
-       if (prom_is_qemu)
+       if (alpha_is_qemu)
                return 0;
 
        prom_enter();
@@ -318,7 +317,7 @@
        prom_return_t ret;
 
        /* XXX */
-       if (prom_is_qemu)
+       if (alpha_is_qemu)
                return 0;
 
        prom_enter();
diff -r 6dc2c07e4826 -r 073c183cc7fc sys/arch/alpha/include/alpha.h
--- a/sys/arch/alpha/include/alpha.h    Sun Sep 27 23:12:12 2020 +0000
+++ b/sys/arch/alpha/include/alpha.h    Sun Sep 27 23:16:10 2020 +0000
@@ -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 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;



Home | Main Index | Thread Index | Old Index