Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc64 sun4v: add function to retrieve hypervisor ...



details:   https://anonhg.NetBSD.org/src/rev/6a90ed5d5362
branches:  trunk
changeset: 359578:6a90ed5d5362
user:      palle <palle%NetBSD.org@localhost>
date:      Mon Jan 10 20:14:54 2022 +0000

description:
sun4v: add function to retrieve hypervisor api version

diffstat:

 sys/arch/sparc64/include/sparc64.h     |   3 ++-
 sys/arch/sparc64/sparc64/ofw_machdep.c |  32 ++++++++++++++++++++++++++++++--
 2 files changed, 32 insertions(+), 3 deletions(-)

diffs (71 lines):

diff -r 71a487a3990e -r 6a90ed5d5362 sys/arch/sparc64/include/sparc64.h
--- a/sys/arch/sparc64/include/sparc64.h        Mon Jan 10 20:04:01 2022 +0000
+++ b/sys/arch/sparc64/include/sparc64.h        Mon Jan 10 20:14:54 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sparc64.h,v 1.14 2021/07/03 19:18:55 palle Exp $       */
+/*     $NetBSD: sparc64.h,v 1.15 2022/01/10 20:14:54 palle Exp $       */
 
 /*
  * Copyright (C) 1996 Wolfgang Solfrank.
@@ -60,6 +60,7 @@
 void prom_startcpu(u_int, void *, u_long);
 int prom_startcpu_by_cpuid(u_int, void *, u_long arg);
 uint64_t prom_set_sun4v_api_version(uint64_t, uint64_t, uint64_t, uint64_t *);
+uint64_t prom_get_sun4v_api_version(uint64_t, uint64_t *, uint64_t *);
 void prom_sun4v_soft_state_supported(void);
 
 #endif /* _MACHINE_SPARC64_H_ */
diff -r 71a487a3990e -r 6a90ed5d5362 sys/arch/sparc64/sparc64/ofw_machdep.c
--- a/sys/arch/sparc64/sparc64/ofw_machdep.c    Mon Jan 10 20:04:01 2022 +0000
+++ b/sys/arch/sparc64/sparc64/ofw_machdep.c    Mon Jan 10 20:14:54 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ofw_machdep.c,v 1.47 2021/07/03 19:18:55 palle Exp $   */
+/*     $NetBSD: ofw_machdep.c,v 1.48 2022/01/10 20:14:54 palle Exp $   */
 
 /*
  * Copyright (C) 1996 Wolfgang Solfrank.
@@ -34,7 +34,7 @@
 #include "opt_multiprocessor.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.47 2021/07/03 19:18:55 palle Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.48 2022/01/10 20:14:54 palle Exp $");
 
 #include <sys/param.h>
 #include <sys/buf.h>
@@ -676,7 +676,35 @@
        *supported_minor = args.supported_minor;
        return (uint64_t)args.status;
 }
+#if 1
+uint64_t
+prom_get_sun4v_api_version(uint64_t api_group, uint64_t* major, uint64_t* minor)
+{
+       static struct {
+               cell_t  name;
+               cell_t  nargs;
+               cell_t  nreturns;
+               cell_t  api_group;
+               cell_t  status;
+               cell_t  major;
+               cell_t  minor;
+       } args;
 
+       args.name = ADR2CELL("SUNW,get-sun4v-api-version");
+       args.nargs = 1;
+       args.nreturns = 3;
+       args.api_group = api_group;
+       args.status = -1;
+       args.major = -1;
+       args.minor = -1;
+
+       openfirmware(&args);
+
+       *major = args.major;
+       *minor = args.minor;
+       return (uint64_t)args.status;
+}
+#endif
 void
 prom_sun4v_soft_state_supported(void)
 {



Home | Main Index | Thread Index | Old Index