- Make KeFlushProcessTb work. Since no MPCore support, CPU TLB is flushed instead...
[reactos.git] / reactos / ntoskrnl / include / internal / arm / ke.h
1 #ifndef __NTOSKRNL_INCLUDE_INTERNAL_ARM_KE_H
2 #define __NTOSKRNL_INCLUDE_INTERNAL_ARM_KE_H
3
4 #include "intrin_i.h"
5
6 #define KiServiceExit2 KiExceptionExit
7
8 //
9 //Lockdown TLB entries
10 //
11 #define PCR_ENTRY 0
12 #define PDR_ENTRY 2
13
14 #define IMAGE_FILE_MACHINE_ARCHITECTURE IMAGE_FILE_MACHINE_ARM
15
16 //
17 // BKPT is 4 bytes long
18 //
19 #define KD_BREAKPOINT_TYPE ULONG
20 #define KD_BREAKPOINT_SIZE sizeof(ULONG)
21 //#define KD_BREAKPOINT_VALUE
22
23 //
24 // Macros for getting and setting special purpose registers in portable code
25 //
26 #define KeGetContextPc(Context) \
27 ((Context)->Pc)
28
29 #define KeSetContextPc(Context, ProgramCounter) \
30 ((Context)->Pc = (ProgramCounter))
31
32 #define KeGetTrapFramePc(TrapFrame) \
33 ((TrapFrame)->Pc)
34
35 #define KeGetContextReturnRegister(Context) \
36 ((Context)->R0)
37
38 #define KeSetContextReturnRegister(Context, ReturnValue) \
39 ((Context)->R0 = (ReturnValue))
40
41 //
42 // Macro to get trap and exception frame from a thread stack
43 //
44 #define KeGetTrapFrame(Thread) \
45 (PKTRAP_FRAME)((ULONG_PTR)((Thread)->InitialStack) - \
46 sizeof(KTRAP_FRAME))
47
48 #define KeGetExceptionFrame(Thread) \
49 (PKEXCEPTION_FRAME)((ULONG_PTR)KeGetTrapFrame(Thread) - \
50 sizeof(KEXCEPTION_FRAME))
51
52 //
53 // Macro to get context switches from the PRCB
54 // All architectures but x86 have it in the PRCB's KeContextSwitches
55 //
56 #define KeGetContextSwitches(Prcb) \
57 CONTAINING_RECORD(Prcb, KIPCR, PrcbData)->ContextSwitches
58
59 //
60 // Returns the Interrupt State from a Trap Frame.
61 // ON = TRUE, OFF = FALSE
62 //
63 //#define KeGetTrapFrameInterruptState(TrapFrame)
64
65 //
66 // Invalidates the TLB entry for a specified address
67 //
68 FORCEINLINE
69 VOID
70 KeInvalidateTlbEntry(IN PVOID Address)
71 {
72 /* Invalidate the TLB entry for this address */
73 KeArmInvalidateTlbEntry(Address);
74 }
75
76 FORCEINLINE
77 VOID
78 KeFlushProcessTb(VOID)
79 {
80 KeArmFlushTlb();
81 }
82
83 FORCEINLINE
84 VOID
85 KiRundownThread(IN PKTHREAD Thread)
86 {
87 /* FIXME */
88 }
89
90 VOID
91 KiPassiveRelease(
92 VOID
93 );
94
95 VOID
96 KiSystemService(IN PKTHREAD Thread,
97 IN PKTRAP_FRAME TrapFrame,
98 IN ULONG Instruction);
99
100 VOID
101 KiApcInterrupt(
102 VOID
103 );
104
105 #include "mm.h"
106
107 VOID
108 KeFlushTb(
109 VOID
110 );
111
112 #define Ki386PerfEnd()
113 #define KiEndInterrupt(x,y)
114
115 #define KiGetLinkedTrapFrame(x) \
116 (PKTRAP_FRAME)((x)->PreviousTrapFrame)
117
118 #define KiGetPreviousMode(tf) \
119 ((tf->Spsr & CPSR_MODES) == CPSR_USER_MODE) ? UserMode: KernelMode
120
121 #endif