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.

971 lines
32 KiB

  1. /*++
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. ia64 psr
  5. Abstract:
  6. KD Extension Api
  7. Author:
  8. Thierry Fevrier (v-thief)
  9. Environment:
  10. User Mode.
  11. Revision History:
  12. --*/
  13. #include "precomp.h"
  14. #pragma hdrstop
  15. #include "ia64.h"
  16. //
  17. // EmPspFields: EM register fields for the Processor State Parameter.
  18. //
  19. EM_REG_FIELD EmPspFields[] = {
  20. { "rv", "reserved0" , 0x2, 0 },
  21. { "rz", "Rendez-vous successful" , 0x1, 2 },
  22. { "ra", "Rendez-vous attempted" , 0x1, 3 },
  23. { "me", "Distinct Multiple errors" , 0x1, 4 },
  24. { "mn", "Min-state Save Area registered" , 0x1, 5 },
  25. { "sy", "Storage integrity synchronized" , 0x1, 6 },
  26. { "co", "Continuable" , 0x1, 7 },
  27. { "ci", "Machine Check isolated" , 0x1, 8 },
  28. { "us", "Uncontained Storage damage" , 0x1, 9 },
  29. { "hd", "Hardware damage" , 0x1, 10 },
  30. { "tl", "Trap lost" , 0x1, 11 },
  31. { "mi", "More Information" , 0x1, 12 },
  32. { "pi", "Precise Instruction pointer" , 0x1, 13 },
  33. { "pm", "Precise Min-state Save Area" , 0x1, 14 },
  34. { "dy", "Processor Dynamic State valid" , 0x1, 15 },
  35. { "in", "INIT interruption" , 0x1, 16 },
  36. { "rs", "RSE valid" , 0x1, 17 },
  37. { "cm", "Machine Check corrected" , 0x1, 18 },
  38. { "ex", "Machine Check expected" , 0x1, 19 },
  39. { "cr", "Control Registers valid" , 0x1, 20 },
  40. { "pc", "Performance Counters valid" , 0x1, 21 },
  41. { "dr", "Debug Registers valid" , 0x1, 22 },
  42. { "tr", "Translation Registers valid" , 0x1, 23 },
  43. { "rr", "Region Registers valid" , 0x1, 24 },
  44. { "ar", "Application Registers valid" , 0x1, 25 },
  45. { "br", "Branch Registers valid" , 0x1, 26 },
  46. { "pr", "Predicate Registers valid" , 0x1, 27 },
  47. { "fp", "Floating-Point Registers valid" , 0x1, 28 },
  48. { "b1", "Preserved Bank 1 General Registers valid" , 0x1, 29 },
  49. { "b0", "Preserved Bank 0 General Registers valid" , 0x1, 30 },
  50. { "gr", "General Registers valid" , 0x1, 31 },
  51. { "dsize", "Processor Dynamic State size" , 0x10, 32 },
  52. { "rv", "reserved1" , 0xB, 48 },
  53. { "cc", "Cache Check" , 0x1, 59 },
  54. { "tc", "TLB Check" , 0x1, 60 },
  55. { "bc", "Bus Check" , 0x1, 61 },
  56. { "rc", "Register File Check" , 0x1, 62 },
  57. { "uc", "Micro-Architectural Check" , 0x1, 63 }
  58. };
  59. VOID
  60. DisplayPspIA64(
  61. IN const PCHAR Header,
  62. IN EM_PSP EmPsp,
  63. IN DISPLAY_MODE DisplayMode
  64. )
  65. {
  66. dprintf("%s", Header ? Header : "" );
  67. if ( DisplayMode >= DISPLAY_MED ) {
  68. DisplayFullEmReg( EM_PSPToULong64(EmPsp), EmPspFields, DisplayMode );
  69. }
  70. else {
  71. dprintf(
  72. "gr b0 b1 fp pr br ar rr tr dr pc cr ex cm rs in dy pm pi mi tl hd us ci co sy mn me ra rz\n\t\t "
  73. "%1I64x %1I64x %1I64x %1I64x %1I64x %1I64x %1I64x %1I64x %1I64x %1I64x %1I64x %1I64x %1I64x %1I64x %1I64x %1I64x %1I64x %1I64x %1I64x %1I64x %1I64x %1I64x %1I64x %1I64x %1I64x %1I64x %1I64x %1I64x %1I64x %1I64x\n\t\t"
  74. "uc rc bc tc cc dsize\n\t\t "
  75. "%1I64x %1I64x %1I64x %1I64x %1I64x %I64x\n",
  76. EmPsp.gr,
  77. EmPsp.b0,
  78. EmPsp.b1,
  79. EmPsp.fp,
  80. EmPsp.pr,
  81. EmPsp.br,
  82. EmPsp.ar,
  83. EmPsp.rr,
  84. EmPsp.tr,
  85. EmPsp.dr,
  86. EmPsp.pc,
  87. EmPsp.cr,
  88. EmPsp.ex,
  89. EmPsp.cm,
  90. EmPsp.rs,
  91. EmPsp.in,
  92. EmPsp.dy,
  93. EmPsp.pm,
  94. EmPsp.pi,
  95. EmPsp.mi,
  96. EmPsp.tl,
  97. EmPsp.hd,
  98. EmPsp.us,
  99. EmPsp.ci,
  100. EmPsp.co,
  101. EmPsp.sy,
  102. EmPsp.mn,
  103. EmPsp.me,
  104. EmPsp.ra,
  105. EmPsp.rz,
  106. EmPsp.uc,
  107. EmPsp.rc,
  108. EmPsp.bc,
  109. EmPsp.tc,
  110. EmPsp.cc,
  111. EmPsp.dsize
  112. );
  113. }
  114. return;
  115. } // DisplayPspIA64()
  116. DECLARE_API( psp )
  117. /*++
  118. Routine Description:
  119. Dumps an IA64 Processor State Parameter
  120. Arguments:
  121. args - Supplies the address in hex.
  122. Return Value:
  123. None
  124. --*/
  125. {
  126. ULONG64 pspValue;
  127. ULONG result;
  128. ULONG flags = 0;
  129. char *header;
  130. INIT_API();
  131. pspValue = (ULONG64)0;
  132. flags = 0;
  133. if ( GetExpressionEx( args, &pspValue, &args ) ) {
  134. if ( args && *args ) {
  135. flags = (ULONG) GetExpression( args );
  136. }
  137. }
  138. header = (flags > DISPLAY_MIN) ? NULL : "\tpsp:\t";
  139. if (TargetMachine != IMAGE_FILE_MACHINE_IA64)
  140. {
  141. dprintf("!psp not implemented for this architecture.\n");
  142. }
  143. else
  144. {
  145. DisplayPspIA64( header, ULong64ToEM_PSP(pspValue), flags );
  146. }
  147. EXIT_API();
  148. return S_OK;
  149. } // !psp
  150. #define PROCESSOR_MINSTATE_SAVE_AREA_FORMAT_IA64 \
  151. "\tGRNats : 0x%I64x\n" \
  152. "\tGR1 : 0x%I64x\n" \
  153. "\tGR2 : 0x%I64x\n" \
  154. "\tGR3 : 0x%I64x\n" \
  155. "\tGR4 : 0x%I64x\n" \
  156. "\tGR5 : 0x%I64x\n" \
  157. "\tGR6 : 0x%I64x\n" \
  158. "\tGR7 : 0x%I64x\n" \
  159. "\tGR8 : 0x%I64x\n" \
  160. "\tGR9 : 0x%I64x\n" \
  161. "\tGR10 : 0x%I64x\n" \
  162. "\tGR11 : 0x%I64x\n" \
  163. "\tGR12 : 0x%I64x\n" \
  164. "\tGR13 : 0x%I64x\n" \
  165. "\tGR14 : 0x%I64x\n" \
  166. "\tGR15 : 0x%I64x\n" \
  167. "\tBank0GR16 : 0x%I64x\n" \
  168. "\tBank0GR17 : 0x%I64x\n" \
  169. "\tBank0GR18 : 0x%I64x\n" \
  170. "\tBank0GR19 : 0x%I64x\n" \
  171. "\tBank0GR20 : 0x%I64x\n" \
  172. "\tBank0GR21 : 0x%I64x\n" \
  173. "\tBank0GR22 : 0x%I64x\n" \
  174. "\tBank0GR23 : 0x%I64x\n" \
  175. "\tBank0GR24 : 0x%I64x\n" \
  176. "\tBank0GR25 : 0x%I64x\n" \
  177. "\tBank0GR26 : 0x%I64x\n" \
  178. "\tBank0GR27 : 0x%I64x\n" \
  179. "\tBank0GR28 : 0x%I64x\n" \
  180. "\tBank0GR29 : 0x%I64x\n" \
  181. "\tBank0GR30 : 0x%I64x\n" \
  182. "\tBank0GR31 : 0x%I64x\n" \
  183. "\tBank1GR16 : 0x%I64x\n" \
  184. "\tBank1GR17 : 0x%I64x\n" \
  185. "\tBank1GR18 : 0x%I64x\n" \
  186. "\tBank1GR19 : 0x%I64x\n" \
  187. "\tBank1GR20 : 0x%I64x\n" \
  188. "\tBank1GR21 : 0x%I64x\n" \
  189. "\tBank1GR22 : 0x%I64x\n" \
  190. "\tBank1GR23 : 0x%I64x\n" \
  191. "\tBank1GR24 : 0x%I64x\n" \
  192. "\tBank1GR25 : 0x%I64x\n" \
  193. "\tBank1GR26 : 0x%I64x\n" \
  194. "\tBank1GR27 : 0x%I64x\n" \
  195. "\tBank1GR28 : 0x%I64x\n" \
  196. "\tBank1GR29 : 0x%I64x\n" \
  197. "\tBank1GR30 : 0x%I64x\n" \
  198. "\tBank1GR31 : 0x%I64x\n" \
  199. "\tPreds : 0x%I64x\n" \
  200. "\tBR0 : 0x%I64x\n" \
  201. "\tRSC : 0x%I64x\n" \
  202. "\tIIP : 0x%I64x\n" \
  203. "\tIPSR : 0x%I64x\n" \
  204. "\tIFS : 0x%I64x\n" \
  205. "\tXIP : 0x%I64x\n" \
  206. "\tXPSR : 0x%I64x\n" \
  207. "\tXFS : 0x%I64x\n\n"
  208. VOID
  209. DisplayProcessorMinStateSaveArea(
  210. ULONG64 Pmssa
  211. )
  212. {
  213. ULONG pmssaSize;
  214. pmssaSize = GetTypeSize("hal!_PROCESSOR_MINSTATE_SAVE_AREA");
  215. dprintf("\tProcessor MinState Save Area @ 0x%I64x\n", Pmssa );
  216. if ( pmssaSize ) {
  217. CHAR cmd[MAX_PATH];
  218. sprintf(cmd, "dt -o -r hal!_PROCESSOR_MINSTATE_SAVE_AREA 0x%I64x", Pmssa);
  219. ExecCommand(cmd);
  220. }
  221. else {
  222. dprintf("Failed to get hal!_PROCESSOR_MINSTATE_SAVE_AREA type size\n" );
  223. }
  224. return;
  225. } // DisplayProcessorMinStateSaveArea()
  226. DECLARE_API( pmssa )
  227. /*++
  228. Routine Description:
  229. Dumps memory address as an IA64 Processor Min-State Save Area.
  230. Arguments:
  231. args - Supplies the address in hex.
  232. Return Value:
  233. None
  234. --*/
  235. {
  236. ULONG64 pmssaValue;
  237. ULONG result;
  238. char *header;
  239. pmssaValue = GetExpression(args);
  240. if (TargetMachine != IMAGE_FILE_MACHINE_IA64)
  241. {
  242. dprintf("!pmssa not implemented for this architecture.\n");
  243. }
  244. else
  245. {
  246. if ( pmssaValue ) {
  247. DisplayProcessorMinStateSaveArea( pmssaValue );
  248. }
  249. else {
  250. dprintf("usage: pmssa <address>\n");
  251. }
  252. }
  253. return S_OK;
  254. } // !pmssa
  255. #define PROCESSOR_CONTROL_REGISTERS_FORMAT_IA64 \
  256. "\tDCR : 0x%I64x\n" \
  257. "\tITM : 0x%I64x\n" \
  258. "\tIVA : 0x%I64x\n" \
  259. "\tCR3 : 0x%I64x\n" \
  260. "\tCR4 : 0x%I64x\n" \
  261. "\tCR5 : 0x%I64x\n" \
  262. "\tCR6 : 0x%I64x\n" \
  263. "\tCR7 : 0x%I64x\n" \
  264. "\tPTA : 0x%I64x\n" \
  265. "\tGPTA : 0x%I64x\n" \
  266. "\tCR10 : 0x%I64x\n" \
  267. "\tCR11 : 0x%I64x\n" \
  268. "\tCR12 : 0x%I64x\n" \
  269. "\tCR13 : 0x%I64x\n" \
  270. "\tCR14 : 0x%I64x\n" \
  271. "\tCR15 : 0x%I64x\n" \
  272. "\tIPSR : 0x%I64x\n" \
  273. "\tISR : 0x%I64x\n" \
  274. "\tCR18 : 0x%I64x\n" \
  275. "\tIIP : 0x%I64x\n" \
  276. "\tIFA : 0x%I64x\n" \
  277. "\tITIR : 0x%I64x\n" \
  278. "\tIFS : 0x%I64x\n" \
  279. "\tIIM : 0x%I64x\n" \
  280. "\tIHA : 0x%I64x\n" \
  281. "\tCR26 : 0x%I64x\n" \
  282. "\tCR27 : 0x%I64x\n" \
  283. "\tCR28 : 0x%I64x\n" \
  284. "\tCR29 : 0x%I64x\n" \
  285. "\tCR30 : 0x%I64x\n" \
  286. "\tCR31 : 0x%I64x\n" \
  287. "\tCR32 : 0x%I64x\n" \
  288. "\tCR33 : 0x%I64x\n" \
  289. "\tCR34 : 0x%I64x\n" \
  290. "\tCR35 : 0x%I64x\n" \
  291. "\tCR36 : 0x%I64x\n" \
  292. "\tCR37 : 0x%I64x\n" \
  293. "\tCR38 : 0x%I64x\n" \
  294. "\tCR39 : 0x%I64x\n" \
  295. "\tCR40 : 0x%I64x\n" \
  296. "\tCR41 : 0x%I64x\n" \
  297. "\tCR42 : 0x%I64x\n" \
  298. "\tCR43 : 0x%I64x\n" \
  299. "\tCR44 : 0x%I64x\n" \
  300. "\tCR45 : 0x%I64x\n" \
  301. "\tCR46 : 0x%I64x\n" \
  302. "\tCR47 : 0x%I64x\n" \
  303. "\tCR48 : 0x%I64x\n" \
  304. "\tCR49 : 0x%I64x\n" \
  305. "\tCR50 : 0x%I64x\n" \
  306. "\tCR51 : 0x%I64x\n" \
  307. "\tCR52 : 0x%I64x\n" \
  308. "\tCR53 : 0x%I64x\n" \
  309. "\tCR54 : 0x%I64x\n" \
  310. "\tCR55 : 0x%I64x\n" \
  311. "\tCR56 : 0x%I64x\n" \
  312. "\tCR57 : 0x%I64x\n" \
  313. "\tCR58 : 0x%I64x\n" \
  314. "\tCR59 : 0x%I64x\n" \
  315. "\tCR60 : 0x%I64x\n" \
  316. "\tCR61 : 0x%I64x\n" \
  317. "\tCR62 : 0x%I64x\n" \
  318. "\tCR63 : 0x%I64x\n" \
  319. "\tLID : 0x%I64x\n" \
  320. "\tIVR : 0x%I64x\n" \
  321. "\tTPR : 0x%I64x\n" \
  322. "\tEOI : 0x%I64x\n" \
  323. "\tIRR0 : 0x%I64x\n" \
  324. "\tIRR1 : 0x%I64x\n" \
  325. "\tIRR2 : 0x%I64x\n" \
  326. "\tIRR3 : 0x%I64x\n" \
  327. "\tITV : 0x%I64x\n" \
  328. "\tPMV : 0x%I64x\n" \
  329. "\tCMCV : 0x%I64x\n" \
  330. "\tCR75 : 0x%I64x\n" \
  331. "\tCR76 : 0x%I64x\n" \
  332. "\tCR77 : 0x%I64x\n" \
  333. "\tCR78 : 0x%I64x\n" \
  334. "\tCR79 : 0x%I64x\n" \
  335. "\tLRR0 : 0x%I64x\n" \
  336. "\tLRR1 : 0x%I64x\n" \
  337. "\tCR82 : 0x%I64x\n" \
  338. "\tCR83 : 0x%I64x\n" \
  339. "\tCR84 : 0x%I64x\n" \
  340. "\tCR85 : 0x%I64x\n" \
  341. "\tCR86 : 0x%I64x\n" \
  342. "\tCR87 : 0x%I64x\n" \
  343. "\tCR88 : 0x%I64x\n" \
  344. "\tCR89 : 0x%I64x\n" \
  345. "\tCR90 : 0x%I64x\n" \
  346. "\tCR91 : 0x%I64x\n" \
  347. "\tCR92 : 0x%I64x\n" \
  348. "\tCR93 : 0x%I64x\n" \
  349. "\tCR94 : 0x%I64x\n" \
  350. "\tCR95 : 0x%I64x\n" \
  351. "\tCR96 : 0x%I64x\n" \
  352. "\tCR97 : 0x%I64x\n" \
  353. "\tCR98 : 0x%I64x\n" \
  354. "\tCR99 : 0x%I64x\n" \
  355. "\tCR100 : 0x%I64x\n" \
  356. "\tCR101 : 0x%I64x\n" \
  357. "\tCR102 : 0x%I64x\n" \
  358. "\tCR103 : 0x%I64x\n" \
  359. "\tCR104 : 0x%I64x\n" \
  360. "\tCR105 : 0x%I64x\n" \
  361. "\tCR106 : 0x%I64x\n" \
  362. "\tCR107 : 0x%I64x\n" \
  363. "\tCR108 : 0x%I64x\n" \
  364. "\tCR109 : 0x%I64x\n" \
  365. "\tCR110 : 0x%I64x\n" \
  366. "\tCR111 : 0x%I64x\n" \
  367. "\tCR112 : 0x%I64x\n" \
  368. "\tCR113 : 0x%I64x\n" \
  369. "\tCR114 : 0x%I64x\n" \
  370. "\tCR115 : 0x%I64x\n" \
  371. "\tCR116 : 0x%I64x\n" \
  372. "\tCR117 : 0x%I64x\n" \
  373. "\tCR118 : 0x%I64x\n" \
  374. "\tCR119 : 0x%I64x\n" \
  375. "\tCR120 : 0x%I64x\n" \
  376. "\tCR121 : 0x%I64x\n" \
  377. "\tCR122 : 0x%I64x\n" \
  378. "\tCR123 : 0x%I64x\n" \
  379. "\tCR124 : 0x%I64x\n" \
  380. "\tCR125 : 0x%I64x\n" \
  381. "\tCR126 : 0x%I64x\n" \
  382. "\tCR127 : 0x%I64x\n"
  383. VOID
  384. DisplayProcessorControlRegisters(
  385. ULONG64 Pcrs
  386. )
  387. {
  388. ULONG pcrsSize;
  389. pcrsSize = GetTypeSize("hal!_PROCESSOR_CONTROL_REGISTERS");
  390. dprintf("\tProcessor Control Registers File @ 0x%I64x\n", Pcrs );
  391. if ( pcrsSize ) {
  392. CHAR cmd[MAX_PATH];
  393. sprintf(cmd, "dt -o -r hal!_PROCESSOR_CONTROL_REGISTERS 0x%I64x", Pcrs);
  394. ExecCommand(cmd);
  395. }
  396. else {
  397. PROCESSOR_CONTROL_REGISTERS_IA64 controlRegisters;
  398. ULONG bytesRead = 0;
  399. pcrsSize = sizeof(controlRegisters);
  400. ReadMemory( Pcrs, &controlRegisters, pcrsSize, &bytesRead );
  401. if ( bytesRead >= pcrsSize ) {
  402. dprintf( PROCESSOR_CONTROL_REGISTERS_FORMAT_IA64,
  403. controlRegisters.DCR,
  404. controlRegisters.ITM,
  405. controlRegisters.IVA,
  406. controlRegisters.CR3,
  407. controlRegisters.CR4,
  408. controlRegisters.CR5,
  409. controlRegisters.CR6,
  410. controlRegisters.CR7,
  411. controlRegisters.PTA,
  412. controlRegisters.GPTA,
  413. controlRegisters.CR10,
  414. controlRegisters.CR11,
  415. controlRegisters.CR12,
  416. controlRegisters.CR13,
  417. controlRegisters.CR14,
  418. controlRegisters.CR15,
  419. controlRegisters.IPSR,
  420. controlRegisters.ISR,
  421. controlRegisters.CR18,
  422. controlRegisters.IIP,
  423. controlRegisters.IFA,
  424. controlRegisters.ITIR,
  425. controlRegisters.IFS,
  426. controlRegisters.IIM,
  427. controlRegisters.IHA,
  428. controlRegisters.CR26,
  429. controlRegisters.CR27,
  430. controlRegisters.CR28,
  431. controlRegisters.CR29,
  432. controlRegisters.CR30,
  433. controlRegisters.CR31,
  434. controlRegisters.CR32,
  435. controlRegisters.CR33,
  436. controlRegisters.CR34,
  437. controlRegisters.CR35,
  438. controlRegisters.CR36,
  439. controlRegisters.CR37,
  440. controlRegisters.CR38,
  441. controlRegisters.CR39,
  442. controlRegisters.CR40,
  443. controlRegisters.CR41,
  444. controlRegisters.CR42,
  445. controlRegisters.CR43,
  446. controlRegisters.CR44,
  447. controlRegisters.CR45,
  448. controlRegisters.CR46,
  449. controlRegisters.CR47,
  450. controlRegisters.CR48,
  451. controlRegisters.CR49,
  452. controlRegisters.CR50,
  453. controlRegisters.CR51,
  454. controlRegisters.CR52,
  455. controlRegisters.CR53,
  456. controlRegisters.CR54,
  457. controlRegisters.CR55,
  458. controlRegisters.CR56,
  459. controlRegisters.CR57,
  460. controlRegisters.CR58,
  461. controlRegisters.CR59,
  462. controlRegisters.CR60,
  463. controlRegisters.CR61,
  464. controlRegisters.CR62,
  465. controlRegisters.CR63,
  466. controlRegisters.LID,
  467. controlRegisters.IVR,
  468. controlRegisters.TPR,
  469. controlRegisters.EOI,
  470. controlRegisters.IRR0,
  471. controlRegisters.IRR1,
  472. controlRegisters.IRR2,
  473. controlRegisters.IRR3,
  474. controlRegisters.ITV,
  475. controlRegisters.PMV,
  476. controlRegisters.CMCV,
  477. controlRegisters.CR75,
  478. controlRegisters.CR76,
  479. controlRegisters.CR77,
  480. controlRegisters.CR78,
  481. controlRegisters.CR79,
  482. controlRegisters.LRR0,
  483. controlRegisters.LRR1,
  484. controlRegisters.CR82,
  485. controlRegisters.CR83,
  486. controlRegisters.CR84,
  487. controlRegisters.CR85,
  488. controlRegisters.CR86,
  489. controlRegisters.CR87,
  490. controlRegisters.CR88,
  491. controlRegisters.CR89,
  492. controlRegisters.CR90,
  493. controlRegisters.CR91,
  494. controlRegisters.CR92,
  495. controlRegisters.CR93,
  496. controlRegisters.CR94,
  497. controlRegisters.CR95,
  498. controlRegisters.CR96,
  499. controlRegisters.CR97,
  500. controlRegisters.CR98,
  501. controlRegisters.CR99,
  502. controlRegisters.CR100,
  503. controlRegisters.CR101,
  504. controlRegisters.CR102,
  505. controlRegisters.CR103,
  506. controlRegisters.CR104,
  507. controlRegisters.CR105,
  508. controlRegisters.CR106,
  509. controlRegisters.CR107,
  510. controlRegisters.CR108,
  511. controlRegisters.CR109,
  512. controlRegisters.CR110,
  513. controlRegisters.CR111,
  514. controlRegisters.CR112,
  515. controlRegisters.CR113,
  516. controlRegisters.CR114,
  517. controlRegisters.CR115,
  518. controlRegisters.CR116,
  519. controlRegisters.CR117,
  520. controlRegisters.CR118,
  521. controlRegisters.CR119,
  522. controlRegisters.CR120,
  523. controlRegisters.CR121,
  524. controlRegisters.CR122,
  525. controlRegisters.CR123,
  526. controlRegisters.CR124,
  527. controlRegisters.CR125,
  528. controlRegisters.CR126,
  529. controlRegisters.CR127
  530. );
  531. }
  532. else {
  533. dprintf("Reading _PROCESSOR_CONTROL_REGISTERS directly from memory failed @ 0x%I64x.\n", Pcrs );
  534. }
  535. }
  536. return;
  537. } // DisplayProcessorControlRegisters()
  538. DECLARE_API( pcrs )
  539. /*++
  540. Routine Description:
  541. Dumps memory address as an IA64 Processor Control Registers file.
  542. Arguments:
  543. args - Supplies the address in hex.
  544. Return Value:
  545. None
  546. --*/
  547. {
  548. ULONG64 pcrsValue;
  549. ULONG result;
  550. char *header;
  551. pcrsValue = GetExpression(args);
  552. if (TargetMachine != IMAGE_FILE_MACHINE_IA64)
  553. {
  554. dprintf("!pcrs not implemented for this architecture.\n");
  555. }
  556. else
  557. {
  558. if ( pcrsValue ) {
  559. DisplayProcessorControlRegisters( pcrsValue );
  560. }
  561. else {
  562. dprintf("usage: pcrs <address>\n");
  563. }
  564. }
  565. return S_OK;
  566. } // !pcrs
  567. #define PROCESSOR_APPLICATION_REGISTERS_FORMAT_IA64 \
  568. "\tKR0 : 0x%I64x\n" \
  569. "\tKR1 : 0x%I64x\n" \
  570. "\tKR2 : 0x%I64x\n" \
  571. "\tKR3 : 0x%I64x\n" \
  572. "\tKR4 : 0x%I64x\n" \
  573. "\tKR5 : 0x%I64x\n" \
  574. "\tKR6 : 0x%I64x\n" \
  575. "\tKR7 : 0x%I64x\n" \
  576. "\tAR8 : 0x%I64x\n" \
  577. "\tAR9 : 0x%I64x\n" \
  578. "\tAR10 : 0x%I64x\n" \
  579. "\tAR11 : 0x%I64x\n" \
  580. "\tAR12 : 0x%I64x\n" \
  581. "\tAR13 : 0x%I64x\n" \
  582. "\tAR14 : 0x%I64x\n" \
  583. "\tAR15 : 0x%I64x\n" \
  584. "\tRSC : 0x%I64x\n" \
  585. "\tBSP : 0x%I64x\n" \
  586. "\tBSPSTORE : 0x%I64x\n" \
  587. "\tRNAT : 0x%I64x\n" \
  588. "\tAR20 : 0x%I64x\n" \
  589. "\tFCR : 0x%I64x\n" \
  590. "\tAR22 : 0x%I64x\n" \
  591. "\tAR23 : 0x%I64x\n" \
  592. "\tEFLAG : 0x%I64x\n" \
  593. "\tCSD : 0x%I64x\n" \
  594. "\tSSD : 0x%I64x\n" \
  595. "\tCFLG : 0x%I64x\n" \
  596. "\tFSR : 0x%I64x\n" \
  597. "\tFIR : 0x%I64x\n" \
  598. "\tFDR : 0x%I64x\n" \
  599. "\tAR31 : 0x%I64x\n" \
  600. "\tCCV : 0x%I64x\n" \
  601. "\tAR33 : 0x%I64x\n" \
  602. "\tAR34 : 0x%I64x\n" \
  603. "\tAR35 : 0x%I64x\n" \
  604. "\tUNAT : 0x%I64x\n" \
  605. "\tAR37 : 0x%I64x\n" \
  606. "\tAR38 : 0x%I64x\n" \
  607. "\tAR39 : 0x%I64x\n" \
  608. "\tFPSR : 0x%I64x\n" \
  609. "\tAR41 : 0x%I64x\n" \
  610. "\tAR42 : 0x%I64x\n" \
  611. "\tAR43 : 0x%I64x\n" \
  612. "\tITC : 0x%I64x\n" \
  613. "\tAR45 : 0x%I64x\n" \
  614. "\tAR46 : 0x%I64x\n" \
  615. "\tAR47 : 0x%I64x\n" \
  616. "\tAR48 : 0x%I64x\n" \
  617. "\tAR49 : 0x%I64x\n" \
  618. "\tAR50 : 0x%I64x\n" \
  619. "\tAR51 : 0x%I64x\n" \
  620. "\tAR52 : 0x%I64x\n" \
  621. "\tAR53 : 0x%I64x\n" \
  622. "\tAR54 : 0x%I64x\n" \
  623. "\tAR55 : 0x%I64x\n" \
  624. "\tAR56 : 0x%I64x\n" \
  625. "\tAR57 : 0x%I64x\n" \
  626. "\tAR58 : 0x%I64x\n" \
  627. "\tAR59 : 0x%I64x\n" \
  628. "\tAR60 : 0x%I64x\n" \
  629. "\tAR61 : 0x%I64x\n" \
  630. "\tAR62 : 0x%I64x\n" \
  631. "\tAR63 : 0x%I64x\n" \
  632. "\tPFS : 0x%I64x\n" \
  633. "\tLC : 0x%I64x\n" \
  634. "\tEC : 0x%I64x\n" \
  635. "\tAR67 : 0x%I64x\n" \
  636. "\tAR68 : 0x%I64x\n" \
  637. "\tAR69 : 0x%I64x\n" \
  638. "\tAR70 : 0x%I64x\n" \
  639. "\tAR71 : 0x%I64x\n" \
  640. "\tAR72 : 0x%I64x\n" \
  641. "\tAR73 : 0x%I64x\n" \
  642. "\tAR74 : 0x%I64x\n" \
  643. "\tAR75 : 0x%I64x\n" \
  644. "\tAR76 : 0x%I64x\n" \
  645. "\tAR77 : 0x%I64x\n" \
  646. "\tAR78 : 0x%I64x\n" \
  647. "\tAR79 : 0x%I64x\n" \
  648. "\tAR80 : 0x%I64x\n" \
  649. "\tAR81 : 0x%I64x\n" \
  650. "\tAR82 : 0x%I64x\n" \
  651. "\tAR83 : 0x%I64x\n" \
  652. "\tAR84 : 0x%I64x\n" \
  653. "\tAR85 : 0x%I64x\n" \
  654. "\tAR86 : 0x%I64x\n" \
  655. "\tAR87 : 0x%I64x\n" \
  656. "\tAR88 : 0x%I64x\n" \
  657. "\tAR89 : 0x%I64x\n" \
  658. "\tAR90 : 0x%I64x\n" \
  659. "\tAR91 : 0x%I64x\n" \
  660. "\tAR92 : 0x%I64x\n" \
  661. "\tAR93 : 0x%I64x\n" \
  662. "\tAR94 : 0x%I64x\n" \
  663. "\tAR95 : 0x%I64x\n" \
  664. "\tAR96 : 0x%I64x\n" \
  665. "\tAR97 : 0x%I64x\n" \
  666. "\tAR98 : 0x%I64x\n" \
  667. "\tAR99 : 0x%I64x\n" \
  668. "\tAR100 : 0x%I64x\n" \
  669. "\tAR101 : 0x%I64x\n" \
  670. "\tAR102 : 0x%I64x\n" \
  671. "\tAR103 : 0x%I64x\n" \
  672. "\tAR104 : 0x%I64x\n" \
  673. "\tAR105 : 0x%I64x\n" \
  674. "\tAR106 : 0x%I64x\n" \
  675. "\tAR107 : 0x%I64x\n" \
  676. "\tAR108 : 0x%I64x\n" \
  677. "\tAR109 : 0x%I64x\n" \
  678. "\tAR110 : 0x%I64x\n" \
  679. "\tAR111 : 0x%I64x\n" \
  680. "\tAR112 : 0x%I64x\n" \
  681. "\tAR113 : 0x%I64x\n" \
  682. "\tAR114 : 0x%I64x\n" \
  683. "\tAR115 : 0x%I64x\n" \
  684. "\tAR116 : 0x%I64x\n" \
  685. "\tAR117 : 0x%I64x\n" \
  686. "\tAR118 : 0x%I64x\n" \
  687. "\tAR119 : 0x%I64x\n" \
  688. "\tAR120 : 0x%I64x\n" \
  689. "\tAR121 : 0x%I64x\n" \
  690. "\tAR122 : 0x%I64x\n" \
  691. "\tAR123 : 0x%I64x\n" \
  692. "\tAR124 : 0x%I64x\n" \
  693. "\tAR125 : 0x%I64x\n" \
  694. "\tAR126 : 0x%I64x\n" \
  695. "\tAR127 : 0x%I64x\n"
  696. VOID
  697. DisplayProcessorApplicationRegisters(
  698. ULONG64 Pars
  699. )
  700. {
  701. ULONG parsSize;
  702. parsSize = GetTypeSize("hal!_PROCESSOR_APPLICATION_REGISTERS");
  703. dprintf("\tProcessor Application Registers File @ 0x%I64x\n", Pars );
  704. if ( parsSize ) {
  705. CHAR cmd[MAX_PATH];
  706. sprintf(cmd, "dt -o -r hal!_PROCESSOR_APPLICATION_REGISTERS 0x%I64x", Pars);
  707. ExecCommand(cmd);
  708. }
  709. else {
  710. PROCESSOR_APPLICATION_REGISTERS_IA64 applicationRegisters;
  711. ULONG bytesRead = 0;
  712. parsSize = sizeof(applicationRegisters);
  713. ReadMemory( Pars, &applicationRegisters, parsSize, &bytesRead );
  714. if ( bytesRead >= parsSize ) {
  715. dprintf( PROCESSOR_APPLICATION_REGISTERS_FORMAT_IA64,
  716. applicationRegisters.KR0,
  717. applicationRegisters.KR1,
  718. applicationRegisters.KR2,
  719. applicationRegisters.KR3,
  720. applicationRegisters.KR4,
  721. applicationRegisters.KR5,
  722. applicationRegisters.KR6,
  723. applicationRegisters.KR7,
  724. applicationRegisters.AR8,
  725. applicationRegisters.AR9,
  726. applicationRegisters.AR10,
  727. applicationRegisters.AR11,
  728. applicationRegisters.AR12,
  729. applicationRegisters.AR13,
  730. applicationRegisters.AR14,
  731. applicationRegisters.AR15,
  732. applicationRegisters.RSC,
  733. applicationRegisters.BSP,
  734. applicationRegisters.BSPSTORE,
  735. applicationRegisters.RNAT,
  736. applicationRegisters.AR20,
  737. applicationRegisters.FCR,
  738. applicationRegisters.AR22,
  739. applicationRegisters.AR23,
  740. applicationRegisters.EFLAG,
  741. applicationRegisters.CSD,
  742. applicationRegisters.SSD,
  743. applicationRegisters.CFLG,
  744. applicationRegisters.FSR,
  745. applicationRegisters.FIR,
  746. applicationRegisters.FDR,
  747. applicationRegisters.AR31,
  748. applicationRegisters.CCV,
  749. applicationRegisters.AR33,
  750. applicationRegisters.AR34,
  751. applicationRegisters.AR35,
  752. applicationRegisters.UNAT,
  753. applicationRegisters.AR37,
  754. applicationRegisters.AR38,
  755. applicationRegisters.AR39,
  756. applicationRegisters.FPSR,
  757. applicationRegisters.AR41,
  758. applicationRegisters.AR42,
  759. applicationRegisters.AR43,
  760. applicationRegisters.ITC,
  761. applicationRegisters.AR45,
  762. applicationRegisters.AR46,
  763. applicationRegisters.AR47,
  764. applicationRegisters.AR48,
  765. applicationRegisters.AR49,
  766. applicationRegisters.AR50,
  767. applicationRegisters.AR51,
  768. applicationRegisters.AR52,
  769. applicationRegisters.AR53,
  770. applicationRegisters.AR54,
  771. applicationRegisters.AR55,
  772. applicationRegisters.AR56,
  773. applicationRegisters.AR57,
  774. applicationRegisters.AR58,
  775. applicationRegisters.AR59,
  776. applicationRegisters.AR60,
  777. applicationRegisters.AR61,
  778. applicationRegisters.AR62,
  779. applicationRegisters.AR63,
  780. applicationRegisters.PFS,
  781. applicationRegisters.LC,
  782. applicationRegisters.EC,
  783. applicationRegisters.AR67,
  784. applicationRegisters.AR68,
  785. applicationRegisters.AR69,
  786. applicationRegisters.AR70,
  787. applicationRegisters.AR71,
  788. applicationRegisters.AR72,
  789. applicationRegisters.AR73,
  790. applicationRegisters.AR74,
  791. applicationRegisters.AR75,
  792. applicationRegisters.AR76,
  793. applicationRegisters.AR77,
  794. applicationRegisters.AR78,
  795. applicationRegisters.AR79,
  796. applicationRegisters.AR80,
  797. applicationRegisters.AR81,
  798. applicationRegisters.AR82,
  799. applicationRegisters.AR83,
  800. applicationRegisters.AR84,
  801. applicationRegisters.AR85,
  802. applicationRegisters.AR86,
  803. applicationRegisters.AR87,
  804. applicationRegisters.AR88,
  805. applicationRegisters.AR89,
  806. applicationRegisters.AR90,
  807. applicationRegisters.AR91,
  808. applicationRegisters.AR92,
  809. applicationRegisters.AR93,
  810. applicationRegisters.AR94,
  811. applicationRegisters.AR95,
  812. applicationRegisters.AR96,
  813. applicationRegisters.AR97,
  814. applicationRegisters.AR98,
  815. applicationRegisters.AR99,
  816. applicationRegisters.AR100,
  817. applicationRegisters.AR101,
  818. applicationRegisters.AR102,
  819. applicationRegisters.AR103,
  820. applicationRegisters.AR104,
  821. applicationRegisters.AR105,
  822. applicationRegisters.AR106,
  823. applicationRegisters.AR107,
  824. applicationRegisters.AR108,
  825. applicationRegisters.AR109,
  826. applicationRegisters.AR110,
  827. applicationRegisters.AR111,
  828. applicationRegisters.AR112,
  829. applicationRegisters.AR113,
  830. applicationRegisters.AR114,
  831. applicationRegisters.AR115,
  832. applicationRegisters.AR116,
  833. applicationRegisters.AR117,
  834. applicationRegisters.AR118,
  835. applicationRegisters.AR119,
  836. applicationRegisters.AR120,
  837. applicationRegisters.AR121,
  838. applicationRegisters.AR122,
  839. applicationRegisters.AR123,
  840. applicationRegisters.AR124,
  841. applicationRegisters.AR125,
  842. applicationRegisters.AR126,
  843. applicationRegisters.AR127
  844. );
  845. }
  846. else {
  847. dprintf("Reading _PROCESSOR_APPLICATION_REGISTERS directly from memory failed @ 0x%I64x.\n", Pars );
  848. }
  849. }
  850. return;
  851. } // DisplayProcessorApplicationRegisters()
  852. DECLARE_API( pars )
  853. /*++
  854. Routine Description:
  855. Dumps memory address as an IA64 Processor Control Registers file.
  856. Arguments:
  857. args - Supplies the address in hex.
  858. Return Value:
  859. None
  860. --*/
  861. {
  862. ULONG64 parsValue;
  863. ULONG result;
  864. char *header;
  865. parsValue = GetExpression(args);
  866. if (TargetMachine != IMAGE_FILE_MACHINE_IA64)
  867. {
  868. dprintf("!pars not implemented for this architecture.\n");
  869. }
  870. else
  871. {
  872. if ( parsValue ) {
  873. DisplayProcessorApplicationRegisters( parsValue );
  874. }
  875. else {
  876. dprintf("usage: pars <address>\n");
  877. }
  878. }
  879. return S_OK;
  880. } // !pars