]> git.proxmox.com Git - mirror_edk2.git/blobdiff - DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
DynamicTablesPkg: AML Code generation for memory ranges
[mirror_edk2.git] / DynamicTablesPkg / Include / Library / AmlLib / AmlLib.h
index 094a8f32c6ff2ca5c50e398a16a4e96f49fc4971..385d2459d273971bda191d28dd076918726f2d45 100644 (file)
@@ -418,6 +418,278 @@ AmlUpdateRdQWord (
   IN  UINT64                BaseAddressLength\r
   );\r
 \r
+/** Code generation for the "DWordIO ()" ASL function.\r
+\r
+  The Resource Data effectively created is a DWord Address Space Resource\r
+  Data. Cf ACPI 6.4:\r
+   - s6.4.3.5.2 "DWord Address Space Descriptor".\r
+   - s19.6.34 "DWordIO".\r
+\r
+  The created resource data node can be:\r
+   - appended to the list of resource data elements of the NameOpNode.\r
+     In such case NameOpNode must be defined by a the "Name ()" ASL statement\r
+     and initially contain a "ResourceTemplate ()".\r
+   - returned through the NewRdNode parameter.\r
+\r
+  See ACPI 6.4 spec, s19.6.34 for more.\r
+\r
+  @param [in]  IsResourceConsumer   ResourceUsage parameter.\r
+  @param [in]  IsMinFixed           Minimum address is fixed.\r
+  @param [in]  IsMaxFixed           Maximum address is fixed.\r
+  @param [in]  IsPosDecode          Decode parameter\r
+  @param [in]  IsaRanges            Possible values are:\r
+                                     0-Reserved\r
+                                     1-NonISAOnly\r
+                                     2-ISAOnly\r
+                                     3-EntireRange\r
+  @param [in]  AddressGranularity   Address granularity.\r
+  @param [in]  AddressMinimum       Minimum address.\r
+  @param [in]  AddressMaximum       Maximum address.\r
+  @param [in]  AddressTranslation   Address translation.\r
+  @param [in]  RangeLength          Range length.\r
+  @param [in]  ResourceSourceIndex  Resource Source index.\r
+                                    Not supported. Must be 0.\r
+  @param [in]  ResourceSource       Resource Source.\r
+                                    Not supported. Must be NULL.\r
+  @param [in]  IsDenseTranslation   TranslationDensity parameter.\r
+  @param [in]  IsTypeStatic         TranslationType parameter.\r
+  @param [in]  NameOpNode           NameOp object node defining a named object.\r
+                                    If provided, append the new resource data\r
+                                    node to the list of resource data elements\r
+                                    of this node.\r
+  @param [out] NewRdNode            If provided and success,\r
+                                    contain the created node.\r
+\r
+  @retval EFI_SUCCESS             The function completed successfully.\r
+  @retval EFI_INVALID_PARAMETER   Invalid parameter.\r
+  @retval EFI_OUT_OF_RESOURCES    Could not allocate memory.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+AmlCodeGenRdDWordIo (\r
+  IN        BOOLEAN IsResourceConsumer,\r
+  IN        BOOLEAN IsMinFixed,\r
+  IN        BOOLEAN IsMaxFixed,\r
+  IN        BOOLEAN IsPosDecode,\r
+  IN        UINT8 IsaRanges,\r
+  IN        UINT32 AddressGranularity,\r
+  IN        UINT32 AddressMinimum,\r
+  IN        UINT32 AddressMaximum,\r
+  IN        UINT32 AddressTranslation,\r
+  IN        UINT32 RangeLength,\r
+  IN        UINT8 ResourceSourceIndex,\r
+  IN  CONST CHAR8 *ResourceSource,\r
+  IN        BOOLEAN IsDenseTranslation,\r
+  IN        BOOLEAN IsTypeStatic,\r
+  IN        AML_OBJECT_NODE_HANDLE NameOpNode, OPTIONAL\r
+  OUT       AML_DATA_NODE_HANDLE    *NewRdNode  OPTIONAL\r
+  );\r
+\r
+/** Code generation for the "DWordMemory ()" ASL function.\r
+\r
+  The Resource Data effectively created is a DWord Address Space Resource\r
+  Data. Cf ACPI 6.4:\r
+   - s6.4.3.5.2 "DWord Address Space Descriptor".\r
+   - s19.6.35 "DWordMemory".\r
+\r
+  The created resource data node can be:\r
+   - appended to the list of resource data elements of the NameOpNode.\r
+     In such case NameOpNode must be defined by a the "Name ()" ASL statement\r
+     and initially contain a "ResourceTemplate ()".\r
+   - returned through the NewRdNode parameter.\r
+\r
+  See ACPI 6.4 spec, s19.6.35 for more.\r
+\r
+  @param [in]  IsResourceConsumer   ResourceUsage parameter.\r
+  @param [in]  IsPosDecode          Decode parameter\r
+  @param [in]  IsMinFixed           Minimum address is fixed.\r
+  @param [in]  IsMaxFixed           Maximum address is fixed.\r
+  @param [in]  Cacheable            Possible values are:\r
+                                    0-The memory is non-cacheable\r
+                                    1-The memory is cacheable\r
+                                    2-The memory is cacheable and supports\r
+                                      write combining\r
+                                    3-The memory is cacheable and prefetchable\r
+  @param [in]  IsReadWrite          ReadAndWrite parameter.\r
+  @param [in]  AddressGranularity   Address granularity.\r
+  @param [in]  AddressMinimum       Minimum address.\r
+  @param [in]  AddressMaximum       Maximum address.\r
+  @param [in]  AddressTranslation   Address translation.\r
+  @param [in]  RangeLength          Range length.\r
+  @param [in]  ResourceSourceIndex  Resource Source index.\r
+                                    Not supported. Must be 0.\r
+  @param [in]  ResourceSource       Resource Source.\r
+                                    Not supported. Must be NULL.\r
+  @param [in]  MemoryRangeType      Possible values are:\r
+                                      0-AddressRangeMemory\r
+                                      1-AddressRangeReserved\r
+                                      2-AddressRangeACPI\r
+                                      3-AddressRangeNVS\r
+  @param [in]  IsTypeStatic         TranslationType parameter.\r
+  @param [in]  NameOpNode           NameOp object node defining a named object.\r
+                                    If provided, append the new resource data\r
+                                    node to the list of resource data elements\r
+                                    of this node.\r
+  @param [out] NewRdNode            If provided and success,\r
+                                    contain the created node.\r
+\r
+  @retval EFI_SUCCESS             The function completed successfully.\r
+  @retval EFI_INVALID_PARAMETER   Invalid parameter.\r
+  @retval EFI_OUT_OF_RESOURCES    Could not allocate memory.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+AmlCodeGenRdDWordMemory (\r
+  IN        BOOLEAN IsResourceConsumer,\r
+  IN        BOOLEAN IsPosDecode,\r
+  IN        BOOLEAN IsMinFixed,\r
+  IN        BOOLEAN IsMaxFixed,\r
+  IN        UINT8 Cacheable,\r
+  IN        BOOLEAN IsReadWrite,\r
+  IN        UINT32 AddressGranularity,\r
+  IN        UINT32 AddressMinimum,\r
+  IN        UINT32 AddressMaximum,\r
+  IN        UINT32 AddressTranslation,\r
+  IN        UINT32 RangeLength,\r
+  IN        UINT8 ResourceSourceIndex,\r
+  IN  CONST CHAR8 *ResourceSource,\r
+  IN        UINT8 MemoryRangeType,\r
+  IN        BOOLEAN IsTypeStatic,\r
+  IN        AML_OBJECT_NODE_HANDLE NameOpNode, OPTIONAL\r
+  OUT       AML_DATA_NODE_HANDLE    *NewRdNode  OPTIONAL\r
+  );\r
+\r
+/** Code generation for the "WordBusNumber ()" ASL function.\r
+\r
+  The Resource Data effectively created is a Word Address Space Resource\r
+  Data. Cf ACPI 6.4:\r
+   - s6.4.3.5.3 "Word Address Space Descriptor".\r
+   - s19.6.149 "WordBusNumber".\r
+\r
+  The created resource data node can be:\r
+   - appended to the list of resource data elements of the NameOpNode.\r
+     In such case NameOpNode must be defined by a the "Name ()" ASL statement\r
+     and initially contain a "ResourceTemplate ()".\r
+   - returned through the NewRdNode parameter.\r
+\r
+  See ACPI 6.4 spec, s19.6.149 for more.\r
+\r
+  @param [in]  IsResourceConsumer   ResourceUsage parameter.\r
+  @param [in]  IsMinFixed           Minimum address is fixed.\r
+  @param [in]  IsMaxFixed           Maximum address is fixed.\r
+  @param [in]  IsPosDecode          Decode parameter\r
+  @param [in]  AddressGranularity   Address granularity.\r
+  @param [in]  AddressMinimum       Minimum address.\r
+  @param [in]  AddressMaximum       Maximum address.\r
+  @param [in]  AddressTranslation   Address translation.\r
+  @param [in]  RangeLength          Range length.\r
+  @param [in]  ResourceSourceIndex  Resource Source index.\r
+                                    Not supported. Must be 0.\r
+  @param [in]  ResourceSource       Resource Source.\r
+                                    Not supported. Must be NULL.\r
+  @param [in]  NameOpNode           NameOp object node defining a named object.\r
+                                    If provided, append the new resource data\r
+                                    node to the list of resource data elements\r
+                                    of this node.\r
+  @param [out] NewRdNode            If provided and success,\r
+                                    contain the created node.\r
+\r
+  @retval EFI_SUCCESS             The function completed successfully.\r
+  @retval EFI_INVALID_PARAMETER   Invalid parameter.\r
+  @retval EFI_OUT_OF_RESOURCES    Could not allocate memory.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+AmlCodeGenRdWordBusNumber (\r
+  IN        BOOLEAN IsResourceConsumer,\r
+  IN        BOOLEAN IsMinFixed,\r
+  IN        BOOLEAN IsMaxFixed,\r
+  IN        BOOLEAN IsPosDecode,\r
+  IN        UINT32 AddressGranularity,\r
+  IN        UINT32 AddressMinimum,\r
+  IN        UINT32 AddressMaximum,\r
+  IN        UINT32 AddressTranslation,\r
+  IN        UINT32 RangeLength,\r
+  IN        UINT8 ResourceSourceIndex,\r
+  IN  CONST CHAR8 *ResourceSource,\r
+  IN        AML_OBJECT_NODE_HANDLE NameOpNode, OPTIONAL\r
+  OUT       AML_DATA_NODE_HANDLE    *NewRdNode  OPTIONAL\r
+  );\r
+\r
+/** Code generation for the "QWordMemory ()" ASL function.\r
+\r
+  The Resource Data effectively created is a QWord Address Space Resource\r
+  Data. Cf ACPI 6.4:\r
+   - s6.4.3.5.1 "QWord Address Space Descriptor".\r
+   - s19.6.110 "QWordMemory".\r
+\r
+  The created resource data node can be:\r
+   - appended to the list of resource data elements of the NameOpNode.\r
+     In such case NameOpNode must be defined by a the "Name ()" ASL statement\r
+     and initially contain a "ResourceTemplate ()".\r
+   - returned through the NewRdNode parameter.\r
+\r
+  See ACPI 6.4 spec, s19.6.110 for more.\r
+\r
+  @param [in]  IsResourceConsumer   ResourceUsage parameter.\r
+  @param [in]  IsPosDecode          Decode parameter.\r
+  @param [in]  IsMinFixed           Minimum address is fixed.\r
+  @param [in]  IsMaxFixed           Maximum address is fixed.\r
+  @param [in]  Cacheable            Possible values are:\r
+                                    0-The memory is non-cacheable\r
+                                    1-The memory is cacheable\r
+                                    2-The memory is cacheable and supports\r
+                                      write combining\r
+                                    3-The memory is cacheable and prefetchable\r
+  @param [in]  IsReadWrite          ReadAndWrite parameter.\r
+  @param [in]  AddressGranularity   Address granularity.\r
+  @param [in]  AddressMinimum       Minimum address.\r
+  @param [in]  AddressMaximum       Maximum address.\r
+  @param [in]  AddressTranslation   Address translation.\r
+  @param [in]  RangeLength          Range length.\r
+  @param [in]  ResourceSourceIndex  Resource Source index.\r
+                                    Not supported. Must be 0.\r
+  @param [in]  ResourceSource       Resource Source.\r
+                                    Not supported. Must be NULL.\r
+  @param [in]  MemoryRangeType      Possible values are:\r
+                                      0-AddressRangeMemory\r
+                                      1-AddressRangeReserved\r
+                                      2-AddressRangeACPI\r
+                                      3-AddressRangeNVS\r
+  @param [in]  IsTypeStatic         TranslationType parameter.\r
+  @param [in]  NameOpNode           NameOp object node defining a named object.\r
+                                    If provided, append the new resource data\r
+                                    node to the list of resource data elements\r
+                                    of this node.\r
+  @param [out] NewRdNode            If provided and success,\r
+                                    contain the created node.\r
+\r
+  @retval EFI_SUCCESS             The function completed successfully.\r
+  @retval EFI_INVALID_PARAMETER   Invalid parameter.\r
+  @retval EFI_OUT_OF_RESOURCES    Could not allocate memory.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+AmlCodeGenRdQWordMemory (\r
+  IN        BOOLEAN IsResourceConsumer,\r
+  IN        BOOLEAN IsPosDecode,\r
+  IN        BOOLEAN IsMinFixed,\r
+  IN        BOOLEAN IsMaxFixed,\r
+  IN        UINT8 Cacheable,\r
+  IN        BOOLEAN IsReadWrite,\r
+  IN        UINT64 AddressGranularity,\r
+  IN        UINT64 AddressMinimum,\r
+  IN        UINT64 AddressMaximum,\r
+  IN        UINT64 AddressTranslation,\r
+  IN        UINT64 RangeLength,\r
+  IN        UINT8 ResourceSourceIndex,\r
+  IN  CONST CHAR8 *ResourceSource,\r
+  IN        UINT8 MemoryRangeType,\r
+  IN        BOOLEAN IsTypeStatic,\r
+  IN        AML_OBJECT_NODE_HANDLE NameOpNode, OPTIONAL\r
+  OUT       AML_DATA_NODE_HANDLE    *NewRdNode  OPTIONAL\r
+  );\r
+\r
 /** Code generation for the "Interrupt ()" ASL function.\r
 \r
   The Resource Data effectively created is an Extended Interrupt Resource\r