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.

129 lines
3.4 KiB

  1. /*++
  2. Copyright (c) 1989-2000 Microsoft Corporation
  3. Component Name:
  4. HALIA64
  5. Module Name:
  6. xxhal.c
  7. Abstract:
  8. This module determines the HAL IA64 common features based on processor
  9. and platform types. This exposes the processor and system features
  10. that the HAL would use to enable / disable its own features.
  11. By the mean of HAL exported interfaces or exported global variables,
  12. the HAL exposes its supported features.
  13. Author:
  14. David N. Cutler (davec) 5-Mar-1989
  15. Environment:
  16. ToBeSpecified
  17. Revision History:
  18. 3/23/2000 Thierry Fevrier (v-thief@microsoft.com):
  19. Initial version
  20. --*/
  21. #include "halp.h"
  22. extern ULONG HalpMaxCPEImplemented;
  23. #ifdef ALLOC_PRAGMA
  24. #pragma alloc_text(INIT,HalpGetFeatureBits)
  25. #endif
  26. ULONG
  27. HalpGetFeatureBits (
  28. VOID
  29. )
  30. {
  31. ULONG bits = HALP_FEATURE_INIT;
  32. PKPRCB prcb = KeGetCurrentPrcb();
  33. //
  34. // Determine Processor type and System type.
  35. //
  36. // For the processor, this could come from:
  37. // - PAL_BUS_GET_FEATURES
  38. // - PAL_DEBUG_INFO ??
  39. // - PAL_FREQ_BASE
  40. // - PAL_FREQ_RATIOS
  41. // - PAL_PERF_MON_INFO
  42. // - PAL_PROC_GET_FEATURES
  43. // - PAL_REGISTER_INFO
  44. // - PAL_VERSION
  45. //
  46. // NOT-YET...
  47. //
  48. // Determine Processor features:
  49. // like support for Processor Hardware Performance Monitor Events and
  50. // - HAL_NO_SPECULATION
  51. // - HAL_MCA_PRESENT
  52. // NOT-YET - should call PAL PERF_MON call.
  53. bits |= HAL_PERF_EVENTS;
  54. //
  55. // Determine Platform features:
  56. // like support for Platform Performance Monitor Events...
  57. //
  58. // NOT-YET - should call SAL calls.
  59. //
  60. // Default software HAL support for IA64 Errors (MCA, CMC, CPE).
  61. //
  62. // However, we already know if we found an ACPI platform interrupt entry which identifier
  63. // is PLATFORM_INT_CPE.
  64. //
  65. bits |= HAL_MCA_PRESENT;
  66. if ( HalpCmcInfo.Stats.MaxLogSize ) {
  67. if ( HalpCmcInfo.Stats.MaxLogSize >= sizeof( ERROR_RECORD_HEADER )) {
  68. bits |= HAL_CMC_PRESENT;
  69. }
  70. else if ( prcb->Number == 0 ) {
  71. HalDebugPrint(( HAL_ERROR,
  72. "HAL!HalpGetFeatureBits: Invalid max CMC log size from SAL\n" ));
  73. }
  74. }
  75. //
  76. // Thierry 03/11/2001: WARNING WARNING
  77. // For the final release, the following HalpMaxCPEImplemented should be eliminated.
  78. // However the current FWs MCE situation is rather pathetic:
  79. // **** Do not allow the setting of HAL_CPE_PRESENT if HalpMaxCPEImplemented == 0 ****
  80. //
  81. // [good] reasons:
  82. // - We bugcheck with the current BigSur SAL/FW (<= build 99) at SAL_GET_STATE_INFO calls,
  83. // the FW assuming that we are calling the SAL MC related functions in physical mode.
  84. // - With the Lion SAL/FW (<= build 75), we bugcheck after getting MCA logs at boot time,
  85. // the FW having some virtualization issues.
  86. // Intel is committed to provide working FWs soon (< 2 weeks...).
  87. //
  88. if ( HalpMaxCPEImplemented && HalpCpeInfo.Stats.MaxLogSize ) {
  89. if ( HalpCpeInfo.Stats.MaxLogSize >= sizeof( ERROR_RECORD_HEADER ) ) {
  90. bits |= HAL_CPE_PRESENT;
  91. }
  92. else if ( prcb->Number == 0 ) {
  93. HalDebugPrint(( HAL_ERROR,
  94. "HAL!HalpGetFeatureBits: Invalid max CPE log size from SAL\n" ));
  95. }
  96. }
  97. return bits;
  98. } // HalpGetFeatureBits()