Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

113 lines
2.2 KiB

  1. /*++
  2. Copyright (c) 1993 Digital Equipment Corporation
  3. Module Name:
  4. buserror.c
  5. Abstract:
  6. This module implements the code necessary to process machine checks.
  7. Author:
  8. Joe Notarangelo 11-Feb-1993
  9. Environment:
  10. Kernel mode only.
  11. Revision History:
  12. --*/
  13. #include "ki.h"
  14. VOID
  15. KiMachineCheck (
  16. IN PEXCEPTION_RECORD ExceptionRecord,
  17. IN PKEXCEPTION_FRAME ExceptionFrame,
  18. IN PKTRAP_FRAME TrapFrame
  19. )
  20. /*++
  21. Routine Description:
  22. This function is called to process a machine check. If the vendor
  23. has supplied a machine check handler with its HAL then the machine
  24. check handler is called. If the routine returns TRUE indicating
  25. that the error has been handled then execution resumes, otherwise,
  26. a bugcheck is raised.
  27. If no machine check handler is registered or it does not indicate
  28. that the error has been handled, then this routine will attempt
  29. default handling. Default handling consists of checking the
  30. machine check status in the exception record. If the status indicates
  31. that the machine check is correctable or retryable then return and
  32. resume execution, otherwise a bugcheck is raised.
  33. Arguments:
  34. ExceptionRecord - Supplies a pointer to an exception record.
  35. ExceptionFrame - Supplies a pointer to an exception frame.
  36. TrapFrame - Supplies a pointer to a trap frame.
  37. Return Value:
  38. None.
  39. --*/
  40. {
  41. if( ((ULONG_PTR)PCR->MachineCheckError != 0) &&
  42. (PCR->MachineCheckError)(ExceptionRecord,
  43. ExceptionFrame,
  44. TrapFrame) ) {
  45. //
  46. // The HAL has handled the error.
  47. //
  48. return;
  49. } else {
  50. //
  51. // Either there is no HAL handler, or it did not handle the
  52. // error.
  53. //
  54. if( ExceptionRecord->ExceptionInformation[0] != 0 ){
  55. //
  56. // The error is either correctable or retryable, resume
  57. // execution.
  58. //
  59. #if DBG
  60. DbgPrint( "MCHK: resuming correctable or retryable error\n" );
  61. #endif //DBG
  62. return;
  63. }
  64. }
  65. //
  66. // The error was not handled and is not correctable or retryable.
  67. //
  68. KeBugCheck(DATA_BUS_ERROR);
  69. }