xref: /titanic_53/usr/src/uts/sun4v/sys/hsvc.h (revision 125be069be21bcb7b94bd4525c19eb424bc56276)
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*125be069SJason Beloro  * Copyright 2009 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
443b890a5bSjb145095 #define	HSVC_GROUP_SOFT_STATE		0x0003
452f0fcb93SJason Beloro #define	HSVC_GROUP_MEM_IFLUSH		0x0010
462f0fcb93SJason Beloro #define	HSVC_GROUP_TM			0x0080
47c56c1e58Sgirish #define	HSVC_GROUP_VPCI			0x0100
48c56c1e58Sgirish #define	HSVC_GROUP_LDC			0x0101
49c56c1e58Sgirish #define	HSVC_GROUP_VSC			0x0102
50c56c1e58Sgirish #define	HSVC_GROUP_NCS			0x0103
5144961713Sgirish #define	HSVC_GROUP_RNG			0x0104
52c56c1e58Sgirish #define	HSVC_GROUP_NIAGARA_CPU		0x0200
53c56c1e58Sgirish #define	HSVC_GROUP_FIRE_PERF		0x0201
5444961713Sgirish #define	HSVC_GROUP_NIAGARA2_CPU		0x0202
5544961713Sgirish #define	HSVC_GROUP_NIU			0x0204
5659ac0c16Sdavemq #define	HSVC_GROUP_VFALLS_CPU		0x0205
572f0fcb93SJason Beloro #define	HSVC_GROUP_RKPERF		0x0206
58*125be069SJason Beloro #define	HSVC_GROUP_RKMMU_EXT		0x0207
59*125be069SJason Beloro #define	HSVC_GROUP_RKCPU		0x0208
60c56c1e58Sgirish #define	HSVC_GROUP_DIAG			0x0300
61c56c1e58Sgirish 
62c56c1e58Sgirish #ifndef _ASM
63c56c1e58Sgirish 
64c56c1e58Sgirish #include <sys/types.h>
65c56c1e58Sgirish 
66c56c1e58Sgirish /*
67c56c1e58Sgirish  * Hypervisor service negotiation data strcture
68c56c1e58Sgirish  */
69c56c1e58Sgirish struct hsvc_info {
70c56c1e58Sgirish 	int		hsvc_rev;	/* data structure revision number */
71c56c1e58Sgirish 	void		*hsvc_private;	/* reserved for the framework */
72c56c1e58Sgirish 	uint64_t	hsvc_group;	/* hypervisor API group */
73c56c1e58Sgirish 	uint64_t	hsvc_major;	/* API group major number */
74c56c1e58Sgirish 	uint64_t	hsvc_minor;	/* API group minor number */
75c56c1e58Sgirish 	char		*hsvc_modname;	/* module name */
76c56c1e58Sgirish };
77c56c1e58Sgirish 
78c56c1e58Sgirish typedef struct hsvc_info hsvc_info_t;
79c56c1e58Sgirish 
80c56c1e58Sgirish /*
81c56c1e58Sgirish  * hsvc_rev field
82c56c1e58Sgirish  */
83c56c1e58Sgirish #define	HSVC_REV_1		1
84c56c1e58Sgirish 
852f0fcb93SJason Beloro extern	int	hsvc_kdi_mem_iflush_negotiated;
862f0fcb93SJason Beloro 
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