1 #ifndef __NTOSKRNL_INCLUDE_INTERNAL_ARM_KE_H
2 #define __NTOSKRNL_INCLUDE_INTERNAL_ARM_KE_H
12 #define IMAGE_FILE_MACHINE_ARCHITECTURE IMAGE_FILE_MACHINE_ARM
15 // BKPT is 4 bytes long
17 #define KD_BREAKPOINT_TYPE ULONG
18 #define KD_BREAKPOINT_SIZE sizeof(ULONG)
19 //#define KD_BREAKPOINT_VALUE
22 // Macros for getting and setting special purpose registers in portable code
24 #define KeGetContextPc(Context) \
27 #define KeSetContextPc(Context, ProgramCounter) \
28 ((Context)->Pc = (ProgramCounter))
30 #define KeGetTrapFramePc(TrapFrame) \
33 #define KeGetContextReturnRegister(Context) \
36 #define KeSetContextReturnRegister(Context, ReturnValue) \
37 ((Context)->R0 = (ReturnValue))
40 // Macro to get trap and exception frame from a thread stack
42 #define KeGetTrapFrame(Thread) \
43 (PKTRAP_FRAME)((ULONG_PTR)((Thread)->InitialStack) - \
46 #define KeGetExceptionFrame(Thread) \
47 (PKEXCEPTION_FRAME)((ULONG_PTR)KeGetTrapFrame(Thread) - \
48 sizeof(KEXCEPTION_FRAME))
51 // Macro to get context switches from the PRCB
52 // All architectures but x86 have it in the PRCB's KeContextSwitches
54 #define KeGetContextSwitches(Prcb) \
55 Prcb->KeContextSwitches
58 // Returns the Interrupt State from a Trap Frame.
59 // ON = TRUE, OFF = FALSE
61 //#define KeGetTrapFrameInterruptState(TrapFrame)
64 // Invalidates the TLB entry for a specified address
68 KeInvalidateTlbEntry(IN PVOID Address
)
70 /* Invalidate the TLB entry for this address */
71 KeArmInvalidateTlbEntry(Address
);
76 KeFlushProcessTb(VOID
)
79 // We need to implement this!
81 ASSERTMSG("Need ARM flush routine\n", FALSE
);
86 KiRundownThread(IN PKTHREAD Thread
)
116 #define KiSystemStartupReal KiSystemStartup
118 #define KiGetPreviousMode(tf) \
119 ((tf->Spsr & CPSR_MODES) == CPSR_USER_MODE) ? UserMode: KernelMode