ReactOS  0.4.14-dev-606-g14ebc0b
cpu.c File Reference
#include <ntoskrnl.h>
#include <debug.h>
Include dependency graph for cpu.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

VOID NTAPI CPUID (IN ULONG CpuInfo[4], IN ULONG InfoType)
 
VOID WRMSR (IN ULONG Register, IN LONGLONG Value)
 
LONGLONG RDMSR (IN ULONG Register)
 
VOID NTAPI KiSetProcessorType (VOID)
 
ULONG NTAPI KiGetCpuVendor (VOID)
 
ULONG NTAPI KiGetFeatureBits (VOID)
 
VOID NTAPI KiGetCacheInformation (VOID)
 
VOID NTAPI KiSetCR0Bits (VOID)
 
VOID NTAPI KiInitializeTSS2 (IN PKTSS Tss, IN PKGDTENTRY TssEntry OPTIONAL)
 
VOID NTAPI KiInitializeTSS (IN PKTSS Tss)
 
VOID FASTCALL Ki386InitializeTss (IN PKTSS Tss, IN PKIDTENTRY Idt, IN PKGDTENTRY Gdt)
 
VOID NTAPI KeFlushCurrentTb (VOID)
 
VOID NTAPI KiSaveProcessorControlState (OUT PKPROCESSOR_STATE ProcessorState)
 
VOID NTAPI KiInitializeMachineType (VOID)
 
ULONG_PTR NTAPI KiLoadFastSyscallMachineSpecificRegisters (IN ULONG_PTR Context)
 
VOID NTAPI KiRestoreFastSyscallReturnState (VOID)
 
ULONG_PTR NTAPI Ki386EnableDE (IN ULONG_PTR Context)
 
ULONG_PTR NTAPI Ki386EnableFxsr (IN ULONG_PTR Context)
 
ULONG_PTR NTAPI Ki386EnableXMMIExceptions (IN ULONG_PTR Context)
 
VOID NTAPI KiI386PentiumLockErrataFixup (VOID)
 
NTSTATUS NTAPI KeSaveFloatingPointState (OUT PKFLOATING_SAVE Save)
 
NTSTATUS NTAPI KeRestoreFloatingPointState (IN PKFLOATING_SAVE Save)
 
ULONG NTAPI KeGetRecommendedSharedDataAlignment (VOID)
 
VOID NTAPI KeFlushEntireTb (IN BOOLEAN Invalid, IN BOOLEAN AllProcessors)
 
VOID NTAPI KeSetDmaIoCoherency (IN ULONG Coherency)
 
KAFFINITY NTAPI KeQueryActiveProcessors (VOID)
 
VOID __cdecl KeSaveStateForHibernate (IN PKPROCESSOR_STATE State)
 

Variables

ULONG KeLargestCacheLine = 0x40
 
ULONG KeDcacheFlushCount = 0
 
ULONG KeIcacheFlushCount = 0
 
ULONG KiDmaIoCoherency = 0
 
BOOLEAN KiSMTProcessorsPresent
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 12 of file cpu.c.

Function Documentation

◆ CPUID()

VOID NTAPI CPUID ( IN ULONG  CpuInfo[4],
IN ULONG  InfoType 
)

Definition at line 38 of file cpu.c.

40 {
41  RtlZeroMemory(CpuInfo, 4 * sizeof(ULONG));
42 }
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261

◆ KeFlushCurrentTb()

◆ KeFlushEntireTb()

VOID NTAPI KeFlushEntireTb ( IN BOOLEAN  Invalid,
IN BOOLEAN  AllProcessors 
)

Definition at line 215 of file cpu.c.

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 }
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
UCHAR KIRQL
Definition: env_spec_w32.h:591
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803
KIRQL NTAPI KeRaiseIrqlToSynchLevel(VOID)
Definition: pic.c:156

◆ KeGetRecommendedSharedDataAlignment()

ULONG NTAPI KeGetRecommendedSharedDataAlignment ( VOID  )

Definition at line 204 of file cpu.c.

205 {
206  /* Return the global variable */
207  return KeLargestCacheLine;
208 }
ULONG KeLargestCacheLine
Definition: cpu.c:32

◆ KeQueryActiveProcessors()

KAFFINITY NTAPI KeQueryActiveProcessors ( VOID  )

Definition at line 251 of file cpu.c.

252 {
253  PAGED_CODE();
254 
255  /* Simply return the number of active processors */
256  return KeActiveProcessors;
257 }
#define PAGED_CODE()
Definition: video.h:57
KAFFINITY KeActiveProcessors
Definition: krnlinit.c:23

◆ KeRestoreFloatingPointState()

NTSTATUS NTAPI KeRestoreFloatingPointState ( IN PKFLOATING_SAVE  Save)

Definition at line 194 of file cpu.c.

195 {
196  return STATUS_SUCCESS;
197 }
return STATUS_SUCCESS
Definition: btrfs.c:2938

◆ KeSaveFloatingPointState()

NTSTATUS NTAPI KeSaveFloatingPointState ( OUT PKFLOATING_SAVE  Save)

Definition at line 184 of file cpu.c.

185 {
186  return STATUS_SUCCESS;
187 }
return STATUS_SUCCESS
Definition: btrfs.c:2938

◆ KeSaveStateForHibernate()

VOID __cdecl KeSaveStateForHibernate ( IN PKPROCESSOR_STATE  State)

Definition at line 264 of file cpu.c.

265 {
266  /* Capture the context */
267  RtlCaptureContext(&State->ContextFrame);
268 
269  /* Capture the control state */
271 }
VOID NTAPI KiSaveProcessorControlState(OUT PKPROCESSOR_STATE ProcessorState)
Definition: cpu.c:372
NTSYSAPI VOID NTAPI RtlCaptureContext(_Out_ PCONTEXT ContextRecord)

◆ KeSetDmaIoCoherency()

VOID NTAPI KeSetDmaIoCoherency ( IN ULONG  Coherency)

Definition at line 240 of file cpu.c.

241 {
242  /* Save the coherency globally */
243  KiDmaIoCoherency = Coherency;
244 }
ULONG KiDmaIoCoherency
Definition: cpu.c:33

◆ Ki386EnableDE()

ULONG_PTR NTAPI Ki386EnableDE ( IN ULONG_PTR  Context)

Definition at line 148 of file cpu.c.

149 {
150  return 0;
151 }

Referenced by KiInitMachineDependent().

◆ Ki386EnableFxsr()

ULONG_PTR NTAPI Ki386EnableFxsr ( IN ULONG_PTR  Context)

Definition at line 155 of file cpu.c.

156 {
157  return 0;
158 }

Referenced by KiInitMachineDependent().

◆ Ki386EnableXMMIExceptions()

ULONG_PTR NTAPI Ki386EnableXMMIExceptions ( IN ULONG_PTR  Context)

Definition at line 162 of file cpu.c.

163 {
164  /* FIXME: Support this */
165  DPRINT1("Your machine supports XMMI exceptions but ReactOS doesn't\n");
166  return 0;
167 }
#define DPRINT1
Definition: precomp.h:8

Referenced by KiInitMachineDependent().

◆ Ki386InitializeTss()

VOID FASTCALL Ki386InitializeTss ( IN PKTSS  Tss,
IN PKIDTENTRY  Idt,
IN PKGDTENTRY  Gdt 
)

Definition at line 109 of file cpu.c.

112 {
113 }

Referenced by KiSystemStartup().

◆ KiGetCacheInformation()

VOID NTAPI KiGetCacheInformation ( VOID  )

Definition at line 84 of file cpu.c.

85 {
86 }

Referenced by KiSystemStartupBootStack().

◆ KiGetCpuVendor()

ULONG NTAPI KiGetCpuVendor ( VOID  )

Definition at line 68 of file cpu.c.

69 {
70  return 0;
71 }

◆ KiGetFeatureBits()

ULONG NTAPI KiGetFeatureBits ( VOID  )

Definition at line 75 of file cpu.c.

76 {
77  ULONG FeatureBits = 0;
78  /* Return the Feature Bits */
79  return FeatureBits;
80 }
unsigned int ULONG
Definition: retypes.h:1

◆ KiI386PentiumLockErrataFixup()

VOID NTAPI KiI386PentiumLockErrataFixup ( VOID  )

Definition at line 171 of file cpu.c.

172 {
173  /* FIXME: Support this */
174  DPRINT1("WARNING: Your machine has a CPU bug that ReactOS can't bypass!\n");
175 }
#define DPRINT1
Definition: precomp.h:8

Referenced by KiInitMachineDependent().

◆ KiInitializeMachineType()

VOID NTAPI KiInitializeMachineType ( VOID  )

Definition at line 129 of file cpu.c.

130 {
131 }

◆ KiInitializeTSS()

VOID NTAPI KiInitializeTSS ( IN PKTSS  Tss)

Definition at line 103 of file cpu.c.

104 {
105 }

◆ KiInitializeTSS2()

VOID NTAPI KiInitializeTSS2 ( IN PKTSS  Tss,
IN PKGDTENTRY TssEntry  OPTIONAL 
)

Definition at line 96 of file cpu.c.

98 {
99 }

◆ KiLoadFastSyscallMachineSpecificRegisters()

ULONG_PTR NTAPI KiLoadFastSyscallMachineSpecificRegisters ( IN ULONG_PTR  Context)

Definition at line 135 of file cpu.c.

136 {
137  return 0;
138 }

◆ KiRestoreFastSyscallReturnState()

VOID NTAPI KiRestoreFastSyscallReturnState ( VOID  )

Definition at line 142 of file cpu.c.

143 {
144 }

Referenced by KiInitMachineDependent().

◆ KiSaveProcessorControlState()

VOID NTAPI KiSaveProcessorControlState ( OUT PKPROCESSOR_STATE  ProcessorState)

Definition at line 123 of file cpu.c.

124 {
125 }

Referenced by KdpReport(), KeBugCheckWithTf(), KiInitializeKernel(), and KiSystemStartupBootStack().

◆ KiSetCR0Bits()

VOID NTAPI KiSetCR0Bits ( VOID  )

Definition at line 90 of file cpu.c.

91 {
92 }

Referenced by KiInitMachineDependent().

◆ KiSetProcessorType()

VOID NTAPI KiSetProcessorType ( VOID  )

Definition at line 62 of file cpu.c.

63 {
64 }

◆ RDMSR()

LONGLONG RDMSR ( IN ULONG  Register)

Definition at line 51 of file cpu.c.

52 {
53  LARGE_INTEGER LargeVal;
54  LargeVal.QuadPart = 0;
55  return LargeVal.QuadPart;
56 }
LONGLONG QuadPart
Definition: typedefs.h:112

◆ WRMSR()

VOID WRMSR ( IN ULONG  Register,
IN LONGLONG  Value 
)

Definition at line 45 of file cpu.c.

47 {
48 }

Variable Documentation

◆ KeDcacheFlushCount

ULONG KeDcacheFlushCount = 0

Definition at line 19 of file cpu.c.

◆ KeIcacheFlushCount

ULONG KeIcacheFlushCount = 0

Definition at line 20 of file cpu.c.

◆ KeLargestCacheLine

ULONG KeLargestCacheLine = 0x40

Definition at line 18 of file cpu.c.

◆ KiDmaIoCoherency

ULONG KiDmaIoCoherency = 0

Definition at line 21 of file cpu.c.

◆ KiSMTProcessorsPresent

BOOLEAN KiSMTProcessorsPresent

Definition at line 22 of file cpu.c.