ReactOS 0.4.15-dev-8127-g6338913
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 KiFlushSingleTb (IN BOOLEAN Invalid, IN PVOID Virtual)
 
VOID KeFlushTb (VOID)
 
VOID NTAPI KeFlushCurrentTb (VOID)
 
VOID FASTCALL KeZeroPages (IN PVOID Address, IN ULONG Size)
 
VOID NTAPI KiSaveProcessorControlState (OUT PKPROCESSOR_STATE ProcessorState)
 
VOID NTAPI KiRestoreProcessorControlState (PKPROCESSOR_STATE ProcessorState)
 
BOOLEAN NTAPI KeInvalidateAllCaches (VOID)
 
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)
 
VOID NTAPI KeFlushIoBuffers (_In_ PMDL Mdl, _In_ BOOLEAN ReadOperation, _In_ BOOLEAN DmaOperation)
 
NTSTATUS NTAPI NtVdmControl (IN ULONG ControlCode, IN PVOID ControlData)
 
NTSTATUS NTAPI NtSetLdtEntries (IN ULONG Selector1, IN LDT_ENTRY LdtEntry1, IN ULONG Selector2, IN LDT_ENTRY LdtEntry2)
 

Variables

ULONG KeFixedTbEntries
 
ULONG KiDmaIoCoherency
 
ULONG KeIcacheFlushCount = 0
 
ULONG KeDcacheFlushCount
 
ULONG KeLargestCacheLine = 64
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 12 of file cpu.c.

Function Documentation

◆ KeFlushCurrentTb()

VOID NTAPI KeFlushCurrentTb ( VOID  )

Definition at line 46 of file cpu.c.

47{
48 //
49 // Rename?
50 //
51 KeFlushTb();
52}
VOID KeFlushTb(VOID)
Definition: cpu.c:36

◆ KeFlushEntireTb()

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

Definition at line 122 of file cpu.c.

124{
126
127 //
128 // Raise the IRQL for the TB Flush
129 //
131
132 //
133 // Flush the TB for the Current CPU
134 //
136
137 //
138 // Return to Original IRQL
139 //
141}
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
KIRQL NTAPI KeRaiseIrqlToSynchLevel(VOID)
Definition: pic.c:156
VOID NTAPI KeFlushCurrentTb(VOID)
Definition: cpu.c:526
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:778

◆ KeFlushIoBuffers()

VOID NTAPI KeFlushIoBuffers ( _In_ PMDL  Mdl,
_In_ BOOLEAN  ReadOperation,
_In_ BOOLEAN  DmaOperation 
)

Definition at line 191 of file cpu.c.

195{
197}
NTSYSAPI void WINAPI DbgBreakPoint(void)

◆ KeFlushTb()

VOID KeFlushTb ( VOID  )

Definition at line 36 of file cpu.c.

37{
38 //
39 // Flush the entire TLB
40 //
42}
FORCEINLINE VOID KeArmFlushTlb(VOID)
Definition: intrin_i.h:175

Referenced by KeFlushCurrentTb(), and KiInitializeSystem().

◆ KeGetRecommendedSharedDataAlignment()

ULONG NTAPI KeGetRecommendedSharedDataAlignment ( VOID  )

Definition at line 111 of file cpu.c.

112{
113 /* Return the global variable */
114 return KeLargestCacheLine;
115}
ULONG KeLargestCacheLine
Definition: cpu.c:28

◆ KeInvalidateAllCaches()

BOOLEAN NTAPI KeInvalidateAllCaches ( VOID  )

Definition at line 94 of file cpu.c.

95{
96 //
97 // Invalidate D cache and I cache
98 //
100 return TRUE;
101}
FORCEINLINE VOID KeArmInvalidateAllCaches(VOID)
Definition: intrin_i.h:195
#define TRUE
Definition: types.h:120

◆ KeQueryActiveProcessors()

KAFFINITY NTAPI KeQueryActiveProcessors ( VOID  )

Definition at line 161 of file cpu.c.

162{
163 PAGED_CODE();
164
165 //
166 // Simply return the number of active processors
167 //
168 return KeActiveProcessors;
169}
#define PAGED_CODE()
KAFFINITY KeActiveProcessors
Definition: krnlinit.c:23

◆ KeSaveStateForHibernate()

VOID __cdecl KeSaveStateForHibernate ( IN PKPROCESSOR_STATE  State)

Definition at line 176 of file cpu.c.

177{
178 //
179 // Capture the context
180 //
181 RtlCaptureContext(&State->ContextFrame);
182
183 //
184 // Capture the control state
185 //
187}
NTSYSAPI VOID NTAPI RtlCaptureContext(_Out_ PCONTEXT ContextRecord)
VOID NTAPI KiSaveProcessorControlState(OUT PKPROCESSOR_STATE ProcessorState)
Definition: cpu.c:576

◆ KeSetDmaIoCoherency()

VOID NTAPI KeSetDmaIoCoherency ( IN ULONG  Coherency)

Definition at line 148 of file cpu.c.

149{
150 //
151 // Save the coherency globally
152 //
153 KiDmaIoCoherency = Coherency;
154}
ULONG KiDmaIoCoherency
Definition: cpu.c:29

◆ KeZeroPages()

VOID FASTCALL KeZeroPages ( IN PVOID  Address,
IN ULONG  Size 
)

Definition at line 56 of file cpu.c.

58{
59 /* Not using XMMI in this routine */
61}
static WCHAR Address[46]
Definition: ping.c:68
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533

Referenced by MiSessionInitializeWorkingSetList(), MiZeroPfn(), MiZeroPhysicalPage(), and MmZeroPageThread().

◆ KiFlushSingleTb()

VOID KiFlushSingleTb ( IN BOOLEAN  Invalid,
IN PVOID  Virtual 
)

Definition at line 26 of file cpu.c.

28{
29 //
30 // Just invalidate it
31 //
33}
FORCEINLINE VOID KeArmInvalidateTlbEntry(IN PVOID Address)
Definition: intrin_i.h:185

◆ KiRestoreProcessorControlState()

VOID NTAPI KiRestoreProcessorControlState ( PKPROCESSOR_STATE  ProcessorState)

Definition at line 81 of file cpu.c.

82{
84#if 0
85 KeArmControlRegisterSet(ProcessorState->SpecialRegisters.ControlRegister);
86 KeArmLockdownRegisterSet(ProcessorState->SpecialRegisters.LockdownRegister);
87 KeArmCacheRegisterSet(ProcessorState->SpecialRegisters.CacheRegister);
88 KeArmStatusRegisterSet(ProcessorState->SpecialRegisters.StatusRegister);
89#endif
90}
FORCEINLINE VOID KeArmControlRegisterSet(IN ARM_CONTROL_REGISTER ControlRegister)
Definition: intrin_i.h:135
FORCEINLINE VOID KeArmLockdownRegisterSet(IN ARM_LOCKDOWN_REGISTER LockdownRegister)
Definition: intrin_i.h:165
void __cdecl __debugbreak(void)
Definition: intrin_ppc.h:698
KSPECIAL_REGISTERS SpecialRegisters
Definition: ketypes.h:615

◆ KiSaveProcessorControlState()

VOID NTAPI KiSaveProcessorControlState ( OUT PKPROCESSOR_STATE  ProcessorState)

Definition at line 65 of file cpu.c.

66{
67 //
68 // Save some critical stuff we use
69 //
71#if 0
72 ProcessorState->SpecialRegisters.ControlRegister = KeArmControlRegisterGet();
73 ProcessorState->SpecialRegisters.LockdownRegister = KeArmLockdownRegisterGet();
74 ProcessorState->SpecialRegisters.CacheRegister = KeArmCacheRegisterGet();
75 ProcessorState->SpecialRegisters.StatusRegister = KeArmStatusRegisterGet();
76#endif
77}
FORCEINLINE ARM_LOCKDOWN_REGISTER KeArmLockdownRegisterGet(VOID)
Definition: intrin_i.h:83
FORCEINLINE ARM_CACHE_REGISTER KeArmCacheRegisterGet(VOID)
Definition: intrin_i.h:109
FORCEINLINE ARM_CONTROL_REGISTER KeArmControlRegisterGet(VOID)
Definition: intrin_i.h:18
FORCEINLINE ARM_STATUS_REGISTER KeArmStatusRegisterGet(VOID)
Definition: intrin_i.h:122

◆ NtSetLdtEntries()

NTSTATUS NTAPI NtSetLdtEntries ( IN ULONG  Selector1,
IN LDT_ENTRY  LdtEntry1,
IN ULONG  Selector2,
IN LDT_ENTRY  LdtEntry2 
)

Definition at line 217 of file cpu.c.

221{
222 //
223 // Does not exist on ARM
224 //
226}
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:239

◆ NtVdmControl()

NTSTATUS NTAPI NtVdmControl ( IN ULONG  ControlCode,
IN PVOID  ControlData 
)

Definition at line 206 of file cpu.c.

208{
209 //
210 // Does not exist on ARM
211 //
213}

Variable Documentation

◆ KeDcacheFlushCount

ULONG KeDcacheFlushCount

Definition at line 20 of file cpu.c.

◆ KeFixedTbEntries

ULONG KeFixedTbEntries

Definition at line 17 of file cpu.c.

◆ KeIcacheFlushCount

ULONG KeIcacheFlushCount = 0

Definition at line 19 of file cpu.c.

◆ KeLargestCacheLine

ULONG KeLargestCacheLine = 64

Definition at line 21 of file cpu.c.

◆ KiDmaIoCoherency

ULONG KiDmaIoCoherency

Definition at line 18 of file cpu.c.