Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

xxmpipi.c

Go to the documentation of this file.
00001 /*++ 00002 00003 Copyright (c) 1993 Microsoft Corporation 00004 00005 Module Name: 00006 00007 xxmpipi.c 00008 00009 Abstract: 00010 00011 This module implements MIPS specific MP routine. 00012 00013 Author: 00014 00015 David N. Cutler 24-Apr-1993 00016 00017 Environment: 00018 00019 Kernel mode only. 00020 00021 Revision History: 00022 00023 --*/ 00024 00025 #include "ki.h" 00026 00027 VOID 00028 KiRestoreProcessorState ( 00029 IN PKTRAP_FRAME TrapFrame, 00030 IN PKEXCEPTION_FRAME ExceptionFrame 00031 ) 00032 00033 /*++ 00034 00035 Routine Description: 00036 00037 This function moves processor register state from the current 00038 processor context structure in the processor block to the 00039 specified trap and exception frames. 00040 00041 Arguments: 00042 00043 TrapFrame - Supplies a pointer to a trap frame. 00044 00045 ExceptionFrame - Supplies a pointer to an exception frame. 00046 00047 Return Value: 00048 00049 None. 00050 00051 --*/ 00052 00053 { 00054 00055 PKPRCB Prcb; 00056 00057 // 00058 // Get the address of the current processor block and move the 00059 // specified register state from the processor context structure 00060 // to the specified trap and exception frames 00061 // 00062 00063 Prcb = KeGetCurrentPrcb(); 00064 KeContextToKframes(TrapFrame, 00065 ExceptionFrame, 00066 &Prcb->ProcessorState.ContextFrame, 00067 CONTEXT_FULL, 00068 KernelMode); 00069 00070 return; 00071 } 00072 00073 VOID 00074 KiSaveProcessorState ( 00075 IN PKTRAP_FRAME TrapFrame, 00076 IN PKEXCEPTION_FRAME ExceptionFrame 00077 ) 00078 00079 /*++ 00080 00081 Routine Description: 00082 00083 This function moves processor register state from the specified trap 00084 and exception frames to the processor context structure in the current 00085 processor block. 00086 00087 Arguments: 00088 00089 TrapFrame - Supplies a pointer to a trap frame. 00090 00091 ExceptionFrame - Supplies a pointer to an exception frame. 00092 00093 Return Value: 00094 00095 None. 00096 00097 --*/ 00098 00099 { 00100 00101 PKPRCB Prcb; 00102 00103 // 00104 // Get the address of the current processor block and move the 00105 // specified register state from specified trap and exception 00106 // frames to the current processor context structure. 00107 // 00108 00109 Prcb = KeGetCurrentPrcb(); 00110 Prcb->ProcessorState.ContextFrame.ContextFlags = CONTEXT_FULL; 00111 KeContextFromKframes(TrapFrame, 00112 ExceptionFrame, 00113 &Prcb->ProcessorState.ContextFrame); 00114 00115 // 00116 // Save the current processor control state. 00117 // 00118 00119 KiSaveProcessorControlState(&Prcb->ProcessorState); 00120 return; 00121 } 00122 00123 VOID 00124 KiSaveProcessorControlState ( 00125 IN PKPROCESSOR_STATE ProcessorState 00126 ) 00127 00128 /*++ 00129 00130 Routine Description: 00131 00132 This routine saves the processor's control state for debugger. 00133 00134 Arguments: 00135 00136 ProcessorState (a0) - Supplies a pointer to the processor state. 00137 00138 Return Value: 00139 00140 None. 00141 00142 --*/ 00143 00144 { 00145 00146 ULONG Index; 00147 00148 // 00149 // Read Tb entries and store in the processor state structure. 00150 // 00151 00152 for (Index = 0; Index < KeNumberTbEntries; Index += 1) { 00153 KiReadEntryTb(Index, &ProcessorState->TbEntry[Index]); 00154 } 00155 00156 return; 00157 } 00158 00159 BOOLEAN 00160 KiIpiServiceRoutine ( 00161 IN PKTRAP_FRAME TrapFrame, 00162 IN PKEXCEPTION_FRAME ExceptionFrame 00163 ) 00164 00165 /*++ 00166 00167 Routine Description: 00168 00169 00170 This function is called at IPI_LEVEL to process any outstanding 00171 interprocess request for the current processor. 00172 00173 Arguments: 00174 00175 TrapFrame - Supplies a pointer to a trap frame. 00176 00177 ExceptionFrame - Supplies a pointer to an exception frame 00178 00179 Return Value: 00180 00181 A value of TRUE is returned, if one of more requests were service. 00182 Otherwise, FALSE is returned. 00183 00184 --*/ 00185 00186 { 00187 00188 ULONG RequestSummary; 00189 00190 // 00191 // Process any outstanding interprocessor requests. 00192 // 00193 00194 RequestSummary = KiIpiProcessRequests(); 00195 00196 // 00197 // If freeze is requested, then freeze target execution. 00198 // 00199 00200 if ((RequestSummary & IPI_FREEZE) != 0) { 00201 KiFreezeTargetExecution(TrapFrame, ExceptionFrame); 00202 } 00203 00204 // 00205 // Return whether any requests were processed. 00206 // 00207 00208 return (RequestSummary & ~IPI_FREEZE) != 0; 00209 }

Generated on Sat May 15 19:42:33 2004 for test by doxygen 1.3.7