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.

136 lines
4.4 KiB

  1. /*** unasm.h - Unassembler Private Definitions
  2. *
  3. * Copyright (c) 1996,1998 Microsoft Corporation
  4. * Author: Michael Tsang (MikeTs)
  5. * Created 03/24/98
  6. *
  7. * MODIFICATION HISTORY
  8. */
  9. #ifndef _UNASM_H
  10. #define _UNASM_H
  11. #ifdef DEBUGGER
  12. /*** Constants
  13. */
  14. // Implementation constants
  15. #define MAX_ARGS 7
  16. // Error codes
  17. #define UNASMERR_NONE 0
  18. #define UNASMERR_FATAL -1
  19. #define UNASMERR_INVALID_OPCODE -2
  20. #define UNASMERR_ABORT -3
  21. // Opcode classes
  22. #define OPCLASS_INVALID 0
  23. #define OPCLASS_DATA_OBJ 1
  24. #define OPCLASS_NAME_OBJ 2
  25. #define OPCLASS_CONST_OBJ 3
  26. #define OPCLASS_CODE_OBJ 4
  27. #define OPCLASS_ARG_OBJ 5
  28. #define OPCLASS_LOCAL_OBJ 6
  29. // NameSpace object types
  30. #define NSTYPE_UNKNOWN 'U'
  31. #define NSTYPE_SCOPE 'S'
  32. #define NSTYPE_FIELDUNIT 'F'
  33. #define NSTYPE_DEVICE 'D'
  34. #define NSTYPE_EVENT 'E'
  35. #define NSTYPE_METHOD 'M'
  36. #define NSTYPE_MUTEX 'X'
  37. #define NSTYPE_OPREGION 'O'
  38. #define NSTYPE_POWERRES 'P'
  39. #define NSTYPE_PROCESSOR 'C'
  40. #define NSTYPE_THERMALZONE 'T'
  41. #define NSTYPE_OBJALIAS 'A'
  42. #define NSTYPE_BUFFFIELD 'B'
  43. // Term classes
  44. #define UTC_PNP_MACRO 0x00100000
  45. #define UTC_REF_OBJECT 0x00200000
  46. #define UTC_FIELD_MACRO 0x00400000
  47. #define UTC_DATA_OBJECT 0x00800000
  48. #define UTC_NAMED_OBJECT 0x01000000
  49. #define UTC_NAMESPACE_MODIFIER 0x02000000
  50. #define UTC_OPCODE_TYPE1 0x04000000
  51. #define UTC_OPCODE_TYPE2 0x08000000
  52. #define UTC_CONST_NAME 0x10000000
  53. #define UTC_SHORT_NAME 0x20000000
  54. #define UTC_COMPILER_DIRECTIVE 0x40000000
  55. #define UTC_KEYWORD 0x80000000
  56. #define UTC_OPCODE (UTC_OPCODE_TYPE1 | UTC_OPCODE_TYPE2 | \
  57. UTC_SHORT_NAME | UTC_CONST_NAME | \
  58. UTC_DATA_OBJECT)
  59. // Term flags
  60. #define TF_ACTION_FLIST 0x00000001
  61. #define TF_ACTION_VLIST 0x00000002
  62. #define TF_PACKAGE_LEN 0x00000004
  63. #define TF_CHANGE_CHILDSCOPE 0x00000008
  64. #define TF_FIELD_MACRO UTC_FIELD_MACRO
  65. #define TF_DATA_OBJECT UTC_DATA_OBJECT
  66. #define TF_NAMED_OBJECT UTC_NAMED_OBJECT
  67. #define TF_NAMESPACE_MODIFIER UTC_NAMESPACE_MODIFIER
  68. #define TF_OPCODE_TYPE1 UTC_OPCODE_TYPE1
  69. #define TF_OPCODE_TYPE2 UTC_OPCODE_TYPE2
  70. #define TF_CONST_NAME UTC_CONST_NAME
  71. #define TF_SHORT_NAME UTC_SHORT_NAME
  72. #define TF_COMPILER_DIRECTIVE UTC_COMPILER_DIRECTIVE
  73. #define TF_KEYWORD UTC_KEYWORD
  74. #define TF_PNP_MACRO UTC_PNP_MACRO
  75. #define TF_OBJECT_LIST (UTC_NAMED_OBJECT | UTC_NAMESPACE_MODIFIER)
  76. #define TF_CODE_LIST (UTC_OPCODE_TYPE1 | UTC_OPCODE_TYPE2)
  77. #define TF_DATA_LIST 0x00010000
  78. #define TF_FIELD_LIST 0x00020000
  79. #define TF_BYTE_LIST 0x00040000
  80. #define TF_DWORD_LIST 0x00080000
  81. #define TF_PACKAGE_LIST (UTC_DATA_OBJECT | UTC_SHORT_NAME | \
  82. UTC_CONST_NAME)
  83. #define TF_ALL_LISTS (TF_DATA_OBJECT | TF_NAMED_OBJECT | \
  84. TF_NAMESPACE_MODIFIER | TF_OPCODE_TYPE1 | \
  85. TF_OPCODE_TYPE2 | TF_SHORT_NAME | \
  86. TF_CONST_NAME | TF_COMPILER_DIRECTIVE | \
  87. TF_DATA_LIST | TF_PACKAGE_LIST | \
  88. TF_FIELD_LIST | TF_PNP_MACRO | TF_BYTE_LIST |\
  89. TF_DWORD_LIST)
  90. /*** Type definitions
  91. */
  92. typedef ULONG NAMESEG;
  93. typedef int (LOCAL *PFNTERM)(PTOKEN, BOOL);
  94. typedef struct _aslterm
  95. {
  96. PSZ pszID;
  97. ULONG dwfTermClass;
  98. ULONG dwTermData;
  99. ULONG dwOpcode;
  100. PSZ pszUnAsmArgTypes;
  101. PSZ pszArgActions;
  102. ULONG dwfTerm;
  103. } ASLTERM, *PASLTERM;
  104. typedef struct _opmap
  105. {
  106. UCHAR bExOp;
  107. UCHAR bOpClass;
  108. } OPMAP, *POPMAP;
  109. // Data prototype
  110. extern int gicCode;
  111. extern int giLevel;
  112. extern PNSOBJ gpnsCurUnAsmScope;
  113. extern ASLTERM TermTable[];
  114. extern UCHAR OpClassTable[256];
  115. extern OPMAP ExOpClassTable[];
  116. // Exported functions
  117. LONG LOCAL UnAsmScope(PUCHAR *ppbOp, PUCHAR pbEnd, int iLevel, int icCode);
  118. #endif //ifdef DEBUGGER
  119. #endif //ifndef _UNASM_H