[STORPORT] Fix x64 build
[reactos.git] / ntoskrnl / ke / powerpc / cpu.c
1 /*
2 * PROJECT: ReactOS Kernel
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: ntoskrnl/ke/powerpc/cpu.c
5 * PURPOSE: Routines for CPU-level support
6 * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
7 */
8
9 /* INCLUDES *****************************************************************/
10
11 #include <ntoskrnl.h>
12 #define NDEBUG
13 #include <debug.h>
14
15 /* GLOBALS *******************************************************************/
16
17 /* CPU Features and Flags */
18 ULONG KeLargestCacheLine = 0x40;
19 ULONG KeDcacheFlushCount = 0;
20 ULONG KeIcacheFlushCount = 0;
21 ULONG KiDmaIoCoherency = 0;
22 BOOLEAN KiSMTProcessorsPresent;
23
24 /* CPU Signatures */
25 #if 0
26 CHAR CmpIntelID[] = "GenuineIntel";
27 CHAR CmpAmdID[] = "AuthenticAMD";
28 CHAR CmpCyrixID[] = "CyrixInstead";
29 CHAR CmpTransmetaID[] = "GenuineTMx86";
30 CHAR CmpCentaurID[] = "CentaurHauls";
31 CHAR CmpRiseID[] = "RiseRiseRise";
32 #endif
33
34 /* SUPPORT ROUTINES FOR MSVC COMPATIBILITY ***********************************/
35
36 VOID
37 NTAPI
38 CPUID(IN ULONG CpuInfo[4],
39 IN ULONG InfoType)
40 {
41 RtlZeroMemory(CpuInfo, 4 * sizeof(ULONG));
42 }
43
44 VOID
45 WRMSR(IN ULONG Register,
46 IN LONGLONG Value)
47 {
48 }
49
50 LONGLONG
51 RDMSR(IN ULONG Register)
52 {
53 LARGE_INTEGER LargeVal;
54 LargeVal.QuadPart = 0;
55 return LargeVal.QuadPart;
56 }
57
58 /* FUNCTIONS *****************************************************************/
59
60 VOID
61 NTAPI
62 KiSetProcessorType(VOID)
63 {
64 }
65
66 ULONG
67 NTAPI
68 KiGetCpuVendor(VOID)
69 {
70 return 0;
71 }
72
73 ULONG
74 NTAPI
75 KiGetFeatureBits(VOID)
76 {
77 ULONG FeatureBits = 0;
78 /* Return the Feature Bits */
79 return FeatureBits;
80 }
81
82 VOID
83 NTAPI
84 KiGetCacheInformation(VOID)
85 {
86 }
87
88 VOID
89 NTAPI
90 KiSetCR0Bits(VOID)
91 {
92 }
93
94 VOID
95 NTAPI
96 KiInitializeTSS2(IN PKTSS Tss,
97 IN PKGDTENTRY TssEntry OPTIONAL)
98 {
99 }
100
101 VOID
102 NTAPI
103 KiInitializeTSS(IN PKTSS Tss)
104 {
105 }
106
107 VOID
108 FASTCALL
109 Ki386InitializeTss(IN PKTSS Tss,
110 IN PKIDTENTRY Idt,
111 IN PKGDTENTRY Gdt)
112 {
113 }
114
115 VOID
116 NTAPI
117 KeFlushCurrentTb(VOID)
118 {
119 }
120
121 VOID
122 NTAPI
123 KiSaveProcessorControlState(OUT PKPROCESSOR_STATE ProcessorState)
124 {
125 }
126
127 VOID
128 NTAPI
129 KiInitializeMachineType(VOID)
130 {
131 }
132
133 ULONG_PTR
134 NTAPI
135 KiLoadFastSyscallMachineSpecificRegisters(IN ULONG_PTR Context)
136 {
137 return 0;
138 }
139
140 VOID
141 NTAPI
142 KiRestoreFastSyscallReturnState(VOID)
143 {
144 }
145
146 ULONG_PTR
147 NTAPI
148 Ki386EnableDE(IN ULONG_PTR Context)
149 {
150 return 0;
151 }
152
153 ULONG_PTR
154 NTAPI
155 Ki386EnableFxsr(IN ULONG_PTR Context)
156 {
157 return 0;
158 }
159
160 ULONG_PTR
161 NTAPI
162 Ki386EnableXMMIExceptions(IN ULONG_PTR Context)
163 {
164 /* FIXME: Support this */
165 DPRINT1("Your machine supports XMMI exceptions but ReactOS doesn't\n");
166 return 0;
167 }
168
169 VOID
170 NTAPI
171 KiI386PentiumLockErrataFixup(VOID)
172 {
173 /* FIXME: Support this */
174 DPRINT1("WARNING: Your machine has a CPU bug that ReactOS can't bypass!\n");
175 }
176
177 /* PUBLIC FUNCTIONS **********************************************************/
178
179 /*
180 * @implemented
181 */
182 NTSTATUS
183 NTAPI
184 KeSaveFloatingPointState(OUT PKFLOATING_SAVE Save)
185 {
186 return STATUS_SUCCESS;
187 }
188
189 /*
190 * @implemented
191 */
192 NTSTATUS
193 NTAPI
194 KeRestoreFloatingPointState(IN PKFLOATING_SAVE Save)
195 {
196 return STATUS_SUCCESS;
197 }
198
199 /*
200 * @implemented
201 */
202 ULONG
203 NTAPI
204 KeGetRecommendedSharedDataAlignment(VOID)
205 {
206 /* Return the global variable */
207 return KeLargestCacheLine;
208 }
209
210 /*
211 * @implemented
212 */
213 VOID
214 NTAPI
215 KeFlushEntireTb(IN BOOLEAN Invalid,
216 IN BOOLEAN AllProcessors)
217 {
218 KIRQL OldIrql;
219
220 /* Raise the IRQL for the TB Flush */
221 OldIrql = KeRaiseIrqlToSynchLevel();
222
223 #ifdef CONFIG_SMP
224 /* FIXME: Support IPI Flush */
225 #error Not yet implemented!
226 #endif
227
228 /* Flush the TB for the Current CPU */
229 //KeFlushCurrentTb();
230
231 /* Return to Original IRQL */
232 KeLowerIrql(OldIrql);
233 }
234
235 /*
236 * @implemented
237 */
238 VOID
239 NTAPI
240 KeSetDmaIoCoherency(IN ULONG Coherency)
241 {
242 /* Save the coherency globally */
243 KiDmaIoCoherency = Coherency;
244 }
245
246 /*
247 * @implemented
248 */
249 KAFFINITY
250 NTAPI
251 KeQueryActiveProcessors(VOID)
252 {
253 PAGED_CODE();
254
255 /* Simply return the number of active processors */
256 return KeActiveProcessors;
257 }
258
259 /*
260 * @implemented
261 */
262 VOID
263 __cdecl
264 KeSaveStateForHibernate(IN PKPROCESSOR_STATE State)
265 {
266 /* Capture the context */
267 RtlCaptureContext(&State->ContextFrame);
268
269 /* Capture the control state */
270 KiSaveProcessorControlState(State);
271 }