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.

145 lines
4.1 KiB

  1. /*** aslp.h - ASL Private Definitions
  2. *
  3. * Copyright (c) 1996,1997 Microsoft Corporation
  4. * Author: Michael Tsang (MikeTs)
  5. * Created 09/05/96
  6. *
  7. * MODIFICATION HISTORY
  8. */
  9. #ifndef _ASLP_H
  10. #define _ASLP_H
  11. /*** Constants
  12. */
  13. // String constants
  14. #define STR_PROGDESC "ACPI Source Language Assembler"
  15. #define STR_COPYRIGHT "Copyright (c) 1996,1999 Microsoft Corporation"
  16. #define STR_MS "MSFT"
  17. // Error codes
  18. #define ASLERR_NONE 0
  19. #define ASLERR_INVALID_PARAM -1
  20. #define ASLERR_OPEN_FILE -2
  21. #define ASLERR_CREATE_FILE -3
  22. #define ASLERR_READ_FILE -4
  23. #define ASLERR_WRITE_FILE -5
  24. #define ASLERR_SEEK_FILE -6
  25. #define ASLERR_INIT_SCANNER -7
  26. #define ASLERR_OUT_OF_MEM -8
  27. #define ASLERR_NAME_TOO_LONG -9
  28. #define ASLERR_NEST_DDB -10
  29. #define ASLERR_SYNTAX -11
  30. #define ASLERR_PKTLEN_TOO_LONG -12
  31. #define ASLERR_NAME_EXIST -13
  32. #define ASLERR_NSOBJ_EXIST -14
  33. #define ASLERR_NSOBJ_NOT_FOUND -15
  34. #define ASLERR_INVALID_NAME -16
  35. #define ASLERR_INTERNAL_ERROR -17
  36. #define ASLERR_INVALID_EISAID -18
  37. #define ASLERR_EXPECT_EOF -19
  38. #define ASLERR_INVALID_OPCODE -20
  39. #define ASLERR_SIG_NOT_FOUND -21
  40. #define ASLERR_GET_TABLE -22
  41. #define ASLERR_CHECKSUM -23
  42. #define ASLERR_INVALID_ARGTYPE -24
  43. #define ASLERR_INVALID_OBJTYPE -25
  44. #define ASLERR_OPEN_VXD -26
  45. // Misc. constants
  46. #define VERSION_MAJOR 1
  47. #define VERSION_MINOR 0
  48. #define VERSION_RELEASE 13
  49. #define VERSION_DWORD ((VERSION_MAJOR << 24) | \
  50. (VERSION_MINOR << 16) | \
  51. VERSION_RELEASE)
  52. // Implementation constants
  53. #define MAX_STRING_LEN 199
  54. #define MAX_NAMECODE_LEN 1300 //approx. 255*4 + 2 + 255
  55. #define MAX_MSG_LEN 127
  56. #define MAX_PACKAGE_LEN 0x0fffffff
  57. // gdwfASL flags
  58. #define ASLF_NOLOGO 0x00000001
  59. #define ASLF_UNASM 0x00000002
  60. #define ASLF_GENASM 0x00000004
  61. #define ASLF_GENSRC 0x00000008
  62. #define ASLF_NT 0x00000010
  63. #define ASLF_DUMP_NONASL 0x00000020
  64. #define ASLF_DUMP_BIN 0x00000040
  65. #define ASLF_CREAT_BIN 0x00000080
  66. // Code flags
  67. #define CF_MISSING_ARG 0x00000001
  68. #define CF_PARSING_FIXEDLIST 0x00000002
  69. #define CF_PARSING_VARLIST 0x00000004
  70. #define CF_CREATED_NSOBJ 0x00000008
  71. // Data types
  72. #define CODETYPE_UNKNOWN 0
  73. #define CODETYPE_ASLTERM 1
  74. #define CODETYPE_NAME 2
  75. #define CODETYPE_DATAOBJ 3
  76. #define CODETYPE_FIELDOBJ 4
  77. #define CODETYPE_INTEGER 5
  78. #define CODETYPE_STRING 6
  79. #define CODETYPE_KEYWORD 7
  80. #define CODETYPE_USERTERM 8
  81. #define CODETYPE_QWORD 9
  82. /*** Macros
  83. */
  84. #define MODNAME ProgInfo.pszProgName
  85. #define ISLEADNAMECHAR(c) (((c) >= 'A') && ((c) <= 'Z') || ((c) == '_'))
  86. #define ISNAMECHAR(c) (ISLEADNAMECHAR(c) || ((c) >= '0') && ((c) <= '9'))
  87. #define OPCODELEN(d) (((d) == OP_NONE)? 0: (((d) & 0x0000ff00)? 2: 1))
  88. #ifdef DEBUG
  89. #define MEMALLOC(n) (++gdwcMemObjs, malloc(n))
  90. #define MEMFREE(p) {ASSERT(gdwcMemObjs > 0); free(p); --gdwcMemObjs;}
  91. #else
  92. #define MEMALLOC(n) malloc(n)
  93. #define MEMFREE(p) free(p)
  94. #endif
  95. /*** Type definitions
  96. */
  97. typedef struct _codeobj
  98. {
  99. LIST list; //link to siblings
  100. struct _codeobj *pcParent;
  101. struct _codeobj *pcFirstChild;
  102. PNSOBJ pnsObj;
  103. DWORD dwTermIndex;
  104. DWORD dwfCode;
  105. DWORD dwCodeType;
  106. DWORD dwCodeValue;
  107. DWORD dwDataLen;
  108. PBYTE pbDataBuff;
  109. DWORD dwCodeLen;
  110. BYTE bCodeChkSum;
  111. } CODEOBJ, *PCODEOBJ;
  112. typedef struct _nschk
  113. {
  114. struct _nschk *pnschkNext;
  115. char szObjName[MAX_NSPATH_LEN + 1];
  116. PSZ pszFile;
  117. PNSOBJ pnsScope;
  118. PNSOBJ pnsMethod;
  119. ULONG dwExpectedType;
  120. ULONG dwChkData;
  121. WORD wLineNum;
  122. } NSCHK, *PNSCHK;
  123. typedef struct _resfield
  124. {
  125. PSZ pszName;
  126. DWORD dwBitOffset;
  127. DWORD dwBitSize;
  128. } RESFIELD, *PRESFIELD;
  129. #endif //ifndef _ASLP_H