Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenke.h
Go to the documentation of this file.
00001 #pragma once 00002 00003 #include "intrin_i.h" 00004 00005 #define KiServiceExit2 KiExceptionExit 00006 00007 // 00008 //Lockdown TLB entries 00009 // 00010 #define PCR_ENTRY 0 00011 #define PDR_ENTRY 2 00012 00013 // 00014 // BKPT is 4 bytes long 00015 // 00016 #define KD_BREAKPOINT_TYPE ULONG 00017 #define KD_BREAKPOINT_SIZE sizeof(ULONG) 00018 //#define KD_BREAKPOINT_VALUE 00019 00020 // 00021 // Macros for getting and setting special purpose registers in portable code 00022 // 00023 #define KeGetContextPc(Context) \ 00024 ((Context)->Pc) 00025 00026 #define KeSetContextPc(Context, ProgramCounter) \ 00027 ((Context)->Pc = (ProgramCounter)) 00028 00029 #define KeGetTrapFramePc(TrapFrame) \ 00030 ((TrapFrame)->Pc) 00031 00032 #define KeGetContextReturnRegister(Context) \ 00033 ((Context)->R0) 00034 00035 #define KeSetContextReturnRegister(Context, ReturnValue) \ 00036 ((Context)->R0 = (ReturnValue)) 00037 00038 // 00039 // Macro to get trap and exception frame from a thread stack 00040 // 00041 #define KeGetTrapFrame(Thread) \ 00042 (PKTRAP_FRAME)((ULONG_PTR)((Thread)->InitialStack) - \ 00043 sizeof(KTRAP_FRAME)) 00044 00045 #define KeGetExceptionFrame(Thread) \ 00046 (PKEXCEPTION_FRAME)((ULONG_PTR)KeGetTrapFrame(Thread) - \ 00047 sizeof(KEXCEPTION_FRAME)) 00048 00049 // 00050 // Macro to get context switches from the PRCB 00051 // All architectures but x86 have it in the PRCB's KeContextSwitches 00052 // 00053 #define KeGetContextSwitches(Prcb) \ 00054 CONTAINING_RECORD(Prcb, KIPCR, PrcbData)->ContextSwitches 00055 00056 // 00057 // Macro to get the second level cache size field name which differs between 00058 // CISC and RISC architectures, as the former has unified I/D cache 00059 // 00060 #define KiGetSecondLevelDCacheSize() ((PKIPCR)KeGetPcr())->SecondLevelDcacheSize 00061 00062 // 00063 // Returns the Interrupt State from a Trap Frame. 00064 // ON = TRUE, OFF = FALSE 00065 // 00066 //#define KeGetTrapFrameInterruptState(TrapFrame) 00067 00068 FORCEINLINE 00069 BOOLEAN 00070 KeDisableInterrupts(VOID) 00071 { 00072 ARM_STATUS_REGISTER Flags; 00073 00074 // 00075 // Get current interrupt state and disable interrupts 00076 // 00077 Flags = KeArmStatusRegisterGet(); 00078 _disable(); 00079 00080 // 00081 // Return previous interrupt state 00082 // 00083 return Flags.IrqDisable; 00084 } 00085 00086 FORCEINLINE 00087 VOID 00088 KeRestoreInterrupts(BOOLEAN WereEnabled) 00089 { 00090 if (WereEnabled) _enable(); 00091 } 00092 00093 // 00094 // Invalidates the TLB entry for a specified address 00095 // 00096 FORCEINLINE 00097 VOID 00098 KeInvalidateTlbEntry(IN PVOID Address) 00099 { 00100 /* Invalidate the TLB entry for this address */ 00101 KeArmInvalidateTlbEntry(Address); 00102 } 00103 00104 FORCEINLINE 00105 VOID 00106 KeFlushProcessTb(VOID) 00107 { 00108 KeArmFlushTlb(); 00109 } 00110 00111 FORCEINLINE 00112 VOID 00113 KiRundownThread(IN PKTHREAD Thread) 00114 { 00115 /* FIXME */ 00116 } 00117 00118 VOID 00119 KiPassiveRelease( 00120 VOID 00121 ); 00122 00123 VOID 00124 KiSystemService(IN PKTHREAD Thread, 00125 IN PKTRAP_FRAME TrapFrame, 00126 IN ULONG Instruction); 00127 00128 VOID 00129 KiApcInterrupt( 00130 VOID 00131 ); 00132 00133 #include "mm.h" 00134 00135 VOID 00136 KeFlushTb( 00137 VOID 00138 ); 00139 00140 #define Ki386PerfEnd() 00141 #define KiEndInterrupt(x,y) 00142 00143 #define KiGetLinkedTrapFrame(x) \ 00144 (PKTRAP_FRAME)((x)->PreviousTrapFrame) 00145 00146 #define KiGetPreviousMode(tf) \ 00147 ((tf->Spsr & CPSR_MODES) == CPSR_USER_MODE) ? UserMode: KernelMode Generated on Sun May 27 2012 04:33:22 for ReactOS by
1.7.6.1
|