diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2008-08-09 21:06:06 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2008-08-09 21:06:06 +0000 |
commit | a5fa09894833397c174e0d04b16e94d9649e52b6 (patch) | |
tree | a9b81888e392974e834ceca9d707f6f199cd71bd /sys/arch/sparc64 | |
parent | 091625bd946781e0b28302e018e3555b2e862f67 (diff) |
Add prom_set_sun4v_api_version().
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r-- | sys/arch/sparc64/include/sparc64.h | 3 | ||||
-rw-r--r-- | sys/arch/sparc64/sparc64/ofw_machdep.c | 32 |
2 files changed, 33 insertions, 2 deletions
diff --git a/sys/arch/sparc64/include/sparc64.h b/sys/arch/sparc64/include/sparc64.h index fcfced0e8a6..591808a66c4 100644 --- a/sys/arch/sparc64/include/sparc64.h +++ b/sys/arch/sparc64/include/sparc64.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sparc64.h,v 1.11 2008/07/10 08:57:05 kettenis Exp $ */ +/* $OpenBSD: sparc64.h,v 1.12 2008/08/09 21:06:05 kettenis Exp $ */ /* $NetBSD: sparc64.h,v 1.3 2000/10/20 05:47:03 mrg Exp $ */ /* @@ -56,6 +56,7 @@ void prom_start_cpu(int cpu, void *func, long arg); void prom_start_cpu_by_cpuid(int cpu, void *func, long arg); const char *prom_serengeti_set_console_input(const char *); time_t prom_opl_get_tod(void); +uint64_t prom_set_sun4v_api_version(uint64_t, uint64_t, uint64_t, uint64_t *); /* * Debug diff --git a/sys/arch/sparc64/sparc64/ofw_machdep.c b/sys/arch/sparc64/sparc64/ofw_machdep.c index 47a88e54a5c..201890f2722 100644 --- a/sys/arch/sparc64/sparc64/ofw_machdep.c +++ b/sys/arch/sparc64/sparc64/ofw_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ofw_machdep.c,v 1.28 2008/07/10 08:57:05 kettenis Exp $ */ +/* $OpenBSD: ofw_machdep.c,v 1.29 2008/08/09 21:06:05 kettenis Exp $ */ /* $NetBSD: ofw_machdep.c,v 1.16 2001/07/20 00:07:14 eeh Exp $ */ /* @@ -783,6 +783,36 @@ prom_opl_get_tod(void) return (time_t)args.time; } +uint64_t +prom_set_sun4v_api_version(uint64_t api_group, uint64_t major, + uint64_t minor, uint64_t *supported_minor) +{ + static struct { + cell_t name; + cell_t nargs; + cell_t nreturns; + cell_t api_group; + cell_t major; + cell_t minor; + cell_t status; + cell_t supported_minor; + } args; + + args.name = ADR2CELL("SUNW,set-sun4v-api-version"); + args.nargs = 3; + args.nreturns = 2; + args.api_group = api_group; + args.major = major; + args.minor = minor; + args.status = -1; + args.supported_minor = -1; + + openfirmware(&args); + + *supported_minor = args.supported_minor; + return (uint64_t)args.status; +} + #ifdef DEBUG int ofmapintrdebug = 0; #define DPRINTF(x) do { if (ofmapintrdebug) printf x; } while (0) |