ReactOS 0.4.15-dev-7711-g5627da4
ke.h File Reference
#include "intrin_i.h"
#include "mm.h"
Include dependency graph for ke.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define KiServiceExit2   KiExceptionExit
 
#define SYNCH_LEVEL   DISPATCH_LEVEL
 
#define PCR   ((KPCR * const)KIP0PCRADDRESS)
 
#define PCR_ENTRY   0
 
#define PDR_ENTRY   2
 
#define KD_BREAKPOINT_TYPE   ULONG
 
#define KD_BREAKPOINT_SIZE   sizeof(ULONG)
 
#define KD_BREAKPOINT_VALUE   0xDEFE
 
#define MAXIMUM_VECTOR   16
 
#define KeGetContextPc(Context)    ((Context)->Pc)
 
#define KeSetContextPc(Context, ProgramCounter)    ((Context)->Pc = (ProgramCounter))
 
#define KeGetTrapFramePc(TrapFrame)    ((TrapFrame)->Pc)
 
#define KeGetContextReturnRegister(Context)    ((Context)->R0)
 
#define KeSetContextReturnRegister(Context, ReturnValue)    ((Context)->R0 = (ReturnValue))
 
#define KeGetTrapFrame(Thread)
 
#define KeGetExceptionFrame(Thread)
 
#define KeGetContextSwitches(Prcb)    (Prcb)->KeContextSwitches
 
#define KiGetSecondLevelDCacheSize()   ((PKIPCR)KeGetPcr())->SecondLevelDcacheSize
 
#define KeGetTrapFrameInterruptState(TrapFrame)   0
 
#define Ki386PerfEnd()
 
#define KiEndInterrupt(x, y)
 
#define KiGetLinkedTrapFrame(x)    (PKTRAP_FRAME)((x)->TrapFrame)
 
#define KiGetPreviousMode(tf)    ((tf->Cpsr & CPSRM_MASK) == CPSRM_USER) ? UserMode: KernelMode
 

Functions

FORCEINLINE BOOLEAN KeDisableInterrupts (VOID)
 
FORCEINLINE VOID KeRestoreInterrupts (BOOLEAN WereEnabled)
 
FORCEINLINE VOID KeInvalidateTlbEntry (IN PVOID Address)
 
FORCEINLINE VOID KeFlushProcessTb (VOID)
 
FORCEINLINE VOID KeSweepICache (IN PVOID BaseAddress, IN SIZE_T FlushSize)
 
FORCEINLINE VOID KiRundownThread (IN PKTHREAD Thread)
 
VOID KiPassiveRelease (VOID)
 
VOID KiSystemService (IN PKTHREAD Thread, IN PKTRAP_FRAME TrapFrame, IN ULONG Instruction)
 
VOID KiApcInterrupt (VOID)
 
VOID KeFlushTb (VOID)
 
VOID HalSweepDcache (VOID)
 
VOID HalSweepIcache (VOID)
 

Macro Definition Documentation

◆ KD_BREAKPOINT_SIZE

#define KD_BREAKPOINT_SIZE   sizeof(ULONG)

Definition at line 20 of file ke.h.

◆ KD_BREAKPOINT_TYPE

#define KD_BREAKPOINT_TYPE   ULONG

Definition at line 19 of file ke.h.

◆ KD_BREAKPOINT_VALUE

#define KD_BREAKPOINT_VALUE   0xDEFE

Definition at line 21 of file ke.h.

◆ KeGetContextPc

#define KeGetContextPc (   Context)     ((Context)->Pc)

Definition at line 31 of file ke.h.

◆ KeGetContextReturnRegister

#define KeGetContextReturnRegister (   Context)     ((Context)->R0)

Definition at line 40 of file ke.h.

◆ KeGetContextSwitches

#define KeGetContextSwitches (   Prcb)     (Prcb)->KeContextSwitches

Definition at line 61 of file ke.h.

◆ KeGetExceptionFrame

#define KeGetExceptionFrame (   Thread)
Value:
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
struct _KEXCEPTION_FRAME * PKEXCEPTION_FRAME
#define KeGetTrapFrame(Thread)
Definition: ke.h:208
uint32_t ULONG_PTR
Definition: typedefs.h:65

Definition at line 53 of file ke.h.

◆ KeGetTrapFrame

#define KeGetTrapFrame (   Thread)
Value:
(PKTRAP_FRAME)((ULONG_PTR)((Thread)->InitialStack) - \
sizeof(KTRAP_FRAME))
struct _KTRAP_FRAME * PKTRAP_FRAME

Definition at line 49 of file ke.h.

◆ KeGetTrapFrameInterruptState

#define KeGetTrapFrameInterruptState (   TrapFrame)    0

Definition at line 74 of file ke.h.

◆ KeGetTrapFramePc

#define KeGetTrapFramePc (   TrapFrame)     ((TrapFrame)->Pc)

Definition at line 37 of file ke.h.

◆ KeSetContextPc

#define KeSetContextPc (   Context,
  ProgramCounter 
)     ((Context)->Pc = (ProgramCounter))

Definition at line 34 of file ke.h.

◆ KeSetContextReturnRegister

#define KeSetContextReturnRegister (   Context,
  ReturnValue 
)     ((Context)->R0 = (ReturnValue))

Definition at line 43 of file ke.h.

◆ Ki386PerfEnd

#define Ki386PerfEnd ( )

Definition at line 174 of file ke.h.

◆ KiEndInterrupt

#define KiEndInterrupt (   x,
  y 
)

Definition at line 175 of file ke.h.

◆ KiGetLinkedTrapFrame

#define KiGetLinkedTrapFrame (   x)     (PKTRAP_FRAME)((x)->TrapFrame)

Definition at line 177 of file ke.h.

◆ KiGetPreviousMode

#define KiGetPreviousMode (   tf)     ((tf->Cpsr & CPSRM_MASK) == CPSRM_USER) ? UserMode: KernelMode

Definition at line 180 of file ke.h.

◆ KiGetSecondLevelDCacheSize

#define KiGetSecondLevelDCacheSize ( )    ((PKIPCR)KeGetPcr())->SecondLevelDcacheSize

Definition at line 68 of file ke.h.

◆ KiServiceExit2

#define KiServiceExit2   KiExceptionExit

Definition at line 5 of file ke.h.

◆ MAXIMUM_VECTOR

#define MAXIMUM_VECTOR   16

Definition at line 26 of file ke.h.

◆ PCR

#define PCR   ((KPCR * const)KIP0PCRADDRESS)

Definition at line 8 of file ke.h.

◆ PCR_ENTRY

#define PCR_ENTRY   0

Definition at line 13 of file ke.h.

◆ PDR_ENTRY

#define PDR_ENTRY   2

Definition at line 14 of file ke.h.

◆ SYNCH_LEVEL

#define SYNCH_LEVEL   DISPATCH_LEVEL

Definition at line 7 of file ke.h.

Function Documentation

◆ HalSweepDcache()

VOID HalSweepDcache ( VOID  )

Definition at line 107 of file processor.c.

108{
109 /*
110 * We get called very early on, before HalInitSystem or any of the Hal*
111 * processor routines, so we need to figure out what CPU we're on.
112 */
114
115 /*
116 * Check if we can do it the ARMv5TE-J way
117 */
119 {
120 /* Test, clean, flush D-Cache */
121 __asm__ __volatile__ ("1: mrc p15, 0, pc, c7, c14, 3; bne 1b");
122 }
123 else
124 {
125 /* We need to do it it by set/way. For now always call ARMv7 function */
126 //extern VOID v7_flush_dcache_all(VOID);
127 //v7_flush_dcache_all();
128 }
129}
BOOLEAN HalpTestCleanSupported
Definition: processor.c:20
VOID HalpIdentifyProcessor(VOID)
Definition: processor.c:25
BOOLEAN HalpProcessorIdentified
Definition: processor.c:19
__asm__(".p2align 4, 0x90\n" ".seh_proc __seh2_global_filter_func\n" "__seh2_global_filter_func:\n" "\tpush %rbp\n" "\t.seh_pushreg %rbp\n" "\tsub $32, %rsp\n" "\t.seh_stackalloc 32\n" "\t.seh_endprologue\n" "\tmov %rdx, %rbp\n" "\tjmp *%rax\n" "__seh2_global_filter_func_exit:\n" "\t.p2align 4\n" "\tadd $32, %rsp\n" "\tpop %rbp\n" "\tret\n" "\t.seh_endproc")

Referenced by KiInitializeKernel(), and KiInitializeSystem().

◆ HalSweepIcache()

VOID HalSweepIcache ( VOID  )

Definition at line 135 of file processor.c.

136{
137 /* All ARM cores support the same Icache flush command */
139}
FORCEINLINE VOID KeArmFlushIcache(VOID)
Definition: intrin_i.h:205

Referenced by KiInitializeSystem().

◆ KeDisableInterrupts()

FORCEINLINE BOOLEAN KeDisableInterrupts ( VOID  )

Definition at line 78 of file ke.h.

79{
81
82 //
83 // Get current interrupt state and disable interrupts
84 //
86 _disable();
87
88 //
89 // Return previous interrupt state
90 //
91 return Flags.IrqDisable;
92}
FORCEINLINE ARM_STATUS_REGISTER KeArmStatusRegisterGet(VOID)
Definition: intrin_i.h:122
void __cdecl _disable(void)
Definition: intrin_arm.h:365
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

◆ KeFlushProcessTb()

FORCEINLINE VOID KeFlushProcessTb ( VOID  )

Definition at line 114 of file ke.h.

115{
117}
FORCEINLINE VOID KeArmFlushTlb(VOID)
Definition: intrin_i.h:175

◆ KeFlushTb()

VOID KeFlushTb ( VOID  )

Definition at line 36 of file cpu.c.

37{
38 //
39 // Flush the entire TLB
40 //
42}

Referenced by KeFlushCurrentTb(), and KiInitializeSystem().

◆ KeInvalidateTlbEntry()

FORCEINLINE VOID KeInvalidateTlbEntry ( IN PVOID  Address)

Definition at line 106 of file ke.h.

107{
108 /* Invalidate the TLB entry for this address */
110}
FORCEINLINE VOID KeArmInvalidateTlbEntry(IN PVOID Address)
Definition: intrin_i.h:185
static WCHAR Address[46]
Definition: ping.c:68

◆ KeRestoreInterrupts()

FORCEINLINE VOID KeRestoreInterrupts ( BOOLEAN  WereEnabled)

Definition at line 96 of file ke.h.

97{
98 if (WereEnabled) _enable();
99}
void __cdecl _enable(void)
Definition: intrin_arm.h:373

◆ KeSweepICache()

FORCEINLINE VOID KeSweepICache ( IN PVOID  BaseAddress,
IN SIZE_T  FlushSize 
)

Definition at line 121 of file ke.h.

123{
124 //
125 // Always sweep the whole cache
126 //
128 UNREFERENCED_PARAMETER(FlushSize);
129 _MoveToCoprocessor(0, CP15_ICIALLU);
130}
#define CP15_ICIALLU
Definition: ketypes.h:80
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317

◆ KiApcInterrupt()

VOID KiApcInterrupt ( VOID  )

Definition at line 229 of file trapc.c.

230{
232 KEXCEPTION_FRAME ExceptionFrame;
233 PKTRAP_FRAME TrapFrame = KeGetCurrentThread()->TrapFrame;
234
235 DPRINT1("[APC TRAP]\n");
236 while (TRUE);
237
238 //
239 // Isolate previous mode
240 //
241 PreviousMode = KiGetPreviousMode(TrapFrame);
242
243 //
244 // FIXME-USER: Handle APC interrupt while in user-mode
245 //
247
248 //
249 // Disable interrupts
250 //
251 _disable();
252
253 //
254 // Clear APC interrupt
255 //
257
258 //
259 // Re-enable interrupts
260 //
261 _enable();
262
263 //
264 // Deliver APCs
265 //
266 KiDeliverApc(PreviousMode, &ExceptionFrame, TrapFrame);
267}
#define DPRINT1
Definition: precomp.h:8
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define APC_LEVEL
Definition: env_spec_w32.h:695
VOID FASTCALL HalClearSoftwareInterrupt(IN KIRQL Irql)
Definition: pic.c:282
#define KeGetCurrentThread
Definition: hal.h:55
#define ASSERT(a)
Definition: mode.c:44
#define UserMode
Definition: asm.h:35
#define KiGetPreviousMode(tf)
Definition: ke.h:180
VOID NTAPI KiDeliverApc(IN KPROCESSOR_MODE DeliveryMode, IN PKEXCEPTION_FRAME ExceptionFrame, IN PKTRAP_FRAME TrapFrame)
Definition: apc.c:302
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
_In_ KPROCESSOR_MODE PreviousMode
Definition: sefuncs.h:103

◆ KiPassiveRelease()

VOID KiPassiveRelease ( VOID  )

Referenced by KiInitializePcr().

◆ KiRundownThread()

FORCEINLINE VOID KiRundownThread ( IN PKTHREAD  Thread)

Definition at line 134 of file ke.h.

135{
136 /* FIXME */
137}

◆ KiSystemService()

VOID KiSystemService ( IN PKTHREAD  Thread,
IN PKTRAP_FRAME  TrapFrame,
IN ULONG  Instruction 
)

Definition at line 234 of file traphandler.c.

237{
239 __debugbreak();
240}
#define UNIMPLEMENTED
Definition: debug.h:115
void __cdecl __debugbreak(void)
Definition: intrin_ppc.h:698

Referenced by KiSoftwareInterruptHandler().