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.

144 lines
4.7 KiB

  1. #ifndef _EXTS_PSR_H_
  2. #define _EXTS_PSR_H_
  3. /*++
  4. Copyright (c) 1999 Microsoft Corporation
  5. Module Name:
  6. ia64.h
  7. Abstract:
  8. This file contains definitions which are specifice to ia64 platforms
  9. Author:
  10. Kshitiz K. Sharma (kksharma)
  11. Environment:
  12. User Mode.
  13. Revision History:
  14. --*/
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. /////////////////////////////////////////////
  19. //
  20. // Generic EM Registers definitions
  21. //
  22. /////////////////////////////////////////////
  23. typedef unsigned __int64 EM_REG;
  24. typedef EM_REG *PEM_REG;
  25. #define EM_REG_BITS (sizeof(EM_REG) * 8)
  26. __inline EM_REG
  27. ULong64ToEMREG(
  28. IN ULONG64 Val
  29. )
  30. {
  31. return (*((PEM_REG)&Val));
  32. } // ULong64ToEMREG()
  33. __inline ULONG64
  34. EMREGToULong64(
  35. IN EM_REG EmReg
  36. )
  37. {
  38. return (*((PULONG64)&EmReg));
  39. } // EMRegToULong64()
  40. #define DEFINE_ULONG64_TO_EMREG(_EM_REG_TYPE) \
  41. __inline _EM_REG_TYPE \
  42. ULong64To##_EM_REG_TYPE( \
  43. IN ULONG64 Val \
  44. ) \
  45. { \
  46. return (*((P##_EM_REG_TYPE)&Val)); \
  47. } // ULong64To##_EM_REG_TYPE()
  48. #define DEFINE_EMREG_TO_ULONG64(_EM_REG_TYPE) \
  49. __inline ULONG64 \
  50. _EM_REG_TYPE##ToULong64( \
  51. IN _EM_REG_TYPE EmReg \
  52. ) \
  53. { \
  54. return (*((PULONG64)&EmReg)); \
  55. } // _EM_REG_TYPE##ToULong64()
  56. typedef struct _EM_PSR {
  57. unsigned __int64 reserved0:1; // 0 : reserved
  58. unsigned __int64 be:1; // 1 : Big-Endian
  59. unsigned __int64 up:1; // 2 : User Performance monitor enable
  60. unsigned __int64 ac:1; // 3 : Alignment Check
  61. unsigned __int64 mfl:1; // 4 : Lower (f2 .. f31) floating-point registers written
  62. unsigned __int64 mfh:1; // 5 : Upper (f32 .. f127) floating-point registers written
  63. unsigned __int64 reserved1:7; // 6-12 : reserved
  64. unsigned __int64 ic:1; // 13 : Interruption Collection
  65. unsigned __int64 i:1; // 14 : Interrupt Bit
  66. unsigned __int64 pk:1; // 15 : Protection Key enable
  67. unsigned __int64 reserved2:1; // 16 : reserved
  68. unsigned __int64 dt:1; // 17 : Data Address Translation
  69. unsigned __int64 dfl:1; // 18 : Disabled Floating-point Low register set
  70. unsigned __int64 dfh:1; // 19 : Disabled Floating-point High register set
  71. unsigned __int64 sp:1; // 20 : Secure Performance monitors
  72. unsigned __int64 pp:1; // 21 : Privileged Performance monitor enable
  73. unsigned __int64 di:1; // 22 : Disable Instruction set transition
  74. unsigned __int64 si:1; // 23 : Secure Interval timer
  75. unsigned __int64 db:1; // 24 : Debug Breakpoint fault
  76. unsigned __int64 lp:1; // 25 : Lower Privilege transfer trap
  77. unsigned __int64 tb:1; // 26 : Taken Branch trap
  78. unsigned __int64 rt:1; // 27 : Register stack translation
  79. unsigned __int64 reserved3:4; // 28-31 : reserved
  80. unsigned __int64 cpl:2; // 32;33 : Current Privilege Level
  81. unsigned __int64 is:1; // 34 : Instruction Set
  82. unsigned __int64 mc:1; // 35 : Machine Abort Mask
  83. unsigned __int64 it:1; // 36 : Instruction address Translation
  84. unsigned __int64 id:1; // 37 : Instruction Debug fault disable
  85. unsigned __int64 da:1; // 38 : Disable Data Access and Dirty-bit faults
  86. unsigned __int64 dd:1; // 39 : Data Debug fault disable
  87. unsigned __int64 ss:1; // 40 : Single Step enable
  88. unsigned __int64 ri:2; // 41;42 : Restart Instruction
  89. unsigned __int64 ed:1; // 43 : Exception Deferral
  90. unsigned __int64 bn:1; // 44 : register Bank
  91. unsigned __int64 ia:1; // 45 : Disable Instruction Access-bit faults
  92. unsigned __int64 reserved4:18; // 46-63 : reserved
  93. } EM_PSR, *PEM_PSR;
  94. typedef EM_PSR EM_IPSR;
  95. typedef EM_IPSR *PEM_IPSR;
  96. DEFINE_ULONG64_TO_EMREG(EM_PSR)
  97. DEFINE_EMREG_TO_ULONG64(EM_PSR)
  98. typedef enum _DISPLAY_MODE {
  99. DISPLAY_MIN = 0,
  100. DISPLAY_DEFAULT = DISPLAY_MIN,
  101. DISPLAY_MED = 1,
  102. DISPLAY_MAX = 2,
  103. DISPLAY_FULL = DISPLAY_MAX
  104. } DISPLAY_MODE;
  105. typedef struct _EM_REG_FIELD {
  106. const char *SubName;
  107. const char *Name;
  108. unsigned long Length;
  109. unsigned long Shift;
  110. } EM_REG_FIELD, *PEM_REG_FIELD;
  111. #ifdef __cplusplus
  112. }
  113. #endif
  114. #endif