xref: /titanic_51/usr/src/uts/sun4/sys/vis.h (revision 1e49577a7fcde812700ded04431b49d67cc57d6d)
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, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 1997-2002 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _SYS_VIS_H
28 #define	_SYS_VIS_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 /*
37  * This file is cpu dependent.
38  */
39 
40 #ifdef _KERNEL
41 
42 #include <sys/asi.h>
43 #include <sys/machparam.h>
44 
45 #ifdef _ASM
46 
47 #define	BSTORE_FPREGS(FP, TEMP) \
48 	membar	#Sync; \
49 	stda	%d0, [FP]ASI_BLK_P; \
50 	add	FP, 64, TEMP; \
51 	stda	%d16, [TEMP]ASI_BLK_P; \
52 	add	FP, 128, TEMP; \
53 	stda	%d32, [TEMP]ASI_BLK_P; \
54 	add	FP, 192, TEMP; \
55 	stda	%d48, [TEMP]ASI_BLK_P; \
56 	membar	#Sync;
57 
58 #define	BSTORE_V8_FPREGS(FP, TEMP) \
59 	membar	#Sync; \
60 	stda	%d0, [FP]ASI_BLK_P; \
61 	add	FP, 64, TEMP; \
62 	stda	%d16, [TEMP]ASI_BLK_P; \
63 	membar	#Sync;
64 
65 #define	BSTORE_V8P_FPREGS(FP, TEMP) \
66 	membar	#Sync; \
67 	add	FP, 128, TEMP; \
68 	stda	%d32, [TEMP]ASI_BLK_P; \
69 	add	FP, 192, TEMP; \
70 	stda	%d48, [TEMP]ASI_BLK_P; \
71 	membar	#Sync;
72 
73 #define	BLOAD_FPREGS(FP, TEMP) \
74 	membar	#Sync; \
75 	ldda	[FP]ASI_BLK_P, %d0; \
76 	add	FP, 64, TEMP; \
77 	ldda	[TEMP]ASI_BLK_P, %d16; \
78 	add	FP, 128, TEMP; \
79 	ldda	[TEMP]ASI_BLK_P, %d32; \
80 	add	FP, 192, TEMP; \
81 	ldda	[TEMP]ASI_BLK_P, %d48; \
82 	membar	#Sync;
83 
84 #define	BLOAD_V8_FPREGS(FP, TEMP) \
85 	membar	#Sync; \
86 	ldda	[FP]ASI_BLK_P, %d0; \
87 	add	FP, 64, TEMP; \
88 	ldda	[TEMP]ASI_BLK_P, %d16; \
89 	membar	#Sync;
90 
91 #define	BLOAD_V8P_FPREGS(FP, TEMP) \
92 	membar	#Sync; \
93 	add	FP, 128, TEMP; \
94 	ldda	[TEMP]ASI_BLK_P, %d32; \
95 	add	FP, 192, TEMP; \
96 	ldda	[TEMP]ASI_BLK_P, %d48; \
97 	membar	#Sync;
98 
99 #endif
100 
101 #define	GSR_SIZE 8	/* Graphics Status Register size 64 bits */
102 
103 #endif /* _KERNEL */
104 
105 #ifdef	__cplusplus
106 }
107 #endif
108 
109 #endif	/* _SYS_VIS_H */
110