Leaked source code of windows server 2003
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.

260 lines
6.1 KiB

  1. //###########################################################################
  2. //**
  3. //** Copyright (C) 1996-98 Intel Corporation. All rights reserved.
  4. //**
  5. //** The information and source code contained herein is the exclusive
  6. //** property of Intel Corporation and may not be disclosed, examined
  7. //** or reproduced in whole or in part without explicit written authorization
  8. //** from the company.
  9. //**
  10. //###########################################################################
  11. //-----------------------------------------------------------------------------
  12. // Version control information follows.
  13. //
  14. // $Header: I:/DEVPVCS/OSMCA/oemmca.c_v 2.1 09 Mar 1999 10:30:24 smariset $
  15. // $Log: I:/DEVPVCS/OSMCA/oemmca.c_v $
  16. //
  17. // Rev 2.1 09 Mar 1999 10:30:24 smariset
  18. // *.h consolidation
  19. //
  20. // Rev 2.0 Dec 11 1998 11:42:18 khaw
  21. // Post FW 0.5 release sync-up
  22. //
  23. // Rev 1.5 29 Oct 1998 14:25:00 smariset
  24. //Consolidated Sources
  25. //
  26. // Rev 1.4 07 Aug 1998 13:47:50 smariset
  27. //
  28. //
  29. // Rev 1.3 10 Jul 1998 11:04:22 smariset
  30. //just checking in
  31. //
  32. // Rev 1.2 08 Jul 1998 14:23:14 smariset
  33. //
  34. //
  35. // Rev 1.1 02 Jul 1998 15:36:32 smariset
  36. //
  37. //
  38. // Rev 1.0 02 Jul 1998 09:20:56 smariset
  39. //
  40. //
  41. ///////////////////////////////////////////////////////////////////////////////
  42. //
  43. // Module Name: OEMMCA.C - Merced OS Machine Check Handler
  44. //
  45. // Description:
  46. // This module has OEM machine check handler
  47. //
  48. // Contents: OemMcaHndlr()
  49. // PlatMcaHndlr()
  50. //
  51. //
  52. // Target Platform: Merced
  53. //
  54. // Reuse: None
  55. //
  56. ////////////////////////////////////////////////////////////////////////////M//
  57. #include "halp.h"
  58. #include "arc.h"
  59. #include "i64fw.h"
  60. #include "check.h"
  61. #include "osmca.h"
  62. #include "oemmca.h"
  63. fptr pOsGetErrLog=0; // global pointer for OEM MCA entry point
  64. //++
  65. // Name: OemMcaInit()
  66. //
  67. // Routine Description:
  68. //
  69. // This routine registers OEM MCA handler initialization
  70. //
  71. // Arguments On Entry:
  72. // arg0 = Function ID
  73. //
  74. // Success/Failure (0/!0)
  75. //--
  76. SAL_PAL_RETURN_VALUES
  77. OemMcaInit(void)
  78. {
  79. SAL_PAL_RETURN_VALUES rv={0};
  80. // register the OS_MCA call back handler
  81. rv=HalpOemToOsMcaRegisterProc((fptr)OemMcaDispatch);
  82. return(rv);
  83. }
  84. //EndProc//////////////////////////////////////////////////////////////////////
  85. //++
  86. // Name: OemMcaDispatch()
  87. //
  88. // Routine Description:
  89. //
  90. // This is the OEM call back handler, which is only exported
  91. // to the OS_MCA for call back during MCA/CMC errors. This
  92. // handler will dispatch to the appripriate CMC/MCA proc.
  93. //
  94. // Arguments On Entry:
  95. // arg0 = Error Event (MchkEvent/CmcEvent)
  96. //
  97. // Success/Failure (0/!0)
  98. //--
  99. SAL_PAL_RETURN_VALUES
  100. OemMcaDispatch(ULONGLONG eFlag)
  101. {
  102. SAL_PAL_RETURN_VALUES rv={0};
  103. if(eFlag==MchkEvent)
  104. rv=OemMcaHndlr();
  105. else
  106. rv=OemCmcHndlr();
  107. return(rv);
  108. }
  109. //EndProc//////////////////////////////////////////////////////////////////////
  110. //++
  111. // Name: OemCmcHndlr()
  112. //
  113. // Routine Description:
  114. //
  115. // This is the OsMca CMC Handler, which is called by
  116. // the CMC interrupt handler in virtual mode
  117. //
  118. // Arguments On Entry:
  119. // arg0 = Function ID
  120. //
  121. // Success/Failure (0/!0)
  122. //--
  123. SAL_PAL_RETURN_VALUES
  124. OemCmcHndlr(void)
  125. {
  126. SAL_PAL_RETURN_VALUES rv={0};
  127. PsiLog myPsiLog;
  128. if(pOsGetErrLog >0)
  129. {
  130. rv=HalpOsGetErrLog(0, CmcEvent, PROC_LOG, (ULONGLONG*)&myPsiLog, sizeof(PsiLog));
  131. rv=HalpOsGetErrLog(0, CmcEvent, PLAT_LOG, (ULONGLONG*)&myPsiLog, sizeof(PsiLog));
  132. }
  133. return(rv);
  134. }
  135. //EndProc//////////////////////////////////////////////////////////////////////
  136. //++
  137. // Name: OemMcaHndlr()
  138. //
  139. // Routine Description:
  140. //
  141. // This is the OsMca handler for firmware uncorrected errors
  142. //
  143. // Arguments On Entry:
  144. // arg0 = Function ID
  145. //
  146. // Success/Failure:
  147. // Error Corrected/Not Corrected (0/!0)
  148. //--
  149. SAL_PAL_RETURN_VALUES
  150. OemMcaHndlr(void)
  151. {
  152. SAL_PAL_RETURN_VALUES rv={0};
  153. rv=OemProcErrHndlr();
  154. rv=OemPlatErrHndlr();
  155. return(rv);
  156. }
  157. //EndProc//////////////////////////////////////////////////////////////////////
  158. //++
  159. // Name: OemProcErrHndlr()
  160. //
  161. // Routine Description:
  162. //
  163. // This routine reads or writes data to NVM space
  164. //
  165. // Arguments On Entry:
  166. // arg0 = Function ID
  167. //
  168. // Success/Failure (0/!0)
  169. //--
  170. SAL_PAL_RETURN_VALUES
  171. OemProcErrHndlr(void)
  172. {
  173. SAL_PAL_RETURN_VALUES rv={0};
  174. PsiLog myPsiLog;
  175. // first let us get the error log
  176. if(pOsGetErrLog >0)
  177. {
  178. rv=HalpOsGetErrLog(0, MchkEvent, PROC_LOG, (ULONGLONG*)&myPsiLog, sizeof(PsiLog));
  179. }
  180. return(rv);
  181. }
  182. //EndProc//////////////////////////////////////////////////////////////////////
  183. //++
  184. // Name: OemPlatErrHndlr()
  185. //
  186. // Routine Description:
  187. //
  188. // This routine reads or writes data to NVM space
  189. //
  190. // Arguments On Entry:
  191. // arg0 = Function ID
  192. //
  193. // Success/Failure (0/!0)
  194. //--
  195. SAL_PAL_RETURN_VALUES
  196. OemPlatErrHndlr(void)
  197. {
  198. SAL_PAL_RETURN_VALUES rv={0};
  199. PsiLog myPsiLog;
  200. // first let us get the error log
  201. if(pOsGetErrLog >0)
  202. {
  203. rv=HalpOsGetErrLog(0, MchkEvent, PLAT_LOG, (ULONGLONG*)&myPsiLog, sizeof(PsiLog));
  204. }
  205. return(rv);
  206. }
  207. //EndProc//////////////////////////////////////////////////////////////////////
  208. //++
  209. // Name: OemMcaCb()
  210. //
  211. // Routine Description:
  212. //
  213. // The entry point to this procedure is registered with OsMca
  214. // fw interface for call back to return the call back address of OS proc.
  215. //
  216. // Arguments On Entry:
  217. // arg0 = OS MCA call back handler entry point
  218. //
  219. // Success/Failure (0/!0)
  220. //--
  221. SAL_PAL_RETURN_VALUES
  222. OemMcaCb(fptr pOsHndlr)
  223. {
  224. SAL_PAL_RETURN_VALUES rv={0};
  225. pOsGetErrLog=pOsHndlr;
  226. return(rv);
  227. }
  228. //EndProc//////////////////////////////////////////////////////////////////////