resdesc.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. /*++
  2. Copyright (c) 2015 Minoca Corp.
  3. This file is licensed under the terms of the GNU General Public License
  4. version 3. Alternative licensing terms are available. Contact
  5. info@minocacorp.com for details. See the LICENSE file at the root of this
  6. project for complete licensing information.
  7. Module Name:
  8. resdesc.h
  9. Abstract:
  10. This header contains definitions for handling and converting resource
  11. descriptors in ACPI.
  12. Author:
  13. Evan Green 4-Aug-2015
  14. --*/
  15. //
  16. // ------------------------------------------------------------------- Includes
  17. //
  18. //
  19. // ---------------------------------------------------------------- Definitions
  20. //
  21. //
  22. // ------------------------------------------------------ Data Type Definitions
  23. //
  24. //
  25. // -------------------------------------------------------------------- Globals
  26. //
  27. //
  28. // -------------------------------------------------------- Function Prototypes
  29. //
  30. KSTATUS
  31. AcpipParseGenericAddress (
  32. PACPI_OBJECT ResourceBuffer,
  33. PGENERIC_ADDRESS GenericAddress
  34. );
  35. /*++
  36. Routine Description:
  37. This routine reads a single generic address from the given resource buffer.
  38. Arguments:
  39. ResourceBuffer - Supplies a pointer to the ACPI resource buffer to parse.
  40. GenericAddress - Supplies a pointer where the extracted generic address
  41. will be returned.
  42. Return Value:
  43. Status code.
  44. --*/
  45. KSTATUS
  46. AcpipConvertFromAcpiResourceBuffer (
  47. PACPI_OBJECT Device,
  48. PACPI_OBJECT ResourceBuffer,
  49. PRESOURCE_CONFIGURATION_LIST *ConfigurationListResult
  50. );
  51. /*++
  52. Routine Description:
  53. This routine converts an ACPI resource buffer into an OS configuration list.
  54. Arguments:
  55. Device - Supplies a pointer to the namespace object of the device this
  56. buffer is coming from. This is used for relative namespace traversal
  57. for certain types of resource descriptors (like GPIO).
  58. ResourceBuffer - Supplies a pointer to the ACPI resource list buffer to
  59. parse.
  60. ConfigurationListResult - Supplies a pointer where a newly allocated
  61. resource configuration list will be returned. It is the callers
  62. responsibility to manage this memory once it is returned.
  63. Return Value:
  64. Status code.
  65. --*/
  66. KSTATUS
  67. AcpipConvertFromRequirementListToAllocationList (
  68. PRESOURCE_CONFIGURATION_LIST ConfigurationList,
  69. PRESOURCE_ALLOCATION_LIST *AllocationList
  70. );
  71. /*++
  72. Routine Description:
  73. This routine converts a resource requirement list into a resource allocation
  74. list. For every requirement, it will create an allocation from the
  75. requirement's minimum and length.
  76. Arguments:
  77. ConfigurationList - Supplies a pointer to the resource configuration list to
  78. convert. This routine assumes there is only one configuration on the
  79. list.
  80. AllocationList - Supplies a pointer where a pointer to a new resource
  81. allocation list will be returned on success. The caller is responsible
  82. for freeing this memory once it is returned.
  83. Return Value:
  84. Status code.
  85. --*/
  86. KSTATUS
  87. AcpipConvertToAcpiResourceBuffer (
  88. PRESOURCE_ALLOCATION_LIST AllocationList,
  89. PACPI_OBJECT ResourceBuffer
  90. );
  91. /*++
  92. Routine Description:
  93. This routine converts an ACPI resource buffer into an OS configuration list.
  94. Arguments:
  95. AllocationList - Supplies a pointer to a resource allocation list to convert
  96. to a resource buffer.
  97. ResourceBuffer - Supplies a pointer to a resource buffer to tweak to fit
  98. the allocation list. The resource buffer comes from executing the _CRS
  99. method.
  100. Return Value:
  101. Status code.
  102. --*/