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