ReactOS  0.4.13-dev-563-g0561610
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 {
125  KIRQL OldIrql;
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 }
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
UCHAR KIRQL
Definition: env_spec_w32.h:591
VOID NTAPI KeFlushCurrentTb(VOID)
Definition: cpu.c:322
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803
KIRQL NTAPI KeRaiseIrqlToSynchLevel(VOID)
Definition: pic.c:156

◆ KeFlushIoBuffers()

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

Definition at line 191 of file cpu.c.

195 {
196  DbgBreakPoint();
197 }
void DbgBreakPoint()
Definition: mach.c:558

◆ KeFlushTb()

VOID KeFlushTb ( VOID  )

Definition at line 36 of file cpu.c.

37 {
38  //
39  // Flush the entire TLB
40  //
41  KeArmFlushTlb();
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:32

◆ 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 }
#define TRUE
Definition: types.h:120
FORCEINLINE VOID KeArmInvalidateAllCaches(VOID)
Definition: intrin_i.h:195

◆ 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()
Definition: video.h:57
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 }
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 148 of file cpu.c.

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

◆ 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
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261

◆ KiFlushSingleTb()

VOID KiFlushSingleTb ( IN BOOLEAN  Invalid,
IN PVOID  Virtual 
)

Definition at line 26 of file cpu.c.

28 {
29  //
30  // Just invalidate it
31  //
32  KeArmInvalidateTlbEntry(Virtual);
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 {
83  __debugbreak();
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 KeArmLockdownRegisterSet(IN ARM_LOCKDOWN_REGISTER LockdownRegister)
Definition: intrin_i.h:165
KSPECIAL_REGISTERS SpecialRegisters
Definition: ketypes.h:530
void __cdecl __debugbreak(void)
Definition: intrin_ppc.h:698
FORCEINLINE VOID KeArmControlRegisterSet(IN ARM_CONTROL_REGISTER ControlRegister)
Definition: intrin_i.h:135

◆ 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  //
70  __debugbreak();
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_CACHE_REGISTER KeArmCacheRegisterGet(VOID)
Definition: intrin_i.h:109
FORCEINLINE ARM_CONTROL_REGISTER KeArmControlRegisterGet(VOID)
Definition: intrin_i.h:18
void __cdecl __debugbreak(void)
Definition: intrin_ppc.h:698
FORCEINLINE ARM_STATUS_REGISTER KeArmStatusRegisterGet(VOID)
Definition: intrin_i.h:122
FORCEINLINE ARM_LOCKDOWN_REGISTER KeArmLockdownRegisterGet(VOID)
Definition: intrin_i.h:83

◆ 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  //
225  return STATUS_NOT_IMPLEMENTED;
226 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225

◆ 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  //
212  return STATUS_NOT_IMPLEMENTED;
213 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225

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.