Windows NT 4.0 source code leak
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.

1031 lines
20 KiB

4 years ago
  1. /*++
  2. Copyright (c) 1993 Digital Equipment Corporation
  3. Module Name:
  4. mkinitnt.c
  5. Abstract:
  6. This module implements the platform-specific initialization for
  7. an Mikasa system.
  8. Author:
  9. Joe Notarangelo 25-Oct-1993
  10. Environment:
  11. Kernel mode only.
  12. Revision History:
  13. James Livingston 29-Apr-1994
  14. Adapted from Avanti module for Mikasa.
  15. Janet Schneider (Digital) 27-July-1995
  16. Added support for the Noritake.
  17. Balakumar Nagarajan (Digital) 9-Mar-1996
  18. Added Errorlogging support.
  19. --*/
  20. #include "halp.h"
  21. #include "pcrtc.h"
  22. #include "mikasa.h"
  23. #include "halpcsl.h"
  24. #include "eisa.h"
  25. #include "pci.h"
  26. #include "pcip.h"
  27. #include "iousage.h"
  28. #include "stdio.h"
  29. #include "fwcallbk.h"
  30. #include <ntverp.h> // to get the product build number.
  31. //
  32. // Define extern global buffer for the Uncorrectable Error Frame.
  33. // declared in halalpha\inithal.c
  34. //
  35. extern PERROR_FRAME PUncorrectableError;
  36. #if DBG
  37. VOID
  38. DumpEpic(
  39. VOID
  40. );
  41. #endif // DBG
  42. //
  43. // Define the Product Naming data.
  44. //
  45. PCHAR HalpFamilyName = "AlphaServer";
  46. PCHAR HalpProductName = "1000";
  47. ULONG HalpProcessorNumber = 4;
  48. #define MAX_INIT_MSG (80)
  49. //
  50. // Define global data for builtin device interrupt enables.
  51. //
  52. USHORT HalpBuiltinInterruptEnable;
  53. // irql mask and tables
  54. //
  55. // irql 0 - passive
  56. // irql 1 - sfw apc level
  57. // irql 2 - sfw dispatch level
  58. // irql 3 - device low
  59. // irql 4 - device high
  60. // irql 5 - clock
  61. // irql 6 - real time, ipi, performance counters
  62. // irql 7 - error, mchk, nmi, halt
  63. //
  64. //
  65. // IDT mappings:
  66. // For the built-ins, GetInterruptVector will need more info,
  67. // or it will have to be built-in to the routines, since
  68. // these don't match IRQL levels in any meaningful way.
  69. //
  70. // 0 passive 8 perf cntr 1
  71. // 1 apc 9
  72. // 2 dispatch 10 PIC
  73. // 3 11
  74. // 4 12 errors
  75. // 5 clock 13
  76. // 6 perf cntr 0 14 halt
  77. // 7 nmi 15
  78. //
  79. // This is assuming the following prioritization:
  80. // nmi
  81. // halt
  82. // errors
  83. // performance counters
  84. // clock
  85. // pic
  86. //
  87. // The hardware interrupt pins are used as follows for Mikasa
  88. //
  89. // IRQ_H[0] = EPIC Error
  90. // IRQ_H[1] = EISA Interrupt (PIC)
  91. // IRQ_H[2] = PCI Interrupt
  92. // IRQ_H[3] = Reserved
  93. // IRQ_H[4] = Clock
  94. // IRQ_H[5] = NMI (includes Halt)
  95. //
  96. // For information purposes: here is what the IDT division looks like:
  97. //
  98. // 000-015 Built-ins (we only use 8 entries; NT wants 10)
  99. // 016-031 ISA
  100. // 048-063 EISA
  101. // 080-095 PCI
  102. // 112-127 Turbo Channel
  103. // 128-255 unused, as are all other holes
  104. //
  105. //
  106. // Define the bus type, this value allows us to distinguish between
  107. // EISA and ISA systems. We're only interested in distinguishing
  108. // between just those two buses.
  109. //
  110. ULONG HalpBusType = MACHINE_TYPE_EISA;
  111. //
  112. // This is the PCI Memory space that cannot be used by anyone
  113. // and therefore the HAL says it is reserved for itself
  114. //
  115. //ADDRESS_USAGE
  116. //MikasaPCIMemorySpace = {
  117. // NULL, CmResourceTypeMemory, PCIUsage,
  118. // {
  119. // __8MB, ( __32MB - __8MB ), // Start=8MB; Length=24MB
  120. // 0,0
  121. // }
  122. //};
  123. //
  124. // Define global data used to communicate new clock rates to the clock
  125. // interrupt service routine.
  126. //
  127. ULONG HalpCurrentTimeIncrement;
  128. ULONG HalpNextRateSelect;
  129. ULONG HalpNextTimeIncrement;
  130. ULONG HalpNewTimeIncrement;
  131. //
  132. // Determines if the platform is a Noritake.
  133. //
  134. BOOLEAN HalpNoritakePlatform;
  135. //
  136. // Function prototypes.
  137. //
  138. VOID
  139. HalpInitializeHAERegisters(
  140. VOID
  141. );
  142. VOID
  143. HalpClearInterrupts(
  144. VOID
  145. );
  146. BOOLEAN
  147. HalpInitializeMikasaAndNoritakeInterrupts(
  148. VOID
  149. );
  150. VOID
  151. HalpParseLoaderBlock(
  152. PLOADER_PARAMETER_BLOCK LoaderBlock
  153. );
  154. VOID
  155. HalpRegisterPlatformResources(
  156. PUCHAR HalName
  157. );
  158. VOID
  159. HalpDetermineMachineType(
  160. VOID
  161. );
  162. BOOLEAN
  163. HalpInitializeInterrupts (
  164. VOID
  165. )
  166. /*++
  167. Routine Description:
  168. This function initializes interrupts for an Alpha system.
  169. Arguments:
  170. None.
  171. Return Value:
  172. A value of TRUE is returned if the initialization is successfully
  173. completed. Otherwise a value of FALSE is returned.
  174. --*/
  175. {
  176. UCHAR DataByte;
  177. ULONG Irq;
  178. KIRQL Irql;
  179. UCHAR Priority;
  180. ULONG Vector;
  181. //
  182. // Initialize HAL processor parameters based on estimated CPU speed.
  183. // This must be done before HalpStallExecution is called. Compute integral
  184. // megahertz first to avoid rounding errors due to imprecise cycle clock
  185. // period values.
  186. //
  187. HalpInitializeProcessorParameters();
  188. //
  189. // Connect the Stall interrupt vector to the clock. When the
  190. // profile count is calculated, we then connect the normal
  191. // clock.
  192. PCR->InterruptRoutine[CLOCK2_LEVEL] = HalpStallInterrupt;
  193. //
  194. // Clear all pending interrupts
  195. //
  196. HalpClearInterrupts();
  197. //
  198. // Start the peridodic interrupt from the RTC
  199. //
  200. HalpProgramIntervalTimer(MAXIMUM_RATE_SELECT);
  201. // jwlfix - Does the following apply to me on Mikasa?
  202. //
  203. //jnfix, wkc - init the Eisa interrupts after the chip, don't init the
  204. // PIC here, fix halenablesysteminterrupt to init the pic
  205. // interrrupt, as in sable
  206. //
  207. // Initialize EISA, PCI and NMI interrupts.
  208. //
  209. HalpInitializeMikasaAndNoritakeInterrupts();
  210. //
  211. // Initialize the 21064 interrupts.
  212. //
  213. HalpInitialize21064Interrupts();
  214. HalpEnable21064SoftwareInterrupt( Irql = APC_LEVEL );
  215. HalpEnable21064SoftwareInterrupt( Irql = DISPATCH_LEVEL );
  216. HalpEnable21064HardwareInterrupt( Irq = 5,
  217. Irql = HIGH_LEVEL,
  218. Vector = EISA_NMI_VECTOR,
  219. Priority = 0 );
  220. HalpEnable21064HardwareInterrupt( Irq = 4,
  221. Irql = CLOCK_LEVEL,
  222. Vector = CLOCK_VECTOR,
  223. Priority = 0 );
  224. HalpEnable21064HardwareInterrupt( Irq = 2,
  225. Irql = DEVICE_LEVEL,
  226. Vector = PCI_VECTOR,
  227. Priority = 0 );
  228. HalpEnable21064HardwareInterrupt( Irq = 1,
  229. Irql = DEVICE_LEVEL,
  230. Vector = PIC_VECTOR,
  231. Priority = 0 );
  232. return TRUE;
  233. }
  234. VOID
  235. HalpClearInterrupts(
  236. )
  237. /*++
  238. Routine Description:
  239. This function no longer does anything.
  240. Arguments:
  241. None.
  242. Return Value:
  243. None.
  244. --*/
  245. {
  246. return;
  247. }
  248. VOID
  249. HalpSetTimeIncrement(
  250. VOID
  251. )
  252. /*++
  253. Routine Description:
  254. This routine is responsible for setting the time increment for an EV4
  255. based machine via a call into the kernel.
  256. Arguments:
  257. None.
  258. Return Value:
  259. None.
  260. --*/
  261. {
  262. //
  263. // Set the time increment value.
  264. //
  265. HalpCurrentTimeIncrement = MAXIMUM_INCREMENT;
  266. HalpNextTimeIncrement = MAXIMUM_INCREMENT;
  267. HalpNextRateSelect = 0;
  268. KeSetTimeIncrement( MAXIMUM_INCREMENT, MINIMUM_INCREMENT );
  269. }
  270. //
  271. // Define global data used to calibrate and stall processor execution.
  272. //
  273. ULONG HalpProfileCountRate;
  274. VOID
  275. HalpInitializeClockInterrupts(
  276. VOID
  277. )
  278. /*++
  279. Routine Description:
  280. This function is called during phase 1 initialization to complete
  281. the initialization of clock interrupts. For EV4, this function
  282. connects the true clock interrupt handler and initializes the values
  283. required to handle profile interrupts.
  284. Arguments:
  285. None.
  286. Return Value:
  287. None.
  288. --*/
  289. {
  290. //
  291. // Compute the profile interrupt rate.
  292. //
  293. HalpProfileCountRate = ((1000 * 1000 * 10) / KeQueryTimeIncrement());
  294. //
  295. // Set the time increment value and connect the real clock interrupt
  296. // routine.
  297. //
  298. PCR->InterruptRoutine[CLOCK2_LEVEL] = HalpClockInterrupt;
  299. return;
  300. }
  301. VOID
  302. HalpEstablishErrorHandler(
  303. VOID
  304. )
  305. /*++
  306. Routine Description:
  307. This routine performs the initialization necessary for the HAL to
  308. begin servicing machine checks.
  309. Arguments:
  310. None.
  311. Return Value:
  312. None.
  313. --*/
  314. {
  315. BOOLEAN ReportCorrectables;
  316. //
  317. // Connect the machine check handler via the PCR.
  318. //
  319. PCR->MachineCheckError = HalMachineCheck;
  320. //
  321. // Initialize error handling for APECS.
  322. //
  323. HalpInitializeMachineChecks( ReportCorrectables = FALSE );
  324. return;
  325. }
  326. VOID
  327. HalpInitializeMachineDependent(
  328. IN ULONG Phase,
  329. IN PLOADER_PARAMETER_BLOCK LoaderBlock
  330. )
  331. /*++
  332. Routine Description:
  333. This function performs any EV4-specific initialization based on
  334. the current phase on initialization.
  335. Arguments:
  336. Phase - Supplies an indicator for phase of initialization, phase 0 or
  337. phase 1.
  338. LoaderBlock - supplies a pointer to the loader block.
  339. Return Value:
  340. None.
  341. --*/
  342. {
  343. ULONG BusIrql;
  344. ULONG BusNumber;
  345. UCHAR MsgBuffer[MAX_INIT_MSG];
  346. BOOLEAN ReportCorrectables;
  347. BOOLEAN PciParityChecking;
  348. if( Phase == 0 ){
  349. //
  350. // Phase 0 Initialization.
  351. //
  352. //
  353. // Parse the Loader Parameter block looking for PCI entry to determine
  354. // if PCI parity should be disabled
  355. //
  356. HalpParseLoaderBlock( LoaderBlock );
  357. //
  358. // Re-establish the error handler, to reflect the parity checking
  359. //
  360. HalpEstablishErrorHandler();
  361. //
  362. // Set up the hardware address extension registers.
  363. //
  364. HalpInitializeHAERegisters();
  365. //
  366. // Determine whether we are on a Noritake or a Mikasa platform.
  367. //
  368. HalpDetermineMachineType();
  369. } else {
  370. //
  371. // Phase 1 Initialization.
  372. //
  373. //
  374. // Initialize the existing bus handlers.
  375. //
  376. HalpRegisterInternalBusHandlers();
  377. //
  378. // Initialize PCI Bus.
  379. //
  380. HalpInitializePCIBus (LoaderBlock);
  381. //
  382. // Initialize profiler.
  383. //
  384. HalpInitializeProfiler();
  385. //
  386. // Print a message with version number.
  387. //
  388. sprintf( MsgBuffer,
  389. "Digital Equipment Corporation %s %s %d/%d\n",
  390. HalpFamilyName,
  391. HalpProductName,
  392. HalpProcessorNumber,
  393. HalpClockMegaHertz );
  394. HalDisplayString( MsgBuffer );
  395. //
  396. // Register the name of the HAL.
  397. //
  398. sprintf( MsgBuffer,
  399. "%s %s %d/%d PCI/EISA HAL",
  400. HalpFamilyName,
  401. HalpProductName,
  402. HalpProcessorNumber,
  403. HalpClockMegaHertz );
  404. HalpRegisterPlatformResources( MsgBuffer );
  405. }
  406. return;
  407. }
  408. VOID
  409. HalpRegisterPlatformResources(
  410. PUCHAR HalName
  411. )
  412. /*++
  413. Routine Description:
  414. Register I/O resources used by the HAL.
  415. Arguments:
  416. HalName - Supplies a pointer to the name for the HAL.
  417. Return Value:
  418. None.
  419. --*/
  420. {
  421. RESOURCE_USAGE Resource;
  422. //
  423. // Register the buses.
  424. //
  425. HalpRegisterBusUsage(Internal);
  426. HalpRegisterBusUsage(Eisa);
  427. HalpRegisterBusUsage(Isa);
  428. HalpRegisterBusUsage(PCIBus);
  429. //
  430. // Register the name of the HAL.
  431. //
  432. HalpRegisterHalName( HalName );
  433. //
  434. // Register the interrupt vector used for the cascaded interrupt
  435. // on the 8254s.
  436. //
  437. Resource.BusType = Isa;
  438. Resource.BusNumber = 0;
  439. Resource.ResourceType = CmResourceTypeInterrupt;
  440. Resource.u.InterruptMode = Latched;
  441. Resource.u.BusInterruptVector = 2;
  442. Resource.u.SystemInterruptVector = 2;
  443. Resource.u.SystemIrql = 2;
  444. HalpRegisterResourceUsage(&Resource);
  445. //
  446. // Register machine specific io/memory addresses.
  447. //
  448. Resource.BusType = Isa;
  449. Resource.BusNumber = 0;
  450. Resource.ResourceType = CmResourceTypePort;
  451. Resource.u.Start = I2C_INTERFACE_DATA_PORT;
  452. Resource.u.Length = I2C_INTERFACE_LENGTH;
  453. HalpRegisterResourceUsage(&Resource);
  454. Resource.u.Start = SUPERIO_INDEX_PORT;
  455. Resource.u.Length = SUPERIO_PORT_LENGTH;
  456. HalpRegisterResourceUsage(&Resource);
  457. //
  458. // Register the DMA channel used for the cascade.
  459. //
  460. Resource.BusType = Isa;
  461. Resource.BusNumber = 0;
  462. Resource.ResourceType = CmResourceTypeDma;
  463. Resource.u.DmaChannel = 0x4;
  464. Resource.u.DmaPort = 0x0;
  465. HalpRegisterResourceUsage(&Resource);
  466. }
  467. VOID
  468. HalpStallInterrupt (
  469. VOID
  470. )
  471. /*++
  472. Routine Description:
  473. This function serves as the stall calibration interrupt service
  474. routine. It is executed in response to system clock interrupts
  475. during the initialization of the HAL layer.
  476. Arguments:
  477. None.
  478. Return Value:
  479. None.
  480. --*/
  481. {
  482. HalpAcknowledgeClockInterrupt();
  483. return;
  484. }
  485. ULONG
  486. HalSetTimeIncrement (
  487. IN ULONG DesiredIncrement
  488. )
  489. /*++
  490. Routine Description:
  491. This function is called to set the clock interrupt rate to the frequency
  492. required by the specified time increment value.
  493. Arguments:
  494. DesiredIncrement - Supplies desired number of 100ns units between clock
  495. interrupts.
  496. Return Value:
  497. The actual time increment in 100ns units.
  498. --*/
  499. {
  500. ULONG NewTimeIncrement;
  501. ULONG NextRateSelect;
  502. KIRQL OldIrql;
  503. //
  504. // Raise IRQL to the highest level, set the new clock interrupt
  505. // parameters, lower IRQl, and return the new time increment value.
  506. //
  507. KeRaiseIrql(HIGH_LEVEL, &OldIrql);
  508. if (DesiredIncrement < MINIMUM_INCREMENT) {
  509. DesiredIncrement = MINIMUM_INCREMENT;
  510. }
  511. if (DesiredIncrement > MAXIMUM_INCREMENT) {
  512. DesiredIncrement = MAXIMUM_INCREMENT;
  513. }
  514. //
  515. // Find the allowed increment that is less than or equal to
  516. // the desired increment.
  517. //
  518. if (DesiredIncrement >= RTC_PERIOD_IN_CLUNKS4) {
  519. NewTimeIncrement = RTC_PERIOD_IN_CLUNKS4;
  520. NextRateSelect = RTC_RATE_SELECT4;
  521. } else if (DesiredIncrement >= RTC_PERIOD_IN_CLUNKS3) {
  522. NewTimeIncrement = RTC_PERIOD_IN_CLUNKS3;
  523. NextRateSelect = RTC_RATE_SELECT3;
  524. } else if (DesiredIncrement >= RTC_PERIOD_IN_CLUNKS2) {
  525. NewTimeIncrement = RTC_PERIOD_IN_CLUNKS2;
  526. NextRateSelect = RTC_RATE_SELECT2;
  527. } else {
  528. NewTimeIncrement = RTC_PERIOD_IN_CLUNKS1;
  529. NextRateSelect = RTC_RATE_SELECT1;
  530. }
  531. HalpNextRateSelect = NextRateSelect;
  532. HalpNewTimeIncrement = NewTimeIncrement;
  533. KeLowerIrql(OldIrql);
  534. return NewTimeIncrement;
  535. }
  536. VOID
  537. HalpInitializeHAERegisters(
  538. VOID
  539. )
  540. /*++
  541. Routine Description:
  542. This function initializes the HAE registers in the EPIC/APECS chipset.
  543. It also register the holes in the PCI memory space if any.
  544. Arguments:
  545. none
  546. Return Value:
  547. none
  548. --*/
  549. {
  550. //
  551. // Set HAXR1 and HAXR2 registers
  552. //
  553. // We set HAXR1 to 0. This means HAXR1 has no effect.
  554. //
  555. WRITE_EPIC_REGISTER( &((PEPIC_CSRS)(APECS_EPIC_BASE_QVA))->Haxr1, 0);
  556. //
  557. // We set HAXR2 to 0. Which means we have the following
  558. // PCI IO addresses:
  559. // 0 to 64KB VALID. HAXR2 Not used in address translation
  560. // 64K to 16MB VALID. HAXR2 is used in the address translation
  561. //
  562. WRITE_EPIC_REGISTER( &((PEPIC_CSRS)(APECS_EPIC_BASE_QVA))->Haxr2, 0);
  563. //
  564. // Report that the apecs mapping to the Io subsystem
  565. //
  566. // HalpRegisterAddressUsage (&MikasaPCIMemorySpace);
  567. #if DBG
  568. DumpEpic();
  569. #endif // DBG
  570. }
  571. VOID
  572. HalpResetHAERegisters(
  573. VOID
  574. )
  575. /*++
  576. Routine Description:
  577. This function resets the HAE registers in the EPIC chip to 0.
  578. This is routine called during a shutdown so that the prom
  579. gets a predictable environment.
  580. Arguments:
  581. none
  582. Return Value:
  583. none
  584. --*/
  585. {
  586. WRITE_EPIC_REGISTER( &((PEPIC_CSRS)(APECS_EPIC_BASE_QVA))->Haxr1, 0 );
  587. WRITE_EPIC_REGISTER( &((PEPIC_CSRS)(APECS_EPIC_BASE_QVA))->Haxr2, 0 );
  588. }
  589. VOID
  590. HalpDetermineMachineType(
  591. VOID
  592. )
  593. /*++
  594. Routine Description:
  595. This routine will determine whether the platform we are running on is a
  596. Noritake or a Mikasa, and set HalpNoritakePlatform accordingly.
  597. Arguments:
  598. None.
  599. Return value:
  600. None.
  601. --*/
  602. {
  603. PSYSTEM_ID SystemId;
  604. //
  605. // Get the ProductId, and see if it contains "Nori".
  606. // (The ProductId could be "1Nori" or "10Nori".)
  607. //
  608. SystemId = ArcGetSystemId();
  609. if( strstr( &SystemId->ProductId[0], "Nori" ) != 0 ) {
  610. HalpNoritakePlatform = TRUE;
  611. } else {
  612. HalpNoritakePlatform = FALSE;
  613. }
  614. }
  615. VOID
  616. HalpGetMachineDependentErrorFrameSizes(
  617. PULONG RawProcessorSize,
  618. PULONG RawSystemInfoSize
  619. )
  620. /*++
  621. Routine Description:
  622. This function returns the size of the system specific structures.
  623. Arguments:
  624. RawProcessorSize - Pointer to a buffer that will receive the
  625. size of the processor specific error information buffer.
  626. RawSystemInfoSize - Pointer to a buffer that will receive the
  627. size of the system specific error information buffer.
  628. Return Value:
  629. none
  630. --*/
  631. {
  632. *RawProcessorSize = sizeof(PROCESSOR_EV4_UNCORRECTABLE);
  633. *RawSystemInfoSize = sizeof(APECS_UNCORRECTABLE_FRAME);
  634. return;
  635. }
  636. VOID
  637. HalpGetSystemInfo(SYSTEM_INFORMATION *SystemInfo)
  638. /*++
  639. Routine Description:
  640. This function fills in the System information.
  641. Arguments:
  642. SystemInfo - Pointer to the SYSTEM_INFORMATION buffer that needs
  643. to be filled in.
  644. Return Value:
  645. none
  646. --*/
  647. {
  648. char systemtype[] = "Mikasa";
  649. EXTENDED_SYSTEM_INFORMATION FwExtSysInfo;
  650. VenReturnExtendedSystemInformation(&FwExtSysInfo);
  651. RtlCopyMemory(SystemInfo->FirmwareRevisionId,
  652. FwExtSysInfo.FirmwareVersion,
  653. 16);
  654. RtlCopyMemory(SystemInfo->SystemType,systemtype, 8);
  655. SystemInfo->ClockSpeed =
  656. ((1000 * 1000) + (PCR->CycleClockPeriod >> 1)) / PCR->CycleClockPeriod;
  657. SystemInfo->SystemRevision = PCR->SystemRevision;
  658. RtlCopyMemory(SystemInfo->SystemSerialNumber,
  659. PCR->SystemSerialNumber,
  660. 16);
  661. SystemInfo->SystemVariant = PCR->SystemVariant;
  662. SystemInfo->PalMajorVersion = PCR->PalMajorVersion;
  663. SystemInfo->PalMinorVersion = PCR->PalMinorVersion;
  664. SystemInfo->OsRevisionId = VER_PRODUCTBUILD;
  665. //
  666. // For now fill in dummy values.
  667. //
  668. SystemInfo->ModuleVariant = 1UL;
  669. SystemInfo->ModuleRevision = 1UL;
  670. SystemInfo->ModuleSerialNumber = 0;
  671. return;
  672. }
  673. VOID
  674. HalpInitializeUncorrectableErrorFrame (
  675. VOID
  676. )
  677. /*++
  678. Routine Description:
  679. This function Allocates an Uncorrectable Error frame for this
  680. system and initializes the frame with certain constant/global
  681. values.
  682. This is routine called during machine dependent system
  683. Initialization.
  684. Arguments:
  685. none
  686. Return Value:
  687. none
  688. --*/
  689. {
  690. //
  691. // If the Uncorrectable error buffer is not set then simply return
  692. //
  693. if(PUncorrectableError == NULL)
  694. return;
  695. PUncorrectableError->Signature = ERROR_FRAME_SIGNATURE;
  696. PUncorrectableError->FrameType = UncorrectableFrame;
  697. //
  698. // ERROR_FRAME_VERSION is define in errframe.h and will
  699. // change as and when there is a change in the errframe.h.
  700. // This Version number helps the service, that reads this
  701. // information from the dumpfile, to check if it knows about
  702. // this frmae version type to decode. If it doesn't know, it
  703. // will dump the entire frame to the EventLog with a message
  704. // "Error Frame Version Mismatch".
  705. //
  706. PUncorrectableError->VersionNumber = ERROR_FRAME_VERSION;
  707. //
  708. // The sequence number will always be 1 for Uncorrectable errors.
  709. //
  710. PUncorrectableError->SequenceNumber = 1;
  711. //
  712. // The PerformanceCounterValue field is not used for Uncorrectable
  713. // errors.
  714. //
  715. PUncorrectableError->PerformanceCounterValue = 0;
  716. //
  717. // We will fill in the UncorrectableFrame.SystemInfo here.
  718. //
  719. HalpGetSystemInfo(&PUncorrectableError->UncorrectableFrame.System);
  720. PUncorrectableError->UncorrectableFrame.Flags.SystemInformationValid = 1;
  721. return;
  722. }