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.

134 lines
4.4 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. acpiioct.h
  5. Abstract:
  6. This module handles all of the INTERNAL_DEVICE_CONTROLS requested to
  7. the ACPI driver
  8. Author:
  9. Environment:
  10. NT Kernel Model Driver only
  11. --*/
  12. #ifndef _ACPIIOCT_H_
  13. #define _ACPIIOCT_H_
  14. #if defined (_MSC_VER) && (_MSC_VER >= 1020)
  15. #pragma once
  16. #endif
  17. //
  18. // IRP_MJ_INTERNAL_DEVICE_CONTROL CODES
  19. //
  20. #define IOCTL_ACPI_ASYNC_EVAL_METHOD CTL_CODE(FILE_DEVICE_ACPI, 0, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  21. #define IOCTL_ACPI_EVAL_METHOD CTL_CODE(FILE_DEVICE_ACPI, 1, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  22. #define IOCTL_ACPI_ACQUIRE_GLOBAL_LOCK CTL_CODE(FILE_DEVICE_ACPI, 4, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  23. #define IOCTL_ACPI_RELEASE_GLOBAL_LOCK CTL_CODE(FILE_DEVICE_ACPI, 5, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  24. //
  25. // Data structures used for IOCTL_ACPI_ASYNC_EVAL_METHOD and
  26. // IOCTL_ACPI_EVAL_METHOD
  27. //
  28. //
  29. // Possible Input buffer
  30. //
  31. typedef struct _ACPI_EVAL_INPUT_BUFFER {
  32. ULONG Signature;
  33. union {
  34. UCHAR MethodName[4];
  35. ULONG MethodNameAsUlong;
  36. };
  37. } ACPI_EVAL_INPUT_BUFFER, *PACPI_EVAL_INPUT_BUFFER;
  38. typedef struct _ACPI_EVAL_INPUT_BUFFER_SIMPLE_INTEGER {
  39. ULONG Signature;
  40. union {
  41. UCHAR MethodName[4];
  42. ULONG MethodNameAsUlong;
  43. };
  44. ULONG IntegerArgument;
  45. } ACPI_EVAL_INPUT_BUFFER_SIMPLE_INTEGER, *PACPI_EVAL_INPUT_BUFFER_SIMPLE_INTEGER;
  46. typedef struct _ACPI_EVAL_INPUT_BUFFER_SIMPLE_STRING {
  47. ULONG Signature;
  48. union {
  49. UCHAR MethodName[4];
  50. ULONG MethodNameAsUlong;
  51. };
  52. ULONG StringLength;
  53. UCHAR String[ANYSIZE_ARRAY];
  54. } ACPI_EVAL_INPUT_BUFFER_SIMPLE_STRING, *PACPI_EVAL_INPUT_BUFFER_SIMPLE_STRING;
  55. typedef struct _ACPI_METHOD_ARGUMENT {
  56. USHORT Type;
  57. USHORT DataLength;
  58. union {
  59. ULONG Argument;
  60. UCHAR Data[ANYSIZE_ARRAY];
  61. };
  62. } ACPI_METHOD_ARGUMENT, *PACPI_METHOD_ARGUMENT;
  63. #define ACPI_METHOD_ARGUMENT_LENGTH_FROM_ARGUMENT( Argument ) \
  64. ( ( (PACPI_METHOD_ARGUMENT) Argument)->DataLength > sizeof(ULONG) ? \
  65. ( (PACPI_METHOD_ARGUMENT) Argument)->DataLength + 2 * sizeof(USHORT):\
  66. 2 * sizeof(USHORT) + sizeof(ULONG) )
  67. #define ACPI_METHOD_ARGUMENT_LENGTH( DataLength ) \
  68. ( (DataLength > sizeof(ULONG)) ? DataLength + (2 * sizeof(USHORT)) : \
  69. 2 * sizeof(USHORT) + sizeof(ULONG) )
  70. #define ACPI_METHOD_NEXT_ARGUMENT( Argument ) \
  71. (PACPI_METHOD_ARGUMENT) ( (PUCHAR) Argument + \
  72. ACPI_METHOD_ARGUMENT_LENGTH_FROM_ARGUMENT( Argument ) )
  73. typedef struct _ACPI_EVAL_INPUT_BUFFER_COMPLEX {
  74. ULONG Signature;
  75. union {
  76. UCHAR MethodName[4];
  77. ULONG MethodNameAsUlong;
  78. };
  79. ULONG Size;
  80. ULONG ArgumentCount;
  81. ACPI_METHOD_ARGUMENT Argument[ANYSIZE_ARRAY];
  82. } ACPI_EVAL_INPUT_BUFFER_COMPLEX, *PACPI_EVAL_INPUT_BUFFER_COMPLEX;
  83. typedef struct _ACPI_EVAL_OUTPUT_BUFFER {
  84. ULONG Signature;
  85. ULONG Length;
  86. ULONG Count;
  87. ACPI_METHOD_ARGUMENT Argument[ANYSIZE_ARRAY];
  88. } ACPI_EVAL_OUTPUT_BUFFER, *PACPI_EVAL_OUTPUT_BUFFER;
  89. #define ACPI_EVAL_INPUT_BUFFER_SIGNATURE 'BieA'
  90. #define ACPI_EVAL_INPUT_BUFFER_SIMPLE_INTEGER_SIGNATURE 'IieA'
  91. #define ACPI_EVAL_INPUT_BUFFER_SIMPLE_STRING_SIGNATURE 'SieA'
  92. #define ACPI_EVAL_INPUT_BUFFER_COMPLEX_SIGNATURE 'CieA'
  93. #define ACPI_EVAL_OUTPUT_BUFFER_SIGNATURE 'BoeA'
  94. #define ACPI_METHOD_ARGUMENT_INTEGER 0x0
  95. #define ACPI_METHOD_ARGUMENT_STRING 0x1
  96. #define ACPI_METHOD_ARGUMENT_BUFFER 0x2
  97. #define ACPI_METHOD_ARGUMENT_PACKAGE 0x3
  98. //
  99. // Data structures used for IOCTL_ACPI_ACQUIRE_GLOBAL_LOCK
  100. // IOCTL_ACPI_RELEASE_GLOBAL_LOCK
  101. //
  102. typedef struct _ACPI_MANIPULATE_GLOBAL_LOCK_BUFFER {
  103. ULONG Signature;
  104. PVOID LockObject;
  105. } ACPI_MANIPULATE_GLOBAL_LOCK_BUFFER, *PACPI_MANIPULATE_GLOBAL_LOCK_BUFFER;
  106. #define ACPI_ACQUIRE_GLOBAL_LOCK_SIGNATURE 'LgaA'
  107. #define ACPI_RELEASE_GLOBAL_LOCK_SIGNATURE 'LgrA'
  108. #endif