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.

124 lines
2.8 KiB

  1. /*++
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. ia64 dcr
  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. // EmDcrFields: EM register fields for the Default Control Register.
  18. //
  19. EM_REG_FIELD EmDcrFields[] = {
  20. { "pp", "Privileged Performance Monitor Default" , 0x1, 0 }, // 0
  21. { "be", "Big-Endian Default" , 0x1, 1 }, // 1
  22. { "lc", "IA-32 Lock check Enable", 0x1, 2 }, // 2
  23. { "rv", "reserved1", 0x5, 3 }, // 3-7
  24. { "dm", "Defer TLB Miss faults only", 0x1, 8 }, // 8
  25. { "dp", "Defer Page Not Present faults only", 0x1, 9 }, // 9
  26. { "dk", "Defer Key Miss faults only", 0x1, 10 }, // 10
  27. { "dx", "Defer Key Permission faults only", 0x1, 11 }, // 11
  28. { "dr", "Defer Access Rights faults only", 0x1, 12 }, // 12
  29. { "da", "Defer Access Bit faults only", 0x1, 13 }, // 13
  30. { "dd", "Defer Debug faults only", 0x1,1420 }, // 14
  31. { "rv", "reserved2", 0x31, 15 }, // 15-63
  32. };
  33. VOID
  34. DisplayDcrIA64(
  35. IN const PCHAR Header,
  36. IN EM_DCR EmDcr,
  37. IN DISPLAY_MODE DisplayMode
  38. )
  39. {
  40. dprintf("%s", Header ? Header : "" );
  41. if ( DisplayMode >= DISPLAY_MED ) {
  42. DisplayFullEmReg( EM_DCRToULong64(EmDcr), EmDcrFields, DisplayMode );
  43. }
  44. else {
  45. dprintf(
  46. "pp be lc dm dp dk dx dr da dd\n"
  47. "%1I64x %1I64x %1I64x %1I64x %1I64x %1I64x %1I64x %1I64x %1I64x %1I64x\n",
  48. EmDcr.pp,
  49. EmDcr.be,
  50. EmDcr.lc,
  51. EmDcr.dm,
  52. EmDcr.dp,
  53. EmDcr.dk,
  54. EmDcr.dx,
  55. EmDcr.dr,
  56. EmDcr.da,
  57. EmDcr.dd
  58. );
  59. }
  60. return;
  61. } // DisplayDcrIA64()
  62. DECLARE_API( dcr )
  63. /*++
  64. Routine Description:
  65. Dumps an IA64 Processor Default Control Register
  66. Arguments:
  67. args - Supplies the address in hex or @dcr.
  68. Return Value:
  69. None
  70. --*/
  71. {
  72. ULONG64 dcrValue;
  73. ULONG result;
  74. ULONG flags = 0;
  75. char *header;
  76. if (GetExpressionEx(args,&dcrValue, &args)) {
  77. flags = (ULONG) GetExpression(args);
  78. } else {
  79. dprintf("USAGE: !dcr 0xValue [display_mode:0,1,2]\n");
  80. dprintf("USAGE: !dcr @dcr [display_mode:0,1,2]\n");
  81. return E_INVALIDARG;
  82. }
  83. header = (flags > DISPLAY_MIN) ? NULL : "\tdcr:\t";
  84. switch ( TargetMachine ) {
  85. case IMAGE_FILE_MACHINE_IA64:
  86. DisplayDcrIA64( header, ULong64ToEM_DCR(dcrValue), flags );
  87. break;
  88. default:
  89. dprintf("!dcr not implemented for this architecture.\n");
  90. break;
  91. }
  92. return S_OK;
  93. } // !dcr