1
0

resdesc.h 3.3 KB

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