ReactOS  0.4.14-dev-57-g333b8f1
cpu.c
Go to the documentation of this file.
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 */
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,
47 {
48 }
49 
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
63 {
64 }
65 
66 ULONG
67 NTAPI
69 {
70  return 0;
71 }
72 
73 ULONG
74 NTAPI
76 {
77  ULONG FeatureBits = 0;
78  /* Return the Feature Bits */
79  return FeatureBits;
80 }
81 
82 VOID
83 NTAPI
85 {
86 }
87 
88 VOID
89 NTAPI
91 {
92 }
93 
94 VOID
95 NTAPI
97  IN PKGDTENTRY TssEntry OPTIONAL)
98 {
99 }
100 
101 VOID
102 NTAPI
104 {
105 }
106 
107 VOID
108 FASTCALL
110  IN PKIDTENTRY Idt,
111  IN PKGDTENTRY Gdt)
112 {
113 }
114 
115 VOID
116 NTAPI
118 {
119 }
120 
121 VOID
122 NTAPI
124 {
125 }
126 
127 VOID
128 NTAPI
130 {
131 }
132 
133 ULONG_PTR
134 NTAPI
136 {
137  return 0;
138 }
139 
140 VOID
141 NTAPI
143 {
144 }
145 
146 ULONG_PTR
147 NTAPI
149 {
150  return 0;
151 }
152 
153 ULONG_PTR
154 NTAPI
156 {
157  return 0;
158 }
159 
160 ULONG_PTR
161 NTAPI
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
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
185 {
186  return STATUS_SUCCESS;
187 }
188 
189 /*
190  * @implemented
191  */
192 NTSTATUS
193 NTAPI
195 {
196  return STATUS_SUCCESS;
197 }
198 
199 /*
200  * @implemented
201  */
202 ULONG
203 NTAPI
205 {
206  /* Return the global variable */
207  return KeLargestCacheLine;
208 }
209 
210 /*
211  * @implemented
212  */
213 VOID
214 NTAPI
216  IN BOOLEAN AllProcessors)
217 {
218  KIRQL OldIrql;
219 
220  /* Raise the IRQL for the TB Flush */
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 */
233 }
234 
235 /*
236  * @implemented
237  */
238 VOID
239 NTAPI
241 {
242  /* Save the coherency globally */
243  KiDmaIoCoherency = Coherency;
244 }
245 
246 /*
247  * @implemented
248  */
249 KAFFINITY
250 NTAPI
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
265 {
266  /* Capture the context */
267  RtlCaptureContext(&State->ContextFrame);
268 
269  /* Capture the control state */
271 }
static const CHAR CmpRiseID[]
Definition: cpu.c:49
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
#define IN
Definition: typedefs.h:38
VOID NTAPI KiGetCacheInformation(VOID)
Definition: cpu.c:214
VOID NTAPI KiSaveProcessorControlState(OUT PKPROCESSOR_STATE ProcessorState)
Definition: cpu.c:372
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
static const CHAR CmpAmdID[]
Definition: cpu.c:45
#define __cdecl
Definition: accygwin.h:79
INIT_FUNCTION VOID NTAPI KiI386PentiumLockErrataFixup(VOID)
Definition: cpu.c:1088
static const CHAR CmpCyrixID[]
Definition: cpu.c:46
INIT_FUNCTION ULONG_PTR NTAPI Ki386EnableFxsr(IN ULONG_PTR Context)
Definition: cpu.c:1055
static const CHAR CmpCentaurID[]
Definition: cpu.c:48
char CHAR
Definition: xmlstorage.h:175
VOID NTAPI KiSetProcessorType(VOID)
Definition: cpu.c:55
LONG NTSTATUS
Definition: precomp.h:26
NTSYSAPI VOID NTAPI RtlCaptureContext(_Out_ PCONTEXT ContextRecord)
#define FASTCALL
Definition: nt_native.h:50
ULONG KeIcacheFlushCount
Definition: cpu.c:19
#define PAGED_CODE()
Definition: video.h:57
ULONG NTAPI KeGetRecommendedSharedDataAlignment(VOID)
Definition: cpu.c:471
uint32_t ULONG_PTR
Definition: typedefs.h:63
ULONG NTAPI KiGetCpuVendor(VOID)
Definition: cpu.c:85
INIT_FUNCTION VOID NTAPI KiInitializeTSS2(IN PKTSS Tss, IN PKGDTENTRY TssEntry OPTIONAL)
Definition: cpu.c:745
UCHAR KIRQL
Definition: env_spec_w32.h:591
VOID WRMSR(IN ULONG Register, IN LONGLONG Value)
Definition: cpu.c:45
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
VOID NTAPI KeFlushCurrentTb(VOID)
Definition: cpu.c:322
LONGLONG RDMSR(IN ULONG Register)
Definition: cpu.c:51
static int Save(const char **args)
Definition: vfdcmd.c:1851
unsigned char BOOLEAN
VOID NTAPI KiInitializeTSS(IN PKTSS Tss)
Definition: cpu.c:783
NTSTATUS NTAPI KeRestoreFloatingPointState(IN PKFLOATING_SAVE Save)
Definition: cpu.c:1399
Definition: ketypes.h:789
ULONG KiDmaIoCoherency
Definition: cpu.c:33
VOID NTAPI KeFlushEntireTb(IN BOOLEAN Invalid, IN BOOLEAN AllProcessors)
Definition: cpu.c:413
int64_t LONGLONG
Definition: typedefs.h:66
INIT_FUNCTION VOID FASTCALL Ki386InitializeTss(IN PKTSS Tss, IN PKIDTENTRY Idt, IN PKGDTENTRY Gdt)
Definition: cpu.c:799
VOID __cdecl KeSaveStateForHibernate(IN PKPROCESSOR_STATE State)
Definition: cpu.c:482
KAFFINITY NTAPI KeQueryActiveProcessors(VOID)
Definition: cpu.c:433
INIT_FUNCTION ULONG_PTR NTAPI Ki386EnableXMMIExceptions(IN ULONG_PTR Context)
Definition: cpu.c:1065
VOID NTAPI CPUID(IN ULONG CpuInfo[4], IN ULONG InfoType)
Definition: cpu.c:38
INIT_FUNCTION VOID NTAPI KiInitializeMachineType(VOID)
Definition: cpu.c:988
ULONG NTAPI KiGetFeatureBits(VOID)
Definition: cpu.c:125
static const CHAR CmpTransmetaID[]
Definition: cpu.c:47
INIT_FUNCTION ULONG_PTR NTAPI KiLoadFastSyscallMachineSpecificRegisters(IN ULONG_PTR Context)
Definition: cpu.c:997
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803
KAFFINITY KeActiveProcessors
Definition: krnlinit.c:23
NTSTATUS NTAPI KeSaveFloatingPointState(OUT PKFLOATING_SAVE Save)
Definition: cpu.c:1367
static const CHAR CmpIntelID[]
Definition: cpu.c:44
ULONG KeDcacheFlushCount
Definition: cpu.c:20
VOID NTAPI KeSetDmaIoCoherency(IN ULONG Coherency)
Definition: cpu.c:496
ULONG_PTR KAFFINITY
Definition: compat.h:75
INIT_FUNCTION VOID NTAPI KiSetCR0Bits(VOID)
Definition: cpu.c:728
INIT_FUNCTION VOID NTAPI KiRestoreFastSyscallReturnState(VOID)
Definition: cpu.c:1011
#define DPRINT1
Definition: precomp.h:8
INIT_FUNCTION ULONG_PTR NTAPI Ki386EnableDE(IN ULONG_PTR Context)
Definition: cpu.c:1045
#define OUT
Definition: typedefs.h:39
unsigned int ULONG
Definition: retypes.h:1
ULONG KeLargestCacheLine
Definition: cpu.c:32
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
return STATUS_SUCCESS
Definition: btrfs.c:2966
BOOLEAN KiSMTProcessorsPresent
Definition: cpu.c:34
LONGLONG QuadPart
Definition: typedefs.h:112
KIRQL NTAPI KeRaiseIrqlToSynchLevel(VOID)
Definition: pic.c:156
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68