Merge from amd64 branch:
[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 //
7 //Lockdown TLB entries
8 //
9 #define PCR_ENTRY 0
10 #define PDR_ENTRY 2
11
12 #define IMAGE_FILE_MACHINE_ARCHITECTURE IMAGE_FILE_MACHINE_ARM
13
14 //
15 // BKPT is 4 bytes long
16 //
17 #define KD_BREAKPOINT_TYPE ULONG
18 #define KD_BREAKPOINT_SIZE sizeof(ULONG)
19 //#define KD_BREAKPOINT_VALUE
20
21 //
22 // Macros for getting and setting special purpose registers in portable code
23 //
24 #define KeGetContextPc(Context) \
25 ((Context)->Pc)
26
27 #define KeSetContextPc(Context, ProgramCounter) \
28 ((Context)->Pc = (ProgramCounter))
29
30 #define KeGetTrapFramePc(TrapFrame) \
31 ((TrapFrame)->Pc)
32
33 #define KeGetContextReturnRegister(Context) \
34 ((Context)->R0)
35
36 #define KeSetContextReturnRegister(Context, ReturnValue) \
37 ((Context)->R0 = (ReturnValue))
38
39 //
40 // Macro to get trap and exception frame from a thread stack
41 //
42 #define KeGetTrapFrame(Thread) \
43 (PKTRAP_FRAME)((ULONG_PTR)((Thread)->InitialStack) - \
44 sizeof(KTRAP_FRAME))
45
46 #define KeGetExceptionFrame(Thread) \
47 (PKEXCEPTION_FRAME)((ULONG_PTR)KeGetTrapFrame(Thread) - \
48 sizeof(KEXCEPTION_FRAME))
49
50 //
51 // Macro to get context switches from the PRCB
52 // All architectures but x86 have it in the PRCB's KeContextSwitches
53 //
54 #define KeGetContextSwitches(Prcb) \
55 Prcb->KeContextSwitches
56
57 //
58 // Returns the Interrupt State from a Trap Frame.
59 // ON = TRUE, OFF = FALSE
60 //
61 //#define KeGetTrapFrameInterruptState(TrapFrame)
62
63 //
64 // Invalidates the TLB entry for a specified address
65 //
66 FORCEINLINE
67 VOID
68 KeInvalidateTlbEntry(IN PVOID Address)
69 {
70 /* Invalidate the TLB entry for this address */
71 KeArmInvalidateTlbEntry(Address);
72 }
73
74 FORCEINLINE
75 VOID
76 KeFlushProcessTb(VOID)
77 {
78 //
79 // We need to implement this!
80 //
81 ASSERTMSG("Need ARM flush routine\n", FALSE);
82 }
83
84 FORCEINLINE
85 VOID
86 KiRundownThread(IN PKTHREAD Thread)
87 {
88 /* FIXME */
89 }
90
91 VOID
92 KiPassiveRelease(
93 VOID
94
95 );
96
97 VOID
98 KiApcInterrupt(
99 VOID
100 );
101
102 #include "mm.h"
103
104 VOID
105 KeFillFixedEntryTb(
106 IN ARM_PTE Pte,
107 IN PVOID Virtual,
108 IN ULONG Index
109 );
110
111 VOID
112 KeFlushTb(
113 VOID
114 );
115
116 #define KiSystemStartupReal KiSystemStartup
117
118 #define KiGetPreviousMode(tf) \
119 ((tf->Spsr & CPSR_MODES) == CPSR_USER_MODE) ? UserMode: KernelMode
120
121 #endif