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

buserror.c File Reference

#include "ki.h"

Go to the source code of this file.

Functions

BOOLEAN KeBusError (IN PEXCEPTION_RECORD ExceptionRecord, IN PKEXCEPTION_FRAME ExceptionFrame, IN PKTRAP_FRAME TrapFrame, IN PVOID VirtualAddress, IN PHYSICAL_ADDRESS PhysicalAddress)
PHYSICAL_ADDRESS KiGetPhysicalAddress (IN PVOID VirtualAddress)
VOID KiDataBusError (IN PEXCEPTION_RECORD ExceptionRecord, IN PKEXCEPTION_FRAME ExceptionFrame, IN PKTRAP_FRAME TrapFrame)
VOID KiInstructionBusError (IN PEXCEPTION_RECORD ExceptionRecord, IN PKEXCEPTION_FRAME ExceptionFrame, IN PKTRAP_FRAME TrapFrame)
VOID KeSetCacheErrorRoutine (IN PKCACHE_ERROR_ROUTINE Routine)


Function Documentation

BOOLEAN KeBusError IN PEXCEPTION_RECORD  ExceptionRecord,
IN PKEXCEPTION_FRAME  ExceptionFrame,
IN PKTRAP_FRAME  TrapFrame,
IN PVOID  VirtualAddress,
IN PHYSICAL_ADDRESS  PhysicalAddress
 

Definition at line 29 of file mips/buserror.c.

References FALSE, and KeBugCheckEx().

Referenced by KiInitializeKernel().

00039 : 00040 00041 This function provides the default bus error handling routine for NT. 00042 00043 N.B. There is no return from this routine. 00044 00045 Arguments: 00046 00047 ExceptionRecord - Supplies a pointer to an exception record. 00048 00049 ExceptionFrame - Supplies a pointer to an exception frame. 00050 00051 TrapFrame - Supplies a pointer to a trap frame. 00052 00053 VirtualAddress - Supplies the virtual address of the bus error. 00054 00055 PhysicalAddress - Supplies the physical address of the bus error. 00056 00057 Return Value: 00058 00059 None. 00060 00061 --*/ 00062 00063 { 00064 00065 // 00066 // Bug check specifying the exception code, the virtual address, the 00067 // low part of the physical address, the current processor state, and 00068 // the exception PC. 00069 // 00070 00071 KeBugCheckEx(ExceptionRecord->ExceptionCode & 0xffff, 00072 (ULONG)VirtualAddress, 00073 PhysicalAddress.LowPart, 00074 TrapFrame->Psr, 00075 TrapFrame->Fir); 00076 00077 return FALSE; 00078 }

VOID KeSetCacheErrorRoutine IN PKCACHE_ERROR_ROUTINE  Routine  ) 
 

Definition at line 280 of file mips/buserror.c.

References KSEG1_BASE.

00286 : 00287 00288 This function is called to set the address of the cache error routine. 00289 The cache error routine is called whenever a cache error occurs. 00290 00291 Arguments: 00292 00293 Routine - Supplies a pointer to the cache error routine. 00294 00295 Return Value: 00296 00297 None. 00298 00299 --*/ 00300 00301 { 00302 00303 // 00304 // Set the address of the cache error routine. 00305 // 00306 00307 *((PULONG)CACHE_ERROR_VECTOR) = (ULONG)Routine | KSEG1_BASE; 00308 return; 00309 } }

VOID KiDataBusError IN PEXCEPTION_RECORD  ExceptionRecord,
IN PKEXCEPTION_FRAME  ExceptionFrame,
IN PKTRAP_FRAME  TrapFrame
 

Definition at line 124 of file mips/buserror.c.

References DATA_BUS_ERROR, EXCEPTION_EXECUTE_HANDLER, FALSE, KeBugCheck(), KiGetPhysicalAddress(), and KiGetRegisterValue().

Referenced by KiDispatchException().

00132 : 00133 00134 This function is called to process a data bus error. The virtual and 00135 physical address of the error are computed and the data bus error 00136 processing routine is called indirectly through the PCR. NT provides 00137 a standard routine to process the error and shutdown the system. A 00138 vendor, however, can replace the standard NT routine and do additional 00139 processing if necessary via the HAL. 00140 00141 N.B. There is no return from this routine. 00142 00143 Arguments: 00144 00145 ExceptionRecord - Supplies a pointer to an exception record. 00146 00147 ExceptionFrame - Supplies a pointer to an exception frame. 00148 00149 TrapFrame - Supplies a pointer to a trap frame. 00150 00151 Return Value: 00152 00153 None. 00154 00155 --*/ 00156 00157 { 00158 00159 PVOID VirtualAddress; 00160 PHYSICAL_ADDRESS PhysicalAddress; 00161 MIPS_INSTRUCTION FaultInstruction; 00162 00163 // 00164 // Any exception that occurs during the attempted calculation of the 00165 // virtual address causes the virtual address calculation to be 00166 // aborted and the virtual address of the instruction itself is used 00167 // instead. 00168 // 00169 00170 try { 00171 00172 // 00173 // Compute the effective address of the reference. 00174 // 00175 00176 FaultInstruction.Long = *((PULONG)ExceptionRecord->ExceptionAddress); 00177 VirtualAddress = (PVOID)(KiGetRegisterValue(FaultInstruction.i_format.Rs, 00178 ExceptionFrame, 00179 TrapFrame) + 00180 FaultInstruction.i_format.Simmediate); 00181 00182 // 00183 // If an exception occurs, then abort the calculation of the virtual 00184 // address and set the virtual address equal to the instruction address. 00185 // 00186 00187 } except (EXCEPTION_EXECUTE_HANDLER) { 00188 VirtualAddress = ExceptionRecord->ExceptionAddress; 00189 } 00190 00191 // 00192 // Compute the physical address that corresponds to the data address. 00193 // 00194 00195 PhysicalAddress = KiGetPhysicalAddress(VirtualAddress); 00196 00197 // 00198 // If a value of FALSE is returned by the data bus error handling routine, 00199 // then bug check. Otherwise, assume that the error has been handled and 00200 // return. 00201 // 00202 00203 if ((PCR->DataBusError)(ExceptionRecord, 00204 ExceptionFrame, 00205 TrapFrame, 00206 VirtualAddress, 00207 PhysicalAddress) == FALSE) { 00208 00209 KeBugCheck(DATA_BUS_ERROR); 00210 } 00211 00212 return; 00213 }

PHYSICAL_ADDRESS KiGetPhysicalAddress IN PVOID  VirtualAddress  ) 
 

Definition at line 81 of file mips/buserror.c.

References KSEG0_BASE, KSEG1_BASE, and MmGetPhysicalAddress().

Referenced by KiDataBusError(), and KiInstructionBusError().

00087 : 00088 00089 This function computes the physical address for a given virtual address. 00090 00091 Arguments: 00092 00093 VirtualAddress - Supplies the virtual address whose physical address is 00094 to be computed. 00095 00096 Return Value: 00097 00098 The physical address that correcponds to the specified virtual address. 00099 00100 --*/ 00101 00102 { 00103 PHYSICAL_ADDRESS PhysicalAddress; 00104 00105 // 00106 // If the address is a KSEG0 or KSEG1 address, then mask off the high 00107 // three address bits and return the result as the physical address. 00108 // Otherwise, call memory management to convert the virtual address to 00109 // a physical address. 00110 // 00111 00112 if (((ULONG)VirtualAddress >= KSEG0_BASE) && 00113 ((ULONG)VirtualAddress < (KSEG1_BASE + 0x20000000))) { 00114 PhysicalAddress.LowPart = (ULONG)VirtualAddress & 0x1fffffff; 00115 PhysicalAddress.HighPart = 0; 00116 return PhysicalAddress; 00117 00118 } else { 00119 return MmGetPhysicalAddress(VirtualAddress); 00120 } 00121 }

VOID KiInstructionBusError IN PEXCEPTION_RECORD  ExceptionRecord,
IN PKEXCEPTION_FRAME  ExceptionFrame,
IN PKTRAP_FRAME  TrapFrame
 

Definition at line 216 of file mips/buserror.c.

References FALSE, INSTRUCTION_BUS_ERROR, KeBugCheck(), and KiGetPhysicalAddress().

Referenced by KiDispatchException().

00224 : 00225 00226 This function is called to process an instruction bus error. The virtual 00227 and physical address of the error are computed and the instruction bus 00228 error processing routine is called indirectly through the PCR. NT provides 00229 a standard routine to process the error and shutdown the system. A vendor, 00230 however, can replace the standard NT routine and do additional processing 00231 if necessary via the HAL. 00232 00233 N.B. There is no return from this routine. 00234 00235 Arguments: 00236 00237 ExceptionRecord - Supplies a pointer to an exception record. 00238 00239 ExceptionFrame - Supplies a pointer to an exception frame. 00240 00241 TrapFrame - Supplies a pointer to a trap frame. 00242 00243 Return Value: 00244 00245 None. 00246 00247 --*/ 00248 00249 { 00250 00251 PVOID VirtualAddress; 00252 PHYSICAL_ADDRESS PhysicalAddress; 00253 00254 // 00255 // Compute the physical address that corresponds to the data address. 00256 // 00257 00258 VirtualAddress = ExceptionRecord->ExceptionAddress; 00259 PhysicalAddress = KiGetPhysicalAddress(VirtualAddress); 00260 00261 // 00262 // If a value of FALSE is returned by the instructiona bus error handling 00263 // routine, then bug check. Otherwise, assume that the error has been 00264 // handled and return. 00265 // 00266 00267 if ((PCR->InstructionBusError)(ExceptionRecord, 00268 ExceptionFrame, 00269 TrapFrame, 00270 VirtualAddress, 00271 PhysicalAddress) == FALSE) { 00272 00273 KeBugCheck(INSTRUCTION_BUS_ERROR); 00274 } 00275 00276 return; 00277 }


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