hsvc.h revision b693132f48f19b8c1bd613e914faf3589565cb57
a4544a5a0e622ef69e38641f87ab1b5685e05911Phill Cunnington/*
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * CDDL HEADER START
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The contents of this file are subject to the terms of the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Common Development and Distribution License (the "License").
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * You may not use this file except in compliance with the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * or http://www.opensolaris.org/os/licensing.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * See the License for the specific language governing permissions
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * and limitations under the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * When distributing Covered Code, include this CDDL HEADER in each
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * If applicable, add the following below this CDDL HEADER, with the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * fields enclosed by brackets "[]" replaced with your own identifying
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * information: Portions Copyright [yyyy] [name of copyright owner]
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * CDDL HEADER END
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster/*
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Use is subject to license terms.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster#ifndef _SYS_HSVC_H
1c3134bddb7b413373d1668cbc4b7d95c2477667Mark de Reeper#define _SYS_HSVC_H
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster/*
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Niagara services information
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
c184142912cff04e5442d8bf70febe477285fb1cCraig McDonnell
c184142912cff04e5442d8bf70febe477285fb1cCraig McDonnell#ifdef __cplusplus
c184142912cff04e5442d8bf70febe477285fb1cCraig McDonnellextern "C" {
c184142912cff04e5442d8bf70febe477285fb1cCraig McDonnell#endif
c184142912cff04e5442d8bf70febe477285fb1cCraig McDonnell
c184142912cff04e5442d8bf70febe477285fb1cCraig McDonnell
c184142912cff04e5442d8bf70febe477285fb1cCraig McDonnell/*
c184142912cff04e5442d8bf70febe477285fb1cCraig McDonnell * Hypervisor service groups
c184142912cff04e5442d8bf70febe477285fb1cCraig McDonnell */
c184142912cff04e5442d8bf70febe477285fb1cCraig McDonnell#define HSVC_GROUP_SUN4V 0x0000
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster#define HSVC_GROUP_CORE 0x0001
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster#define HSVC_GROUP_INTR 0x0002
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster#define HSVC_GROUP_SOFT_STATE 0x0003
c184142912cff04e5442d8bf70febe477285fb1cCraig McDonnell#define HSVC_GROUP_TM 0x0080
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster#define HSVC_GROUP_VPCI 0x0100
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster#define HSVC_GROUP_LDC 0x0101
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster#define HSVC_GROUP_VSC 0x0102
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster#define HSVC_GROUP_NCS 0x0103
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster#define HSVC_GROUP_RNG 0x0104
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster#define HSVC_GROUP_NIAGARA_CPU 0x0200
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster#define HSVC_GROUP_FIRE_PERF 0x0201
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster#define HSVC_GROUP_NIAGARA2_CPU 0x0202
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster#define HSVC_GROUP_NIU 0x0204
0c893a059f84246bf91e2f0fbf63e4c92f8e5165Tony Bamford#define HSVC_GROUP_VFALLS_CPU 0x0205
0c893a059f84246bf91e2f0fbf63e4c92f8e5165Tony Bamford#define HSVC_GROUP_DIAG 0x0300
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster#ifndef _ASM
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster#include <sys/types.h>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster/*
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Hypervisor service negotiation data strcture
35ab1c5bca11317474fe12bdd8d22c17cdaf2697Robert Wapshott */
35ab1c5bca11317474fe12bdd8d22c17cdaf2697Robert Wapshottstruct hsvc_info {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster int hsvc_rev; /* data structure revision number */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster void *hsvc_private; /* reserved for the framework */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster uint64_t hsvc_group; /* hypervisor API group */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster uint64_t hsvc_major; /* API group major number */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster uint64_t hsvc_minor; /* API group minor number */
0c893a059f84246bf91e2f0fbf63e4c92f8e5165Tony Bamford char *hsvc_modname; /* module name */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster};
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fostertypedef struct hsvc_info hsvc_info_t;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster/*
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * hsvc_rev field
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
35ab1c5bca11317474fe12bdd8d22c17cdaf2697Robert Wapshott#define HSVC_REV_1 1
35ab1c5bca11317474fe12bdd8d22c17cdaf2697Robert Wapshott
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster/*
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * External interface
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
35ab1c5bca11317474fe12bdd8d22c17cdaf2697Robert Wapshottextern int hsvc_register(hsvc_info_t *hsvcreq, uint64_t *supported_minor);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterextern int hsvc_unregister(hsvc_info_t *hsvcreq);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterextern int hsvc_version(uint64_t hsvc_group, uint64_t *major, uint64_t *minor);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
35ab1c5bca11317474fe12bdd8d22c17cdaf2697Robert Wapshott#endif /* _ASM */
35ab1c5bca11317474fe12bdd8d22c17cdaf2697Robert Wapshott
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster#ifdef __cplusplus
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster}
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster#endif
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
0c893a059f84246bf91e2f0fbf63e4c92f8e5165Tony Bamford#endif /* _SYS_HSVC_H */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster