xref: /titanic_51/usr/src/uts/sun4v/cpu/mach_cpu_module.c (revision 7513a25aae149481ea80622aa04489964f00f979)
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 /*
23  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #pragma ident	"%Z%%M%	%I%	%E% SMI"
28 
29 #include <sys/cpu_module.h>
30 #include <vm/page.h>
31 #include <vm/seg_map.h>
32 
33 /*ARGSUSED*/
34 void
35 cpu_fiximp(struct cpu_node *cpunode)
36 {}
37 
38 /*ARGSUSED*/
39 void
40 cpu_map_exec_units(struct cpu *cp)
41 {}
42 
43 void
44 cpu_flush_ecache(void)
45 {}
46 
47 /*ARGSUSED*/
48 void
49 cpu_faulted_enter(struct cpu *cp)
50 {}
51 
52 /*ARGSUSED*/
53 void
54 cpu_faulted_exit(struct cpu *cp)
55 {}
56 
57 /*
58  * Ecache scrub operations
59  */
60 void
61 cpu_init_cache_scrub(void)
62 {}
63 
64 /* ARGSUSED */
65 void
66 prefetch_page_w(void *pp)
67 {
68 #define	ECACHE_SUBBLOCKS_PER_PAGE	2
69 #define	ECACHE_SUBBLOCK_SIZE_BYTES	64
70 #define	ECACHE_PAGE_BYTE_MAX	\
71 	(ECACHE_SUBBLOCKS_PER_PAGE*ECACHE_SUBBLOCK_SIZE_BYTES+1)
72 
73 	/*
74 	 * The following line is intended to cause an error
75 	 * whenever the sun4u page_t grows beyond 128
76 	 * bytes.
77 	 *
78 	 * If you get an error here, you'll need to change
79 	 * the 'prefetch_page_w' assembly language code
80 	 * (see also prefetch_page_w prologue comment)
81 	 */
82 	/*LINTED*/
83 	volatile int garbage[ECACHE_PAGE_BYTE_MAX - sizeof (page_t)];
84 }
85 
86 /* ARGSUSED */
87 void
88 prefetch_page_r(void *pp)
89 {
90 #define	ECACHE_SUBBLOCKS_PER_PAGE	2
91 #define	ECACHE_SUBBLOCK_SIZE_BYTES	64
92 #define	ECACHE_PAGE_BYTE_MAX	\
93 	(ECACHE_SUBBLOCKS_PER_PAGE*ECACHE_SUBBLOCK_SIZE_BYTES+1)
94 
95 	/*
96 	 * The following line is intended to cause an error
97 	 * whenever the sun4u page_t grows beyond 128
98 	 * bytes.
99 	 *
100 	 * If you get an error here, you'll need to change
101 	 * the 'prefetch_page_r' assembly language code
102 	 * (see also prefetch_page_w prologue comment)
103 	 */
104 	/*LINTED*/
105 	volatile int garbage[ECACHE_PAGE_BYTE_MAX - sizeof (page_t)];
106 }
107 
108 
109 #ifdef	SEGKPM_SUPPORT
110 #define	SMAP_SIZE	80
111 #else
112 #define	SMAP_SIZE	56
113 #endif
114 
115 /* ARGSUSED */
116 void
117 prefetch_smap_w(void *smp)
118 {
119 
120 	/*
121 	 * The following lines are intended to cause an error
122 	 * whenever the smap object size changes from the current
123 	 * size of 48 bytes.  If you get an error here, you'll
124 	 * need to update the code in the 'prefetch_smap_w' assembly
125 	 * language code.
126 	 */
127 	/*LINTED*/
128 	volatile int smap_size_changed [SMAP_SIZE - sizeof (struct smap) + 1];
129 	volatile int smap_size_changed2 [sizeof (struct smap) - SMAP_SIZE + 1];
130 }
131 
132 void
133 kdi_flush_caches(void)
134 {}
135 
136 /*ARGSUSED*/
137 int
138 kzero(void *addr, size_t count)
139 { return (0); }
140 
141 /*ARGSUSED*/
142 void
143 uzero(void *addr, size_t count)
144 {}
145 
146 /*ARGSUSED*/
147 void
148 bzero(void *addr, size_t count)
149 {}
150 
151 /*ARGSUSED*/
152 void
153 cpu_inv_tsb(caddr_t tsb_base, uint_t tsb_bytes)
154 {}
155 
156 void
157 fp_zero(void)
158 {}
159