xref: /illumos-gate/usr/src/uts/sun4v/sys/hsvc.h (revision fc256490)
1c56c1e58Sgirish /*
2c56c1e58Sgirish  * CDDL HEADER START
3c56c1e58Sgirish  *
4c56c1e58Sgirish  * The contents of this file are subject to the terms of the
5c56c1e58Sgirish  * Common Development and Distribution License (the "License").
6c56c1e58Sgirish  * You may not use this file except in compliance with the License.
7c56c1e58Sgirish  *
8c56c1e58Sgirish  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9c56c1e58Sgirish  * or http://www.opensolaris.org/os/licensing.
10c56c1e58Sgirish  * See the License for the specific language governing permissions
11c56c1e58Sgirish  * and limitations under the License.
12c56c1e58Sgirish  *
13c56c1e58Sgirish  * When distributing Covered Code, include this CDDL HEADER in each
14c56c1e58Sgirish  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15c56c1e58Sgirish  * If applicable, add the following below this CDDL HEADER, with the
16c56c1e58Sgirish  * fields enclosed by brackets "[]" replaced with your own identifying
17c56c1e58Sgirish  * information: Portions Copyright [yyyy] [name of copyright owner]
18c56c1e58Sgirish  *
19c56c1e58Sgirish  * CDDL HEADER END
20c56c1e58Sgirish  */
21c56c1e58Sgirish /*
22*fc256490SJason Beloro  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
23c56c1e58Sgirish  * Use is subject to license terms.
24c56c1e58Sgirish  */
25c56c1e58Sgirish 
26c56c1e58Sgirish #ifndef _SYS_HSVC_H
27c56c1e58Sgirish #define	_SYS_HSVC_H
28c56c1e58Sgirish 
29c56c1e58Sgirish /*
30c56c1e58Sgirish  * Niagara services information
31c56c1e58Sgirish  */
32c56c1e58Sgirish 
33c56c1e58Sgirish #ifdef __cplusplus
34c56c1e58Sgirish extern "C" {
35c56c1e58Sgirish #endif
36c56c1e58Sgirish 
37c56c1e58Sgirish 
38c56c1e58Sgirish /*
39c56c1e58Sgirish  * Hypervisor service groups
40c56c1e58Sgirish  */
41c56c1e58Sgirish #define	HSVC_GROUP_SUN4V		0x0000
42c56c1e58Sgirish #define	HSVC_GROUP_CORE			0x0001
431ae08745Sheppo #define	HSVC_GROUP_INTR			0x0002
443b890a5bSjb #define	HSVC_GROUP_SOFT_STATE		0x0003
452f0fcb93SJason Beloro #define	HSVC_GROUP_TM			0x0080
46c56c1e58Sgirish #define	HSVC_GROUP_VPCI			0x0100
47c56c1e58Sgirish #define	HSVC_GROUP_LDC			0x0101
48c56c1e58Sgirish #define	HSVC_GROUP_VSC			0x0102
49c56c1e58Sgirish #define	HSVC_GROUP_NCS			0x0103
5044961713Sgirish #define	HSVC_GROUP_RNG			0x0104
514df55fdeSJanie Lu #define	HSVC_GROUP_PBOOT		0x0105
528d26100cSWyllys Ingersoll #define	HSVC_GROUP_TPM			0x0107
53*fc256490SJason Beloro #define	HSVC_GROUP_SDIO			0x0108
54*fc256490SJason Beloro #define	HSVC_GROUP_SDIO_ERR		0x0109
554df55fdeSJanie Lu #define	HSVC_GROUP_REBOOT_DATA		0x0110
56c56c1e58Sgirish #define	HSVC_GROUP_NIAGARA_CPU		0x0200
57c56c1e58Sgirish #define	HSVC_GROUP_FIRE_PERF		0x0201
5844961713Sgirish #define	HSVC_GROUP_NIAGARA2_CPU		0x0202
5944961713Sgirish #define	HSVC_GROUP_NIU			0x0204
6059ac0c16Sdavemq #define	HSVC_GROUP_VFALLS_CPU		0x0205
614df55fdeSJanie Lu #define	HSVC_GROUP_KT_CPU		0x0209
62c56c1e58Sgirish #define	HSVC_GROUP_DIAG			0x0300
63c56c1e58Sgirish 
64c56c1e58Sgirish #ifndef _ASM
65c56c1e58Sgirish 
66c56c1e58Sgirish #include <sys/types.h>
67c56c1e58Sgirish 
68c56c1e58Sgirish /*
69c56c1e58Sgirish  * Hypervisor service negotiation data strcture
70c56c1e58Sgirish  */
71c56c1e58Sgirish struct hsvc_info {
72c56c1e58Sgirish 	int		hsvc_rev;	/* data structure revision number */
73c56c1e58Sgirish 	void		*hsvc_private;	/* reserved for the framework */
74c56c1e58Sgirish 	uint64_t	hsvc_group;	/* hypervisor API group */
75c56c1e58Sgirish 	uint64_t	hsvc_major;	/* API group major number */
76c56c1e58Sgirish 	uint64_t	hsvc_minor;	/* API group minor number */
77c56c1e58Sgirish 	char		*hsvc_modname;	/* module name */
78c56c1e58Sgirish };
79c56c1e58Sgirish 
80c56c1e58Sgirish typedef struct hsvc_info hsvc_info_t;
81c56c1e58Sgirish 
82c56c1e58Sgirish /*
83c56c1e58Sgirish  * hsvc_rev field
84c56c1e58Sgirish  */
85c56c1e58Sgirish #define	HSVC_REV_1		1
86c56c1e58Sgirish 
87c56c1e58Sgirish /*
88c56c1e58Sgirish  * External interface
89c56c1e58Sgirish  */
90c56c1e58Sgirish extern int hsvc_register(hsvc_info_t *hsvcreq, uint64_t *supported_minor);
91c56c1e58Sgirish extern int hsvc_unregister(hsvc_info_t *hsvcreq);
92c56c1e58Sgirish extern int hsvc_version(uint64_t hsvc_group, uint64_t *major, uint64_t *minor);
93c56c1e58Sgirish 
94c56c1e58Sgirish #endif /* _ASM */
95c56c1e58Sgirish 
96c56c1e58Sgirish #ifdef __cplusplus
97c56c1e58Sgirish }
98c56c1e58Sgirish #endif
99c56c1e58Sgirish 
100c56c1e58Sgirish #endif /* _SYS_HSVC_H */
101