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.

689 lines
15 KiB

  1. /*++ BUILD Version: 0000 Increment this if a change has global effects
  2. Copyright (c) 1996 Digital Euipment Corporation
  3. Module Name:
  4. axp21264.h
  5. Abstract:
  6. This module defines the DECchip 21264-specific structures that are
  7. defined in the PAL but must be visible to the HAL.
  8. Revision History:
  9. --*/
  10. #ifndef _AXP21264_
  11. #define _AXP21264_
  12. //
  13. // Define the "special" processor bus used by all machines that run a
  14. // DECchip 21264. The processor bus is used to access the internal
  15. // performance counters.
  16. //
  17. #define PROCESSOR_BUS_21264 21264
  18. //
  19. // Define the physical address bit that turns on user-mode access
  20. // to I/O space in the pfn of a pte. This bit is required because of
  21. // the current 36 bit physical address space limit on NT.
  22. //
  23. #define EV6_USER_IO_ADDRESS_SPACE (ULONGLONG)(0x800000000)
  24. //
  25. // Define the Ebox Internal Processor Register formats.
  26. //
  27. //
  28. // Define the CC_CTL.
  29. //
  30. typedef union _CC_CTL_21264{
  31. struct {
  32. ULONGLONG Count : 32;
  33. ULONGLONG CcEna : 1;
  34. ULONGLONG Ignore : 31;
  35. } ;
  36. ULONGLONG all;
  37. } CC_CTL_21264, *PCC_CTL_21264;
  38. //
  39. // Define VA_CTL.
  40. //
  41. typedef union _VA_CTL_21264{
  42. struct {
  43. ULONGLONG BigEndian : 1;
  44. ULONGLONG Va48 : 1;
  45. ULONGLONG VaForm32 : 1;
  46. ULONGLONG Mbz : 27;
  47. ULONGLONG VPtb : 34;
  48. };
  49. ULONGLONG all;
  50. } VA_CTL_21264, *PVA_CTL_21264;
  51. //
  52. // Define the Ibox Internal Processor Register formats.
  53. //
  54. //
  55. // Define ITB_PTE.
  56. //
  57. typedef union _ITB_PTE_21264{
  58. struct {
  59. ULONGLONG Ignore1 : 4;
  60. ULONGLONG Asm : 1;
  61. ULONGLONG Gh : 2;
  62. ULONGLONG Ignore2 : 1;
  63. ULONGLONG Kre : 1;
  64. ULONGLONG Ere : 1;
  65. ULONGLONG Sre : 1;
  66. ULONGLONG Ure : 1;
  67. ULONGLONG Ignore3 : 1;
  68. ULONGLONG Pfn : 31;
  69. ULONGLONG Ignore4 : 20;
  70. };
  71. ULONGLONG all;
  72. } ITB_PTE_21264, *PITB_PTE_21264;
  73. //
  74. // Define EXC_ADDR
  75. //
  76. typedef union _EXC_ADDR_21264{
  77. struct{
  78. ULONGLONG Pal : 1;
  79. ULONGLONG Raz : 1;
  80. ULONGLONG Pc : 62;
  81. };
  82. ULONGLONG all;
  83. } EXC_ADDR_21264, *PEXC_ADDR_21264;
  84. //
  85. // Define IER_CM - Interrupt Enable/Current Mode Register
  86. // Note that this can be also be written as two independant registers.
  87. //
  88. typedef union _IER_CM_21264{
  89. struct {
  90. ULONGLONG Raz1 : 3;
  91. ULONGLONG Cm : 2;
  92. ULONGLONG Raz2 : 8;
  93. ULONGLONG AstEn : 1;
  94. ULONGLONG SiEn : 15;
  95. ULONGLONG PcEn : 2;
  96. ULONGLONG CrEn : 1;
  97. ULONGLONG SlEn : 1;
  98. ULONGLONG EiEn : 6;
  99. ULONGLONG Raz3 : 25;
  100. };
  101. ULONGLONG all;
  102. } IER_CM_21264, *PIER_CM_21264;
  103. //
  104. // Define SIRR - Software Interrupt Request Register
  105. //
  106. typedef union _SIRR_21264{
  107. struct{
  108. ULONGLONG Raz1 : 14;
  109. ULONGLONG Sir : 15;
  110. ULONGLONG Raz2 : 35;
  111. };
  112. ULONGLONG all;
  113. } SIRR_21264, *PSIRR_21264;
  114. //
  115. // Define ISUM - Interrupt Summary register
  116. //
  117. typedef union _ISUM_21264{
  118. struct{
  119. ULONGLONG Raz1 : 3;
  120. ULONGLONG AstK : 1;
  121. ULONGLONG AstE : 1;
  122. ULONGLONG Raz2 : 4;
  123. ULONGLONG AstS : 1;
  124. ULONGLONG AstU : 1;
  125. ULONGLONG Raz3 : 3;
  126. ULONGLONG Si : 15;
  127. ULONGLONG Pc : 2;
  128. ULONGLONG Cr : 1;
  129. ULONGLONG Sl : 1;
  130. ULONGLONG Ei : 6;
  131. ULONGLONG Raz4 : 25;
  132. };
  133. ULONGLONG all;
  134. } ISUM_21264, *PISUM_21264;
  135. //
  136. // Define HW_INT_CLR - Hardware Interrupt Clear Register
  137. //
  138. typedef union _HW_INT_CLR_21264{
  139. struct{
  140. ULONGLONG Ign1 : 26;
  141. ULONGLONG Fbtp : 1;
  142. ULONGLONG Fbdp : 1;
  143. ULONGLONG MchkD : 1;
  144. ULONGLONG Pc : 2;
  145. ULONGLONG Cr : 1;
  146. ULONGLONG Sl : 1;
  147. ULONGLONG Ign2 : 31;
  148. };
  149. ULONGLONG all;
  150. } HW_INT_CLR_21264, *PHW_INT_CLR_21264;
  151. //
  152. // Define EXC_SUM - Exception Summary Register
  153. //
  154. typedef union _EXC_SUM_21264{
  155. struct{
  156. ULONGLONG Swc : 1;
  157. ULONGLONG Inv : 1;
  158. ULONGLONG Dze : 1;
  159. ULONGLONG Fov : 1;
  160. ULONGLONG Unf : 1;
  161. ULONGLONG Ine : 1;
  162. ULONGLONG Iov : 1;
  163. ULONGLONG Int : 1;
  164. ULONGLONG Reg : 5;
  165. ULONGLONG BadIva : 1;
  166. ULONGLONG Ignore1 : 27;
  167. ULONGLONG PcOvf : 1;
  168. ULONGLONG SetInv : 1;
  169. ULONGLONG SetDze : 1;
  170. ULONGLONG SetOvf : 1;
  171. ULONGLONG SetUnf : 1;
  172. ULONGLONG SetIne : 1;
  173. ULONGLONG SetIov : 1;
  174. ULONGLONG Ignore2 : 16;
  175. };
  176. ULONGLONG all;
  177. } EXC_SUM_21264, *PEXC_SUM_21264;
  178. //
  179. // Define I_CTL - Ibox Control Register
  180. //
  181. typedef union _I_CTL_21264{
  182. struct{
  183. ULONGLONG PcEn : 1;
  184. ULONGLONG IcEnable : 2;
  185. ULONGLONG Sp32 : 1;
  186. ULONGLONG Sp43 : 1;
  187. ULONGLONG Sp48 : 1;
  188. ULONGLONG Raz1 : 1;
  189. ULONGLONG Sde : 1;
  190. ULONGLONG Sbe : 2;
  191. ULONGLONG BpMode : 2;
  192. ULONGLONG Hwe : 1;
  193. ULONGLONG Fbtp : 1;
  194. ULONGLONG Fbdp : 1;
  195. ULONGLONG Va48 : 1;
  196. ULONGLONG VaForm32 : 1;
  197. ULONGLONG SingleIssue : 1;
  198. ULONGLONG Pct0En : 1;
  199. ULONGLONG Pct1En : 1;
  200. ULONGLONG CallPalR23 : 1;
  201. ULONGLONG MchkEn : 1;
  202. ULONGLONG TbMbEn : 1;
  203. ULONGLONG BistFail : 1;
  204. ULONGLONG ChipId : 6;
  205. ULONGLONG Vptb : 18;
  206. ULONGLONG Sext : 16;
  207. };
  208. ULONGLONG all;
  209. } I_CTL_21264, *PI_CTL_21264;
  210. //
  211. // Define I_STAT - Ibox Status Register
  212. //
  213. typedef union _I_STAT_21264{
  214. struct{
  215. ULONGLONG Raz1 : 29;
  216. ULONGLONG Tpe : 1;
  217. ULONGLONG Dpe : 1;
  218. ULONGLONG Raz2 : 33;
  219. };
  220. ULONGLONG all;
  221. } I_STAT_21264, *PI_STAT_21264;
  222. //
  223. // Define PCTX - Ibox Process Context Register
  224. // Note that this can be also be written as five independant registers.
  225. // (ASN, ASTER, ASTRR, PPCE, FPE)
  226. //
  227. typedef union _PCTX_21264{
  228. struct{
  229. ULONGLONG Raz1 : 1;
  230. ULONGLONG Ppce : 1;
  231. ULONGLONG Fpe : 1;
  232. ULONGLONG Raz2 : 2;
  233. ULONGLONG AstEr : 4;
  234. ULONGLONG AstRr : 4;
  235. ULONGLONG Raz3 : 26;
  236. ULONGLONG Asn : 8;
  237. ULONGLONG Raz4 : 17;
  238. };
  239. ULONGLONG all;
  240. } PCTX_21264, *PPCTX_21264;
  241. //
  242. // Define PCTR_CTL - Performance Counter Control Register
  243. //
  244. typedef union _PCTR_CTL_21264{
  245. struct{
  246. ULONGLONG Sel1 : 4;
  247. ULONGLONG Sel0 : 1;
  248. ULONGLONG Raz1 : 1;
  249. ULONGLONG Pctr1 : 20;
  250. ULONGLONG Raz2 : 2;
  251. ULONGLONG Pctr0 : 20;
  252. ULONGLONG Raz3 : 16;
  253. };
  254. ULONGLONG all;
  255. } PCTR_CTL_21264, *PPCTR_CTL_21264;
  256. //
  257. // Define the Mbox and Dcache Internal Processor Register formats.
  258. //
  259. //
  260. // Define DTB_PTE
  261. //
  262. typedef union _DTB_PTE_21264{
  263. struct{
  264. ULONGLONG Ignore1 : 1;
  265. ULONGLONG For : 1;
  266. ULONGLONG Fow : 1;
  267. ULONGLONG Ignore2 : 1;
  268. ULONGLONG Asm : 1;
  269. ULONGLONG Gh : 2;
  270. ULONGLONG Ignore3 : 1;
  271. ULONGLONG Kre : 1;
  272. ULONGLONG Ere : 1;
  273. ULONGLONG Sre : 1;
  274. ULONGLONG Ure : 1;
  275. ULONGLONG Kwe : 1;
  276. ULONGLONG Ewe : 1;
  277. ULONGLONG Swe : 1;
  278. ULONGLONG Uwe : 1;
  279. ULONGLONG Ignore4 : 16;
  280. ULONGLONG Pfn : 31;
  281. ULONGLONG Ignore5 : 1;
  282. };
  283. ULONGLONG all;
  284. } DTB_PTE_21264, *PDTB_PTE_21264;
  285. //
  286. // Define DTB_ASN
  287. //
  288. typedef union _DTB_ASN_21264{
  289. struct{
  290. ULONGLONG Ignore1 : 56;
  291. ULONGLONG Asn : 8;
  292. };
  293. ULONGLONG all;
  294. } DTB_ASN_21264, *PDTB_ASN_21264;
  295. //
  296. // Define MM_STAT - MBOX Status Register
  297. //
  298. typedef union _MM_STAT_21264{
  299. struct{
  300. ULONGLONG Wr : 1;
  301. ULONGLONG Acv : 1;
  302. ULONGLONG For : 1;
  303. ULONGLONG Fow : 1;
  304. ULONGLONG Opcode : 6;
  305. ULONGLONG DcTagPerr : 1;
  306. ULONGLONG Ignore1 : 53;
  307. };
  308. ULONGLONG all;
  309. } MM_STAT_21264, *PMM_STAT_21264;
  310. //
  311. // Define M_CTL - MBOX Control Register
  312. //
  313. typedef union _M_CTL_21264{
  314. struct{
  315. ULONGLONG Mbz1 : 1;
  316. ULONGLONG sp32 : 1;
  317. ULONGLONG sp43 : 1;
  318. ULONGLONG sp48 : 1;
  319. ULONGLONG Mbz2 : 60;
  320. };
  321. ULONGLONG all;
  322. } M_CTL_21264, *PM_CTL_21264;
  323. //
  324. // Define DC_CTL - Dcache Control Register
  325. //
  326. typedef union _DC_CTL_21264{
  327. struct{
  328. ULONGLONG SetEn : 2;
  329. ULONGLONG Fhit : 1;
  330. ULONGLONG Flush : 1;
  331. ULONGLONG FBadTpar : 1;
  332. ULONGLONG FBadDecc : 1;
  333. ULONGLONG DcTagParEn : 1;
  334. ULONGLONG DcDatErrEn : 1;
  335. ULONGLONG Mbz1 : 56;
  336. };
  337. ULONGLONG all;
  338. } DC_CTL_21264, *PDC_CTL_21264;
  339. //
  340. // Define DC_STAT - Dcache Status Register
  341. //
  342. typedef union _DC_STAT_21264{
  343. struct{
  344. ULONGLONG TPerrP0 : 1;
  345. ULONGLONG TPerrP1 : 1;
  346. ULONGLONG EccErrSt : 1;
  347. ULONGLONG EccErrLd : 1;
  348. ULONGLONG Seo : 1;
  349. ULONGLONG Raz1 : 59;
  350. };
  351. ULONGLONG all;
  352. } DC_STAT_21264, *PDC_STAT_21264;
  353. //
  354. // Define Cbox Internal Processor Registers.
  355. //
  356. //
  357. // Define CSTAT field in CBOX read IPR
  358. //
  359. typedef union _C_STAT_21264 {
  360. struct {
  361. ULONGLONG ErrorQualifier :3;
  362. ULONGLONG IstreamError :1;
  363. ULONGLONG DoubleBitError :1;
  364. ULONGLONG Reserved :59;
  365. };
  366. ULONGLONG all;
  367. } C_STAT_21264, *PC_STAT_21264;
  368. // SjBfix. CBOX Register chain not defined yet.
  369. //
  370. // Define the Interrupt Mask structure communicated between the
  371. // HAL and PALcode.
  372. //
  373. // This is the bit defintion for the IRQL fields that are stored
  374. // in the PCR IrqlTable. Keep it the same as on EV4.
  375. //
  376. typedef struct _IETEntry_21264{
  377. ULONG ApcEnable: 1;
  378. ULONG DispatchEnable: 1;
  379. ULONG PerformanceCounter0Enable: 1;
  380. ULONG PerformanceCounter1Enable: 1;
  381. ULONG CorrectableReadEnable: 1;
  382. ULONG Irq0Enable: 1;
  383. ULONG Irq1Enable: 1;
  384. ULONG Irq2Enable: 1;
  385. ULONG Irq3Enable: 1;
  386. ULONG Irq4Enable: 1;
  387. ULONG Irq5Enable: 1;
  388. ULONG Reserved: 21;
  389. } IETEntry_21264, *PIETEntry_21264;
  390. //
  391. // Define the offsets and sizes of the mask sub-tables within the interrupt
  392. // mask table in the PCR.
  393. //
  394. #define IRQLMASK_HDW_SUBTABLE_21264 (8)
  395. #define IRQLMASK_HDW_SUBTABLE_21264_ENTRIES (64)
  396. #define IRQLMASK_SFW_SUBTABLE_21264 (0)
  397. #define IRQLMASK_SFW_SUBTABLE_21264_ENTRIES (4)
  398. #define IRQLMASK_PC_SUBTABLE_21264 (4)
  399. #define IRQLMASK_PC_SUBTABLE_21264_ENTRIES (4)
  400. //
  401. // HACKHACK - this should probably be in a table
  402. //
  403. #define EV6_CRD_VECTOR (25)
  404. //
  405. // PALcode Event Counters for the 21264
  406. // This is the structure of the data returned by the rdcounters call pal.
  407. //
  408. typedef struct _COUNTERS_21264{
  409. ULONGLONG MachineCheckCount;
  410. ULONGLONG ArithmeticExceptionCount;
  411. ULONGLONG InterruptCount;
  412. ULONGLONG ItbMissCount;
  413. ULONGLONG DtbMissSingleCount;
  414. ULONGLONG DtbMissDoubleCount;
  415. ULONGLONG IAccvioCount;
  416. ULONGLONG DfaultCount;
  417. ULONGLONG UnalignedCount;
  418. ULONGLONG OpcdecCount;
  419. ULONGLONG FenCount;
  420. ULONGLONG ItbTnvCount;
  421. ULONGLONG DtbTnvCount;
  422. ULONGLONG PdeTnvCount;
  423. ULONGLONG FPCRCount;
  424. ULONGLONG RestCount;
  425. ULONGLONG DtbMissDouble4Count;
  426. ULONGLONG HardwareInterruptCount;
  427. ULONGLONG SoftwareInterruptCount;
  428. ULONGLONG SpecialInterruptCount;
  429. ULONGLONG HaltCount;
  430. ULONGLONG RestartCount;
  431. ULONGLONG DrainaCount;
  432. ULONGLONG RebootCount;
  433. ULONGLONG InitpalCount;
  434. ULONGLONG WrentryCount;
  435. ULONGLONG SwpirqlCount;
  436. ULONGLONG RdirqlCount;
  437. ULONGLONG DiCount;
  438. ULONGLONG EiCount;
  439. ULONGLONG SwppalCount;
  440. ULONGLONG SsirCount;
  441. ULONGLONG CsirCount;
  442. ULONGLONG RfeCount;
  443. ULONGLONG RetsysCount;
  444. ULONGLONG SwpctxCount;
  445. ULONGLONG SwpprocessCount;
  446. ULONGLONG RdmcesCount;
  447. ULONGLONG WrmcesCount;
  448. ULONGLONG TbiaCount;
  449. ULONGLONG TbisCount;
  450. ULONGLONG TbisasnCount;
  451. ULONGLONG DtbisCount;
  452. ULONGLONG RdkspCount;
  453. ULONGLONG SwpkspCount;
  454. ULONGLONG RdpsrCount;
  455. ULONGLONG RdpcrCount;
  456. ULONGLONG RdthreadCount;
  457. ULONGLONG TbimCount;
  458. ULONGLONG TbimasnCount;
  459. ULONGLONG RdcountersCount;
  460. ULONGLONG RdstateCount;
  461. ULONGLONG WrperfmonCount;
  462. ULONGLONG InitpcrCount;
  463. ULONGLONG BptCount;
  464. ULONGLONG CallsysCount;
  465. ULONGLONG ImbCount;
  466. ULONGLONG GentrapCount;
  467. ULONGLONG RdtebCount;
  468. ULONGLONG KbptCount;
  469. ULONGLONG CallkdCount;
  470. ULONGLONG AddressSpaceSwapCount;
  471. ULONGLONG AsnWrapCount;
  472. ULONGLONG EalnfixCount;
  473. ULONGLONG DalnfixCount;
  474. ULONGLONG SleepCount;
  475. ULONGLONG Misc1Count;
  476. ULONGLONG Misc2Count;
  477. ULONGLONG Misc3Count;
  478. ULONGLONG Misc4Count;
  479. ULONGLONG Misc5Count;
  480. ULONGLONG Misc6Count;
  481. ULONGLONG Misc7Count;
  482. ULONGLONG Misc8Count;
  483. ULONGLONG Misc9Count;
  484. ULONGLONG Misc10Count;
  485. ULONGLONG Misc11Count;
  486. ULONGLONG Misc12Count;
  487. ULONGLONG Misc13Count;
  488. ULONGLONG Misc14Count;
  489. ULONGLONG Misc15Count;
  490. ULONGLONG Misc16Count;
  491. ULONGLONG Misc17Count;
  492. } COUNTERS_21264, *PCOUNTERS_21264;
  493. //
  494. // Types of performance counters.
  495. //
  496. typedef enum _AXP21264_PCCOUNTER{
  497. Ev6PerformanceCounter0 = 0,
  498. Ev6PerformanceCounter1 = 1,
  499. } AXP21264_PCCOUNTER, *PAXP21264_PCCOUNTER;
  500. //
  501. // Mux control values
  502. //
  503. typedef enum _AXP21264_PCMUXCONTROL{
  504. //
  505. // Mux values for PCTR1:
  506. //
  507. Ev6Instructions = 0x00,
  508. Ev6CondBranches = 0x01,
  509. Ev6Mispredicts = 0x02,
  510. Ev6ITBMisses = 0x03,
  511. Ev6DTBMisses = 0x04,
  512. Ev6Unaligned = 0x05,
  513. Ev6IcacheMisses = 0x06,
  514. Ev6ReplayTraps = 0x07,
  515. Ev6LoadMisses = 0x08,
  516. Ev6DcacheMisses = 0x09,
  517. Ev6BcacheReads = 0x0a,
  518. Ev6BcacheWrites = 0x0b,
  519. Ev6SysPortReads = 0x0c,
  520. Ev6SysPortWrites = 0x0d,
  521. Ev6MBStalls = 0x0e, // SjBfix. Not documented
  522. Ev6StcStalls = 0x0f, // SjBfix. Not documented
  523. //
  524. // Mux values for PCTR0:
  525. //
  526. Ev6Cycles = 0x00,
  527. Ev6RetiredInstructions = 0x01
  528. } AXP21264_PCMUXCONTROL, *PAXP21264_PCMUXCONTROL;
  529. //
  530. // Internal processor state record.
  531. // This is the structure of the data returned by the rdstate call pal.
  532. //
  533. typedef struct _PROCESSOR_STATE_21264{
  534. IER_CM_21264 IerCm;
  535. SIRR_21264 Sirr;
  536. ISUM_21264 Isum;
  537. EXC_SUM_21264 ExcSum;
  538. ULONGLONG PalBase;
  539. I_CTL_21264 ICtl;
  540. I_STAT_21264 IStat;
  541. PCTX_21264 PCtx;
  542. PCTR_CTL_21264 PCtr;
  543. MM_STAT_21264 MmStat;
  544. DC_STAT_21264 DcStat;
  545. } PROCESSOR_STATE_21264, *PPROCESSOR_STATE_21264;
  546. //
  547. // Machine-check logout frame.
  548. //
  549. typedef struct _LOGOUT_FRAME_21264{
  550. ULONG FrameSize;
  551. ULONG RSDC;
  552. ULONG CpuAreaOffset;
  553. ULONG SystemAreaOffset;
  554. ULONG MchkCode;
  555. ULONG MchkFrameRev;
  556. I_STAT_21264 IStat;
  557. DC_STAT_21264 DcStat;
  558. ULONGLONG CAddr;
  559. ULONGLONG Dc1Syndrome;
  560. ULONGLONG Dc0Syndrome;
  561. ULONGLONG CStat;
  562. ULONGLONG CSts;
  563. ULONGLONG Va;
  564. ULONGLONG ExcAddr;
  565. IER_CM_21264 IerCm;
  566. ISUM_21264 ISum;
  567. MM_STAT_21264 MmStat;
  568. ULONGLONG PalBase;
  569. I_CTL_21264 ICtl;
  570. PCTX_21264 PCtx;
  571. VA_CTL_21264 VaCtl;
  572. ULONGLONG Ps;
  573. } LOGOUT_FRAME_21264, *PLOGOUT_FRAME_21264;
  574. //
  575. // Correctable logout frame
  576. //
  577. typedef struct _CORRECTABLE_FRAME_21264 {
  578. ULONG FrameSize;
  579. ULONG RSDC;
  580. ULONG CpuAreaOffset;
  581. ULONG SystemAreaOffset;
  582. ULONG MchkCode;
  583. ULONG MchkFrameRev;
  584. I_STAT_21264 IStat;
  585. DC_STAT_21264 DCStat;
  586. ULONGLONG CAddr;
  587. ULONGLONG Dc1Syndrome;
  588. ULONGLONG Dc0Syndrome;
  589. ULONGLONG CStat;
  590. ULONGLONG CSts;
  591. ULONGLONG MmStat;
  592. } CORRECTABLE_FRAME_21264, *PCORRECTABLE_FRAME_21264;
  593. //
  594. // Define the number of physical and virtual address bits
  595. //
  596. #define EV6_PHYSICAL_ADDRESS_BITS 44
  597. #define EV6_VIRTUAL_ADDRESS_BITS 43
  598. #endif //!_AXP21264_