1 #ifndef __NTOSKRNL_INCLUDE_INTERNAL_ARM_KE_H
2 #define __NTOSKRNL_INCLUDE_INTERNAL_ARM_KE_H
6 #define KiServiceExit2 KiExceptionExit
14 #define IMAGE_FILE_MACHINE_ARCHITECTURE IMAGE_FILE_MACHINE_ARM
17 // BKPT is 4 bytes long
19 #define KD_BREAKPOINT_TYPE ULONG
20 #define KD_BREAKPOINT_SIZE sizeof(ULONG)
21 //#define KD_BREAKPOINT_VALUE
24 // Macros for getting and setting special purpose registers in portable code
26 #define KeGetContextPc(Context) \
29 #define KeSetContextPc(Context, ProgramCounter) \
30 ((Context)->Pc = (ProgramCounter))
32 #define KeGetTrapFramePc(TrapFrame) \
35 #define KeGetContextReturnRegister(Context) \
38 #define KeSetContextReturnRegister(Context, ReturnValue) \
39 ((Context)->R0 = (ReturnValue))
42 // Macro to get trap and exception frame from a thread stack
44 #define KeGetTrapFrame(Thread) \
45 (PKTRAP_FRAME)((ULONG_PTR)((Thread)->InitialStack) - \
48 #define KeGetExceptionFrame(Thread) \
49 (PKEXCEPTION_FRAME)((ULONG_PTR)KeGetTrapFrame(Thread) - \
50 sizeof(KEXCEPTION_FRAME))
53 // Macro to get context switches from the PRCB
54 // All architectures but x86 have it in the PRCB's KeContextSwitches
56 #define KeGetContextSwitches(Prcb) \
57 CONTAINING_RECORD(Prcb, KIPCR, PrcbData)->ContextSwitches
60 // Returns the Interrupt State from a Trap Frame.
61 // ON = TRUE, OFF = FALSE
63 //#define KeGetTrapFrameInterruptState(TrapFrame)
66 // Invalidates the TLB entry for a specified address
70 KeInvalidateTlbEntry(IN PVOID Address
)
72 /* Invalidate the TLB entry for this address */
73 KeArmInvalidateTlbEntry(Address
);
78 KeFlushProcessTb(VOID
)
85 KiRundownThread(IN PKTHREAD Thread
)
96 KiSystemService(IN PKTHREAD Thread
,
97 IN PKTRAP_FRAME TrapFrame
,
98 IN ULONG Instruction
);
112 #define Ki386PerfEnd()
113 #define KiEndInterrupt(x,y)
115 #define KiGetLinkedTrapFrame(x) \
116 (PKTRAP_FRAME)((x)->PreviousTrapFrame)
118 #define KiGetPreviousMode(tf) \
119 ((tf->Spsr & CPSR_MODES) == CPSR_USER_MODE) ? UserMode: KernelMode