Print this page
9927 refetch_read_once() would like a p please bob
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/intel/asm/cpu.h
+++ new/usr/src/uts/intel/asm/cpu.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 24 */
25 25
26 26 #ifndef _ASM_CPU_H
27 27 #define _ASM_CPU_H
28 28
29 29 #include <sys/ccompile.h>
30 30
31 31 #ifdef __cplusplus
32 32 extern "C" {
33 33 #endif
34 34
35 35 #if !defined(__lint) && defined(__GNUC__)
36 36
37 37 #if defined(__i386) || defined(__amd64)
38 38
39 39 extern __GNU_INLINE void
40 40 ht_pause(void)
41 41 {
42 42 __asm__ __volatile__(
43 43 "pause");
44 44 }
45 45
46 46 /*
47 47 * prefetch 64 bytes
48 48 *
49 49 * prefetch is an SSE extension which is not supported on
50 50 * older 32-bit processors, so define this as a no-op for now
51 51 */
52 52
53 53 extern __GNU_INLINE void
54 54 prefetch_read_many(void *addr)
55 55 {
↓ open down ↓ |
55 lines elided |
↑ open up ↑ |
56 56 #if defined(__amd64)
57 57 __asm__(
58 58 "prefetcht0 (%0);"
59 59 "prefetcht0 32(%0);"
60 60 : /* no output */
61 61 : "r" (addr));
62 62 #endif /* __amd64 */
63 63 }
64 64
65 65 extern __GNU_INLINE void
66 -refetch_read_once(void *addr)
66 +prefetch_read_once(void *addr)
67 67 {
68 68 #if defined(__amd64)
69 69 __asm__(
70 70 "prefetchnta (%0);"
71 71 "prefetchnta 32(%0);"
72 72 : /* no output */
73 73 : "r" (addr));
74 74 #endif /* __amd64 */
75 75 }
76 76
77 77 extern __GNU_INLINE void
78 78 prefetch_write_many(void *addr)
79 79 {
80 80 #if defined(__amd64)
81 81 __asm__(
82 82 "prefetcht0 (%0);"
83 83 "prefetcht0 32(%0);"
84 84 : /* no output */
85 85 : "r" (addr));
86 86 #endif /* __amd64 */
87 87 }
88 88
89 89 extern __GNU_INLINE void
90 90 prefetch_write_once(void *addr)
91 91 {
92 92 #if defined(__amd64)
93 93 __asm__(
94 94 "prefetcht0 (%0);"
95 95 "prefetcht0 32(%0);"
96 96 : /* no output */
97 97 : "r" (addr));
98 98 #endif /* __amd64 */
99 99 }
100 100
101 101 #if !defined(__xpv)
102 102
103 103 extern __GNU_INLINE void
104 104 cli(void)
105 105 {
106 106 __asm__ __volatile__(
107 107 "cli" : : : "memory");
108 108 }
109 109
110 110 extern __GNU_INLINE void
111 111 sti(void)
112 112 {
113 113 __asm__ __volatile__(
114 114 "sti");
115 115 }
116 116
117 117 extern __GNU_INLINE void
118 118 i86_halt(void)
119 119 {
120 120 __asm__ __volatile__(
121 121 "sti; hlt");
122 122 }
123 123
124 124 #endif /* !__xpv */
125 125
126 126 #endif /* __i386 || defined(__amd64) */
127 127
128 128 #if defined(__amd64)
129 129
130 130 extern __GNU_INLINE void
131 131 __set_ds(selector_t value)
132 132 {
133 133 __asm__ __volatile__(
134 134 "movw %0, %%ds"
135 135 : /* no output */
136 136 : "r" (value));
137 137 }
138 138
139 139 extern __GNU_INLINE void
140 140 __set_es(selector_t value)
141 141 {
142 142 __asm__ __volatile__(
143 143 "movw %0, %%es"
144 144 : /* no output */
145 145 : "r" (value));
146 146 }
147 147
148 148 extern __GNU_INLINE void
149 149 __set_fs(selector_t value)
150 150 {
151 151 __asm__ __volatile__(
152 152 "movw %0, %%fs"
153 153 : /* no output */
154 154 : "r" (value));
155 155 }
156 156
157 157 extern __GNU_INLINE void
158 158 __set_gs(selector_t value)
159 159 {
160 160 __asm__ __volatile__(
161 161 "movw %0, %%gs"
162 162 : /* no output */
163 163 : "r" (value));
164 164 }
165 165
166 166 #if !defined(__xpv)
167 167
168 168 extern __GNU_INLINE void
169 169 __swapgs(void)
170 170 {
171 171 __asm__ __volatile__(
172 172 "mfence; swapgs");
173 173 }
174 174
175 175 #endif /* !__xpv */
176 176
177 177 #endif /* __amd64 */
178 178
179 179 #endif /* !__lint && __GNUC__ */
180 180
181 181 #ifdef __cplusplus
182 182 }
183 183 #endif
184 184
185 185 #endif /* _ASM_CPU_H */
↓ open down ↓ |
109 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX