Compare commits
	
		
			243 Commits
		
	
	
		
			system76
			...
			edk2-stabl
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					bb1bba3d77 | ||
| 
						 | 
					4c7ce0d285 | ||
| 
						 | 
					e1e7306b54 | ||
| 
						 | 
					455b0347a7 | ||
| 
						 | 
					466ebdd2e0 | ||
| 
						 | 
					4c495e5e3d | ||
| 
						 | 
					a92559671a | ||
| 
						 | 
					22c3b5a865 | ||
| 
						 | 
					8c8867c5da | ||
| 
						 | 
					f826b20811 | ||
| 
						 | 
					a7b35aae13 | ||
| 
						 | 
					aab6bb3d32 | ||
| 
						 | 
					c974257821 | ||
| 
						 | 
					d6e6337cd6 | ||
| 
						 | 
					8c1b1fe634 | ||
| 
						 | 
					fd42dcb1fc | ||
| 
						 | 
					d939a25d41 | ||
| 
						 | 
					45137bca2f | ||
| 
						 | 
					77dcd03ecf | ||
| 
						 | 
					f331310a10 | ||
| 
						 | 
					5948ec3647 | ||
| 
						 | 
					48452993ad | ||
| 
						 | 
					b5d4a35d90 | ||
| 
						 | 
					d79df34beb | ||
| 
						 | 
					4050c873b5 | ||
| 
						 | 
					15e635d1b5 | ||
| 
						 | 
					b0a03ca4a9 | ||
| 
						 | 
					c1f2287635 | ||
| 
						 | 
					e13e53cb2f | ||
| 
						 | 
					0f4cdad25b | ||
| 
						 | 
					b258f12889 | ||
| 
						 | 
					6f9e83f757 | ||
| 
						 | 
					939c2355da | ||
| 
						 | 
					c8594a5311 | ||
| 
						 | 
					91b772ab62 | ||
| 
						 | 
					e7663fdd82 | ||
| 
						 | 
					1bc232aae3 | ||
| 
						 | 
					bb146ce32d | ||
| 
						 | 
					9a95d11023 | ||
| 
						 | 
					2f6f3329ad | ||
| 
						 | 
					b80c17b62d | ||
| 
						 | 
					242dcfe30f | ||
| 
						 | 
					ae8acce8ae | ||
| 
						 | 
					04714cef46 | ||
| 
						 | 
					1d66480aa4 | ||
| 
						 | 
					bed990aae6 | ||
| 
						 | 
					e7e8ea27d4 | ||
| 
						 | 
					87a34ca0cf | ||
| 
						 | 
					8b76f23534 | ||
| 
						 | 
					c9ec74a198 | ||
| 
						 | 
					5a2411784b | ||
| 
						 | 
					f079e9b450 | ||
| 
						 | 
					6254037223 | ||
| 
						 | 
					bd5ec03d87 | ||
| 
						 | 
					2f286930a8 | ||
| 
						 | 
					305fd6bee0 | ||
| 
						 | 
					99325a8b65 | ||
| 
						 | 
					6893865b30 | ||
| 
						 | 
					4fdf843c75 | ||
| 
						 | 
					37a33f02aa | ||
| 
						 | 
					90246a6d9f | ||
| 
						 | 
					6ef5797447 | ||
| 
						 | 
					91a978ce7e | ||
| 
						 | 
					36b561623a | ||
| 
						 | 
					11a4af85a4 | ||
| 
						 | 
					2108698346 | ||
| 
						 | 
					f10a112f08 | ||
| 
						 | 
					7e43d3e086 | ||
| 
						 | 
					785cfd3305 | ||
| 
						 | 
					f2400e06db | ||
| 
						 | 
					e0c23cba5e | ||
| 
						 | 
					b21c6794de | ||
| 
						 | 
					9a7509e465 | ||
| 
						 | 
					c6770f4b88 | ||
| 
						 | 
					26aa241d2f | ||
| 
						 | 
					f8d0501ded | ||
| 
						 | 
					47bd85e9f9 | ||
| 
						 | 
					d881c6ddf5 | ||
| 
						 | 
					77e9b3a7c6 | ||
| 
						 | 
					7d78a86ecf | ||
| 
						 | 
					fb759b8b73 | ||
| 
						 | 
					e40fefafa9 | ||
| 
						 | 
					a7fcab7aa3 | ||
| 
						 | 
					43b3840873 | ||
| 
						 | 
					978d428ec3 | ||
| 
						 | 
					6ed6abd6c1 | ||
| 
						 | 
					4225a464c6 | ||
| 
						 | 
					f22feb0e3b | ||
| 
						 | 
					ba4ae92234 | ||
| 
						 | 
					782d018703 | ||
| 
						 | 
					19ee56c4b3 | ||
| 
						 | 
					769e63999f | ||
| 
						 | 
					f17ef10e63 | ||
| 
						 | 
					a5e36ad9bc | ||
| 
						 | 
					018a962d92 | ||
| 
						 | 
					3e958e93ce | ||
| 
						 | 
					e2d7b4950b | ||
| 
						 | 
					de62ccbf4f | ||
| 
						 | 
					ce15936f2f | ||
| 
						 | 
					12e65fd258 | ||
| 
						 | 
					1e33479b39 | ||
| 
						 | 
					9454d1ebcb | ||
| 
						 | 
					f995f8672b | ||
| 
						 | 
					6d2777d85f | ||
| 
						 | 
					37bd08176c | ||
| 
						 | 
					2dd7dd3952 | ||
| 
						 | 
					7b2022d39e | ||
| 
						 | 
					74addfeab6 | ||
| 
						 | 
					28b2df475f | ||
| 
						 | 
					bfaf7c8b9e | ||
| 
						 | 
					25cf58a163 | ||
| 
						 | 
					71c3c9c0c4 | ||
| 
						 | 
					30400318a2 | ||
| 
						 | 
					5ece2ad36c | ||
| 
						 | 
					b4da6c29f1 | ||
| 
						 | 
					80e67bcb23 | ||
| 
						 | 
					942c9bd357 | ||
| 
						 | 
					f09dbf20b9 | ||
| 
						 | 
					06a326caf1 | ||
| 
						 | 
					862e814de4 | ||
| 
						 | 
					55f47d2299 | ||
| 
						 | 
					8456785986 | ||
| 
						 | 
					2c467c9be2 | ||
| 
						 | 
					1d3e89f349 | ||
| 
						 | 
					bf02d73e74 | ||
| 
						 | 
					8583b57c5c | ||
| 
						 | 
					6a8e9ad24b | ||
| 
						 | 
					76602f45dc | ||
| 
						 | 
					27de86ae41 | ||
| 
						 | 
					b9dd64b80e | ||
| 
						 | 
					6073bf6cd8 | ||
| 
						 | 
					06fa1f1931 | ||
| 
						 | 
					0569c52b15 | ||
| 
						 | 
					60d55c4156 | ||
| 
						 | 
					2a49c19b9e | ||
| 
						 | 
					4932f05a00 | ||
| 
						 | 
					606340fba3 | ||
| 
						 | 
					c806b76865 | ||
| 
						 | 
					b3685956d2 | ||
| 
						 | 
					282122ec5f | ||
| 
						 | 
					c49cb8f30e | ||
| 
						 | 
					4cc1458dbe | ||
| 
						 | 
					22873f58c4 | ||
| 
						 | 
					691c5f7762 | ||
| 
						 | 
					7a8c037e9e | ||
| 
						 | 
					235ff9fcd1 | ||
| 
						 | 
					96e006b37e | ||
| 
						 | 
					72ab552554 | ||
| 
						 | 
					653113412f | ||
| 
						 | 
					1ad5182500 | ||
| 
						 | 
					20775950c6 | ||
| 
						 | 
					0875443f7e | ||
| 
						 | 
					422e5d2f7f | ||
| 
						 | 
					2273799677 | ||
| 
						 | 
					9e950cda6a | ||
| 
						 | 
					8b4bb94f64 | ||
| 
						 | 
					f86de75862 | ||
| 
						 | 
					bd298d7593 | ||
| 
						 | 
					8ab8fbc016 | ||
| 
						 | 
					b8675deaa8 | ||
| 
						 | 
					499c4608b1 | ||
| 
						 | 
					442e46d3b6 | ||
| 
						 | 
					c7d5b046d9 | ||
| 
						 | 
					445c39f757 | ||
| 
						 | 
					259c184c8f | ||
| 
						 | 
					c214128a38 | ||
| 
						 | 
					1ce6ceb75b | ||
| 
						 | 
					2ea0a0a414 | ||
| 
						 | 
					4a1899dd79 | ||
| 
						 | 
					dc430ccf3f | ||
| 
						 | 
					cc5a67269e | ||
| 
						 | 
					b0f1b1c5fd | ||
| 
						 | 
					f57040b038 | ||
| 
						 | 
					46b4606ba2 | ||
| 
						 | 
					d60915b751 | ||
| 
						 | 
					7ea7f9c077 | ||
| 
						 | 
					c0cd26f43c | ||
| 
						 | 
					f2a7e24e38 | ||
| 
						 | 
					fdeff3fdae | ||
| 
						 | 
					79019c7a42 | ||
| 
						 | 
					f334c5a41d | ||
| 
						 | 
					542cba73d2 | ||
| 
						 | 
					e3e47d7963 | ||
| 
						 | 
					ac6388add4 | ||
| 
						 | 
					60d8bb9f28 | ||
| 
						 | 
					89f7ed8b29 | ||
| 
						 | 
					010753b7e7 | ||
| 
						 | 
					bda3546c55 | ||
| 
						 | 
					f4e72cf9d6 | ||
| 
						 | 
					c19d18136e | ||
| 
						 | 
					6f501a7c9b | ||
| 
						 | 
					6c80564b89 | ||
| 
						 | 
					3b69fcf5f8 | ||
| 
						 | 
					2fa89c8e11 | ||
| 
						 | 
					a4867dea2a | ||
| 
						 | 
					f108178c56 | ||
| 
						 | 
					2906e572c6 | ||
| 
						 | 
					ebbc8ab2cd | ||
| 
						 | 
					4d5f39cd22 | ||
| 
						 | 
					610d8073f2 | ||
| 
						 | 
					dcd3d63f4f | ||
| 
						 | 
					d96df7e993 | ||
| 
						 | 
					cf7c650592 | ||
| 
						 | 
					6c7d6d4a5e | ||
| 
						 | 
					d248516b3a | ||
| 
						 | 
					851785ea67 | ||
| 
						 | 
					a7cf2c5664 | ||
| 
						 | 
					4473834e7d | ||
| 
						 | 
					edf8bc6d24 | ||
| 
						 | 
					81d71fb86e | ||
| 
						 | 
					c5e805ffe1 | ||
| 
						 | 
					b6bc203375 | ||
| 
						 | 
					e3ee8c8dbd | ||
| 
						 | 
					63fddc98e0 | ||
| 
						 | 
					12e33dca4c | ||
| 
						 | 
					b170806518 | ||
| 
						 | 
					3b3f882288 | ||
| 
						 | 
					cdda3f74a1 | ||
| 
						 | 
					5d34cc49d5 | ||
| 
						 | 
					f0fe55bca4 | ||
| 
						 | 
					9f3eda177a | ||
| 
						 | 
					5b5f10d746 | ||
| 
						 | 
					52e2dabc0f | ||
| 
						 | 
					28152333bc | ||
| 
						 | 
					cb0d24637d | ||
| 
						 | 
					cae735f613 | ||
| 
						 | 
					0f11537548 | ||
| 
						 | 
					443300be46 | ||
| 
						 | 
					dc995ce906 | ||
| 
						 | 
					b04453d36b | ||
| 
						 | 
					77d5fa8024 | ||
| 
						 | 
					ae12188cf8 | ||
| 
						 | 
					6a3e9576b8 | ||
| 
						 | 
					537a724421 | ||
| 
						 | 
					212a2b9bb8 | ||
| 
						 | 
					08293e43da | ||
| 
						 | 
					94e465e5cb | ||
| 
						 | 
					a82bad9730 | ||
| 
						 | 
					b9af5037b2 | ||
| 
						 | 
					ab77b6031b | ||
| 
						 | 
					80e67af9af | ||
| 
						 | 
					8b15024dc7 | ||
| 
						 | 
					82f7e315d6 | 
@@ -48,6 +48,9 @@ jobs:
 | 
				
			|||||||
      TARGET_SECURITY:
 | 
					      TARGET_SECURITY:
 | 
				
			||||||
        Build.Pkgs: 'SecurityPkg'
 | 
					        Build.Pkgs: 'SecurityPkg'
 | 
				
			||||||
        Build.Targets: 'DEBUG,RELEASE,NO-TARGET'
 | 
					        Build.Targets: 'DEBUG,RELEASE,NO-TARGET'
 | 
				
			||||||
 | 
					      TARGET_UEFIPAYLOAD:
 | 
				
			||||||
 | 
					        Build.Pkgs: 'UefiPayloadPkg'
 | 
				
			||||||
 | 
					        Build.Targets: 'DEBUG,RELEASE,NO-TARGET'
 | 
				
			||||||
      TARGET_PLATFORMS:
 | 
					      TARGET_PLATFORMS:
 | 
				
			||||||
        # For Platforms only check code. Leave it to Platform CI
 | 
					        # For Platforms only check code. Leave it to Platform CI
 | 
				
			||||||
        # to build them.
 | 
					        # to build them.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -67,7 +67,8 @@ class Settings(CiBuildSettingsManager, UpdateSettingsManager, SetupSettingsManag
 | 
				
			|||||||
                "CryptoPkg",
 | 
					                "CryptoPkg",
 | 
				
			||||||
                "UnitTestFrameworkPkg",
 | 
					                "UnitTestFrameworkPkg",
 | 
				
			||||||
                "OvmfPkg",
 | 
					                "OvmfPkg",
 | 
				
			||||||
                "RedfishPkg"
 | 
					                "RedfishPkg",
 | 
				
			||||||
 | 
					                "UefiPayloadPkg"
 | 
				
			||||||
                )
 | 
					                )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def GetArchitecturesSupported(self):
 | 
					    def GetArchitecturesSupported(self):
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,6 +3,7 @@
 | 
				
			|||||||
#
 | 
					#
 | 
				
			||||||
# Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.<BR>
 | 
					# Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.<BR>
 | 
				
			||||||
# Copyright (c) 2011 - 2021, ARM Limited. All rights reserved.
 | 
					# Copyright (c) 2011 - 2021, ARM Limited. All rights reserved.
 | 
				
			||||||
 | 
					# Copyright (c) 2021, Ampere Computing LLC. All rights reserved.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#    SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
					#    SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
@@ -337,9 +338,9 @@
 | 
				
			|||||||
  #   UINT64 Mmio32CpuBase; // mapping target in 64-bit cpu-physical space
 | 
					  #   UINT64 Mmio32CpuBase; // mapping target in 64-bit cpu-physical space
 | 
				
			||||||
  #   UINT64 Mmio64CpuBase; // mapping target in 64-bit cpu-physical space
 | 
					  #   UINT64 Mmio64CpuBase; // mapping target in 64-bit cpu-physical space
 | 
				
			||||||
  #
 | 
					  #
 | 
				
			||||||
  #   PcdPciIoTranslation     = IoCpuBase     - PcdPciIoBase;
 | 
					  #   gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation = IoCpuBase - PcdPciIoBase;
 | 
				
			||||||
  #   PcdPciMmio32Translation = Mmio32CpuBase - (UINT64)PcdPciMmio32Base;
 | 
					  #   gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation = Mmio32CpuBase - (UINT64)PcdPciMmio32Base;
 | 
				
			||||||
  #   PcdPciMmio64Translation = Mmio64CpuBase - PcdPciMmio64Base;
 | 
					  #   gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation = Mmio64CpuBase - PcdPciMmio64Base;
 | 
				
			||||||
  #
 | 
					  #
 | 
				
			||||||
  # because (a) the target address space (ie. the cpu-physical space) is
 | 
					  # because (a) the target address space (ie. the cpu-physical space) is
 | 
				
			||||||
  # 64-bit, and (b) the translation values are meant as offsets for *modular*
 | 
					  # 64-bit, and (b) the translation values are meant as offsets for *modular*
 | 
				
			||||||
@@ -356,11 +357,11 @@
 | 
				
			|||||||
  #   UINT64 TranslatedMmio64Address;   // output parameter
 | 
					  #   UINT64 TranslatedMmio64Address;   // output parameter
 | 
				
			||||||
  #
 | 
					  #
 | 
				
			||||||
  #   TranslatedIoAddress     = UntranslatedIoAddress +
 | 
					  #   TranslatedIoAddress     = UntranslatedIoAddress +
 | 
				
			||||||
  #                             PcdPciIoTranslation;
 | 
					  #                             gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation;
 | 
				
			||||||
  #   TranslatedMmio32Address = (UINT64)UntranslatedMmio32Address +
 | 
					  #   TranslatedMmio32Address = (UINT64)UntranslatedMmio32Address +
 | 
				
			||||||
  #                             PcdPciMmio32Translation;
 | 
					  #                             gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation;
 | 
				
			||||||
  #   TranslatedMmio64Address = UntranslatedMmio64Address +
 | 
					  #   TranslatedMmio64Address = UntranslatedMmio64Address +
 | 
				
			||||||
  #                             PcdPciMmio64Translation;
 | 
					  #                             gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation;
 | 
				
			||||||
  #
 | 
					  #
 | 
				
			||||||
  #  The modular arithmetic performed in UINT64 ensures that the translation
 | 
					  #  The modular arithmetic performed in UINT64 ensures that the translation
 | 
				
			||||||
  #  works correctly regardless of the relation between IoCpuBase and
 | 
					  #  works correctly regardless of the relation between IoCpuBase and
 | 
				
			||||||
@@ -369,16 +370,20 @@
 | 
				
			|||||||
  #
 | 
					  #
 | 
				
			||||||
  gArmTokenSpaceGuid.PcdPciIoBase|0x0|UINT64|0x00000050
 | 
					  gArmTokenSpaceGuid.PcdPciIoBase|0x0|UINT64|0x00000050
 | 
				
			||||||
  gArmTokenSpaceGuid.PcdPciIoSize|0x0|UINT64|0x00000051
 | 
					  gArmTokenSpaceGuid.PcdPciIoSize|0x0|UINT64|0x00000051
 | 
				
			||||||
  gArmTokenSpaceGuid.PcdPciIoTranslation|0x0|UINT64|0x00000052
 | 
					 | 
				
			||||||
  gArmTokenSpaceGuid.PcdPciMmio32Base|0x0|UINT32|0x00000053
 | 
					  gArmTokenSpaceGuid.PcdPciMmio32Base|0x0|UINT32|0x00000053
 | 
				
			||||||
  gArmTokenSpaceGuid.PcdPciMmio32Size|0x0|UINT32|0x00000054
 | 
					  gArmTokenSpaceGuid.PcdPciMmio32Size|0x0|UINT32|0x00000054
 | 
				
			||||||
  gArmTokenSpaceGuid.PcdPciMmio32Translation|0x0|UINT64|0x00000055
 | 
					 | 
				
			||||||
  gArmTokenSpaceGuid.PcdPciMmio64Base|0x0|UINT64|0x00000056
 | 
					  gArmTokenSpaceGuid.PcdPciMmio64Base|0x0|UINT64|0x00000056
 | 
				
			||||||
  gArmTokenSpaceGuid.PcdPciMmio64Size|0x0|UINT64|0x00000057
 | 
					  gArmTokenSpaceGuid.PcdPciMmio64Size|0x0|UINT64|0x00000057
 | 
				
			||||||
  gArmTokenSpaceGuid.PcdPciMmio64Translation|0x0|UINT64|0x00000058
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  #
 | 
					  #
 | 
				
			||||||
  # Inclusive range of allowed PCI buses.
 | 
					  # Inclusive range of allowed PCI buses.
 | 
				
			||||||
  #
 | 
					  #
 | 
				
			||||||
  gArmTokenSpaceGuid.PcdPciBusMin|0x0|UINT32|0x00000059
 | 
					  gArmTokenSpaceGuid.PcdPciBusMin|0x0|UINT32|0x00000059
 | 
				
			||||||
  gArmTokenSpaceGuid.PcdPciBusMax|0x0|UINT32|0x0000005A
 | 
					  gArmTokenSpaceGuid.PcdPciBusMax|0x0|UINT32|0x0000005A
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[PcdsDynamicEx]
 | 
				
			||||||
 | 
					  #
 | 
				
			||||||
 | 
					  # This dynamic PCD hold the GUID of a firmware FFS which contains
 | 
				
			||||||
 | 
					  # the LinuxBoot payload.
 | 
				
			||||||
 | 
					  #
 | 
				
			||||||
 | 
					  gArmTokenSpaceGuid.PcdLinuxBootFileGuid|{0x0}|VOID*|0x0000005C
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,6 +5,7 @@
 | 
				
			|||||||
# Copyright (c) 2011 - 2021, Arm Limited. All rights reserved.<BR>
 | 
					# Copyright (c) 2011 - 2021, Arm Limited. All rights reserved.<BR>
 | 
				
			||||||
# Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
 | 
					# Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
 | 
				
			||||||
# Copyright (c) Microsoft Corporation.<BR>
 | 
					# Copyright (c) Microsoft Corporation.<BR>
 | 
				
			||||||
 | 
					# Copyright (c) 2021, Ampere Computing LLC. All rights reserved.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#    SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
					#    SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
@@ -150,6 +151,7 @@
 | 
				
			|||||||
  ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.inf
 | 
					  ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.inf
 | 
				
			||||||
  ArmPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
 | 
					  ArmPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
 | 
				
			||||||
  ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
 | 
					  ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
 | 
				
			||||||
 | 
					  ArmPkg/Library/LinuxBootBootManagerLib/LinuxBootBootManagerLib.inf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ArmPkg/Drivers/ArmCrashDumpDxe/ArmCrashDumpDxe.inf
 | 
					  ArmPkg/Drivers/ArmCrashDumpDxe/ArmCrashDumpDxe.inf
 | 
				
			||||||
  ArmPkg/Drivers/ArmScmiDxe/ArmScmiDxe.inf
 | 
					  ArmPkg/Drivers/ArmScmiDxe/ArmScmiDxe.inf
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -344,10 +344,6 @@ GicV3ExitBootServicesEvent (
 | 
				
			|||||||
    GicV3DisableInterruptSource (&gHardwareInterruptV3Protocol, Index);
 | 
					    GicV3DisableInterruptSource (&gHardwareInterruptV3Protocol, Index);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  for (Index = 0; Index < mGicNumInterrupts; Index++) {
 | 
					 | 
				
			||||||
    GicV3EndOfInterrupt (&gHardwareInterruptV3Protocol, Index);
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  // Disable Gic Interface
 | 
					  // Disable Gic Interface
 | 
				
			||||||
  ArmGicV3DisableInterruptInterface ();
 | 
					  ArmGicV3DisableInterruptInterface ();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -38,7 +38,7 @@
 | 
				
			|||||||
  UefiBootServicesTableLib
 | 
					  UefiBootServicesTableLib
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[Pcd]
 | 
					[Pcd]
 | 
				
			||||||
  gArmTokenSpaceGuid.PcdPciIoTranslation
 | 
					  gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[Protocols]
 | 
					[Protocols]
 | 
				
			||||||
  gEfiCpuIo2ProtocolGuid                         ## PRODUCES
 | 
					  gEfiCpuIo2ProtocolGuid                         ## PRODUCES
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										186
									
								
								ArmPkg/Library/LinuxBootBootManagerLib/LinuxBootBm.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										186
									
								
								ArmPkg/Library/LinuxBootBootManagerLib/LinuxBootBm.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,186 @@
 | 
				
			|||||||
 | 
					/** @file
 | 
				
			||||||
 | 
					  Implementation for PlatformBootManagerLib library class interfaces.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Copyright (C) 2015-2016, Red Hat, Inc.
 | 
				
			||||||
 | 
					  Copyright (c) 2014 - 2019, ARM Ltd. All rights reserved.<BR>
 | 
				
			||||||
 | 
					  Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
				
			||||||
 | 
					  Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
 | 
				
			||||||
 | 
					  Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved.<BR>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <Uefi.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <Guid/EventGroup.h>
 | 
				
			||||||
 | 
					#include <Library/BaseLib.h>
 | 
				
			||||||
 | 
					#include <Library/BaseMemoryLib.h>
 | 
				
			||||||
 | 
					#include <Library/DebugLib.h>
 | 
				
			||||||
 | 
					#include <Library/DevicePathLib.h>
 | 
				
			||||||
 | 
					#include <Library/MemoryAllocationLib.h>
 | 
				
			||||||
 | 
					#include <Library/PcdLib.h>
 | 
				
			||||||
 | 
					#include <Library/UefiBootManagerLib.h>
 | 
				
			||||||
 | 
					#include <Library/UefiBootServicesTableLib.h>
 | 
				
			||||||
 | 
					#include <Library/UefiLib.h>
 | 
				
			||||||
 | 
					#include <Library/UefiRuntimeServicesTableLib.h>
 | 
				
			||||||
 | 
					#include <Protocol/LoadedImage.h>
 | 
				
			||||||
 | 
					#include <Protocol/PlatformBootManager.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					  Register a boot option using a file GUID in the FV.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @param  FileGuid     The file GUID name in the FV.
 | 
				
			||||||
 | 
					  @param  Description  The description of the boot option.
 | 
				
			||||||
 | 
					  @param  Attributes   The attributes of the boot option.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					STATIC
 | 
				
			||||||
 | 
					VOID
 | 
				
			||||||
 | 
					PlatformRegisterFvBootOption (
 | 
				
			||||||
 | 
					  CONST EFI_GUID *FileGuid,
 | 
				
			||||||
 | 
					  CHAR16         *Description,
 | 
				
			||||||
 | 
					  UINT32         Attributes
 | 
				
			||||||
 | 
					  )
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  EFI_STATUS                        Status;
 | 
				
			||||||
 | 
					  INTN                              OptionIndex;
 | 
				
			||||||
 | 
					  EFI_BOOT_MANAGER_LOAD_OPTION      NewOption;
 | 
				
			||||||
 | 
					  EFI_BOOT_MANAGER_LOAD_OPTION      *BootOptions;
 | 
				
			||||||
 | 
					  UINTN                             BootOptionCount;
 | 
				
			||||||
 | 
					  MEDIA_FW_VOL_FILEPATH_DEVICE_PATH FileNode;
 | 
				
			||||||
 | 
					  EFI_LOADED_IMAGE_PROTOCOL         *LoadedImage;
 | 
				
			||||||
 | 
					  EFI_DEVICE_PATH_PROTOCOL          *DevicePath;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Status = gBS->HandleProtocol (
 | 
				
			||||||
 | 
					                  gImageHandle,
 | 
				
			||||||
 | 
					                  &gEfiLoadedImageProtocolGuid,
 | 
				
			||||||
 | 
					                  (VOID **)&LoadedImage
 | 
				
			||||||
 | 
					                  );
 | 
				
			||||||
 | 
					  ASSERT_EFI_ERROR (Status);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  EfiInitializeFwVolDevicepathNode (&FileNode, FileGuid);
 | 
				
			||||||
 | 
					  DevicePath = DevicePathFromHandle (LoadedImage->DeviceHandle);
 | 
				
			||||||
 | 
					  ASSERT (DevicePath != NULL);
 | 
				
			||||||
 | 
					  DevicePath = AppendDevicePathNode (
 | 
				
			||||||
 | 
					                 DevicePath,
 | 
				
			||||||
 | 
					                 (EFI_DEVICE_PATH_PROTOCOL *)&FileNode
 | 
				
			||||||
 | 
					                 );
 | 
				
			||||||
 | 
					  ASSERT (DevicePath != NULL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Status = EfiBootManagerInitializeLoadOption (
 | 
				
			||||||
 | 
					             &NewOption,
 | 
				
			||||||
 | 
					             LoadOptionNumberUnassigned,
 | 
				
			||||||
 | 
					             LoadOptionTypeBoot,
 | 
				
			||||||
 | 
					             Attributes,
 | 
				
			||||||
 | 
					             Description,
 | 
				
			||||||
 | 
					             DevicePath,
 | 
				
			||||||
 | 
					             NULL,
 | 
				
			||||||
 | 
					             0
 | 
				
			||||||
 | 
					             );
 | 
				
			||||||
 | 
					  ASSERT_EFI_ERROR (Status);
 | 
				
			||||||
 | 
					  FreePool (DevicePath);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  BootOptions = EfiBootManagerGetLoadOptions (
 | 
				
			||||||
 | 
					                  &BootOptionCount,
 | 
				
			||||||
 | 
					                  LoadOptionTypeBoot
 | 
				
			||||||
 | 
					                  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  OptionIndex = EfiBootManagerFindLoadOption (
 | 
				
			||||||
 | 
					                  &NewOption,
 | 
				
			||||||
 | 
					                  BootOptions,
 | 
				
			||||||
 | 
					                  BootOptionCount
 | 
				
			||||||
 | 
					                  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if (OptionIndex == -1) {
 | 
				
			||||||
 | 
					    Status = EfiBootManagerAddLoadOptionVariable (&NewOption, MAX_UINTN);
 | 
				
			||||||
 | 
					    ASSERT_EFI_ERROR (Status);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  EfiBootManagerFreeLoadOption (&NewOption);
 | 
				
			||||||
 | 
					  EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					  Do the platform specific action before the console is connected.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Such as:
 | 
				
			||||||
 | 
					    Update console variable;
 | 
				
			||||||
 | 
					    Register new Driver#### or Boot####;
 | 
				
			||||||
 | 
					    Signal ReadyToLock event.
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					VOID
 | 
				
			||||||
 | 
					EFIAPI
 | 
				
			||||||
 | 
					PlatformBootManagerBeforeConsole (
 | 
				
			||||||
 | 
					  VOID
 | 
				
			||||||
 | 
					  )
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  //
 | 
				
			||||||
 | 
					  // Signal EndOfDxe PI Event
 | 
				
			||||||
 | 
					  //
 | 
				
			||||||
 | 
					  EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					  Do the platform specific action after the console is connected.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Such as:
 | 
				
			||||||
 | 
					    Dynamically switch output mode;
 | 
				
			||||||
 | 
					    Signal console ready platform customized event;
 | 
				
			||||||
 | 
					    Run diagnostics like memory testing;
 | 
				
			||||||
 | 
					    Connect certain devices;
 | 
				
			||||||
 | 
					    Dispatch additional option roms.
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					VOID
 | 
				
			||||||
 | 
					EFIAPI
 | 
				
			||||||
 | 
					PlatformBootManagerAfterConsole (
 | 
				
			||||||
 | 
					  VOID
 | 
				
			||||||
 | 
					  )
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  EFI_GUID LinuxBootFileGuid;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  CopyGuid (&LinuxBootFileGuid, PcdGetPtr (PcdLinuxBootFileGuid));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if (!CompareGuid (&LinuxBootFileGuid, &gZeroGuid)) {
 | 
				
			||||||
 | 
					    //
 | 
				
			||||||
 | 
					    // Register LinuxBoot
 | 
				
			||||||
 | 
					    //
 | 
				
			||||||
 | 
					    PlatformRegisterFvBootOption (
 | 
				
			||||||
 | 
					      &LinuxBootFileGuid,
 | 
				
			||||||
 | 
					      L"LinuxBoot",
 | 
				
			||||||
 | 
					      LOAD_OPTION_ACTIVE
 | 
				
			||||||
 | 
					      );
 | 
				
			||||||
 | 
					  } else {
 | 
				
			||||||
 | 
					    DEBUG ((DEBUG_ERROR, "%a: PcdLinuxBootFileGuid was not set!\n", __FUNCTION__));
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					  This function is called each second during the boot manager waits the
 | 
				
			||||||
 | 
					  timeout.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @param TimeoutRemain  The remaining timeout.
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					VOID
 | 
				
			||||||
 | 
					EFIAPI
 | 
				
			||||||
 | 
					PlatformBootManagerWaitCallback (
 | 
				
			||||||
 | 
					  UINT16 TimeoutRemain
 | 
				
			||||||
 | 
					  )
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  return;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					  The function is called when no boot option could be launched,
 | 
				
			||||||
 | 
					  including platform recovery options and options pointing to applications
 | 
				
			||||||
 | 
					  built into firmware volumes.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  If this function returns, BDS attempts to enter an infinite loop.
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					VOID
 | 
				
			||||||
 | 
					EFIAPI
 | 
				
			||||||
 | 
					PlatformBootManagerUnableToBoot (
 | 
				
			||||||
 | 
					  VOID
 | 
				
			||||||
 | 
					  )
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  return;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -0,0 +1,58 @@
 | 
				
			|||||||
 | 
					## @file
 | 
				
			||||||
 | 
					#  Implementation for PlatformBootManagerLib library class interfaces.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#  Copyright (C) 2015-2016, Red Hat, Inc.
 | 
				
			||||||
 | 
					#  Copyright (c) 2014, ARM Ltd. All rights reserved.<BR>
 | 
				
			||||||
 | 
					#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
 | 
				
			||||||
 | 
					#  Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
 | 
				
			||||||
 | 
					#  Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved.<BR>
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					##
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[Defines]
 | 
				
			||||||
 | 
					  INF_VERSION                    = 0x0001001B
 | 
				
			||||||
 | 
					  BASE_NAME                      = LinuxBootBootManagerLib
 | 
				
			||||||
 | 
					  FILE_GUID                      = 1FA91547-DB23-4F6A-8AF8-3B9782A7F917
 | 
				
			||||||
 | 
					  MODULE_TYPE                    = DXE_DRIVER
 | 
				
			||||||
 | 
					  VERSION_STRING                 = 1.0
 | 
				
			||||||
 | 
					  LIBRARY_CLASS                  = PlatformBootManagerLib|DXE_DRIVER
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# The following information is for reference only and not required by the build tools.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#  VALID_ARCHITECTURES           = ARM AARCH64
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[Sources]
 | 
				
			||||||
 | 
					  LinuxBootBm.c
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[Packages]
 | 
				
			||||||
 | 
					  ArmPkg/ArmPkg.dec
 | 
				
			||||||
 | 
					  MdeModulePkg/MdeModulePkg.dec
 | 
				
			||||||
 | 
					  MdePkg/MdePkg.dec
 | 
				
			||||||
 | 
					  ShellPkg/ShellPkg.dec
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[LibraryClasses]
 | 
				
			||||||
 | 
					  BaseLib
 | 
				
			||||||
 | 
					  BaseMemoryLib
 | 
				
			||||||
 | 
					  DebugLib
 | 
				
			||||||
 | 
					  MemoryAllocationLib
 | 
				
			||||||
 | 
					  PcdLib
 | 
				
			||||||
 | 
					  PrintLib
 | 
				
			||||||
 | 
					  UefiBootManagerLib
 | 
				
			||||||
 | 
					  UefiBootServicesTableLib
 | 
				
			||||||
 | 
					  UefiLib
 | 
				
			||||||
 | 
					  UefiRuntimeServicesTableLib
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[Pcd]
 | 
				
			||||||
 | 
					  gArmTokenSpaceGuid.PcdLinuxBootFileGuid
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[Guids]
 | 
				
			||||||
 | 
					  gEfiEndOfDxeEventGroupGuid
 | 
				
			||||||
 | 
					  gUefiShellFileGuid
 | 
				
			||||||
 | 
					  gZeroGuid
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[Protocols]
 | 
				
			||||||
 | 
					  gEfiLoadedImageProtocolGuid
 | 
				
			||||||
@@ -2,9 +2,10 @@
 | 
				
			|||||||
  Implementation for PlatformBootManagerLib library class interfaces.
 | 
					  Implementation for PlatformBootManagerLib library class interfaces.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Copyright (C) 2015-2016, Red Hat, Inc.
 | 
					  Copyright (C) 2015-2016, Red Hat, Inc.
 | 
				
			||||||
  Copyright (c) 2014 - 2019, ARM Ltd. All rights reserved.<BR>
 | 
					  Copyright (c) 2014 - 2021, ARM Ltd. All rights reserved.<BR>
 | 
				
			||||||
  Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
					  Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
				
			||||||
  Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
 | 
					  Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
 | 
				
			||||||
 | 
					  Copyright (c) 2021, Semihalf All rights reserved.<BR>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
					  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -19,6 +20,7 @@
 | 
				
			|||||||
#include <Library/UefiBootManagerLib.h>
 | 
					#include <Library/UefiBootManagerLib.h>
 | 
				
			||||||
#include <Library/UefiLib.h>
 | 
					#include <Library/UefiLib.h>
 | 
				
			||||||
#include <Library/UefiRuntimeServicesTableLib.h>
 | 
					#include <Library/UefiRuntimeServicesTableLib.h>
 | 
				
			||||||
 | 
					#include <Protocol/BootManagerPolicy.h>
 | 
				
			||||||
#include <Protocol/DevicePath.h>
 | 
					#include <Protocol/DevicePath.h>
 | 
				
			||||||
#include <Protocol/EsrtManagement.h>
 | 
					#include <Protocol/EsrtManagement.h>
 | 
				
			||||||
#include <Protocol/GraphicsOutput.h>
 | 
					#include <Protocol/GraphicsOutput.h>
 | 
				
			||||||
@@ -27,6 +29,7 @@
 | 
				
			|||||||
#include <Protocol/PciIo.h>
 | 
					#include <Protocol/PciIo.h>
 | 
				
			||||||
#include <Protocol/PciRootBridgeIo.h>
 | 
					#include <Protocol/PciRootBridgeIo.h>
 | 
				
			||||||
#include <Protocol/PlatformBootManager.h>
 | 
					#include <Protocol/PlatformBootManager.h>
 | 
				
			||||||
 | 
					#include <Guid/BootDiscoveryPolicy.h>
 | 
				
			||||||
#include <Guid/EventGroup.h>
 | 
					#include <Guid/EventGroup.h>
 | 
				
			||||||
#include <Guid/NonDiscoverableDevice.h>
 | 
					#include <Guid/NonDiscoverableDevice.h>
 | 
				
			||||||
#include <Guid/TtyTerm.h>
 | 
					#include <Guid/TtyTerm.h>
 | 
				
			||||||
@@ -703,6 +706,113 @@ HandleCapsules (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#define VERSION_STRING_PREFIX    L"Tianocore/EDK2 firmware version "
 | 
					#define VERSION_STRING_PREFIX    L"Tianocore/EDK2 firmware version "
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					  This functions checks the value of BootDiscoverPolicy variable and
 | 
				
			||||||
 | 
					  connect devices of class specified by that variable. Then it refreshes
 | 
				
			||||||
 | 
					  Boot order for newly discovered boot device.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @retval  EFI_SUCCESS  Devices connected successfully or connection
 | 
				
			||||||
 | 
					                        not required.
 | 
				
			||||||
 | 
					  @retval  others       Return values from GetVariable(), LocateProtocol()
 | 
				
			||||||
 | 
					                        and ConnectDeviceClass().
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					STATIC
 | 
				
			||||||
 | 
					EFI_STATUS
 | 
				
			||||||
 | 
					BootDiscoveryPolicyHandler (
 | 
				
			||||||
 | 
					  VOID
 | 
				
			||||||
 | 
					  )
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  EFI_STATUS                       Status;
 | 
				
			||||||
 | 
					  UINT32                           DiscoveryPolicy;
 | 
				
			||||||
 | 
					  UINT32                           DiscoveryPolicyOld;
 | 
				
			||||||
 | 
					  UINTN                            Size;
 | 
				
			||||||
 | 
					  EFI_BOOT_MANAGER_POLICY_PROTOCOL *BMPolicy;
 | 
				
			||||||
 | 
					  EFI_GUID                         *Class;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Size = sizeof (DiscoveryPolicy);
 | 
				
			||||||
 | 
					  Status = gRT->GetVariable (
 | 
				
			||||||
 | 
					                  BOOT_DISCOVERY_POLICY_VAR,
 | 
				
			||||||
 | 
					                  &gBootDiscoveryPolicyMgrFormsetGuid,
 | 
				
			||||||
 | 
					                  NULL,
 | 
				
			||||||
 | 
					                  &Size,
 | 
				
			||||||
 | 
					                  &DiscoveryPolicy
 | 
				
			||||||
 | 
					                  );
 | 
				
			||||||
 | 
					  if (Status == EFI_NOT_FOUND) {
 | 
				
			||||||
 | 
					    DiscoveryPolicy = PcdGet32 (PcdBootDiscoveryPolicy);
 | 
				
			||||||
 | 
					    Status = PcdSet32S (PcdBootDiscoveryPolicy, DiscoveryPolicy);
 | 
				
			||||||
 | 
					    if (Status == EFI_NOT_FOUND) {
 | 
				
			||||||
 | 
					      return EFI_SUCCESS;
 | 
				
			||||||
 | 
					    } else if (EFI_ERROR (Status)) {
 | 
				
			||||||
 | 
					      return Status;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  } else if (EFI_ERROR (Status)) {
 | 
				
			||||||
 | 
					    return Status;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if (DiscoveryPolicy == BDP_CONNECT_MINIMAL) {
 | 
				
			||||||
 | 
					    return EFI_SUCCESS;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  switch (DiscoveryPolicy) {
 | 
				
			||||||
 | 
					    case BDP_CONNECT_NET:
 | 
				
			||||||
 | 
					      Class = &gEfiBootManagerPolicyNetworkGuid;
 | 
				
			||||||
 | 
					      break;
 | 
				
			||||||
 | 
					    case BDP_CONNECT_ALL:
 | 
				
			||||||
 | 
					      Class = &gEfiBootManagerPolicyConnectAllGuid;
 | 
				
			||||||
 | 
					      break;
 | 
				
			||||||
 | 
					    default:
 | 
				
			||||||
 | 
					      DEBUG ((
 | 
				
			||||||
 | 
					        DEBUG_INFO,
 | 
				
			||||||
 | 
					        "%a - Unexpected DiscoveryPolicy (0x%x). Run Minimal Discovery Policy\n",
 | 
				
			||||||
 | 
					        __FUNCTION__,
 | 
				
			||||||
 | 
					        DiscoveryPolicy
 | 
				
			||||||
 | 
					        ));
 | 
				
			||||||
 | 
					      return EFI_SUCCESS;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Status = gBS->LocateProtocol (
 | 
				
			||||||
 | 
					                  &gEfiBootManagerPolicyProtocolGuid,
 | 
				
			||||||
 | 
					                  NULL,
 | 
				
			||||||
 | 
					                  (VOID **)&BMPolicy
 | 
				
			||||||
 | 
					                  );
 | 
				
			||||||
 | 
					  if (EFI_ERROR (Status)) {
 | 
				
			||||||
 | 
					    DEBUG ((DEBUG_INFO, "%a - Failed to locate gEfiBootManagerPolicyProtocolGuid."
 | 
				
			||||||
 | 
					      "Driver connect will be skipped.\n", __FUNCTION__));
 | 
				
			||||||
 | 
					    return Status;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Status = BMPolicy->ConnectDeviceClass (BMPolicy, Class);
 | 
				
			||||||
 | 
					  if (EFI_ERROR (Status)){
 | 
				
			||||||
 | 
					    DEBUG ((DEBUG_ERROR, "%a - ConnectDeviceClass returns - %r\n", __FUNCTION__, Status));
 | 
				
			||||||
 | 
					    return Status;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  //
 | 
				
			||||||
 | 
					  // Refresh Boot Options if Boot Discovery Policy has been changed
 | 
				
			||||||
 | 
					  //
 | 
				
			||||||
 | 
					  Size = sizeof (DiscoveryPolicyOld);
 | 
				
			||||||
 | 
					  Status = gRT->GetVariable (
 | 
				
			||||||
 | 
					                  BOOT_DISCOVERY_POLICY_OLD_VAR,
 | 
				
			||||||
 | 
					                  &gBootDiscoveryPolicyMgrFormsetGuid,
 | 
				
			||||||
 | 
					                  NULL,
 | 
				
			||||||
 | 
					                  &Size,
 | 
				
			||||||
 | 
					                  &DiscoveryPolicyOld
 | 
				
			||||||
 | 
					                  );
 | 
				
			||||||
 | 
					  if ((Status == EFI_NOT_FOUND) || (DiscoveryPolicyOld != DiscoveryPolicy)) {
 | 
				
			||||||
 | 
					    EfiBootManagerRefreshAllBootOption ();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Status = gRT->SetVariable (
 | 
				
			||||||
 | 
					                    BOOT_DISCOVERY_POLICY_OLD_VAR,
 | 
				
			||||||
 | 
					                    &gBootDiscoveryPolicyMgrFormsetGuid,
 | 
				
			||||||
 | 
					                    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
 | 
				
			||||||
 | 
					                    sizeof (DiscoveryPolicyOld),
 | 
				
			||||||
 | 
					                    &DiscoveryPolicy
 | 
				
			||||||
 | 
					                    );
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  return EFI_SUCCESS;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
  Do the platform specific action after the console is ready
 | 
					  Do the platform specific action after the console is ready
 | 
				
			||||||
  Possible things that can be done in PlatformBootManagerAfterConsole:
 | 
					  Possible things that can be done in PlatformBootManagerAfterConsole:
 | 
				
			||||||
@@ -753,6 +863,12 @@ PlatformBootManagerAfterConsole (
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  //
 | 
				
			||||||
 | 
					  // Connect device specified by BootDiscoverPolicy variable and
 | 
				
			||||||
 | 
					  // refresh Boot order for newly discovered boot devices
 | 
				
			||||||
 | 
					  //
 | 
				
			||||||
 | 
					  BootDiscoveryPolicyHandler ();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  //
 | 
					  //
 | 
				
			||||||
  // On ARM, there is currently no reason to use the phased capsule
 | 
					  // On ARM, there is currently no reason to use the phased capsule
 | 
				
			||||||
  // update approach where some capsules are dispatched before EndOfDxe
 | 
					  // update approach where some capsules are dispatched before EndOfDxe
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -65,11 +65,15 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[Pcd]
 | 
					[Pcd]
 | 
				
			||||||
  gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut
 | 
					  gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut
 | 
				
			||||||
 | 
					  gEfiMdeModulePkgTokenSpaceGuid.PcdBootDiscoveryPolicy
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[Guids]
 | 
					[Guids]
 | 
				
			||||||
 | 
					  gBootDiscoveryPolicyMgrFormsetGuid
 | 
				
			||||||
  gEdkiiNonDiscoverableEhciDeviceGuid
 | 
					  gEdkiiNonDiscoverableEhciDeviceGuid
 | 
				
			||||||
  gEdkiiNonDiscoverableUhciDeviceGuid
 | 
					  gEdkiiNonDiscoverableUhciDeviceGuid
 | 
				
			||||||
  gEdkiiNonDiscoverableXhciDeviceGuid
 | 
					  gEdkiiNonDiscoverableXhciDeviceGuid
 | 
				
			||||||
 | 
					  gEfiBootManagerPolicyNetworkGuid
 | 
				
			||||||
 | 
					  gEfiBootManagerPolicyConnectAllGuid
 | 
				
			||||||
  gEfiFileInfoGuid
 | 
					  gEfiFileInfoGuid
 | 
				
			||||||
  gEfiFileSystemInfoGuid
 | 
					  gEfiFileSystemInfoGuid
 | 
				
			||||||
  gEfiFileSystemVolumeLabelInfoIdGuid
 | 
					  gEfiFileSystemVolumeLabelInfoIdGuid
 | 
				
			||||||
@@ -79,6 +83,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[Protocols]
 | 
					[Protocols]
 | 
				
			||||||
  gEdkiiNonDiscoverableDeviceProtocolGuid
 | 
					  gEdkiiNonDiscoverableDeviceProtocolGuid
 | 
				
			||||||
 | 
					  gEfiBootManagerPolicyProtocolGuid
 | 
				
			||||||
  gEfiDevicePathProtocolGuid
 | 
					  gEfiDevicePathProtocolGuid
 | 
				
			||||||
  gEfiGraphicsOutputProtocolGuid
 | 
					  gEfiGraphicsOutputProtocolGuid
 | 
				
			||||||
  gEfiLoadedImageProtocolGuid
 | 
					  gEfiLoadedImageProtocolGuid
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -219,7 +219,7 @@ ConfigureCacheArchitectureInformation (
 | 
				
			|||||||
    CacheSize32 = CacheSize16;
 | 
					    CacheSize32 = CacheSize16;
 | 
				
			||||||
  } else if ((CacheSize64 / 64) < MAX_INT16) {
 | 
					  } else if ((CacheSize64 / 64) < MAX_INT16) {
 | 
				
			||||||
    CacheSize16 = (1 << 15) | (CacheSize64 / 64);
 | 
					    CacheSize16 = (1 << 15) | (CacheSize64 / 64);
 | 
				
			||||||
    CacheSize32 = CacheSize16;
 | 
					    CacheSize32 = (1 << 31) | (CacheSize64 / 64);
 | 
				
			||||||
  } else {
 | 
					  } else {
 | 
				
			||||||
    if ((CacheSize64 / 1024) <= 2047) {
 | 
					    if ((CacheSize64 / 1024) <= 2047) {
 | 
				
			||||||
      CacheSize32 = CacheSize64;
 | 
					      CacheSize32 = CacheSize64;
 | 
				
			||||||
@@ -689,7 +689,7 @@ AddSmbiosProcessorTypeTable (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  if (EFI_ERROR (Status)) {
 | 
					  if (EFI_ERROR (Status)) {
 | 
				
			||||||
    DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type04 Table Log Failed! %r \n",
 | 
					    DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type04 Table Log Failed! %r \n",
 | 
				
			||||||
            __FUNCTION__, __LINE__, Status));
 | 
					            __FUNCTION__, DEBUG_LINE_NUMBER, Status));
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  FreePool (Type4Record);
 | 
					  FreePool (Type4Record);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,6 +2,7 @@
 | 
				
			|||||||
  Functions for processor information common to ARM and AARCH64.
 | 
					  Functions for processor information common to ARM and AARCH64.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
 | 
					  Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
 | 
				
			||||||
 | 
					  Copyright (c) 2021, Ampere Computing LLC. All rights reserved.<BR>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
					  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -171,7 +172,7 @@ SmbiosGetProcessorId (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  if (HasSmcArm64SocId ()) {
 | 
					  if (HasSmcArm64SocId ()) {
 | 
				
			||||||
    SmbiosGetSmcArm64SocId (&Jep106Code, &SocRevision);
 | 
					    SmbiosGetSmcArm64SocId (&Jep106Code, &SocRevision);
 | 
				
			||||||
    ProcessorId = ((UINT64)Jep106Code << 32) | SocRevision;
 | 
					    ProcessorId = ((UINT64)SocRevision << 32) | Jep106Code;
 | 
				
			||||||
  } else {
 | 
					  } else {
 | 
				
			||||||
    ProcessorId = ArmReadMidr ();
 | 
					    ProcessorId = ArmReadMidr ();
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -240,11 +240,12 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor)
 | 
				
			|||||||
  SmbiosRecord->BiosSegment = (UINT16)(FixedPcdGet32 (PcdFdBaseAddress) / SIZE_64KB);
 | 
					  SmbiosRecord->BiosSegment = (UINT16)(FixedPcdGet32 (PcdFdBaseAddress) / SIZE_64KB);
 | 
				
			||||||
  if (BiosPhysicalSize < SIZE_16MB) {
 | 
					  if (BiosPhysicalSize < SIZE_16MB) {
 | 
				
			||||||
    SmbiosRecord->BiosSize = Base2ToByteWith64KUnit (BiosPhysicalSize) - 1;
 | 
					    SmbiosRecord->BiosSize = Base2ToByteWith64KUnit (BiosPhysicalSize) - 1;
 | 
				
			||||||
    SmbiosRecord->ExtendedBiosSize.Size = BiosPhysicalSize / SIZE_1MB;
 | 
					 | 
				
			||||||
    SmbiosRecord->ExtendedBiosSize.Unit = 0; // Size is in MB
 | 
					 | 
				
			||||||
  } else {
 | 
					  } else {
 | 
				
			||||||
    SmbiosRecord->BiosSize = 0xFF;
 | 
					    SmbiosRecord->BiosSize = 0xFF;
 | 
				
			||||||
    if (BiosPhysicalSize > 0x3FFF) {
 | 
					    if (BiosPhysicalSize < SIZE_16GB) {
 | 
				
			||||||
 | 
					      SmbiosRecord->ExtendedBiosSize.Size = BiosPhysicalSize / SIZE_1MB;
 | 
				
			||||||
 | 
					      SmbiosRecord->ExtendedBiosSize.Unit = 0; // Size is in MB
 | 
				
			||||||
 | 
					    } else {
 | 
				
			||||||
      SmbiosRecord->ExtendedBiosSize.Size = BiosPhysicalSize / SIZE_1GB;
 | 
					      SmbiosRecord->ExtendedBiosSize.Size = BiosPhysicalSize / SIZE_1GB;
 | 
				
			||||||
      SmbiosRecord->ExtendedBiosSize.Unit = 1; // Size is in GB
 | 
					      SmbiosRecord->ExtendedBiosSize.Unit = 1; // Size is in GB
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -270,7 +271,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor)
 | 
				
			|||||||
  Status = SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL);
 | 
					  Status = SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL);
 | 
				
			||||||
  if (EFI_ERROR (Status)) {
 | 
					  if (EFI_ERROR (Status)) {
 | 
				
			||||||
    DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type00 Table Log Failed! %r \n",
 | 
					    DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type00 Table Log Failed! %r \n",
 | 
				
			||||||
           __FUNCTION__, __LINE__, Status));
 | 
					           __FUNCTION__, DEBUG_LINE_NUMBER, Status));
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  FreePool (SmbiosRecord);
 | 
					  FreePool (SmbiosRecord);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -162,7 +162,7 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscSystemManufacturer)
 | 
				
			|||||||
  Status = SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL);
 | 
					  Status = SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL);
 | 
				
			||||||
  if (EFI_ERROR (Status)) {
 | 
					  if (EFI_ERROR (Status)) {
 | 
				
			||||||
    DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type01 Table Log Failed! %r \n",
 | 
					    DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type01 Table Log Failed! %r \n",
 | 
				
			||||||
            __FUNCTION__, __LINE__, Status));
 | 
					            __FUNCTION__, DEBUG_LINE_NUMBER, Status));
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  FreePool (SmbiosRecord);
 | 
					  FreePool (SmbiosRecord);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -196,7 +196,7 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscBaseBoardManufacturer)
 | 
				
			|||||||
  Status = SmbiosMiscAddRecord ((UINT8 *)SmbiosRecord, NULL);
 | 
					  Status = SmbiosMiscAddRecord ((UINT8 *)SmbiosRecord, NULL);
 | 
				
			||||||
  if (EFI_ERROR (Status)) {
 | 
					  if (EFI_ERROR (Status)) {
 | 
				
			||||||
    DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type02 Table Log Failed! %r \n",
 | 
					    DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type02 Table Log Failed! %r \n",
 | 
				
			||||||
            __FUNCTION__, __LINE__, Status));
 | 
					            __FUNCTION__, DEBUG_LINE_NUMBER, Status));
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  FreePool (SmbiosRecord);
 | 
					  FreePool (SmbiosRecord);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -178,7 +178,7 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscChassisManufacturer)
 | 
				
			|||||||
  Status = SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL);
 | 
					  Status = SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL);
 | 
				
			||||||
  if (EFI_ERROR (Status)) {
 | 
					  if (EFI_ERROR (Status)) {
 | 
				
			||||||
    DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type03 Table Log Failed! %r \n",
 | 
					    DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type03 Table Log Failed! %r \n",
 | 
				
			||||||
            __FUNCTION__, __LINE__, Status));
 | 
					            __FUNCTION__, DEBUG_LINE_NUMBER, Status));
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  FreePool (SmbiosRecord);
 | 
					  FreePool (SmbiosRecord);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -158,7 +158,7 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscNumberOfInstallableLanguages)
 | 
				
			|||||||
  Status = SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL);
 | 
					  Status = SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL);
 | 
				
			||||||
  if (EFI_ERROR (Status)) {
 | 
					  if (EFI_ERROR (Status)) {
 | 
				
			||||||
    DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type13 Table Log Failed! %r \n",
 | 
					    DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type13 Table Log Failed! %r \n",
 | 
				
			||||||
            __FUNCTION__, __LINE__, Status));
 | 
					            __FUNCTION__, DEBUG_LINE_NUMBER, Status));
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  FreePool (SmbiosRecord);
 | 
					  FreePool (SmbiosRecord);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -68,7 +68,7 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscBootInformation)
 | 
				
			|||||||
  Status = SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL);
 | 
					  Status = SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL);
 | 
				
			||||||
  if (EFI_ERROR (Status)) {
 | 
					  if (EFI_ERROR (Status)) {
 | 
				
			||||||
    DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type32 Table Log Failed! %r \n",
 | 
					    DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type32 Table Log Failed! %r \n",
 | 
				
			||||||
            __FUNCTION__, __LINE__, Status));
 | 
					            __FUNCTION__, DEBUG_LINE_NUMBER, Status));
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  FreePool (SmbiosRecord);
 | 
					  FreePool (SmbiosRecord);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -49,12 +49,13 @@
 | 
				
			|||||||
  FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
 | 
					  FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
 | 
				
			||||||
  QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
 | 
					  QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
 | 
				
			||||||
  FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
 | 
					  FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
 | 
				
			||||||
  PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
 | 
					  PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
 | 
				
			||||||
  PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
 | 
					  PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
 | 
				
			||||||
  PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
 | 
					  PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
 | 
				
			||||||
  PciHostBridgeUtilityLib|ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLib/ArmVirtPciHostBridgeUtilityLib.inf
 | 
					  PciHostBridgeUtilityLib|ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLib/ArmVirtPciHostBridgeUtilityLib.inf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
 | 
					  TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
 | 
				
			||||||
 | 
					  TpmPlatformHierarchyLib|SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.inf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
!include MdePkg/MdeLibs.dsc.inc
 | 
					!include MdePkg/MdeLibs.dsc.inc
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -192,7 +193,7 @@
 | 
				
			|||||||
  # PCD and PcdPciDisableBusEnumeration above have not been assigned yet
 | 
					  # PCD and PcdPciDisableBusEnumeration above have not been assigned yet
 | 
				
			||||||
  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xFFFFFFFFFFFFFFFF
 | 
					  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xFFFFFFFFFFFFFFFF
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  gArmTokenSpaceGuid.PcdPciIoTranslation|0
 | 
					  gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  gEfiSecurityPkgTokenSpaceGuid.PcdTpmBaseAddress|0x0
 | 
					  gEfiSecurityPkgTokenSpaceGuid.PcdTpmBaseAddress|0x0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -292,9 +293,9 @@
 | 
				
			|||||||
  #
 | 
					  #
 | 
				
			||||||
  # Platform Driver
 | 
					  # Platform Driver
 | 
				
			||||||
  #
 | 
					  #
 | 
				
			||||||
  ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
 | 
					  OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
 | 
				
			||||||
  ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
 | 
					  EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
 | 
				
			||||||
  ArmVirtPkg/HighMemDxe/HighMemDxe.inf
 | 
					  OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
 | 
				
			||||||
  OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
 | 
					  OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
 | 
				
			||||||
  OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
 | 
					  OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
 | 
				
			||||||
  OvmfPkg/VirtioNetDxe/VirtioNet.inf
 | 
					  OvmfPkg/VirtioNetDxe/VirtioNet.inf
 | 
				
			||||||
@@ -341,12 +342,12 @@
 | 
				
			|||||||
  #
 | 
					  #
 | 
				
			||||||
  ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf {
 | 
					  ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf {
 | 
				
			||||||
    <LibraryClasses>
 | 
					    <LibraryClasses>
 | 
				
			||||||
      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
 | 
					      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
 | 
					  MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
 | 
				
			||||||
  MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
 | 
					  MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
 | 
				
			||||||
    <LibraryClasses>
 | 
					    <LibraryClasses>
 | 
				
			||||||
      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
 | 
					      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf
 | 
					  OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf
 | 
				
			||||||
  OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
 | 
					  OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
 | 
				
			||||||
@@ -360,5 +361,5 @@
 | 
				
			|||||||
  MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
 | 
					  MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
 | 
				
			||||||
  ArmVirtPkg/CloudHvAcpiPlatformDxe/CloudHvAcpiPlatformDxe.inf {
 | 
					  ArmVirtPkg/CloudHvAcpiPlatformDxe/CloudHvAcpiPlatformDxe.inf {
 | 
				
			||||||
    <LibraryClasses>
 | 
					    <LibraryClasses>
 | 
				
			||||||
      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
 | 
					      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -105,9 +105,9 @@ READ_LOCK_STATUS   = TRUE
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  INF MdeModulePkg/Core/Dxe/DxeMain.inf
 | 
					  INF MdeModulePkg/Core/Dxe/DxeMain.inf
 | 
				
			||||||
  INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
 | 
					  INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
 | 
				
			||||||
  INF ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
 | 
					  INF OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
 | 
				
			||||||
  INF ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
 | 
					  INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
 | 
				
			||||||
  INF ArmVirtPkg/HighMemDxe/HighMemDxe.inf
 | 
					  INF OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  #
 | 
					  #
 | 
				
			||||||
  # PI DXE Drivers producing Architectural Protocols (EFI Services)
 | 
					  # PI DXE Drivers producing Architectural Protocols (EFI Services)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -57,9 +57,9 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
 | 
					  FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
 | 
					  PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
 | 
				
			||||||
  PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
 | 
					  PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
 | 
				
			||||||
  PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
 | 
					  PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
 | 
				
			||||||
  PciHostBridgeUtilityLib|ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLib/ArmVirtPciHostBridgeUtilityLib.inf
 | 
					  PciHostBridgeUtilityLib|ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLib/ArmVirtPciHostBridgeUtilityLib.inf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
 | 
					  TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
 | 
				
			||||||
@@ -184,7 +184,7 @@
 | 
				
			|||||||
  # PCD and PcdPciDisableBusEnumeration above have not been assigned yet
 | 
					  # PCD and PcdPciDisableBusEnumeration above have not been assigned yet
 | 
				
			||||||
  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xFFFFFFFFFFFFFFFF
 | 
					  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xFFFFFFFFFFFFFFFF
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  gArmTokenSpaceGuid.PcdPciIoTranslation|0x0
 | 
					  gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0x0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  #
 | 
					  #
 | 
				
			||||||
  # Set video resolution for boot options and for text setup.
 | 
					  # Set video resolution for boot options and for text setup.
 | 
				
			||||||
@@ -291,9 +291,9 @@
 | 
				
			|||||||
  # Platform Driver
 | 
					  # Platform Driver
 | 
				
			||||||
  #
 | 
					  #
 | 
				
			||||||
  ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf
 | 
					  ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf
 | 
				
			||||||
  ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
 | 
					  OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
 | 
				
			||||||
  ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
 | 
					  EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
 | 
				
			||||||
  ArmVirtPkg/HighMemDxe/HighMemDxe.inf
 | 
					  OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
 | 
				
			||||||
  OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
 | 
					  OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
 | 
				
			||||||
  OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
 | 
					  OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
 | 
				
			||||||
  OvmfPkg/VirtioNetDxe/VirtioNet.inf
 | 
					  OvmfPkg/VirtioNetDxe/VirtioNet.inf
 | 
				
			||||||
@@ -338,17 +338,17 @@
 | 
				
			|||||||
  #
 | 
					  #
 | 
				
			||||||
  ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf {
 | 
					  ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf {
 | 
				
			||||||
    <LibraryClasses>
 | 
					    <LibraryClasses>
 | 
				
			||||||
      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
 | 
					      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
 | 
				
			||||||
      NULL|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpressLib.inf
 | 
					      NULL|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpressLib.inf
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf {
 | 
					  MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf {
 | 
				
			||||||
    <LibraryClasses>
 | 
					    <LibraryClasses>
 | 
				
			||||||
      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
 | 
					      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
 | 
				
			||||||
      NULL|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpressLib.inf
 | 
					      NULL|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpressLib.inf
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
 | 
					  MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
 | 
				
			||||||
    <LibraryClasses>
 | 
					    <LibraryClasses>
 | 
				
			||||||
      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
 | 
					      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
 | 
				
			||||||
      NULL|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpressLib.inf
 | 
					      NULL|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpressLib.inf
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
 | 
					  OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -119,10 +119,10 @@ READ_LOCK_STATUS   = TRUE
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  INF MdeModulePkg/Core/Dxe/DxeMain.inf
 | 
					  INF MdeModulePkg/Core/Dxe/DxeMain.inf
 | 
				
			||||||
  INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
 | 
					  INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
 | 
				
			||||||
  INF ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
 | 
					  INF OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
 | 
				
			||||||
  INF ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
 | 
					  INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
 | 
				
			||||||
  INF ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf
 | 
					  INF ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf
 | 
				
			||||||
  INF ArmVirtPkg/HighMemDxe/HighMemDxe.inf
 | 
					  INF OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  #
 | 
					  #
 | 
				
			||||||
  # PI DXE Drivers producing Architectural Protocols (EFI Services)
 | 
					  # PI DXE Drivers producing Architectural Protocols (EFI Services)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -35,9 +35,6 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  gArmVirtVariableGuid   = { 0x50bea1e5, 0xa2c5, 0x46e9, { 0x9b, 0x3a, 0x59, 0x59, 0x65, 0x16, 0xb0, 0x0a } }
 | 
					  gArmVirtVariableGuid   = { 0x50bea1e5, 0xa2c5, 0x46e9, { 0x9b, 0x3a, 0x59, 0x59, 0x65, 0x16, 0xb0, 0x0a } }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[Protocols]
 | 
					 | 
				
			||||||
  gFdtClientProtocolGuid = { 0xE11FACA0, 0x4710, 0x4C8E, { 0xA7, 0xA2, 0x01, 0xBA, 0xA2, 0x59, 0x1B, 0x4C } }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[PcdsFeatureFlag]
 | 
					[PcdsFeatureFlag]
 | 
				
			||||||
  #
 | 
					  #
 | 
				
			||||||
  # Feature Flag PCD that defines whether TPM2 support is enabled
 | 
					  # Feature Flag PCD that defines whether TPM2 support is enabled
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -59,7 +59,7 @@
 | 
				
			|||||||
  # Virtio Support
 | 
					  # Virtio Support
 | 
				
			||||||
  VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf
 | 
					  VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf
 | 
				
			||||||
  VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf
 | 
					  VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf
 | 
				
			||||||
  QemuFwCfgLib|ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
 | 
					  QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.inf
 | 
				
			||||||
  QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/BaseQemuFwCfgS3LibNull.inf
 | 
					  QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/BaseQemuFwCfgS3LibNull.inf
 | 
				
			||||||
  QemuFwCfgSimpleParserLib|OvmfPkg/Library/QemuFwCfgSimpleParserLib/QemuFwCfgSimpleParserLib.inf
 | 
					  QemuFwCfgSimpleParserLib|OvmfPkg/Library/QemuFwCfgSimpleParserLib/QemuFwCfgSimpleParserLib.inf
 | 
				
			||||||
  QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.inf
 | 
					  QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.inf
 | 
				
			||||||
@@ -77,17 +77,19 @@
 | 
				
			|||||||
  FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
 | 
					  FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
 | 
				
			||||||
  QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
 | 
					  QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
 | 
				
			||||||
  FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
 | 
					  FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
 | 
				
			||||||
  PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
 | 
					  PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
 | 
				
			||||||
  PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
 | 
					  PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
 | 
				
			||||||
  PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
 | 
					  PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
 | 
				
			||||||
  PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.inf
 | 
					  PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.inf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
!if $(TPM2_ENABLE) == TRUE
 | 
					!if $(TPM2_ENABLE) == TRUE
 | 
				
			||||||
  Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf
 | 
					  Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf
 | 
				
			||||||
  Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeTcg2PhysicalPresenceLib.inf
 | 
					  Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeTcg2PhysicalPresenceLib.inf
 | 
				
			||||||
  TpmMeasurementLib|SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf
 | 
					  TpmMeasurementLib|SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf
 | 
				
			||||||
 | 
					  TpmPlatformHierarchyLib|SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.inf
 | 
				
			||||||
!else
 | 
					!else
 | 
				
			||||||
  TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
 | 
					  TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
 | 
				
			||||||
 | 
					  TpmPlatformHierarchyLib|SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.inf
 | 
				
			||||||
!endif
 | 
					!endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[LibraryClasses.common.PEIM]
 | 
					[LibraryClasses.common.PEIM]
 | 
				
			||||||
@@ -247,7 +249,7 @@
 | 
				
			|||||||
  # PCD and PcdPciDisableBusEnumeration above have not been assigned yet
 | 
					  # PCD and PcdPciDisableBusEnumeration above have not been assigned yet
 | 
				
			||||||
  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xFFFFFFFFFFFFFFFF
 | 
					  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xFFFFFFFFFFFFFFFF
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  gArmTokenSpaceGuid.PcdPciIoTranslation|0x0
 | 
					  gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0x0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  #
 | 
					  #
 | 
				
			||||||
  # Set video resolution for boot options and for text setup.
 | 
					  # Set video resolution for boot options and for text setup.
 | 
				
			||||||
@@ -403,9 +405,9 @@
 | 
				
			|||||||
  #
 | 
					  #
 | 
				
			||||||
  # Platform Driver
 | 
					  # Platform Driver
 | 
				
			||||||
  #
 | 
					  #
 | 
				
			||||||
  ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
 | 
					  OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
 | 
				
			||||||
  ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
 | 
					  EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
 | 
				
			||||||
  ArmVirtPkg/HighMemDxe/HighMemDxe.inf
 | 
					  OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
 | 
				
			||||||
  OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
 | 
					  OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
 | 
				
			||||||
  OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
 | 
					  OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
 | 
				
			||||||
  OvmfPkg/VirtioNetDxe/VirtioNet.inf
 | 
					  OvmfPkg/VirtioNetDxe/VirtioNet.inf
 | 
				
			||||||
@@ -487,12 +489,12 @@
 | 
				
			|||||||
  #
 | 
					  #
 | 
				
			||||||
  ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf {
 | 
					  ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf {
 | 
				
			||||||
    <LibraryClasses>
 | 
					    <LibraryClasses>
 | 
				
			||||||
      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
 | 
					      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
 | 
					  MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
 | 
				
			||||||
  MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
 | 
					  MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
 | 
				
			||||||
    <LibraryClasses>
 | 
					    <LibraryClasses>
 | 
				
			||||||
      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
 | 
					      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf
 | 
					  OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf
 | 
				
			||||||
  OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
 | 
					  OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
 | 
				
			||||||
@@ -543,5 +545,5 @@
 | 
				
			|||||||
  MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
 | 
					  MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
 | 
				
			||||||
  OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf {
 | 
					  OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf {
 | 
				
			||||||
    <LibraryClasses>
 | 
					    <LibraryClasses>
 | 
				
			||||||
      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
 | 
					      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -40,9 +40,9 @@ READ_LOCK_STATUS   = TRUE
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  INF MdeModulePkg/Core/Dxe/DxeMain.inf
 | 
					  INF MdeModulePkg/Core/Dxe/DxeMain.inf
 | 
				
			||||||
  INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
 | 
					  INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
 | 
				
			||||||
  INF ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
 | 
					  INF OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
 | 
				
			||||||
  INF ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
 | 
					  INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
 | 
				
			||||||
  INF ArmVirtPkg/HighMemDxe/HighMemDxe.inf
 | 
					  INF OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  #
 | 
					  #
 | 
				
			||||||
  # PI DXE Drivers producing Architectural Protocols (EFI Services)
 | 
					  # PI DXE Drivers producing Architectural Protocols (EFI Services)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -57,7 +57,7 @@
 | 
				
			|||||||
  # Virtio Support
 | 
					  # Virtio Support
 | 
				
			||||||
  VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf
 | 
					  VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf
 | 
				
			||||||
  VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf
 | 
					  VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf
 | 
				
			||||||
  QemuFwCfgLib|ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
 | 
					  QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.inf
 | 
				
			||||||
  QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/BaseQemuFwCfgS3LibNull.inf
 | 
					  QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/BaseQemuFwCfgS3LibNull.inf
 | 
				
			||||||
  QemuFwCfgSimpleParserLib|OvmfPkg/Library/QemuFwCfgSimpleParserLib/QemuFwCfgSimpleParserLib.inf
 | 
					  QemuFwCfgSimpleParserLib|OvmfPkg/Library/QemuFwCfgSimpleParserLib/QemuFwCfgSimpleParserLib.inf
 | 
				
			||||||
  QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.inf
 | 
					  QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.inf
 | 
				
			||||||
@@ -75,11 +75,12 @@
 | 
				
			|||||||
  FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
 | 
					  FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
 | 
				
			||||||
  QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
 | 
					  QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
 | 
				
			||||||
  FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
 | 
					  FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
 | 
				
			||||||
  PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
 | 
					  PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
 | 
				
			||||||
  PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
 | 
					  PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
 | 
				
			||||||
  PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
 | 
					  PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
 | 
				
			||||||
  PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.inf
 | 
					  PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.inf
 | 
				
			||||||
  TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
 | 
					  TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
 | 
				
			||||||
 | 
					  TpmPlatformHierarchyLib|SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.inf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[LibraryClasses.common.DXE_DRIVER]
 | 
					[LibraryClasses.common.DXE_DRIVER]
 | 
				
			||||||
  ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
 | 
					  ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
 | 
				
			||||||
@@ -227,7 +228,7 @@
 | 
				
			|||||||
  # PCD and PcdPciDisableBusEnumeration above have not been assigned yet
 | 
					  # PCD and PcdPciDisableBusEnumeration above have not been assigned yet
 | 
				
			||||||
  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xFFFFFFFFFFFFFFFF
 | 
					  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xFFFFFFFFFFFFFFFF
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  gArmTokenSpaceGuid.PcdPciIoTranslation|0x0
 | 
					  gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0x0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  #
 | 
					  #
 | 
				
			||||||
  # Set video resolution for boot options and for text setup.
 | 
					  # Set video resolution for boot options and for text setup.
 | 
				
			||||||
@@ -339,9 +340,9 @@
 | 
				
			|||||||
  #
 | 
					  #
 | 
				
			||||||
  # Platform Driver
 | 
					  # Platform Driver
 | 
				
			||||||
  #
 | 
					  #
 | 
				
			||||||
  ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
 | 
					  OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
 | 
				
			||||||
  ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
 | 
					  EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
 | 
				
			||||||
  ArmVirtPkg/HighMemDxe/HighMemDxe.inf
 | 
					  OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
 | 
				
			||||||
  OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
 | 
					  OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
 | 
				
			||||||
  OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
 | 
					  OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
 | 
				
			||||||
  OvmfPkg/VirtioNetDxe/VirtioNet.inf
 | 
					  OvmfPkg/VirtioNetDxe/VirtioNet.inf
 | 
				
			||||||
@@ -423,12 +424,12 @@
 | 
				
			|||||||
  #
 | 
					  #
 | 
				
			||||||
  ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf {
 | 
					  ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf {
 | 
				
			||||||
    <LibraryClasses>
 | 
					    <LibraryClasses>
 | 
				
			||||||
      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
 | 
					      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
 | 
					  MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
 | 
				
			||||||
  MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
 | 
					  MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
 | 
				
			||||||
    <LibraryClasses>
 | 
					    <LibraryClasses>
 | 
				
			||||||
      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
 | 
					      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf
 | 
					  OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf
 | 
				
			||||||
  OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
 | 
					  OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
 | 
				
			||||||
@@ -459,5 +460,5 @@
 | 
				
			|||||||
  MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
 | 
					  MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
 | 
				
			||||||
  OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf {
 | 
					  OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf {
 | 
				
			||||||
    <LibraryClasses>
 | 
					    <LibraryClasses>
 | 
				
			||||||
      NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
 | 
					      NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -50,6 +50,7 @@
 | 
				
			|||||||
  PlatformBootManagerLib|ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
 | 
					  PlatformBootManagerLib|ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
 | 
				
			||||||
  CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
 | 
					  CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
 | 
				
			||||||
  TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
 | 
					  TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
 | 
				
			||||||
 | 
					  TpmPlatformHierarchyLib|SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.inf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[LibraryClasses.common.UEFI_DRIVER]
 | 
					[LibraryClasses.common.UEFI_DRIVER]
 | 
				
			||||||
  UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
 | 
					  UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
 | 
				
			||||||
@@ -196,7 +197,7 @@
 | 
				
			|||||||
  # Platform Driver
 | 
					  # Platform Driver
 | 
				
			||||||
  #
 | 
					  #
 | 
				
			||||||
  ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf
 | 
					  ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf
 | 
				
			||||||
  ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
 | 
					  EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  #
 | 
					  #
 | 
				
			||||||
  # FAT filesystem + GPT/MBR partitioning + UDF filesystem
 | 
					  # FAT filesystem + GPT/MBR partitioning + UDF filesystem
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -139,7 +139,7 @@ READ_LOCK_STATUS   = TRUE
 | 
				
			|||||||
  INF MdeModulePkg/Core/Dxe/DxeMain.inf
 | 
					  INF MdeModulePkg/Core/Dxe/DxeMain.inf
 | 
				
			||||||
  INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
 | 
					  INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
 | 
				
			||||||
  INF ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf
 | 
					  INF ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf
 | 
				
			||||||
  INF ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
 | 
					  INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  #
 | 
					  #
 | 
				
			||||||
  # PI DXE Drivers producing Architectural Protocols (EFI Services)
 | 
					  # PI DXE Drivers producing Architectural Protocols (EFI Services)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -30,6 +30,7 @@
 | 
				
			|||||||
[Packages]
 | 
					[Packages]
 | 
				
			||||||
  ArmPkg/ArmPkg.dec
 | 
					  ArmPkg/ArmPkg.dec
 | 
				
			||||||
  ArmVirtPkg/ArmVirtPkg.dec
 | 
					  ArmVirtPkg/ArmVirtPkg.dec
 | 
				
			||||||
 | 
					  EmbeddedPkg/EmbeddedPkg.dec
 | 
				
			||||||
  MdePkg/MdePkg.dec
 | 
					  MdePkg/MdePkg.dec
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[Protocols]
 | 
					[Protocols]
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -22,6 +22,7 @@
 | 
				
			|||||||
[Packages]
 | 
					[Packages]
 | 
				
			||||||
  ArmPlatformPkg/ArmPlatformPkg.dec
 | 
					  ArmPlatformPkg/ArmPlatformPkg.dec
 | 
				
			||||||
  ArmVirtPkg/ArmVirtPkg.dec
 | 
					  ArmVirtPkg/ArmVirtPkg.dec
 | 
				
			||||||
 | 
					  EmbeddedPkg/EmbeddedPkg.dec
 | 
				
			||||||
  MdePkg/MdePkg.dec
 | 
					  MdePkg/MdePkg.dec
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[LibraryClasses]
 | 
					[LibraryClasses]
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -24,6 +24,7 @@
 | 
				
			|||||||
[Packages]
 | 
					[Packages]
 | 
				
			||||||
  ArmPkg/ArmPkg.dec
 | 
					  ArmPkg/ArmPkg.dec
 | 
				
			||||||
  ArmVirtPkg/ArmVirtPkg.dec
 | 
					  ArmVirtPkg/ArmVirtPkg.dec
 | 
				
			||||||
 | 
					  EmbeddedPkg/EmbeddedPkg.dec
 | 
				
			||||||
  MdeModulePkg/MdeModulePkg.dec
 | 
					  MdeModulePkg/MdeModulePkg.dec
 | 
				
			||||||
  MdePkg/MdePkg.dec
 | 
					  MdePkg/MdePkg.dec
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -23,6 +23,7 @@
 | 
				
			|||||||
[Packages]
 | 
					[Packages]
 | 
				
			||||||
  ArmPkg/ArmPkg.dec
 | 
					  ArmPkg/ArmPkg.dec
 | 
				
			||||||
  ArmVirtPkg/ArmVirtPkg.dec
 | 
					  ArmVirtPkg/ArmVirtPkg.dec
 | 
				
			||||||
 | 
					  EmbeddedPkg/EmbeddedPkg.dec
 | 
				
			||||||
  MdePkg/MdePkg.dec
 | 
					  MdePkg/MdePkg.dec
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[LibraryClasses]
 | 
					[LibraryClasses]
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -21,6 +21,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[Packages]
 | 
					[Packages]
 | 
				
			||||||
  ArmVirtPkg/ArmVirtPkg.dec
 | 
					  ArmVirtPkg/ArmVirtPkg.dec
 | 
				
			||||||
 | 
					  EmbeddedPkg/EmbeddedPkg.dec
 | 
				
			||||||
  MdePkg/MdePkg.dec
 | 
					  MdePkg/MdePkg.dec
 | 
				
			||||||
  PcAtChipsetPkg/PcAtChipsetPkg.dec
 | 
					  PcAtChipsetPkg/PcAtChipsetPkg.dec
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -22,6 +22,7 @@
 | 
				
			|||||||
  ArmPkg/ArmPkg.dec
 | 
					  ArmPkg/ArmPkg.dec
 | 
				
			||||||
  ArmPlatformPkg/ArmPlatformPkg.dec
 | 
					  ArmPlatformPkg/ArmPlatformPkg.dec
 | 
				
			||||||
  ArmVirtPkg/ArmVirtPkg.dec
 | 
					  ArmVirtPkg/ArmVirtPkg.dec
 | 
				
			||||||
 | 
					  EmbeddedPkg/EmbeddedPkg.dec
 | 
				
			||||||
  MdePkg/MdePkg.dec
 | 
					  MdePkg/MdePkg.dec
 | 
				
			||||||
  MdeModulePkg/MdeModulePkg.dec
 | 
					  MdeModulePkg/MdeModulePkg.dec
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -24,6 +24,7 @@
 | 
				
			|||||||
  ArmPlatformPkg/ArmPlatformPkg.dec
 | 
					  ArmPlatformPkg/ArmPlatformPkg.dec
 | 
				
			||||||
  ArmPkg/ArmPkg.dec
 | 
					  ArmPkg/ArmPkg.dec
 | 
				
			||||||
  ArmVirtPkg/ArmVirtPkg.dec
 | 
					  ArmVirtPkg/ArmVirtPkg.dec
 | 
				
			||||||
 | 
					  EmbeddedPkg/EmbeddedPkg.dec
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[LibraryClasses]
 | 
					[LibraryClasses]
 | 
				
			||||||
  BaseLib
 | 
					  BaseLib
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,6 +16,7 @@
 | 
				
			|||||||
#include <Library/PcdLib.h>
 | 
					#include <Library/PcdLib.h>
 | 
				
			||||||
#include <Library/PlatformBmPrintScLib.h>
 | 
					#include <Library/PlatformBmPrintScLib.h>
 | 
				
			||||||
#include <Library/QemuBootOrderLib.h>
 | 
					#include <Library/QemuBootOrderLib.h>
 | 
				
			||||||
 | 
					#include <Library/TpmPlatformHierarchyLib.h>
 | 
				
			||||||
#include <Library/UefiBootManagerLib.h>
 | 
					#include <Library/UefiBootManagerLib.h>
 | 
				
			||||||
#include <Protocol/DevicePath.h>
 | 
					#include <Protocol/DevicePath.h>
 | 
				
			||||||
#include <Protocol/FirmwareVolume2.h>
 | 
					#include <Protocol/FirmwareVolume2.h>
 | 
				
			||||||
@@ -696,6 +697,11 @@ PlatformBootManagerBeforeConsole (
 | 
				
			|||||||
  //
 | 
					  //
 | 
				
			||||||
  EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid);
 | 
					  EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  //
 | 
				
			||||||
 | 
					  // Disable the TPM 2 platform hierarchy
 | 
				
			||||||
 | 
					  //
 | 
				
			||||||
 | 
					  ConfigureTpmPlatformHierarchy ();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  //
 | 
					  //
 | 
				
			||||||
  // Dispatch deferred images after EndOfDxe event.
 | 
					  // Dispatch deferred images after EndOfDxe event.
 | 
				
			||||||
  //
 | 
					  //
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -33,6 +33,7 @@
 | 
				
			|||||||
  MdeModulePkg/MdeModulePkg.dec
 | 
					  MdeModulePkg/MdeModulePkg.dec
 | 
				
			||||||
  MdePkg/MdePkg.dec
 | 
					  MdePkg/MdePkg.dec
 | 
				
			||||||
  OvmfPkg/OvmfPkg.dec
 | 
					  OvmfPkg/OvmfPkg.dec
 | 
				
			||||||
 | 
					  SecurityPkg/SecurityPkg.dec
 | 
				
			||||||
  ShellPkg/ShellPkg.dec
 | 
					  ShellPkg/ShellPkg.dec
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[LibraryClasses]
 | 
					[LibraryClasses]
 | 
				
			||||||
@@ -47,6 +48,7 @@
 | 
				
			|||||||
  QemuBootOrderLib
 | 
					  QemuBootOrderLib
 | 
				
			||||||
  QemuLoadImageLib
 | 
					  QemuLoadImageLib
 | 
				
			||||||
  ReportStatusCodeLib
 | 
					  ReportStatusCodeLib
 | 
				
			||||||
 | 
					  TpmPlatformHierarchyLib
 | 
				
			||||||
  UefiBootManagerLib
 | 
					  UefiBootManagerLib
 | 
				
			||||||
  UefiBootServicesTableLib
 | 
					  UefiBootServicesTableLib
 | 
				
			||||||
  UefiLib
 | 
					  UefiLib
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -26,6 +26,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[Packages]
 | 
					[Packages]
 | 
				
			||||||
  ArmVirtPkg/ArmVirtPkg.dec
 | 
					  ArmVirtPkg/ArmVirtPkg.dec
 | 
				
			||||||
 | 
					  EmbeddedPkg/EmbeddedPkg.dec
 | 
				
			||||||
  MdePkg/MdePkg.dec
 | 
					  MdePkg/MdePkg.dec
 | 
				
			||||||
  MdeModulePkg/MdeModulePkg.dec
 | 
					  MdeModulePkg/MdeModulePkg.dec
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -21,6 +21,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[Packages]
 | 
					[Packages]
 | 
				
			||||||
  ArmVirtPkg/ArmVirtPkg.dec
 | 
					  ArmVirtPkg/ArmVirtPkg.dec
 | 
				
			||||||
 | 
					  EmbeddedPkg/EmbeddedPkg.dec
 | 
				
			||||||
  MdePkg/MdePkg.dec
 | 
					  MdePkg/MdePkg.dec
 | 
				
			||||||
  OvmfPkg/OvmfPkg.dec
 | 
					  OvmfPkg/OvmfPkg.dec
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
## @file
 | 
					## @file
 | 
				
			||||||
# Download GCC AARCH64 compiler from Linaro's release site
 | 
					# Download GCC AARCH64 compiler from Arm's release site
 | 
				
			||||||
# Set shell variable GCC5_AARCH64_INSTALL to this folder
 | 
					# Set shell variable GCC5_AARCH64_INSTALL to this folder
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# This is only downloaded when a build activates scope gcc_aarch64_linux
 | 
					# This is only downloaded when a build activates scope gcc_aarch64_linux
 | 
				
			||||||
@@ -11,11 +11,11 @@
 | 
				
			|||||||
  "scope": "gcc_aarch64_linux",
 | 
					  "scope": "gcc_aarch64_linux",
 | 
				
			||||||
  "type": "web",
 | 
					  "type": "web",
 | 
				
			||||||
  "name": "gcc_aarch64_linux",
 | 
					  "name": "gcc_aarch64_linux",
 | 
				
			||||||
  "source": "http://releases.linaro.org/components/toolchain/binaries/7.4-2019.02/aarch64-linux-gnu/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu.tar.xz",
 | 
					  "source": "https://developer.arm.com/-/media/Files/downloads/gnu-a/10.3-2021.07/binrel/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu.tar.xz",
 | 
				
			||||||
  "version": "7.4.1",
 | 
					  "version": "10.3-2021.07",
 | 
				
			||||||
  "sha256": "27f1dc2c491ed61ae8f0d4b0c11de59cd2f7dd9c94761ee7153006fcac1bf9ab",
 | 
					  "sha256": "1e33d53dea59c8de823bbdfe0798280bdcd138636c7060da9d77a97ded095a84",
 | 
				
			||||||
  "compression_type": "tar",
 | 
					  "compression_type": "tar",
 | 
				
			||||||
  "internal_path": "/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/",
 | 
					  "internal_path": "/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/",
 | 
				
			||||||
  "flags": ["set_shell_var", ],
 | 
					  "flags": ["set_shell_var", ],
 | 
				
			||||||
  "var_name": "GCC5_AARCH64_INSTALL"
 | 
					  "var_name": "GCC5_AARCH64_INSTALL"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
## @file
 | 
					## @file
 | 
				
			||||||
# Download GCC ARM compiler from Linaro's release site
 | 
					# Download GCC ARM compiler from Arm's release site
 | 
				
			||||||
# Set shell variable GCC5_ARM_INSTALL to this folder
 | 
					# Set shell variable GCC5_ARM_INSTALL to this folder
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# This is only downloaded when a build activates scope gcc_arm_linux
 | 
					# This is only downloaded when a build activates scope gcc_arm_linux
 | 
				
			||||||
@@ -11,11 +11,11 @@
 | 
				
			|||||||
  "scope": "gcc_arm_linux",
 | 
					  "scope": "gcc_arm_linux",
 | 
				
			||||||
  "type": "web",
 | 
					  "type": "web",
 | 
				
			||||||
  "name": "gcc_arm_linux",
 | 
					  "name": "gcc_arm_linux",
 | 
				
			||||||
  "source": "https://releases.linaro.org/components/toolchain/binaries/7.4-2019.02/arm-linux-gnueabihf/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf.tar.xz",
 | 
					  "source": "https://developer.arm.com/-/media/Files/downloads/gnu-a/10.3-2021.07/binrel/gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf.tar.asc",
 | 
				
			||||||
  "version": "7.4.1",
 | 
					  "version": "10.3-2021.07",
 | 
				
			||||||
  "sha256": "3C951CF1941D0FA06D64CC0D5E88612B209D8123B273FA26C16D70BD7BC6B163",
 | 
					  "sha256": "aa074fa8371a4f73fecbd16bd62c8b1945f23289e26414794f130d6ccdf8e39c",
 | 
				
			||||||
  "compression_type": "tar",
 | 
					  "compression_type": "tar",
 | 
				
			||||||
  "internal_path": "/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/",
 | 
					  "internal_path": "/gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf/",
 | 
				
			||||||
  "flags": ["set_shell_var", ],
 | 
					  "flags": ["set_shell_var", ],
 | 
				
			||||||
  "var_name": "GCC5_ARM_INSTALL"
 | 
					  "var_name": "GCC5_ARM_INSTALL"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -57,7 +57,7 @@ class LinuxGcc5ToolChain(IUefiBuildPlugin):
 | 
				
			|||||||
                return 0
 | 
					                return 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            # make GCC5_ARM_PREFIX to align with tools_def.txt
 | 
					            # make GCC5_ARM_PREFIX to align with tools_def.txt
 | 
				
			||||||
            prefix = os.path.join(install_path, "bin", "arm-linux-gnueabihf-")
 | 
					            prefix = os.path.join(install_path, "bin", "arm-none-linux-gnueabihf-")
 | 
				
			||||||
            shell_environment.GetEnvironment().set_shell_var("GCC5_ARM_PREFIX", prefix)
 | 
					            shell_environment.GetEnvironment().set_shell_var("GCC5_ARM_PREFIX", prefix)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # now confirm it exists
 | 
					        # now confirm it exists
 | 
				
			||||||
@@ -80,7 +80,7 @@ class LinuxGcc5ToolChain(IUefiBuildPlugin):
 | 
				
			|||||||
                return 0
 | 
					                return 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            # make GCC5_AARCH64_PREFIX to align with tools_def.txt
 | 
					            # make GCC5_AARCH64_PREFIX to align with tools_def.txt
 | 
				
			||||||
            prefix = os.path.join(install_path, "bin", "aarch64-linux-gnu-")
 | 
					            prefix = os.path.join(install_path, "bin", "aarch64-none-linux-gnu-")
 | 
				
			||||||
            shell_environment.GetEnvironment().set_shell_var("GCC5_AARCH64_PREFIX", prefix)
 | 
					            shell_environment.GetEnvironment().set_shell_var("GCC5_AARCH64_PREFIX", prefix)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # now confirm it exists
 | 
					        # now confirm it exists
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -142,7 +142,7 @@ class parser_lst(object):
 | 
				
			|||||||
                      line.append(struct)
 | 
					                      line.append(struct)
 | 
				
			||||||
                      unparse.append(line)
 | 
					                      unparse.append(line)
 | 
				
			||||||
                  else:
 | 
					                  else:
 | 
				
			||||||
                    if uint not in ['UINT8', 'UINT16', 'UINT32', 'UINT64']:
 | 
					                    if uint not in ['UINT8', 'UINT16', 'UINT32', 'UINT64', 'BOOLEAN']:
 | 
				
			||||||
                      line = [offset, t_name, 0, uint]
 | 
					                      line = [offset, t_name, 0, uint]
 | 
				
			||||||
                      line.append(struct)
 | 
					                      line.append(struct)
 | 
				
			||||||
                      unparse.append(line)
 | 
					                      unparse.append(line)
 | 
				
			||||||
@@ -569,7 +569,7 @@ class mainprocess(object):
 | 
				
			|||||||
    for i in List:
 | 
					    for i in List:
 | 
				
			||||||
      for j in i:
 | 
					      for j in i:
 | 
				
			||||||
        tmp = j.split("|")
 | 
					        tmp = j.split("|")
 | 
				
			||||||
        if (('L"' in j) and ("[" in j)) or (tmp[1].strip() == '{0x0, 0x0}'):
 | 
					        if (('L"' in j) and ("[" in j)) or (tmp[1].split("#")[0].strip() == '{0x0, 0x0}'):
 | 
				
			||||||
          tmp[0] = tmp[0][:tmp[0].index('[')]
 | 
					          tmp[0] = tmp[0][:tmp[0].index('[')]
 | 
				
			||||||
          List[List.index(i)][i.index(j)] = "|".join(tmp)
 | 
					          List[List.index(i)][i.index(j)] = "|".join(tmp)
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -46,7 +46,10 @@ UPSTREAMS = [
 | 
				
			|||||||
     'list': 'devel@edk2.groups.io', 'prefix': 'edk2-platforms'},
 | 
					     'list': 'devel@edk2.groups.io', 'prefix': 'edk2-platforms'},
 | 
				
			||||||
    {'name': 'edk2-non-osi',
 | 
					    {'name': 'edk2-non-osi',
 | 
				
			||||||
     'repo': 'https://github.com/tianocore/edk2-non-osi.git',
 | 
					     'repo': 'https://github.com/tianocore/edk2-non-osi.git',
 | 
				
			||||||
     'list': 'devel@edk2.groups.io', 'prefix': 'edk2-non-osi'}
 | 
					     'list': 'devel@edk2.groups.io', 'prefix': 'edk2-non-osi'},
 | 
				
			||||||
 | 
					    {'name': 'edk2-test',
 | 
				
			||||||
 | 
					     'repo': 'https://github.com/tianocore/edk2-test.git',
 | 
				
			||||||
 | 
					     'list': 'devel@edk2.groups.io', 'prefix': 'edk2-test'}
 | 
				
			||||||
    ]
 | 
					    ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# The minimum version required for all of the below options to work
 | 
					# The minimum version required for all of the below options to work
 | 
				
			||||||
 
 | 
				
			|||||||
 Submodule BaseTools/Source/C/BrotliCompress/brotli updated: aa7b018dcb...666c3280cc
									
								
							@@ -13,14 +13,6 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o DevicePathFromText.o  DevicePathUtili
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
include $(MAKEROOT)/Makefiles/app.makefile
 | 
					include $(MAKEROOT)/Makefiles/app.makefile
 | 
				
			||||||
 | 
					
 | 
				
			||||||
GCCVERSION = $(shell gcc -dumpversion | awk -F'.' '{print $$1}')
 | 
					 | 
				
			||||||
ifneq ("$(GCCVERSION)", "5")
 | 
					 | 
				
			||||||
ifneq ($(CXX), llvm)
 | 
					 | 
				
			||||||
# gcc 12 trips over device path handling
 | 
					 | 
				
			||||||
BUILD_CFLAGS += -Wno-error=stringop-overflow
 | 
					 | 
				
			||||||
endif
 | 
					 | 
				
			||||||
endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
LIBS = -lCommon
 | 
					LIBS = -lCommon
 | 
				
			||||||
ifeq ($(CYGWIN), CYGWIN)
 | 
					ifeq ($(CYGWIN), CYGWIN)
 | 
				
			||||||
  LIBS += -L/lib/e2fsprogs -luuid
 | 
					  LIBS += -L/lib/e2fsprogs -luuid
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -542,7 +542,7 @@ GetAlignmentFromFile(char *InFile, UINT32 *Alignment)
 | 
				
			|||||||
  PeFileBuffer = (UINT8 *) malloc (PeFileSize);
 | 
					  PeFileBuffer = (UINT8 *) malloc (PeFileSize);
 | 
				
			||||||
  if (PeFileBuffer == NULL) {
 | 
					  if (PeFileBuffer == NULL) {
 | 
				
			||||||
    fclose (InFileHandle);
 | 
					    fclose (InFileHandle);
 | 
				
			||||||
    Error(NULL, 0, 4001, "Resource", "memory cannot be allocated for %s", InFile);
 | 
					    Error(NULL, 0, 4001, "Resource", "memory cannot be allocated  of %s", InFileHandle);
 | 
				
			||||||
    return EFI_OUT_OF_RESOURCES;
 | 
					    return EFI_OUT_OF_RESOURCES;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  fread (PeFileBuffer, sizeof (UINT8), PeFileSize, InFileHandle);
 | 
					  fread (PeFileBuffer, sizeof (UINT8), PeFileSize, InFileHandle);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1062,7 +1062,7 @@ GetAlignmentFromFile(char *InFile, UINT32 *Alignment)
 | 
				
			|||||||
  PeFileBuffer = (UINT8 *) malloc (PeFileSize);
 | 
					  PeFileBuffer = (UINT8 *) malloc (PeFileSize);
 | 
				
			||||||
  if (PeFileBuffer == NULL) {
 | 
					  if (PeFileBuffer == NULL) {
 | 
				
			||||||
    fclose (InFileHandle);
 | 
					    fclose (InFileHandle);
 | 
				
			||||||
    Error(NULL, 0, 4001, "Resource", "memory cannot be allocated for %s", InFile);
 | 
					    Error(NULL, 0, 4001, "Resource", "memory cannot be allocated  of %s", InFileHandle);
 | 
				
			||||||
    return EFI_OUT_OF_RESOURCES;
 | 
					    return EFI_OUT_OF_RESOURCES;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  fread (PeFileBuffer, sizeof (UINT8), PeFileSize, InFileHandle);
 | 
					  fread (PeFileBuffer, sizeof (UINT8), PeFileSize, InFileHandle);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2825,13 +2825,12 @@ SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, BoolInt reInit,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  nowPos64 = p->nowPos64;
 | 
					  nowPos64 = p->nowPos64;
 | 
				
			||||||
  RangeEnc_Init(&p->rc);
 | 
					  RangeEnc_Init(&p->rc);
 | 
				
			||||||
 | 
					  p->rc.outStream = &outStream.vt;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (desiredPackSize == 0)
 | 
					  if (desiredPackSize == 0)
 | 
				
			||||||
    return SZ_ERROR_OUTPUT_EOF;
 | 
					    return SZ_ERROR_OUTPUT_EOF;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  p->rc.outStream = &outStream.vt;
 | 
					 | 
				
			||||||
  res = LzmaEnc_CodeOneBlock(p, desiredPackSize, *unpackSize);
 | 
					  res = LzmaEnc_CodeOneBlock(p, desiredPackSize, *unpackSize);
 | 
				
			||||||
  p->rc.outStream = NULL;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  *unpackSize = (UInt32)(p->nowPos64 - nowPos64);
 | 
					  *unpackSize = (UInt32)(p->nowPos64 - nowPos64);
 | 
				
			||||||
  *destLen -= outStream.rem;
 | 
					  *destLen -= outStream.rem;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1135,6 +1135,8 @@ CVfrVarDataTypeDB::DataTypeAddBitField (
 | 
				
			|||||||
  if (FieldName != NULL) {
 | 
					  if (FieldName != NULL) {
 | 
				
			||||||
    strncpy (pNewField->mFieldName, FieldName, MAX_NAME_LEN - 1);
 | 
					    strncpy (pNewField->mFieldName, FieldName, MAX_NAME_LEN - 1);
 | 
				
			||||||
    pNewField->mFieldName[MAX_NAME_LEN - 1] = 0;
 | 
					    pNewField->mFieldName[MAX_NAME_LEN - 1] = 0;
 | 
				
			||||||
 | 
					  } else {
 | 
				
			||||||
 | 
					    strncpy (pNewField->mFieldName, "", MAX_NAME_LEN - 1);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  pNewField->mFieldType    = pFieldType;
 | 
					  pNewField->mFieldType    = pFieldType;
 | 
				
			||||||
  pNewField->mIsBitField   = TRUE;
 | 
					  pNewField->mIsBitField   = TRUE;
 | 
				
			||||||
@@ -3916,5 +3918,3 @@ CVfrStringDB::GetUnicodeStringTextSize (
 | 
				
			|||||||
CVfrVarDataTypeDB gCVfrVarDataTypeDB;
 | 
					CVfrVarDataTypeDB gCVfrVarDataTypeDB;
 | 
				
			||||||
CVfrDefaultStore  gCVfrDefaultStore;
 | 
					CVfrDefaultStore  gCVfrDefaultStore;
 | 
				
			||||||
CVfrDataStorage  gCVfrDataStorage;
 | 
					CVfrDataStorage  gCVfrDataStorage;
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,7 +2,7 @@
 | 
				
			|||||||
# Create makefile for MS nmake and GNU make
 | 
					# Create makefile for MS nmake and GNU make
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
 | 
					# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
 | 
				
			||||||
# Copyright (c) 2020, ARM Limited. All rights reserved.<BR>
 | 
					# Copyright (c) 2020 - 2021, Arm Limited. All rights reserved.<BR>
 | 
				
			||||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
					# SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -177,11 +177,11 @@ class BuildFile(object):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        MakePath = AutoGenObject.BuildOption.get('MAKE', {}).get('PATH')
 | 
					        MakePath = AutoGenObject.BuildOption.get('MAKE', {}).get('PATH')
 | 
				
			||||||
        if not MakePath:
 | 
					        if not MakePath:
 | 
				
			||||||
            self._FileType = ""
 | 
					            MakePath = AutoGenObject.ToolDefinition.get('MAKE', {}).get('PATH')
 | 
				
			||||||
        elif "nmake" in MakePath:
 | 
					        if "nmake" in MakePath:
 | 
				
			||||||
            self._FileType = NMAKE_FILETYPE
 | 
					            self._FileType = NMAKE_FILETYPE
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            self._FileType = "gmake"
 | 
					            self._FileType = GMAKE_FILETYPE
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if sys.platform == "win32":
 | 
					        if sys.platform == "win32":
 | 
				
			||||||
            self._Platform = WIN32_PLATFORM
 | 
					            self._Platform = WIN32_PLATFORM
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -15,6 +15,7 @@ from Common.VariableAttributes import VariableAttributes
 | 
				
			|||||||
from Common.Misc import *
 | 
					from Common.Misc import *
 | 
				
			||||||
import collections
 | 
					import collections
 | 
				
			||||||
import Common.DataType as DataType
 | 
					import Common.DataType as DataType
 | 
				
			||||||
 | 
					import Common.GlobalData as GlobalData
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var_info = collections.namedtuple("uefi_var", "pcdindex,pcdname,defaultstoragename,skuname,var_name, var_guid, var_offset,var_attribute,pcd_default_value, default_value, data_type,PcdDscLine,StructurePcd")
 | 
					var_info = collections.namedtuple("uefi_var", "pcdindex,pcdname,defaultstoragename,skuname,var_name, var_guid, var_offset,var_attribute,pcd_default_value, default_value, data_type,PcdDscLine,StructurePcd")
 | 
				
			||||||
NvStorageHeaderSize = 28
 | 
					NvStorageHeaderSize = 28
 | 
				
			||||||
@@ -173,11 +174,16 @@ class VariableMgr(object):
 | 
				
			|||||||
            offset += VariableHeaderSize + len(default_info.var_name.split(","))
 | 
					            offset += VariableHeaderSize + len(default_info.var_name.split(","))
 | 
				
			||||||
            var_data_offset[default_info.pcdindex] = offset
 | 
					            var_data_offset[default_info.pcdindex] = offset
 | 
				
			||||||
            offset += data_size - len(default_info.var_name.split(","))
 | 
					            offset += data_size - len(default_info.var_name.split(","))
 | 
				
			||||||
 | 
					            if GlobalData.gCommandLineDefines.get(TAB_DSC_DEFINES_VPD_AUTHENTICATED_VARIABLE_STORE,"FALSE").upper() == "TRUE":
 | 
				
			||||||
            var_header_buffer = VariableMgr.PACK_VARIABLE_HEADER(var_attr_value, len(default_info.var_name.split(",")), len (default_data), vendorguid)
 | 
					                var_header_buffer = VariableMgr.PACK_AUTHENTICATED_VARIABLE_HEADER(var_attr_value, len(default_info.var_name.split(",")), len (default_data), vendorguid)
 | 
				
			||||||
 | 
					            else:
 | 
				
			||||||
 | 
					                var_header_buffer = VariableMgr.PACK_VARIABLE_HEADER(var_attr_value, len(default_info.var_name.split(",")), len (default_data), vendorguid)
 | 
				
			||||||
            NvStoreDataBuffer += (var_header_buffer + DataBuffer)
 | 
					            NvStoreDataBuffer += (var_header_buffer + DataBuffer)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        variable_storage_header_buffer = VariableMgr.PACK_VARIABLE_STORE_HEADER(len(NvStoreDataBuffer) + 28)
 | 
					        if GlobalData.gCommandLineDefines.get(TAB_DSC_DEFINES_VPD_AUTHENTICATED_VARIABLE_STORE,"FALSE").upper() == "TRUE":
 | 
				
			||||||
 | 
					            variable_storage_header_buffer = VariableMgr.PACK_AUTHENTICATED_VARIABLE_STORE_HEADER(len(NvStoreDataBuffer) + 28)
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            variable_storage_header_buffer = VariableMgr.PACK_VARIABLE_STORE_HEADER(len(NvStoreDataBuffer) + 28)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        nv_default_part = VariableMgr.AlignData(VariableMgr.PACK_DEFAULT_DATA(0, 0, VariableMgr.unpack_data(variable_storage_header_buffer+NvStoreDataBuffer)), 8)
 | 
					        nv_default_part = VariableMgr.AlignData(VariableMgr.PACK_DEFAULT_DATA(0, 0, VariableMgr.unpack_data(variable_storage_header_buffer+NvStoreDataBuffer)), 8)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -252,6 +258,20 @@ class VariableMgr(object):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        return GuidBuffer + SizeBuffer + FormatBuffer + StateBuffer + reservedBuffer
 | 
					        return GuidBuffer + SizeBuffer + FormatBuffer + StateBuffer + reservedBuffer
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def PACK_AUTHENTICATED_VARIABLE_STORE_HEADER(size):
 | 
				
			||||||
 | 
					        #Signature: gEfiAuthenticatedVariableGuid
 | 
				
			||||||
 | 
					        Guid = "{ 0xaaf32c78, 0x947b, 0x439a, { 0xa1, 0x80, 0x2e, 0x14, 0x4e, 0xc3, 0x77, 0x92 }}"
 | 
				
			||||||
 | 
					        Guid = GuidStructureStringToGuidString(Guid)
 | 
				
			||||||
 | 
					        GuidBuffer = PackGUID(Guid.split('-'))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        SizeBuffer = pack('=L', size)
 | 
				
			||||||
 | 
					        FormatBuffer = pack('=B', 0x5A)
 | 
				
			||||||
 | 
					        StateBuffer = pack('=B', 0xFE)
 | 
				
			||||||
 | 
					        reservedBuffer = pack('=H', 0)
 | 
				
			||||||
 | 
					        reservedBuffer += pack('=L', 0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return GuidBuffer + SizeBuffer + FormatBuffer + StateBuffer + reservedBuffer
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @staticmethod
 | 
					    @staticmethod
 | 
				
			||||||
    def PACK_NV_STORE_DEFAULT_HEADER(size, maxsize):
 | 
					    def PACK_NV_STORE_DEFAULT_HEADER(size, maxsize):
 | 
				
			||||||
        Signature = pack('=B', ord('N'))
 | 
					        Signature = pack('=B', ord('N'))
 | 
				
			||||||
@@ -279,6 +299,37 @@ class VariableMgr(object):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        return Buffer
 | 
					        return Buffer
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @staticmethod
 | 
				
			||||||
 | 
					    def PACK_AUTHENTICATED_VARIABLE_HEADER(attribute, namesize, datasize, vendorguid):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Buffer = pack('=H', 0x55AA)    # pack StartID
 | 
				
			||||||
 | 
					        Buffer += pack('=B', 0x3F)     # pack State
 | 
				
			||||||
 | 
					        Buffer += pack('=B', 0)        # pack reserved
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Buffer += pack('=L', attribute)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Buffer += pack('=Q', 0)        # pack MonotonicCount
 | 
				
			||||||
 | 
					        Buffer += pack('=HBBBBBBLhBB', # pack TimeStamp
 | 
				
			||||||
 | 
					                         0,            # UINT16 Year
 | 
				
			||||||
 | 
					                         0,            # UINT8  Month
 | 
				
			||||||
 | 
					                         0,            # UINT8  Day
 | 
				
			||||||
 | 
					                         0,            # UINT8  Hour
 | 
				
			||||||
 | 
					                         0,            # UINT8  Minute
 | 
				
			||||||
 | 
					                         0,            # UINT8  Second
 | 
				
			||||||
 | 
					                         0,            # UINT8  Pad1
 | 
				
			||||||
 | 
					                         0,            # UINT32 Nanosecond
 | 
				
			||||||
 | 
					                         0,            # INT16  TimeZone
 | 
				
			||||||
 | 
					                         0,            # UINT8  Daylight
 | 
				
			||||||
 | 
					                         0)            # UINT8  Pad2
 | 
				
			||||||
 | 
					        Buffer += pack('=L', 0)        # pack PubKeyIndex
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Buffer += pack('=L', namesize)
 | 
				
			||||||
 | 
					        Buffer += pack('=L', datasize)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Buffer += PackGUID(vendorguid)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return Buffer
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @staticmethod
 | 
					    @staticmethod
 | 
				
			||||||
    def PACK_VARIABLES_DATA(var_value,data_type, tail = None):
 | 
					    def PACK_VARIABLES_DATA(var_value,data_type, tail = None):
 | 
				
			||||||
        Buffer = bytearray()
 | 
					        Buffer = bytearray()
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -254,7 +254,6 @@ class ModuleAutoGen(AutoGen):
 | 
				
			|||||||
        self.AutoGenDepSet = set()
 | 
					        self.AutoGenDepSet = set()
 | 
				
			||||||
        self.ReferenceModules = []
 | 
					        self.ReferenceModules = []
 | 
				
			||||||
        self.ConstPcd                  = {}
 | 
					        self.ConstPcd                  = {}
 | 
				
			||||||
        self.Makefile         = None
 | 
					 | 
				
			||||||
        self.FileDependCache  = {}
 | 
					        self.FileDependCache  = {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __init_platform_info__(self):
 | 
					    def __init_platform_info__(self):
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -406,6 +406,7 @@ TAB_DSC_DEFINES_SKUID_IDENTIFIER = 'SKUID_IDENTIFIER'
 | 
				
			|||||||
TAB_DSC_DEFINES_PCD_INFO_GENERATION = 'PCD_INFO_GENERATION'
 | 
					TAB_DSC_DEFINES_PCD_INFO_GENERATION = 'PCD_INFO_GENERATION'
 | 
				
			||||||
TAB_DSC_DEFINES_PCD_DYNAMIC_AS_DYNAMICEX = 'PCD_DYNAMIC_AS_DYNAMICEX'
 | 
					TAB_DSC_DEFINES_PCD_DYNAMIC_AS_DYNAMICEX = 'PCD_DYNAMIC_AS_DYNAMICEX'
 | 
				
			||||||
TAB_DSC_DEFINES_PCD_VAR_CHECK_GENERATION = 'PCD_VAR_CHECK_GENERATION'
 | 
					TAB_DSC_DEFINES_PCD_VAR_CHECK_GENERATION = 'PCD_VAR_CHECK_GENERATION'
 | 
				
			||||||
 | 
					TAB_DSC_DEFINES_VPD_AUTHENTICATED_VARIABLE_STORE = 'VPD_AUTHENTICATED_VARIABLE_STORE'
 | 
				
			||||||
TAB_DSC_DEFINES_FLASH_DEFINITION = 'FLASH_DEFINITION'
 | 
					TAB_DSC_DEFINES_FLASH_DEFINITION = 'FLASH_DEFINITION'
 | 
				
			||||||
TAB_DSC_DEFINES_BUILD_NUMBER = 'BUILD_NUMBER'
 | 
					TAB_DSC_DEFINES_BUILD_NUMBER = 'BUILD_NUMBER'
 | 
				
			||||||
TAB_DSC_DEFINES_MAKEFILE_NAME = 'MAKEFILE_NAME'
 | 
					TAB_DSC_DEFINES_MAKEFILE_NAME = 'MAKEFILE_NAME'
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -105,7 +105,7 @@ class Ecc(object):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    def InitDefaultConfigIni(self):
 | 
					    def InitDefaultConfigIni(self):
 | 
				
			||||||
        paths = map(lambda p: os.path.join(p, 'Ecc', 'config.ini'), sys.path)
 | 
					        paths = map(lambda p: os.path.join(p, 'Ecc', 'config.ini'), sys.path)
 | 
				
			||||||
        paths = (os.path.realpath('config.ini'),) + tuple(paths)
 | 
					        paths = (os.path.abspath('config.ini'),) + tuple(paths)
 | 
				
			||||||
        for path in paths:
 | 
					        for path in paths:
 | 
				
			||||||
            if os.path.exists(path):
 | 
					            if os.path.exists(path):
 | 
				
			||||||
                self.ConfigFile = path
 | 
					                self.ConfigFile = path
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -152,11 +152,11 @@ class CompressedImage(Image):
 | 
				
			|||||||
        try:
 | 
					        try:
 | 
				
			||||||
            TmpData = DeCompress('Efi', self[self._HEADER_SIZE_:])
 | 
					            TmpData = DeCompress('Efi', self[self._HEADER_SIZE_:])
 | 
				
			||||||
            DecData = array('B')
 | 
					            DecData = array('B')
 | 
				
			||||||
            DecData.frombytes(TmpData)
 | 
					            DecData.fromstring(TmpData)
 | 
				
			||||||
        except:
 | 
					        except:
 | 
				
			||||||
            TmpData = DeCompress('Framework', self[self._HEADER_SIZE_:])
 | 
					            TmpData = DeCompress('Framework', self[self._HEADER_SIZE_:])
 | 
				
			||||||
            DecData = array('B')
 | 
					            DecData = array('B')
 | 
				
			||||||
            DecData.frombytes(TmpData)
 | 
					            DecData.fromstring(TmpData)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        SectionList = []
 | 
					        SectionList = []
 | 
				
			||||||
        Offset = 0
 | 
					        Offset = 0
 | 
				
			||||||
@@ -196,7 +196,7 @@ class Ui(Image):
 | 
				
			|||||||
        return len(self)
 | 
					        return len(self)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def _GetUiString(self):
 | 
					    def _GetUiString(self):
 | 
				
			||||||
        return codecs.utf_16_decode(self[0:-2].tobytes())[0]
 | 
					        return codecs.utf_16_decode(self[0:-2].tostring())[0]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    String = property(_GetUiString)
 | 
					    String = property(_GetUiString)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -738,7 +738,7 @@ class GuidDefinedImage(Image):
 | 
				
			|||||||
                Offset = self.DataOffset - 4
 | 
					                Offset = self.DataOffset - 4
 | 
				
			||||||
                TmpData = DeCompress('Framework', self[self.Offset:])
 | 
					                TmpData = DeCompress('Framework', self[self.Offset:])
 | 
				
			||||||
                DecData = array('B')
 | 
					                DecData = array('B')
 | 
				
			||||||
                DecData.frombytes(TmpData)
 | 
					                DecData.fromstring(TmpData)
 | 
				
			||||||
                Offset = 0
 | 
					                Offset = 0
 | 
				
			||||||
                while Offset < len(DecData):
 | 
					                while Offset < len(DecData):
 | 
				
			||||||
                    Sec = Section()
 | 
					                    Sec = Section()
 | 
				
			||||||
@@ -759,7 +759,7 @@ class GuidDefinedImage(Image):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                TmpData = DeCompress('Lzma', self[self.Offset:])
 | 
					                TmpData = DeCompress('Lzma', self[self.Offset:])
 | 
				
			||||||
                DecData = array('B')
 | 
					                DecData = array('B')
 | 
				
			||||||
                DecData.frombytes(TmpData)
 | 
					                DecData.fromstring(TmpData)
 | 
				
			||||||
                Offset = 0
 | 
					                Offset = 0
 | 
				
			||||||
                while Offset < len(DecData):
 | 
					                while Offset < len(DecData):
 | 
				
			||||||
                    Sec = Section()
 | 
					                    Sec = Section()
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -707,8 +707,8 @@ class FfsInfStatement(FfsInfStatementClassObject):
 | 
				
			|||||||
                                  FileName,
 | 
					                                  FileName,
 | 
				
			||||||
                                  'DEBUG'
 | 
					                                  'DEBUG'
 | 
				
			||||||
                                  )
 | 
					                                  )
 | 
				
			||||||
        OutputPath = os.path.realpath(OutputPath)
 | 
					        OutputPath = os.path.abspath(OutputPath)
 | 
				
			||||||
        DebugPath = os.path.realpath(DebugPath)
 | 
					        DebugPath = os.path.abspath(DebugPath)
 | 
				
			||||||
        return OutputPath, DebugPath
 | 
					        return OutputPath, DebugPath
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ## __GenSimpleFileSection__() method
 | 
					    ## __GenSimpleFileSection__() method
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -20,7 +20,7 @@ from linecache import getlines
 | 
				
			|||||||
from io import BytesIO
 | 
					from io import BytesIO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import Common.LongFilePathOs as os
 | 
					import Common.LongFilePathOs as os
 | 
				
			||||||
from Common.TargetTxtClassObject import TargetTxtDict
 | 
					from Common.TargetTxtClassObject import TargetTxtDict,gDefaultTargetTxtFile
 | 
				
			||||||
from Common.DataType import *
 | 
					from Common.DataType import *
 | 
				
			||||||
import Common.GlobalData as GlobalData
 | 
					import Common.GlobalData as GlobalData
 | 
				
			||||||
from Common import EdkLogger
 | 
					from Common import EdkLogger
 | 
				
			||||||
@@ -153,7 +153,7 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=None):
 | 
				
			|||||||
            FdfFilename = GenFdsGlobalVariable.ReplaceWorkspaceMacro(FdfFilename)
 | 
					            FdfFilename = GenFdsGlobalVariable.ReplaceWorkspaceMacro(FdfFilename)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if FdfFilename[0:2] == '..':
 | 
					            if FdfFilename[0:2] == '..':
 | 
				
			||||||
                FdfFilename = os.path.realpath(FdfFilename)
 | 
					                FdfFilename = os.path.abspath(FdfFilename)
 | 
				
			||||||
            if not os.path.isabs(FdfFilename):
 | 
					            if not os.path.isabs(FdfFilename):
 | 
				
			||||||
                FdfFilename = mws.join(GenFdsGlobalVariable.WorkSpaceDir, FdfFilename)
 | 
					                FdfFilename = mws.join(GenFdsGlobalVariable.WorkSpaceDir, FdfFilename)
 | 
				
			||||||
            if not os.path.exists(FdfFilename):
 | 
					            if not os.path.exists(FdfFilename):
 | 
				
			||||||
@@ -175,7 +175,7 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=None):
 | 
				
			|||||||
            ActivePlatform = GenFdsGlobalVariable.ReplaceWorkspaceMacro(ActivePlatform)
 | 
					            ActivePlatform = GenFdsGlobalVariable.ReplaceWorkspaceMacro(ActivePlatform)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if ActivePlatform[0:2] == '..':
 | 
					            if ActivePlatform[0:2] == '..':
 | 
				
			||||||
                ActivePlatform = os.path.realpath(ActivePlatform)
 | 
					                ActivePlatform = os.path.abspath(ActivePlatform)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if not os.path.isabs (ActivePlatform):
 | 
					            if not os.path.isabs (ActivePlatform):
 | 
				
			||||||
                ActivePlatform = mws.join(GenFdsGlobalVariable.WorkSpaceDir, ActivePlatform)
 | 
					                ActivePlatform = mws.join(GenFdsGlobalVariable.WorkSpaceDir, ActivePlatform)
 | 
				
			||||||
@@ -207,7 +207,7 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=None):
 | 
				
			|||||||
        GenFdsGlobalVariable.ConfDir = ConfDirectoryPath
 | 
					        GenFdsGlobalVariable.ConfDir = ConfDirectoryPath
 | 
				
			||||||
        if not GlobalData.gConfDirectory:
 | 
					        if not GlobalData.gConfDirectory:
 | 
				
			||||||
            GlobalData.gConfDirectory = GenFdsGlobalVariable.ConfDir
 | 
					            GlobalData.gConfDirectory = GenFdsGlobalVariable.ConfDir
 | 
				
			||||||
        BuildConfigurationFile = os.path.normpath(os.path.join(ConfDirectoryPath, "target.txt"))
 | 
					        BuildConfigurationFile = os.path.normpath(os.path.join(ConfDirectoryPath, gDefaultTargetTxtFile))
 | 
				
			||||||
        if os.path.isfile(BuildConfigurationFile) == True:
 | 
					        if os.path.isfile(BuildConfigurationFile) == True:
 | 
				
			||||||
            # if no build target given in command line, get it from target.txt
 | 
					            # if no build target given in command line, get it from target.txt
 | 
				
			||||||
            TargetObj = TargetTxtDict()
 | 
					            TargetObj = TargetTxtDict()
 | 
				
			||||||
@@ -299,7 +299,7 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=None):
 | 
				
			|||||||
        for Key in GenFdsGlobalVariable.OutputDirDict:
 | 
					        for Key in GenFdsGlobalVariable.OutputDirDict:
 | 
				
			||||||
            OutputDir = GenFdsGlobalVariable.OutputDirDict[Key]
 | 
					            OutputDir = GenFdsGlobalVariable.OutputDirDict[Key]
 | 
				
			||||||
            if OutputDir[0:2] == '..':
 | 
					            if OutputDir[0:2] == '..':
 | 
				
			||||||
                OutputDir = os.path.realpath(OutputDir)
 | 
					                OutputDir = os.path.abspath(OutputDir)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if OutputDir[1] != ':':
 | 
					            if OutputDir[1] != ':':
 | 
				
			||||||
                OutputDir = os.path.join (GenFdsGlobalVariable.WorkSpaceDir, OutputDir)
 | 
					                OutputDir = os.path.join (GenFdsGlobalVariable.WorkSpaceDir, OutputDir)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -24,7 +24,7 @@ from Common import EdkLogger
 | 
				
			|||||||
from Common.Misc import SaveFileOnChange
 | 
					from Common.Misc import SaveFileOnChange
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from Common.TargetTxtClassObject import TargetTxtDict
 | 
					from Common.TargetTxtClassObject import TargetTxtDict
 | 
				
			||||||
from Common.ToolDefClassObject import ToolDefDict
 | 
					from Common.ToolDefClassObject import ToolDefDict,gDefaultToolsDefFile
 | 
				
			||||||
from AutoGen.BuildEngine import ToolBuildRule
 | 
					from AutoGen.BuildEngine import ToolBuildRule
 | 
				
			||||||
import Common.DataType as DataType
 | 
					import Common.DataType as DataType
 | 
				
			||||||
from Common.Misc import PathClass,CreateDirectory
 | 
					from Common.Misc import PathClass,CreateDirectory
 | 
				
			||||||
@@ -103,7 +103,7 @@ class GenFdsGlobalVariable:
 | 
				
			|||||||
        TargetObj = TargetTxtDict()
 | 
					        TargetObj = TargetTxtDict()
 | 
				
			||||||
        ToolDefinitionFile = TargetObj.Target.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_TOOL_CHAIN_CONF]
 | 
					        ToolDefinitionFile = TargetObj.Target.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_TOOL_CHAIN_CONF]
 | 
				
			||||||
        if ToolDefinitionFile == '':
 | 
					        if ToolDefinitionFile == '':
 | 
				
			||||||
            ToolDefinitionFile = "Conf/tools_def.txt"
 | 
					            ToolDefinitionFile =  os.path.join('Conf', gDefaultToolsDefFile)
 | 
				
			||||||
        if os.path.isfile(ToolDefinitionFile):
 | 
					        if os.path.isfile(ToolDefinitionFile):
 | 
				
			||||||
            ToolDefObj = ToolDefDict((os.path.join(os.getenv("WORKSPACE"), "Conf")))
 | 
					            ToolDefObj = ToolDefDict((os.path.join(os.getenv("WORKSPACE"), "Conf")))
 | 
				
			||||||
            ToolDefinition = ToolDefObj.ToolDef.ToolsDefTxtDatabase
 | 
					            ToolDefinition = ToolDefObj.ToolDef.ToolsDefTxtDatabase
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,6 +17,7 @@ import Common.BuildToolError as BuildToolError
 | 
				
			|||||||
from Common.DataType import *
 | 
					from Common.DataType import *
 | 
				
			||||||
from Common.BuildVersion import gBUILD_VERSION
 | 
					from Common.BuildVersion import gBUILD_VERSION
 | 
				
			||||||
from Common.LongFilePathSupport import OpenLongFilePath as open
 | 
					from Common.LongFilePathSupport import OpenLongFilePath as open
 | 
				
			||||||
 | 
					from Common.TargetTxtClassObject import gDefaultTargetTxtFile
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# To Do 1.set clean, 2. add item, if the line is disabled.
 | 
					# To Do 1.set clean, 2. add item, if the line is disabled.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -25,7 +26,7 @@ class TargetTool():
 | 
				
			|||||||
        self.WorkSpace = os.path.normpath(os.getenv('WORKSPACE'))
 | 
					        self.WorkSpace = os.path.normpath(os.getenv('WORKSPACE'))
 | 
				
			||||||
        self.Opt       = opt
 | 
					        self.Opt       = opt
 | 
				
			||||||
        self.Arg       = args[0]
 | 
					        self.Arg       = args[0]
 | 
				
			||||||
        self.FileName  = os.path.normpath(os.path.join(self.WorkSpace, 'Conf', 'target.txt'))
 | 
					        self.FileName  = os.path.normpath(os.path.join(self.WorkSpace, 'Conf', gDefaultTargetTxtFile))
 | 
				
			||||||
        if os.path.isfile(self.FileName) == False:
 | 
					        if os.path.isfile(self.FileName) == False:
 | 
				
			||||||
            print("%s does not exist." % self.FileName)
 | 
					            print("%s does not exist." % self.FileName)
 | 
				
			||||||
            sys.exit(1)
 | 
					            sys.exit(1)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -590,7 +590,6 @@ class PackageBuildClassObject(BuildData):
 | 
				
			|||||||
# @var OutputDirectory:   To store value for OutputDirectory
 | 
					# @var OutputDirectory:   To store value for OutputDirectory
 | 
				
			||||||
# @var FlashDefinition:   To store value for FlashDefinition
 | 
					# @var FlashDefinition:   To store value for FlashDefinition
 | 
				
			||||||
# @var BuildNumber:       To store value for BuildNumber
 | 
					# @var BuildNumber:       To store value for BuildNumber
 | 
				
			||||||
# @var MakefileName:      To store value for MakefileName
 | 
					 | 
				
			||||||
# @var SkuIds:            To store value for SkuIds, it is a set structure as
 | 
					# @var SkuIds:            To store value for SkuIds, it is a set structure as
 | 
				
			||||||
#                         { 'SkuName' : SkuId, '!include' : includefilename, ...}
 | 
					#                         { 'SkuName' : SkuId, '!include' : includefilename, ...}
 | 
				
			||||||
# @var Modules:           To store value for Modules, it is a list structure as
 | 
					# @var Modules:           To store value for Modules, it is a list structure as
 | 
				
			||||||
@@ -614,7 +613,6 @@ class PlatformBuildClassObject(BuildData):
 | 
				
			|||||||
        self.OutputDirectory         = ''
 | 
					        self.OutputDirectory         = ''
 | 
				
			||||||
        self.FlashDefinition         = ''
 | 
					        self.FlashDefinition         = ''
 | 
				
			||||||
        self.BuildNumber             = ''
 | 
					        self.BuildNumber             = ''
 | 
				
			||||||
        self.MakefileName            = ''
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.SkuIds                  = {}
 | 
					        self.SkuIds                  = {}
 | 
				
			||||||
        self.Modules                 = []
 | 
					        self.Modules                 = []
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19,8 +19,8 @@ from Common.Misc import *
 | 
				
			|||||||
from types import *
 | 
					from types import *
 | 
				
			||||||
from Common.Expression import *
 | 
					from Common.Expression import *
 | 
				
			||||||
from CommonDataClass.CommonClass import SkuInfoClass
 | 
					from CommonDataClass.CommonClass import SkuInfoClass
 | 
				
			||||||
from Common.TargetTxtClassObject import TargetTxtDict
 | 
					from Common.TargetTxtClassObject import TargetTxtDict,gDefaultTargetTxtFile
 | 
				
			||||||
from Common.ToolDefClassObject import ToolDefDict
 | 
					from Common.ToolDefClassObject import ToolDefDict,gDefaultToolsDefFile
 | 
				
			||||||
from .MetaDataTable import *
 | 
					from .MetaDataTable import *
 | 
				
			||||||
from .MetaFileTable import *
 | 
					from .MetaFileTable import *
 | 
				
			||||||
from .MetaFileParser import *
 | 
					from .MetaFileParser import *
 | 
				
			||||||
@@ -387,6 +387,10 @@ class DscBuildData(PlatformBuildClassObject):
 | 
				
			|||||||
                for i in range(0, len(LanguageCodes), 3):
 | 
					                for i in range(0, len(LanguageCodes), 3):
 | 
				
			||||||
                    LanguageList.append(LanguageCodes[i:i + 3])
 | 
					                    LanguageList.append(LanguageCodes[i:i + 3])
 | 
				
			||||||
                self._ISOLanguages = LanguageList
 | 
					                self._ISOLanguages = LanguageList
 | 
				
			||||||
 | 
					            elif Name == TAB_DSC_DEFINES_VPD_AUTHENTICATED_VARIABLE_STORE:
 | 
				
			||||||
 | 
					                if TAB_DSC_DEFINES_VPD_AUTHENTICATED_VARIABLE_STORE not in gCommandLineDefines:
 | 
				
			||||||
 | 
					                    gCommandLineDefines[TAB_DSC_DEFINES_VPD_AUTHENTICATED_VARIABLE_STORE] = Record[2].strip()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            elif Name == TAB_DSC_DEFINES_VPD_TOOL_GUID:
 | 
					            elif Name == TAB_DSC_DEFINES_VPD_TOOL_GUID:
 | 
				
			||||||
                #
 | 
					                #
 | 
				
			||||||
                # try to convert GUID to a real UUID value to see whether the GUID is format
 | 
					                # try to convert GUID to a real UUID value to see whether the GUID is format
 | 
				
			||||||
@@ -3526,12 +3530,11 @@ class DscBuildData(PlatformBuildClassObject):
 | 
				
			|||||||
        self._ToolChainFamily = TAB_COMPILER_MSFT
 | 
					        self._ToolChainFamily = TAB_COMPILER_MSFT
 | 
				
			||||||
        TargetObj = TargetTxtDict()
 | 
					        TargetObj = TargetTxtDict()
 | 
				
			||||||
        TargetTxt = TargetObj.Target
 | 
					        TargetTxt = TargetObj.Target
 | 
				
			||||||
        BuildConfigurationFile = os.path.normpath(os.path.join(GlobalData.gConfDirectory, "target.txt"))
 | 
					        BuildConfigurationFile = os.path.normpath(os.path.join(GlobalData.gConfDirectory, gDefaultTargetTxtFile))
 | 
				
			||||||
        if os.path.isfile(BuildConfigurationFile) == True:
 | 
					        if os.path.isfile(BuildConfigurationFile) == True:
 | 
				
			||||||
            ToolDefinitionFile = TargetTxt.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_TOOL_CHAIN_CONF]
 | 
					            ToolDefinitionFile = TargetTxt.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_TOOL_CHAIN_CONF]
 | 
				
			||||||
            if ToolDefinitionFile == '':
 | 
					            if ToolDefinitionFile == '':
 | 
				
			||||||
                ToolDefinitionFile = "tools_def.txt"
 | 
					                ToolDefinitionFile = os.path.normpath(mws.join(self.WorkspaceDir, 'Conf', gDefaultToolsDefFile))
 | 
				
			||||||
                ToolDefinitionFile = os.path.normpath(mws.join(self.WorkspaceDir, 'Conf', ToolDefinitionFile))
 | 
					 | 
				
			||||||
            if os.path.isfile(ToolDefinitionFile) == True:
 | 
					            if os.path.isfile(ToolDefinitionFile) == True:
 | 
				
			||||||
                ToolDefObj = ToolDefDict((os.path.join(os.getenv("WORKSPACE"), "Conf")))
 | 
					                ToolDefObj = ToolDefDict((os.path.join(os.getenv("WORKSPACE"), "Conf")))
 | 
				
			||||||
                ToolDefinition = ToolDefObj.ToolDef.ToolsDefTxtDatabase
 | 
					                ToolDefinition = ToolDefObj.ToolDef.ToolsDefTxtDatabase
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,7 +4,7 @@
 | 
				
			|||||||
#  Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>
 | 
					#  Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>
 | 
				
			||||||
#  Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
 | 
					#  Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
 | 
				
			||||||
#  Copyright (c) 2018, Hewlett Packard Enterprise Development, L.P.<BR>
 | 
					#  Copyright (c) 2018, Hewlett Packard Enterprise Development, L.P.<BR>
 | 
				
			||||||
#  Copyright (c) 2020, ARM Limited. All rights reserved.<BR>
 | 
					#  Copyright (c) 2020 - 2021, ARM Limited. All rights reserved.<BR>
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
					#  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
@@ -67,10 +67,6 @@ from AutoGen.AutoGen import CalculatePriorityValue
 | 
				
			|||||||
## standard targets of build command
 | 
					## standard targets of build command
 | 
				
			||||||
gSupportedTarget = ['all', 'genc', 'genmake', 'modules', 'libraries', 'fds', 'clean', 'cleanall', 'cleanlib', 'run']
 | 
					gSupportedTarget = ['all', 'genc', 'genmake', 'modules', 'libraries', 'fds', 'clean', 'cleanall', 'cleanlib', 'run']
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## build configuration file
 | 
					 | 
				
			||||||
gBuildConfiguration = "target.txt"
 | 
					 | 
				
			||||||
gToolsDefinition = "tools_def.txt"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
TemporaryTablePattern = re.compile(r'^_\d+_\d+_[a-fA-F0-9]+$')
 | 
					TemporaryTablePattern = re.compile(r'^_\d+_\d+_[a-fA-F0-9]+$')
 | 
				
			||||||
TmpTableDict = {}
 | 
					TmpTableDict = {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1308,6 +1304,9 @@ class Build():
 | 
				
			|||||||
        if Target == 'run':
 | 
					        if Target == 'run':
 | 
				
			||||||
            return True
 | 
					            return True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        # Fetch the MakeFileName.
 | 
				
			||||||
 | 
					        self.MakeFileName = AutoGenObject.MakeFileName
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # build modules
 | 
					        # build modules
 | 
				
			||||||
        if BuildModule:
 | 
					        if BuildModule:
 | 
				
			||||||
            BuildCommand = BuildCommand + [Target]
 | 
					            BuildCommand = BuildCommand + [Target]
 | 
				
			||||||
@@ -2183,8 +2182,6 @@ class Build():
 | 
				
			|||||||
            Pa.CreateLibModuelDirs()
 | 
					            Pa.CreateLibModuelDirs()
 | 
				
			||||||
            # Fetch the MakeFileName.
 | 
					            # Fetch the MakeFileName.
 | 
				
			||||||
            self.MakeFileName = Pa.MakeFileName
 | 
					            self.MakeFileName = Pa.MakeFileName
 | 
				
			||||||
            if not self.MakeFileName:
 | 
					 | 
				
			||||||
                self.MakeFileName = Pa.MakeFile
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Pa.DataPipe.DataContainer = {"LibraryBuildDirectoryList":Pa.LibraryBuildDirectoryList}
 | 
					            Pa.DataPipe.DataContainer = {"LibraryBuildDirectoryList":Pa.LibraryBuildDirectoryList}
 | 
				
			||||||
            Pa.DataPipe.DataContainer = {"ModuleBuildDirectoryList":Pa.ModuleBuildDirectoryList}
 | 
					            Pa.DataPipe.DataContainer = {"ModuleBuildDirectoryList":Pa.ModuleBuildDirectoryList}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -864,15 +864,11 @@ Pkcs7Verify (
 | 
				
			|||||||
  // For generic PKCS#7 handling, InData may be NULL if the content is present
 | 
					  // For generic PKCS#7 handling, InData may be NULL if the content is present
 | 
				
			||||||
  // in PKCS#7 structure. So ignore NULL checking here.
 | 
					  // in PKCS#7 structure. So ignore NULL checking here.
 | 
				
			||||||
  //
 | 
					  //
 | 
				
			||||||
  DataBio = BIO_new (BIO_s_mem ());
 | 
					  DataBio = BIO_new_mem_buf (InData, (int) DataLength);
 | 
				
			||||||
  if (DataBio == NULL) {
 | 
					  if (DataBio == NULL) {
 | 
				
			||||||
    goto _Exit;
 | 
					    goto _Exit;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (BIO_write (DataBio, InData, (int) DataLength) <= 0) {
 | 
					 | 
				
			||||||
    goto _Exit;
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  //
 | 
					  //
 | 
				
			||||||
  // Allow partial certificate chains, terminated by a non-self-signed but
 | 
					  // Allow partial certificate chains, terminated by a non-self-signed but
 | 
				
			||||||
  // still trusted intermediate certificate. Also disable time checks.
 | 
					  // still trusted intermediate certificate. Also disable time checks.
 | 
				
			||||||
 
 | 
				
			|||||||
 Submodule CryptoPkg/Library/OpensslLib/openssl updated: e2e09d9fba...52c587d60b
									
								
							@@ -1,7 +1,7 @@
 | 
				
			|||||||
## @file
 | 
					## @file
 | 
				
			||||||
#  Dsc include file for Dynamic Tables Framework.
 | 
					#  Dsc include file for Dynamic Tables Framework.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  Copyright (c) 2017 - 2020, Arm Limited. All rights reserved.<BR>
 | 
					#  Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.<BR>
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
					#  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
@@ -13,6 +13,7 @@
 | 
				
			|||||||
  RELEASE_*_*_CC_FLAGS     = -DMDEPKG_NDEBUG
 | 
					  RELEASE_*_*_CC_FLAGS     = -DMDEPKG_NDEBUG
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[LibraryClasses.common]
 | 
					[LibraryClasses.common]
 | 
				
			||||||
 | 
					  AcpiHelperLib|DynamicTablesPkg/Library/Common/AcpiHelperLib/AcpiHelperLib.inf
 | 
				
			||||||
  AmlLib|DynamicTablesPkg/Library/Common/AmlLib/AmlLib.inf
 | 
					  AmlLib|DynamicTablesPkg/Library/Common/AmlLib/AmlLib.inf
 | 
				
			||||||
  SsdtSerialPortFixupLib|DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.inf
 | 
					  SsdtSerialPortFixupLib|DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.inf
 | 
				
			||||||
  TableHelperLib|DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf
 | 
					  TableHelperLib|DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf
 | 
				
			||||||
@@ -36,6 +37,9 @@
 | 
				
			|||||||
  DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortLibArm.inf
 | 
					  DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortLibArm.inf
 | 
				
			||||||
  DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn600LibArm.inf
 | 
					  DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn600LibArm.inf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  # AML Codegen
 | 
				
			||||||
 | 
					  DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyLibArm.inf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  #
 | 
					  #
 | 
				
			||||||
  # Dynamic Table Factory Dxe
 | 
					  # Dynamic Table Factory Dxe
 | 
				
			||||||
  #
 | 
					  #
 | 
				
			||||||
@@ -55,6 +59,9 @@
 | 
				
			|||||||
      # AML Fixup
 | 
					      # AML Fixup
 | 
				
			||||||
      NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortLibArm.inf
 | 
					      NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortLibArm.inf
 | 
				
			||||||
      NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn600LibArm.inf
 | 
					      NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn600LibArm.inf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      # AML Codegen
 | 
				
			||||||
 | 
					      NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyLibArm.inf
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  #
 | 
					  #
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,6 +5,28 @@
 | 
				
			|||||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
					# SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    "EccCheck": {
 | 
				
			||||||
 | 
					        ## Exception sample looks like below:
 | 
				
			||||||
 | 
					        ## "ExceptionList": [
 | 
				
			||||||
 | 
					        ##     "<ErrorID>", "<KeyWord>"
 | 
				
			||||||
 | 
					        ## ]
 | 
				
			||||||
 | 
					        "ExceptionList": [
 | 
				
			||||||
 | 
					        # "The #ifndef at the start of an include file should use
 | 
				
			||||||
 | 
					        # both prefix and postfix underscore characters, '_'"
 | 
				
			||||||
 | 
					        # This error is not triggered for the latest BaseTools code.
 | 
				
			||||||
 | 
					        # @TODO The error should be re-enabled when the python packages
 | 
				
			||||||
 | 
					        # containing the BaseTools are updated to the latest version.
 | 
				
			||||||
 | 
					        "8003", "DISABLE_NEW_DEPRECATED_INTERFACES",
 | 
				
			||||||
 | 
					        "9005", "@defgroup",      # Use extra Doxygen commands
 | 
				
			||||||
 | 
					        "9005", "@ingroup",       # Use extra Doxygen commands
 | 
				
			||||||
 | 
					        "9005", "@mainpage",      # Use extra Doxygen commands
 | 
				
			||||||
 | 
					        "9005", "@ref",           # Use extra Doxygen commands
 | 
				
			||||||
 | 
					        ],
 | 
				
			||||||
 | 
					        ## Both file path and directory path are accepted.
 | 
				
			||||||
 | 
					        "IgnoreFiles": [
 | 
				
			||||||
 | 
					        ]
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ## options defined .pytool/Plugin/CompilerPlugin
 | 
					    ## options defined .pytool/Plugin/CompilerPlugin
 | 
				
			||||||
    "CompilerPlugin": {
 | 
					    "CompilerPlugin": {
 | 
				
			||||||
        "DscPath": "DynamicTablesPkg.dsc"
 | 
					        "DscPath": "DynamicTablesPkg.dsc"
 | 
				
			||||||
@@ -23,6 +45,7 @@
 | 
				
			|||||||
    ## options defined .pytool/Plugin/DependencyCheck
 | 
					    ## options defined .pytool/Plugin/DependencyCheck
 | 
				
			||||||
    "DependencyCheck": {
 | 
					    "DependencyCheck": {
 | 
				
			||||||
        "AcceptableDependencies": [
 | 
					        "AcceptableDependencies": [
 | 
				
			||||||
 | 
					            "ArmPkg/ArmPkg.dec",
 | 
				
			||||||
            "ArmPlatformPkg/ArmPlatformPkg.dec",
 | 
					            "ArmPlatformPkg/ArmPlatformPkg.dec",
 | 
				
			||||||
            "EmbeddedPkg/EmbeddedPkg.dec",
 | 
					            "EmbeddedPkg/EmbeddedPkg.dec",
 | 
				
			||||||
            "DynamicTablesPkg/DynamicTablesPkg.dec",
 | 
					            "DynamicTablesPkg/DynamicTablesPkg.dec",
 | 
				
			||||||
@@ -77,19 +100,25 @@
 | 
				
			|||||||
           "CCIDX",
 | 
					           "CCIDX",
 | 
				
			||||||
           "CCSIDR",
 | 
					           "CCSIDR",
 | 
				
			||||||
           "countof",
 | 
					           "countof",
 | 
				
			||||||
 | 
					           "edynamic",
 | 
				
			||||||
           "EOBJECT",
 | 
					           "EOBJECT",
 | 
				
			||||||
           "invoc",
 | 
					           "invoc",
 | 
				
			||||||
 | 
					           "ITARGETSR",
 | 
				
			||||||
           "GTBLOCK",
 | 
					           "GTBLOCK",
 | 
				
			||||||
           "lgreater",
 | 
					           "lgreater",
 | 
				
			||||||
           "lless",
 | 
					           "lless",
 | 
				
			||||||
           "MPIDR",
 | 
					           "MPIDR",
 | 
				
			||||||
           "PERIPHBASE",
 | 
					           "PERIPHBASE",
 | 
				
			||||||
 | 
					           "phandle",
 | 
				
			||||||
           "pytool",
 | 
					           "pytool",
 | 
				
			||||||
 | 
					           "Rdword",
 | 
				
			||||||
           "Roadmap",
 | 
					           "Roadmap",
 | 
				
			||||||
           "ROOTNODEBASE",
 | 
					           "ROOTNODEBASE",
 | 
				
			||||||
           "ssdtcmn",
 | 
					           "ssdtcmn",
 | 
				
			||||||
           "ssdtserialporttemplate",
 | 
					           "ssdtserialporttemplate",
 | 
				
			||||||
           "SMMUV",
 | 
					           "SMMUV",
 | 
				
			||||||
 | 
					           "ssdtpcieosctemplate",
 | 
				
			||||||
 | 
					           "SSDTPC",
 | 
				
			||||||
           "standardised",
 | 
					           "standardised",
 | 
				
			||||||
           "TABLEEX",
 | 
					           "TABLEEX",
 | 
				
			||||||
           "TNSID",
 | 
					           "TNSID",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,6 +17,10 @@
 | 
				
			|||||||
  Include
 | 
					  Include
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[LibraryClasses]
 | 
					[LibraryClasses]
 | 
				
			||||||
 | 
					  ##  @libraryclass  Defines a set of Acpi helper methods
 | 
				
			||||||
 | 
					  #   independent from the Dynamic Tables Framework.
 | 
				
			||||||
 | 
					  AcpiHelperLib|Include/Library/AcpiHelperLib.h
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ##  @libraryclass  Defines a set of APIs for Dynamic AML generation.
 | 
					  ##  @libraryclass  Defines a set of APIs for Dynamic AML generation.
 | 
				
			||||||
  AmlLib|Include/Library/AmlLib/AmlLib.h
 | 
					  AmlLib|Include/Library/AmlLib/AmlLib.h
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -35,9 +35,11 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[LibraryClasses.ARM, LibraryClasses.AARCH64]
 | 
					[LibraryClasses.ARM, LibraryClasses.AARCH64]
 | 
				
			||||||
  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
 | 
					  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
 | 
				
			||||||
 | 
					  NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
 | 
				
			||||||
  PL011UartLib|ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.inf
 | 
					  PL011UartLib|ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.inf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[Components.common]
 | 
					[Components.common]
 | 
				
			||||||
 | 
					  DynamicTablesPkg/Library/Common/AcpiHelperLib/AcpiHelperLib.inf
 | 
				
			||||||
  DynamicTablesPkg/Library/Common/AmlLib/AmlLib.inf
 | 
					  DynamicTablesPkg/Library/Common/AmlLib/AmlLib.inf
 | 
				
			||||||
  DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.inf
 | 
					  DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.inf
 | 
				
			||||||
  DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf
 | 
					  DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf
 | 
				
			||||||
@@ -50,4 +52,3 @@
 | 
				
			|||||||
  # Inhibit C6305: Potential mismatch between sizeof and countof quantities.
 | 
					  # Inhibit C6305: Potential mismatch between sizeof and countof quantities.
 | 
				
			||||||
  *_VS2017_*_CC_FLAGS = /wd6305 /analyze
 | 
					  *_VS2017_*_CC_FLAGS = /wd6305 /analyze
 | 
				
			||||||
!endif
 | 
					!endif
 | 
				
			||||||
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
/** @file
 | 
					/** @file
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Copyright (c) 2017 - 2020, Arm Limited. All rights reserved.<BR>
 | 
					  Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.<BR>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
					  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -63,6 +63,10 @@ The Dynamic Tables Framework implements the following ACPI table generators:
 | 
				
			|||||||
            The SSDT CMN-600 generator collates the CMN-600 information
 | 
					            The SSDT CMN-600 generator collates the CMN-600 information
 | 
				
			||||||
            from the Configuration Manager and patches the SSDT CMN-600
 | 
					            from the Configuration Manager and patches the SSDT CMN-600
 | 
				
			||||||
            template to build the SSDT CMN-600 table.
 | 
					            template to build the SSDT CMN-600 table.
 | 
				
			||||||
 | 
					  - SSDT Cpu-Topology:
 | 
				
			||||||
 | 
					            The SSDT Cpu-Topology generator collates the cpu and LPI
 | 
				
			||||||
 | 
					            information from the Configuration Manager and generates a
 | 
				
			||||||
 | 
					            SSDT table describing the CPU hierarchy.
 | 
				
			||||||
*/
 | 
					*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/** The ACPI_TABLE_GENERATOR_ID type describes ACPI table generator ID.
 | 
					/** The ACPI_TABLE_GENERATOR_ID type describes ACPI table generator ID.
 | 
				
			||||||
@@ -88,6 +92,7 @@ typedef enum StdAcpiTableId {
 | 
				
			|||||||
  EStdAcpiTableIdSrat,                          ///< SRAT Generator
 | 
					  EStdAcpiTableIdSrat,                          ///< SRAT Generator
 | 
				
			||||||
  EStdAcpiTableIdSsdtSerialPort,                ///< SSDT Serial-Port Generator
 | 
					  EStdAcpiTableIdSsdtSerialPort,                ///< SSDT Serial-Port Generator
 | 
				
			||||||
  EStdAcpiTableIdSsdtCmn600,                    ///< SSDT Cmn-600 Generator
 | 
					  EStdAcpiTableIdSsdtCmn600,                    ///< SSDT Cmn-600 Generator
 | 
				
			||||||
 | 
					  EStdAcpiTableIdSsdtCpuTopology,               ///< SSDT Cpu Topology
 | 
				
			||||||
  EStdAcpiTableIdMax
 | 
					  EStdAcpiTableIdMax
 | 
				
			||||||
} ESTD_ACPI_TABLE_ID;
 | 
					} ESTD_ACPI_TABLE_ID;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -58,6 +58,7 @@ typedef enum ArmObjectID {
 | 
				
			|||||||
  EArmObjGenericInitiatorAffinityInfo, ///< 34 - Generic Initiator Affinity
 | 
					  EArmObjGenericInitiatorAffinityInfo, ///< 34 - Generic Initiator Affinity
 | 
				
			||||||
  EArmObjSerialPortInfo,               ///< 35 - Generic Serial Port Info
 | 
					  EArmObjSerialPortInfo,               ///< 35 - Generic Serial Port Info
 | 
				
			||||||
  EArmObjCmn600Info,                   ///< 36 - CMN-600 Info
 | 
					  EArmObjCmn600Info,                   ///< 36 - CMN-600 Info
 | 
				
			||||||
 | 
					  EArmObjLpiInfo,                      ///< 37 - Lpi Info
 | 
				
			||||||
  EArmObjMax
 | 
					  EArmObjMax
 | 
				
			||||||
} EARM_OBJECT_ID;
 | 
					} EARM_OBJECT_ID;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -395,21 +396,21 @@ typedef struct CmArmGTBlockInfo {
 | 
				
			|||||||
} CM_ARM_GTBLOCK_INFO;
 | 
					} CM_ARM_GTBLOCK_INFO;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/** A structure that describes the
 | 
					/** A structure that describes the
 | 
				
			||||||
    SBSA Generic Watchdog information for the Platform.
 | 
					    Arm Generic Watchdog information for the Platform.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ID: EArmObjPlatformGenericWatchdogInfo
 | 
					    ID: EArmObjPlatformGenericWatchdogInfo
 | 
				
			||||||
*/
 | 
					*/
 | 
				
			||||||
typedef struct CmArmGenericWatchdogInfo {
 | 
					typedef struct CmArmGenericWatchdogInfo {
 | 
				
			||||||
  /// The physical base address of the SBSA Watchdog control frame
 | 
					  /// The physical base address of the Arm Watchdog control frame
 | 
				
			||||||
  UINT64  ControlFrameAddress;
 | 
					  UINT64  ControlFrameAddress;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /// The physical base address of the SBSA Watchdog refresh frame
 | 
					  /// The physical base address of the Arm Watchdog refresh frame
 | 
				
			||||||
  UINT64  RefreshFrameAddress;
 | 
					  UINT64  RefreshFrameAddress;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /// The watchdog interrupt
 | 
					  /// The watchdog interrupt
 | 
				
			||||||
  UINT32  TimerGSIV;
 | 
					  UINT32  TimerGSIV;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /** The flags for the watchdog as described by the SBSA watchdog
 | 
					  /** The flags for the watchdog as described by the Arm watchdog
 | 
				
			||||||
      structure in the ACPI specification.
 | 
					      structure in the ACPI specification.
 | 
				
			||||||
  */
 | 
					  */
 | 
				
			||||||
  UINT32  Flags;
 | 
					  UINT32  Flags;
 | 
				
			||||||
@@ -711,6 +712,10 @@ typedef struct CmArmProcHierarchyInfo {
 | 
				
			|||||||
  /// the NoOfPrivateResources is 0, in which case it is recommended to set
 | 
					  /// the NoOfPrivateResources is 0, in which case it is recommended to set
 | 
				
			||||||
  /// this field to CM_NULL_TOKEN.
 | 
					  /// this field to CM_NULL_TOKEN.
 | 
				
			||||||
  CM_OBJECT_TOKEN   PrivateResourcesArrayToken;
 | 
					  CM_OBJECT_TOKEN   PrivateResourcesArrayToken;
 | 
				
			||||||
 | 
					  /// Optional field: Reference Token for the Lpi state of this processor.
 | 
				
			||||||
 | 
					  /// Token identifying a CM_ARM_OBJ_REF structure, itself referencing
 | 
				
			||||||
 | 
					  /// CM_ARM_LPI_INFO objects.
 | 
				
			||||||
 | 
					  CM_OBJECT_TOKEN   LpiToken;
 | 
				
			||||||
} CM_ARM_PROC_HIERARCHY_INFO;
 | 
					} CM_ARM_PROC_HIERARCHY_INFO;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/** A structure that describes the Cache Type Structure (Type 1) in PPTT
 | 
					/** A structure that describes the Cache Type Structure (Type 1) in PPTT
 | 
				
			||||||
@@ -878,6 +883,69 @@ typedef struct CmArmCmn600Info {
 | 
				
			|||||||
  CM_ARM_EXTENDED_INTERRUPT  DtcInterrupt[4];
 | 
					  CM_ARM_EXTENDED_INTERRUPT  DtcInterrupt[4];
 | 
				
			||||||
} CM_ARM_CMN_600_INFO;
 | 
					} CM_ARM_CMN_600_INFO;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** A structure that describes the Lpi information.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  The Low Power Idle states are described in DSDT/SSDT and associated
 | 
				
			||||||
 | 
					  to cpus/clusters in the cpu topology.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  ID: EArmObjLpiInfo
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
 | 
					typedef struct CmArmLpiInfo {
 | 
				
			||||||
 | 
					  /** Minimum Residency. Time in microseconds after which a
 | 
				
			||||||
 | 
					      state becomes more energy efficient than any shallower state.
 | 
				
			||||||
 | 
					  */
 | 
				
			||||||
 | 
					  UINT32                                  MinResidency;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  /** Worst case time in microseconds from a wake interrupt
 | 
				
			||||||
 | 
					      being asserted to the return to a running state
 | 
				
			||||||
 | 
					  */
 | 
				
			||||||
 | 
					  UINT32                                  WorstCaseWakeLatency;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  /** Flags.
 | 
				
			||||||
 | 
					  */
 | 
				
			||||||
 | 
					  UINT32                                  Flags;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  /** Architecture specific context loss flags.
 | 
				
			||||||
 | 
					  */
 | 
				
			||||||
 | 
					  UINT32                                  ArchFlags;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  /** Residency counter frequency in cycles-per-second (Hz).
 | 
				
			||||||
 | 
					  */
 | 
				
			||||||
 | 
					  UINT32                                  ResCntFreq;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  /** Every shallower power state in the parent is also enabled.
 | 
				
			||||||
 | 
					  */
 | 
				
			||||||
 | 
					  UINT32                                  EnableParentState;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  /** The EntryMethod _LPI field can be described as an integer
 | 
				
			||||||
 | 
					      or in a Register resource data descriptor.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  If IsInteger is TRUE, the IntegerEntryMethod field is used.
 | 
				
			||||||
 | 
					  If IsInteger is FALSE, the RegisterEntryMethod field is used.
 | 
				
			||||||
 | 
					  */
 | 
				
			||||||
 | 
					  BOOLEAN                                 IsInteger;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  /** EntryMethod described as an Integer.
 | 
				
			||||||
 | 
					  */
 | 
				
			||||||
 | 
					  UINT64                                  IntegerEntryMethod;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  /** EntryMethod described as a EFI_ACPI_GENERIC_REGISTER_DESCRIPTOR.
 | 
				
			||||||
 | 
					  */
 | 
				
			||||||
 | 
					  EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE  RegisterEntryMethod;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  /** Residency counter register.
 | 
				
			||||||
 | 
					  */
 | 
				
			||||||
 | 
					  EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE  ResidencyCounterRegister;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  /** Usage counter register.
 | 
				
			||||||
 | 
					  */
 | 
				
			||||||
 | 
					  EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE  UsageCounterRegister;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  /** String representing the Lpi state
 | 
				
			||||||
 | 
					  */
 | 
				
			||||||
 | 
					  CHAR8                                   StateName[16];
 | 
				
			||||||
 | 
					} CM_ARM_LPI_INFO;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#pragma pack()
 | 
					#pragma pack()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif // ARM_NAMESPACE_OBJECTS_H_
 | 
					#endif // ARM_NAMESPACE_OBJECTS_H_
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										93
									
								
								DynamicTablesPkg/Include/Library/AcpiHelperLib.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										93
									
								
								DynamicTablesPkg/Include/Library/AcpiHelperLib.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,93 @@
 | 
				
			|||||||
 | 
					/** @file
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.<BR>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifndef ACPI_HELPER_LIB_H_
 | 
				
			||||||
 | 
					#define ACPI_HELPER_LIB_H_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** Is a character upper case
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
 | 
					#define IS_UPPER_CHAR(x) ((x >= 'A') && (x <= 'Z'))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** Is a character a decimal digit
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
 | 
					#define IS_DIGIT(x) ((x >= '0') && (x <= '9'))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** Is a character an upper case hexadecimal digit
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
 | 
					#define IS_UPPER_HEX(x) (((x >= 'A') && (x <= 'F')) || IS_DIGIT (x))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** Convert a hex number to its ASCII code.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 @param [in]  Hex   Hex number to convert.
 | 
				
			||||||
 | 
					                    Must be 0 <= x < 16.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 @return The ASCII code corresponding to x.
 | 
				
			||||||
 | 
					         -1 if error.
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					UINT8
 | 
				
			||||||
 | 
					EFIAPI
 | 
				
			||||||
 | 
					AsciiFromHex (
 | 
				
			||||||
 | 
					  IN  UINT8   Hex
 | 
				
			||||||
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** Convert an ASCII char representing an hexadecimal number
 | 
				
			||||||
 | 
					    to its integer value.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 @param [in]  Char  Char to convert.
 | 
				
			||||||
 | 
					                    Must be between '0'-'9' or 'A'-'F' or 'a'-'f'.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 @return The corresponding integer (between 0-16).
 | 
				
			||||||
 | 
					         -1 if error.
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					UINT8
 | 
				
			||||||
 | 
					EFIAPI
 | 
				
			||||||
 | 
					HexFromAscii (
 | 
				
			||||||
 | 
					  IN  CHAR8   Char
 | 
				
			||||||
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** Check if a HID is a valid PNP ID.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @param     [in] Hid     The Hid to validate.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @retval    TRUE         The Hid is a valid PNP ID.
 | 
				
			||||||
 | 
					  @retval    FALSE        The Hid is not a valid PNP ID.
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					BOOLEAN
 | 
				
			||||||
 | 
					IsValidPnpId (
 | 
				
			||||||
 | 
					  IN  CONST CHAR8  * Hid
 | 
				
			||||||
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** Check if a HID is a valid ACPI ID.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @param     [in] Hid     The Hid to validate.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @retval    TRUE         The Hid is a valid ACPI ID.
 | 
				
			||||||
 | 
					  @retval    FALSE        The Hid is not a valid ACPI ID.
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					BOOLEAN
 | 
				
			||||||
 | 
					IsValidAcpiId (
 | 
				
			||||||
 | 
					  IN  CONST CHAR8  * Hid
 | 
				
			||||||
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** Convert a EisaId string to its compressed UINT32 equivalent.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Cf. ACPI 6.4 specification, s19.3.4 "ASL Macros": "Eisaid"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @param  [in]  EisaIdStr   Input EisaId string.
 | 
				
			||||||
 | 
					  @param  [out] EisaIdInt   Output EisaId UINT32 (compressed).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @retval EFI_SUCCESS             The function completed successfully.
 | 
				
			||||||
 | 
					  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					EFI_STATUS
 | 
				
			||||||
 | 
					EFIAPI
 | 
				
			||||||
 | 
					AmlGetEisaIdFromString (
 | 
				
			||||||
 | 
					  IN  CONST CHAR8   * EisaIdStr,
 | 
				
			||||||
 | 
					  OUT       UINT32  * EisaIdInt
 | 
				
			||||||
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#endif // ACPI_HELPER_LIB_H_
 | 
				
			||||||
@@ -1,7 +1,7 @@
 | 
				
			|||||||
/** @file
 | 
					/** @file
 | 
				
			||||||
  AML Lib.
 | 
					  AML Lib.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.<BR>
 | 
					  Copyright (c) 2019 - 2021, Arm Limited. All rights reserved.<BR>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
					  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
				
			||||||
**/
 | 
					**/
 | 
				
			||||||
@@ -301,7 +301,7 @@ AmlNameOpUpdateString (
 | 
				
			|||||||
  IN  CONST CHAR8                   * NewName
 | 
					  IN  CONST CHAR8                   * NewName
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/** Get the first Resource Data element contained in a "_CRS" object.
 | 
					/** Get the first Resource Data element contained in a named object.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  In the following ASL code, the function will return the Resource Data
 | 
					  In the following ASL code, the function will return the Resource Data
 | 
				
			||||||
  node corresponding to the "QWordMemory ()" ASL macro.
 | 
					  node corresponding to the "QWordMemory ()" ASL macro.
 | 
				
			||||||
@@ -312,27 +312,26 @@ AmlNameOpUpdateString (
 | 
				
			|||||||
  )
 | 
					  )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Note:
 | 
					  Note:
 | 
				
			||||||
   - The "_CRS" object must be declared using ASL "Name (Declare Named Object)".
 | 
					  "_CRS" names defined as methods are not handled by this function.
 | 
				
			||||||
   - "_CRS" declared using ASL "Method (Declare Control Method)" is not
 | 
					  They must be defined as names, using the "Name ()" statement.
 | 
				
			||||||
     supported.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @ingroup UserApis
 | 
					  @ingroup UserApis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @param  [in] NameOpCrsNode  NameOp object node defining a "_CRS" object.
 | 
					  @param  [in] NameOpNode   NameOp object node defining a named object.
 | 
				
			||||||
                              Must have an OpCode=AML_NAME_OP, SubOpCode=0.
 | 
					                            Must have an OpCode=AML_NAME_OP, SubOpCode=0.
 | 
				
			||||||
                              NameOp object nodes are defined in ASL
 | 
					                            NameOp object nodes are defined in ASL
 | 
				
			||||||
                              using the "Name ()" function.
 | 
					                            using the "Name ()" function.
 | 
				
			||||||
  @param  [out] OutRdNode     Pointer to the first Resource Data element of
 | 
					  @param  [out] OutRdNode   Pointer to the first Resource Data element of
 | 
				
			||||||
                              the "_CRS" object. A Resource Data element
 | 
					                            the named object. A Resource Data element
 | 
				
			||||||
                              is stored in a data node.
 | 
					                            is stored in a data node.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @retval EFI_SUCCESS             The function completed successfully.
 | 
					  @retval EFI_SUCCESS             The function completed successfully.
 | 
				
			||||||
  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
					  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
				
			||||||
**/
 | 
					**/
 | 
				
			||||||
EFI_STATUS
 | 
					EFI_STATUS
 | 
				
			||||||
EFIAPI
 | 
					EFIAPI
 | 
				
			||||||
AmlNameOpCrsGetFirstRdNode (
 | 
					AmlNameOpGetFirstRdNode (
 | 
				
			||||||
  IN  AML_OBJECT_NODE_HANDLE   NameOpCrsNode,
 | 
					  IN  AML_OBJECT_NODE_HANDLE   NameOpNode,
 | 
				
			||||||
  OUT AML_DATA_NODE_HANDLE   * OutRdNode
 | 
					  OUT AML_DATA_NODE_HANDLE   * OutRdNode
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -347,13 +346,14 @@ AmlNameOpCrsGetFirstRdNode (
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
  )
 | 
					  )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  The CurrRdNode Resource Data node must be defined in an object named "_CRS"
 | 
					  Note:
 | 
				
			||||||
  and defined by a "Name ()" ASL function.
 | 
					  "_CRS" names defined as methods are not handled by this function.
 | 
				
			||||||
 | 
					  They must be defined as names, using the "Name ()" statement.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @ingroup UserApis
 | 
					  @ingroup UserApis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @param  [in]  CurrRdNode   Pointer to the current Resource Data element of
 | 
					  @param  [in]  CurrRdNode   Pointer to the current Resource Data element of
 | 
				
			||||||
                             the "_CRS" variable.
 | 
					                             the named object.
 | 
				
			||||||
  @param  [out] OutRdNode    Pointer to the Resource Data element following
 | 
					  @param  [out] OutRdNode    Pointer to the Resource Data element following
 | 
				
			||||||
                             the CurrRdNode.
 | 
					                             the CurrRdNode.
 | 
				
			||||||
                             Contain a NULL pointer if CurrRdNode is the
 | 
					                             Contain a NULL pointer if CurrRdNode is the
 | 
				
			||||||
@@ -366,7 +366,7 @@ AmlNameOpCrsGetFirstRdNode (
 | 
				
			|||||||
**/
 | 
					**/
 | 
				
			||||||
EFI_STATUS
 | 
					EFI_STATUS
 | 
				
			||||||
EFIAPI
 | 
					EFIAPI
 | 
				
			||||||
AmlNameOpCrsGetNextRdNode (
 | 
					AmlNameOpGetNextRdNode (
 | 
				
			||||||
  IN  AML_DATA_NODE_HANDLE    CurrRdNode,
 | 
					  IN  AML_DATA_NODE_HANDLE    CurrRdNode,
 | 
				
			||||||
  OUT AML_DATA_NODE_HANDLE  * OutRdNode
 | 
					  OUT AML_DATA_NODE_HANDLE  * OutRdNode
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
@@ -418,36 +418,21 @@ AmlUpdateRdQWord (
 | 
				
			|||||||
  IN  UINT64                BaseAddressLength
 | 
					  IN  UINT64                BaseAddressLength
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/** Add an Interrupt Resource Data node.
 | 
					/** Code generation for the "Interrupt ()" ASL function.
 | 
				
			||||||
 | 
					 | 
				
			||||||
  This function creates a Resource Data element corresponding to the
 | 
					 | 
				
			||||||
  "Interrupt ()" ASL function, stores it in an AML Data Node.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  It then adds it after the input CurrRdNode in the list of resource data
 | 
					 | 
				
			||||||
  element.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  The Resource Data effectively created is an Extended Interrupt Resource
 | 
					  The Resource Data effectively created is an Extended Interrupt Resource
 | 
				
			||||||
  Data. See ACPI 6.3 specification, s6.4.3.6 "Extended Interrupt Descriptor"
 | 
					  Data. Cf ACPI 6.4:
 | 
				
			||||||
  for more information about Extended Interrupt Resource Data.
 | 
					   - s6.4.3.6 "Extended Interrupt Descriptor"
 | 
				
			||||||
 | 
					   - s19.6.64 "Interrupt (Interrupt Resource Descriptor Macro)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  The Extended Interrupt contains one single interrupt.
 | 
					  The created resource data node can be:
 | 
				
			||||||
 | 
					   - appended to the list of resource data elements of the NameOpNode.
 | 
				
			||||||
 | 
					     In such case NameOpNode must be defined by a the "Name ()" ASL statement
 | 
				
			||||||
 | 
					     and initially contain a "ResourceTemplate ()".
 | 
				
			||||||
 | 
					   - returned through the NewRdNode parameter.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  This function allocates memory to create a data node. It is the caller's
 | 
					  @ingroup CodeGenApis
 | 
				
			||||||
  responsibility to either:
 | 
					 | 
				
			||||||
   - attach this node to an AML tree;
 | 
					 | 
				
			||||||
   - delete this node.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Note: The _CRS node must be defined using the ASL Name () function.
 | 
					 | 
				
			||||||
        e.g. Name (_CRS, ResourceTemplate () {
 | 
					 | 
				
			||||||
               ...
 | 
					 | 
				
			||||||
             }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  @ingroup UserApis
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  @param  [in]  NameOpCrsNode    NameOp object node defining a "_CRS" object.
 | 
					 | 
				
			||||||
                                 Must have an OpCode=AML_NAME_OP, SubOpCode=0.
 | 
					 | 
				
			||||||
                                 NameOp object nodes are defined in ASL
 | 
					 | 
				
			||||||
                                 using the "Name ()" function.
 | 
					 | 
				
			||||||
  @param  [in]  ResourceConsumer The device consumes the specified interrupt
 | 
					  @param  [in]  ResourceConsumer The device consumes the specified interrupt
 | 
				
			||||||
                                 or produces it for use by a child device.
 | 
					                                 or produces it for use by a child device.
 | 
				
			||||||
  @param  [in]  EdgeTriggered    The interrupt is edge triggered or
 | 
					  @param  [in]  EdgeTriggered    The interrupt is edge triggered or
 | 
				
			||||||
@@ -457,7 +442,12 @@ AmlUpdateRdQWord (
 | 
				
			|||||||
                                 devices or not (Exclusive).
 | 
					                                 devices or not (Exclusive).
 | 
				
			||||||
  @param  [in]  IrqList          Interrupt list. Must be non-NULL.
 | 
					  @param  [in]  IrqList          Interrupt list. Must be non-NULL.
 | 
				
			||||||
  @param  [in]  IrqCount         Interrupt count. Must be non-zero.
 | 
					  @param  [in]  IrqCount         Interrupt count. Must be non-zero.
 | 
				
			||||||
 | 
					  @param  [in]  NameOpNode       NameOp object node defining a named object.
 | 
				
			||||||
 | 
					                                 If provided, append the new resource data node
 | 
				
			||||||
 | 
					                                 to the list of resource data elements of this
 | 
				
			||||||
 | 
					                                 node.
 | 
				
			||||||
 | 
					  @param  [out] NewRdNode        If provided and success,
 | 
				
			||||||
 | 
					                                 contain the created node.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @retval EFI_SUCCESS             The function completed successfully.
 | 
					  @retval EFI_SUCCESS             The function completed successfully.
 | 
				
			||||||
  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
					  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
				
			||||||
@@ -465,14 +455,15 @@ AmlUpdateRdQWord (
 | 
				
			|||||||
**/
 | 
					**/
 | 
				
			||||||
EFI_STATUS
 | 
					EFI_STATUS
 | 
				
			||||||
EFIAPI
 | 
					EFIAPI
 | 
				
			||||||
AmlCodeGenCrsAddRdInterrupt (
 | 
					AmlCodeGenRdInterrupt (
 | 
				
			||||||
  IN  AML_OBJECT_NODE_HANDLE  NameOpCrsNode,
 | 
					 | 
				
			||||||
  IN  BOOLEAN                 ResourceConsumer,
 | 
					  IN  BOOLEAN                 ResourceConsumer,
 | 
				
			||||||
  IN  BOOLEAN                 EdgeTriggered,
 | 
					  IN  BOOLEAN                 EdgeTriggered,
 | 
				
			||||||
  IN  BOOLEAN                 ActiveLow,
 | 
					  IN  BOOLEAN                 ActiveLow,
 | 
				
			||||||
  IN  BOOLEAN                 Shared,
 | 
					  IN  BOOLEAN                 Shared,
 | 
				
			||||||
  IN  UINT32                * IrqList,
 | 
					  IN  UINT32                  *IrqList,
 | 
				
			||||||
  IN  UINT8                   IrqCount
 | 
					  IN  UINT8                   IrqCount,
 | 
				
			||||||
 | 
					  IN  AML_OBJECT_NODE_HANDLE  NameOpNode, OPTIONAL
 | 
				
			||||||
 | 
					  OUT AML_DATA_NODE_HANDLE    *NewRdNode  OPTIONAL
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/** AML code generation for DefinitionBlock.
 | 
					/** AML code generation for DefinitionBlock.
 | 
				
			||||||
@@ -628,4 +619,310 @@ AmlCodeGenScope (
 | 
				
			|||||||
  OUT       AML_OBJECT_NODE_HANDLE  * NewObjectNode   OPTIONAL
 | 
					  OUT       AML_OBJECT_NODE_HANDLE  * NewObjectNode   OPTIONAL
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** AML code generation for a method returning a NameString.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  AmlCodeGenMethodRetNameString (
 | 
				
			||||||
 | 
					    "MET0", "_CRS", 1, TRUE, 3, ParentNode, NewObjectNode
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					  is equivalent of the following ASL code:
 | 
				
			||||||
 | 
					    Method(MET0, 1, Serialized, 3) {
 | 
				
			||||||
 | 
					      Return (_CRS)
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  The ASL parameters "ReturnType" and "ParameterTypes" are not asked
 | 
				
			||||||
 | 
					  in this function. They are optional parameters in ASL.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @ingroup CodeGenApis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @param [in]  MethodNameString     The new Method's name.
 | 
				
			||||||
 | 
					                                    Must be a NULL-terminated ASL NameString
 | 
				
			||||||
 | 
					                                    e.g.: "MET0", "_SB.MET0", etc.
 | 
				
			||||||
 | 
					                                    The input string is copied.
 | 
				
			||||||
 | 
					  @param [in]  ReturnedNameString   The name of the object returned by the
 | 
				
			||||||
 | 
					                                    method. Optional parameter, can be:
 | 
				
			||||||
 | 
					                                     - NULL (ignored).
 | 
				
			||||||
 | 
					                                     - A NULL-terminated ASL NameString.
 | 
				
			||||||
 | 
					                                       e.g.: "MET0", "_SB.MET0", etc.
 | 
				
			||||||
 | 
					                                       The input string is copied.
 | 
				
			||||||
 | 
					  @param [in]  NumArgs              Number of arguments.
 | 
				
			||||||
 | 
					                                    Must be 0 <= NumArgs <= 6.
 | 
				
			||||||
 | 
					  @param [in]  IsSerialized         TRUE is equivalent to Serialized.
 | 
				
			||||||
 | 
					                                    FALSE is equivalent to NotSerialized.
 | 
				
			||||||
 | 
					                                    Default is NotSerialized in ASL spec.
 | 
				
			||||||
 | 
					  @param [in]  SyncLevel            Synchronization level for the method.
 | 
				
			||||||
 | 
					                                    Must be 0 <= SyncLevel <= 15.
 | 
				
			||||||
 | 
					                                    Default is 0 in ASL.
 | 
				
			||||||
 | 
					  @param [in]  ParentNode           If provided, set ParentNode as the parent
 | 
				
			||||||
 | 
					                                    of the node created.
 | 
				
			||||||
 | 
					  @param [out] NewObjectNode        If success, contains the created node.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @retval EFI_SUCCESS             Success.
 | 
				
			||||||
 | 
					  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
				
			||||||
 | 
					  @retval EFI_OUT_OF_RESOURCES    Failed to allocate memory.
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					EFI_STATUS
 | 
				
			||||||
 | 
					EFIAPI
 | 
				
			||||||
 | 
					AmlCodeGenMethodRetNameString (
 | 
				
			||||||
 | 
					  IN  CONST CHAR8                   * MethodNameString,
 | 
				
			||||||
 | 
					  IN  CONST CHAR8                   * ReturnedNameString,  OPTIONAL
 | 
				
			||||||
 | 
					  IN        UINT8                     NumArgs,
 | 
				
			||||||
 | 
					  IN        BOOLEAN                   IsSerialized,
 | 
				
			||||||
 | 
					  IN        UINT8                     SyncLevel,
 | 
				
			||||||
 | 
					  IN        AML_NODE_HANDLE           ParentNode,          OPTIONAL
 | 
				
			||||||
 | 
					  OUT       AML_OBJECT_NODE_HANDLE  * NewObjectNode        OPTIONAL
 | 
				
			||||||
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** Create a _LPI name.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  AmlCreateLpiNode ("_LPI", 0, 1, ParentNode, &LpiNode) is
 | 
				
			||||||
 | 
					  equivalent of the following ASL code:
 | 
				
			||||||
 | 
					    Name (_LPI, Package (
 | 
				
			||||||
 | 
					                  0,  // Revision
 | 
				
			||||||
 | 
					                  1,  // LevelId
 | 
				
			||||||
 | 
					                  0   // Count
 | 
				
			||||||
 | 
					                  ))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  This function doesn't define any LPI state. As shown above, the count
 | 
				
			||||||
 | 
					  of _LPI state is set to 0.
 | 
				
			||||||
 | 
					  The AmlAddLpiState () function must be used to add LPI states.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Cf ACPI 6.3 specification, s8.4.4 "Lower Power Idle States".
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @ingroup CodeGenApis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @param [in]  LpiNameString  The new LPI 's object name.
 | 
				
			||||||
 | 
					                              Must be a NULL-terminated ASL NameString
 | 
				
			||||||
 | 
					                              e.g.: "_LPI", "DEV0.PLPI", etc.
 | 
				
			||||||
 | 
					                              The input string is copied.
 | 
				
			||||||
 | 
					  @param [in]  Revision       Revision number of the _LPI states.
 | 
				
			||||||
 | 
					  @param [in]  LevelId        A platform defined number that identifies the
 | 
				
			||||||
 | 
					                              level of hierarchy of the processor node to
 | 
				
			||||||
 | 
					                              which the LPI states apply.
 | 
				
			||||||
 | 
					  @param [in]  ParentNode     If provided, set ParentNode as the parent
 | 
				
			||||||
 | 
					                              of the node created.
 | 
				
			||||||
 | 
					  @param [out] NewLpiNode     If success, contains the created node.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @retval EFI_SUCCESS             The function completed successfully.
 | 
				
			||||||
 | 
					  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
				
			||||||
 | 
					  @retval EFI_OUT_OF_RESOURCES    Failed to allocate memory.
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					EFI_STATUS
 | 
				
			||||||
 | 
					EFIAPI
 | 
				
			||||||
 | 
					AmlCreateLpiNode (
 | 
				
			||||||
 | 
					  IN  CONST CHAR8                   * LpiNameString,
 | 
				
			||||||
 | 
					  IN        UINT16                    Revision,
 | 
				
			||||||
 | 
					  IN        UINT64                    LevelId,
 | 
				
			||||||
 | 
					  IN        AML_NODE_HANDLE           ParentNode,  OPTIONAL
 | 
				
			||||||
 | 
					  OUT       AML_OBJECT_NODE_HANDLE  * NewLpiNode   OPTIONAL
 | 
				
			||||||
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** Add an _LPI state to a LPI node created using AmlCreateLpiNode ().
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  AmlAddLpiState () increments the Count of LPI states in the LPI node by one,
 | 
				
			||||||
 | 
					  and adds the following package:
 | 
				
			||||||
 | 
					    Package() {
 | 
				
			||||||
 | 
					      MinResidency,
 | 
				
			||||||
 | 
					      WorstCaseWakeLatency,
 | 
				
			||||||
 | 
					      Flags,
 | 
				
			||||||
 | 
					      ArchFlags,
 | 
				
			||||||
 | 
					      ResCntFreq,
 | 
				
			||||||
 | 
					      EnableParentState,
 | 
				
			||||||
 | 
					      (GenericRegisterDescriptor != NULL) ?           // Entry method. If a
 | 
				
			||||||
 | 
					        ResourceTemplate(GenericRegisterDescriptor) : // Register is given,
 | 
				
			||||||
 | 
					        Integer,                                      // use it. Use the
 | 
				
			||||||
 | 
					                                                      // Integer otherwise.
 | 
				
			||||||
 | 
					      ResourceTemplate() {                            // NULL Residency Counter
 | 
				
			||||||
 | 
					        Register (SystemMemory, 0, 0, 0, 0)
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      ResourceTemplate() {                            // NULL Usage Counter
 | 
				
			||||||
 | 
					        Register (SystemMemory, 0, 0, 0, 0)
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      ""                                              // NULL State Name
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Cf ACPI 6.3 specification, s8.4.4 "Lower Power Idle States".
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @ingroup CodeGenApis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @param [in]  MinResidency               Minimum Residency.
 | 
				
			||||||
 | 
					  @param [in]  WorstCaseWakeLatency       Worst case wake-up latency.
 | 
				
			||||||
 | 
					  @param [in]  Flags                      Flags.
 | 
				
			||||||
 | 
					  @param [in]  ArchFlags                  Architectural flags.
 | 
				
			||||||
 | 
					  @param [in]  ResCntFreq                 Residency Counter Frequency.
 | 
				
			||||||
 | 
					  @param [in]  EnableParentState          Enabled Parent State.
 | 
				
			||||||
 | 
					  @param [in]  GenericRegisterDescriptor  Entry Method.
 | 
				
			||||||
 | 
					                                          If not NULL, use this Register to
 | 
				
			||||||
 | 
					                                          describe the entry method address.
 | 
				
			||||||
 | 
					  @param [in]  Integer                    Entry Method.
 | 
				
			||||||
 | 
					                                          If GenericRegisterDescriptor is NULL,
 | 
				
			||||||
 | 
					                                          take this value.
 | 
				
			||||||
 | 
					  @param [in]  ResidencyCounterRegister   If not NULL, use it to populate the
 | 
				
			||||||
 | 
					                                          residency counter register.
 | 
				
			||||||
 | 
					  @param [in]  UsageCounterRegister       If not NULL, use it to populate the
 | 
				
			||||||
 | 
					                                          usage counter register.
 | 
				
			||||||
 | 
					  @param [in]  StateName                  If not NULL, use it to populate the
 | 
				
			||||||
 | 
					                                          state name.
 | 
				
			||||||
 | 
					  @param [in]  LpiNode                    Lpi node created with the function
 | 
				
			||||||
 | 
					                                          AmlCreateLpiNode to which the new LPI
 | 
				
			||||||
 | 
					                                          state is appended.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @retval EFI_SUCCESS             The function completed successfully.
 | 
				
			||||||
 | 
					  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
				
			||||||
 | 
					  @retval EFI_OUT_OF_RESOURCES    Failed to allocate memory.
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					EFI_STATUS
 | 
				
			||||||
 | 
					EFIAPI
 | 
				
			||||||
 | 
					AmlAddLpiState (
 | 
				
			||||||
 | 
					  IN  UINT32                                    MinResidency,
 | 
				
			||||||
 | 
					  IN  UINT32                                    WorstCaseWakeLatency,
 | 
				
			||||||
 | 
					  IN  UINT32                                    Flags,
 | 
				
			||||||
 | 
					  IN  UINT32                                    ArchFlags,
 | 
				
			||||||
 | 
					  IN  UINT32                                    ResCntFreq,
 | 
				
			||||||
 | 
					  IN  UINT32                                    EnableParentState,
 | 
				
			||||||
 | 
					  IN  EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE  * GenericRegisterDescriptor,  OPTIONAL
 | 
				
			||||||
 | 
					  IN  UINT64                                    Integer,                    OPTIONAL
 | 
				
			||||||
 | 
					  IN  EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE  * ResidencyCounterRegister,   OPTIONAL
 | 
				
			||||||
 | 
					  IN  EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE  * UsageCounterRegister,       OPTIONAL
 | 
				
			||||||
 | 
					  IN  CHAR8                                   * StateName,                  OPTIONAL
 | 
				
			||||||
 | 
					  IN  AML_OBJECT_NODE_HANDLE                    LpiNode
 | 
				
			||||||
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// DEPRECATED APIS
 | 
				
			||||||
 | 
					#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** DEPRECATED API
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Get the first Resource Data element contained in a "_CRS" object.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  In the following ASL code, the function will return the Resource Data
 | 
				
			||||||
 | 
					  node corresponding to the "QWordMemory ()" ASL macro.
 | 
				
			||||||
 | 
					  Name (_CRS, ResourceTemplate() {
 | 
				
			||||||
 | 
					      QWordMemory (...) {...},
 | 
				
			||||||
 | 
					      Interrupt (...) {...}
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Note:
 | 
				
			||||||
 | 
					   - The "_CRS" object must be declared using ASL "Name (Declare Named Object)".
 | 
				
			||||||
 | 
					   - "_CRS" declared using ASL "Method (Declare Control Method)" is not
 | 
				
			||||||
 | 
					     supported.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @ingroup UserApis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @param  [in] NameOpCrsNode  NameOp object node defining a "_CRS" object.
 | 
				
			||||||
 | 
					                              Must have an OpCode=AML_NAME_OP, SubOpCode=0.
 | 
				
			||||||
 | 
					                              NameOp object nodes are defined in ASL
 | 
				
			||||||
 | 
					                              using the "Name ()" function.
 | 
				
			||||||
 | 
					  @param  [out] OutRdNode     Pointer to the first Resource Data element of
 | 
				
			||||||
 | 
					                              the "_CRS" object. A Resource Data element
 | 
				
			||||||
 | 
					                              is stored in a data node.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @retval EFI_SUCCESS             The function completed successfully.
 | 
				
			||||||
 | 
					  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					EFI_STATUS
 | 
				
			||||||
 | 
					EFIAPI
 | 
				
			||||||
 | 
					AmlNameOpCrsGetFirstRdNode (
 | 
				
			||||||
 | 
					  IN  AML_OBJECT_NODE_HANDLE   NameOpCrsNode,
 | 
				
			||||||
 | 
					  OUT AML_DATA_NODE_HANDLE   * OutRdNode
 | 
				
			||||||
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** DEPRECATED API
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Get the Resource Data element following the CurrRdNode Resource Data.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  In the following ASL code, if CurrRdNode corresponds to the first
 | 
				
			||||||
 | 
					  "QWordMemory ()" ASL macro, the function will return the Resource Data
 | 
				
			||||||
 | 
					  node corresponding to the "Interrupt ()" ASL macro.
 | 
				
			||||||
 | 
					  Name (_CRS, ResourceTemplate() {
 | 
				
			||||||
 | 
					      QwordMemory (...) {...},
 | 
				
			||||||
 | 
					      Interrupt (...) {...}
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  The CurrRdNode Resource Data node must be defined in an object named "_CRS"
 | 
				
			||||||
 | 
					  and defined by a "Name ()" ASL function.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @ingroup UserApis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @param  [in]  CurrRdNode   Pointer to the current Resource Data element of
 | 
				
			||||||
 | 
					                             the "_CRS" variable.
 | 
				
			||||||
 | 
					  @param  [out] OutRdNode    Pointer to the Resource Data element following
 | 
				
			||||||
 | 
					                             the CurrRdNode.
 | 
				
			||||||
 | 
					                             Contain a NULL pointer if CurrRdNode is the
 | 
				
			||||||
 | 
					                             last Resource Data element in the list.
 | 
				
			||||||
 | 
					                             The "End Tag" is not considered as a resource
 | 
				
			||||||
 | 
					                             data element and is not returned.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @retval EFI_SUCCESS             The function completed successfully.
 | 
				
			||||||
 | 
					  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					EFI_STATUS
 | 
				
			||||||
 | 
					EFIAPI
 | 
				
			||||||
 | 
					AmlNameOpCrsGetNextRdNode (
 | 
				
			||||||
 | 
					  IN  AML_DATA_NODE_HANDLE    CurrRdNode,
 | 
				
			||||||
 | 
					  OUT AML_DATA_NODE_HANDLE  * OutRdNode
 | 
				
			||||||
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** DEPRECATED API
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Add an Interrupt Resource Data node.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  This function creates a Resource Data element corresponding to the
 | 
				
			||||||
 | 
					  "Interrupt ()" ASL function, stores it in an AML Data Node.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  It then adds it after the input CurrRdNode in the list of resource data
 | 
				
			||||||
 | 
					  element.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  The Resource Data effectively created is an Extended Interrupt Resource
 | 
				
			||||||
 | 
					  Data. See ACPI 6.3 specification, s6.4.3.6 "Extended Interrupt Descriptor"
 | 
				
			||||||
 | 
					  for more information about Extended Interrupt Resource Data.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  The Extended Interrupt contains one single interrupt.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  This function allocates memory to create a data node. It is the caller's
 | 
				
			||||||
 | 
					  responsibility to either:
 | 
				
			||||||
 | 
					   - attach this node to an AML tree;
 | 
				
			||||||
 | 
					   - delete this node.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Note: The _CRS node must be defined using the ASL Name () function.
 | 
				
			||||||
 | 
					        e.g. Name (_CRS, ResourceTemplate () {
 | 
				
			||||||
 | 
					               ...
 | 
				
			||||||
 | 
					             }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @ingroup CodeGenApis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @param  [in]  NameOpCrsNode    NameOp object node defining a "_CRS" object.
 | 
				
			||||||
 | 
					                                 Must have an OpCode=AML_NAME_OP, SubOpCode=0.
 | 
				
			||||||
 | 
					                                 NameOp object nodes are defined in ASL
 | 
				
			||||||
 | 
					                                 using the "Name ()" function.
 | 
				
			||||||
 | 
					  @param  [in]  ResourceConsumer The device consumes the specified interrupt
 | 
				
			||||||
 | 
					                                 or produces it for use by a child device.
 | 
				
			||||||
 | 
					  @param  [in]  EdgeTriggered    The interrupt is edge triggered or
 | 
				
			||||||
 | 
					                                 level triggered.
 | 
				
			||||||
 | 
					  @param  [in]  ActiveLow        The interrupt is active-high or active-low.
 | 
				
			||||||
 | 
					  @param  [in]  Shared           The interrupt can be shared with other
 | 
				
			||||||
 | 
					                                 devices or not (Exclusive).
 | 
				
			||||||
 | 
					  @param  [in]  IrqList          Interrupt list. Must be non-NULL.
 | 
				
			||||||
 | 
					  @param  [in]  IrqCount         Interrupt count. Must be non-zero.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @retval EFI_SUCCESS             The function completed successfully.
 | 
				
			||||||
 | 
					  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
				
			||||||
 | 
					  @retval EFI_OUT_OF_RESOURCES    Could not allocate memory.
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					EFI_STATUS
 | 
				
			||||||
 | 
					EFIAPI
 | 
				
			||||||
 | 
					AmlCodeGenCrsAddRdInterrupt (
 | 
				
			||||||
 | 
					  IN  AML_OBJECT_NODE_HANDLE  NameOpCrsNode,
 | 
				
			||||||
 | 
					  IN  BOOLEAN                 ResourceConsumer,
 | 
				
			||||||
 | 
					  IN  BOOLEAN                 EdgeTriggered,
 | 
				
			||||||
 | 
					  IN  BOOLEAN                 ActiveLow,
 | 
				
			||||||
 | 
					  IN  BOOLEAN                 Shared,
 | 
				
			||||||
 | 
					  IN  UINT32                * IrqList,
 | 
				
			||||||
 | 
					  IN  UINT8                   IrqCount
 | 
				
			||||||
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#endif // DISABLE_NEW_DEPRECATED_INTERFACES
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif // AML_LIB_H_
 | 
					#endif // AML_LIB_H_
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,17 +12,7 @@
 | 
				
			|||||||
#ifndef TABLE_HELPER_LIB_H_
 | 
					#ifndef TABLE_HELPER_LIB_H_
 | 
				
			||||||
#define TABLE_HELPER_LIB_H_
 | 
					#define TABLE_HELPER_LIB_H_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/** Is a character upper case
 | 
					#include <Library/AmlLib/AmlLib.h>
 | 
				
			||||||
*/
 | 
					 | 
				
			||||||
#define IS_UPPER_CHAR(x) ((x >= 'A') && (x <= 'Z'))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/** Is a character a decimal digit
 | 
					 | 
				
			||||||
*/
 | 
					 | 
				
			||||||
#define IS_DIGIT(x) ((x >= '0') && (x <= '9'))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/** Is a character an upper case hexadecimal digit
 | 
					 | 
				
			||||||
*/
 | 
					 | 
				
			||||||
#define IS_UPPER_HEX(x) (((x >= 'A') && (x <= 'F')) || IS_DIGIT (x))
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
/** The GetCgfMgrInfo function gets the CM_STD_OBJ_CONFIGURATION_MANAGER_INFO
 | 
					/** The GetCgfMgrInfo function gets the CM_STD_OBJ_CONFIGURATION_MANAGER_INFO
 | 
				
			||||||
    object from the Configuration Manager.
 | 
					    object from the Configuration Manager.
 | 
				
			||||||
@@ -74,6 +64,39 @@ AddAcpiHeader (
 | 
				
			|||||||
  IN      CONST UINT32                                        Length
 | 
					  IN      CONST UINT32                                        Length
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** Build a RootNode containing SSDT ACPI header information using the AmlLib.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  The function utilizes the ACPI table Generator and the Configuration
 | 
				
			||||||
 | 
					  Manager protocol to obtain any information required for constructing the
 | 
				
			||||||
 | 
					  header. It then creates a RootNode. The SSDT ACPI header is part of the
 | 
				
			||||||
 | 
					  RootNode.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  This is essentially a wrapper around AmlCodeGenDefinitionBlock ()
 | 
				
			||||||
 | 
					  from the AmlLib.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @param [in]   CfgMgrProtocol Pointer to the Configuration Manager
 | 
				
			||||||
 | 
					                               protocol interface.
 | 
				
			||||||
 | 
					  @param [in]   Generator      Pointer to the ACPI table Generator.
 | 
				
			||||||
 | 
					  @param [in]   AcpiTableInfo  Pointer to the ACPI table info structure.
 | 
				
			||||||
 | 
					  @param [out]  RootNode       If success, contains the created RootNode.
 | 
				
			||||||
 | 
					                               The SSDT ACPI header is part of the RootNode.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @retval EFI_SUCCESS           Success.
 | 
				
			||||||
 | 
					  @retval EFI_INVALID_PARAMETER A parameter is invalid.
 | 
				
			||||||
 | 
					  @retval EFI_NOT_FOUND         The required object information is not found.
 | 
				
			||||||
 | 
					  @retval EFI_BAD_BUFFER_SIZE   The size returned by the Configuration
 | 
				
			||||||
 | 
					                                Manager is less than the Object size for the
 | 
				
			||||||
 | 
					                                requested object.
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					EFI_STATUS
 | 
				
			||||||
 | 
					EFIAPI
 | 
				
			||||||
 | 
					AddSsdtAcpiHeader (
 | 
				
			||||||
 | 
					  IN      CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  * CONST CfgMgrProtocol,
 | 
				
			||||||
 | 
					  IN      CONST ACPI_TABLE_GENERATOR                  * CONST Generator,
 | 
				
			||||||
 | 
					  IN      CONST CM_STD_OBJ_ACPI_TABLE_INFO            * CONST AcpiTableInfo,
 | 
				
			||||||
 | 
					      OUT       AML_ROOT_NODE_HANDLE                  *       RootNode
 | 
				
			||||||
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
  Function prototype for testing if two arbitrary objects are equal.
 | 
					  Function prototype for testing if two arbitrary objects are equal.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -119,41 +142,14 @@ FindDuplicateValue (
 | 
				
			|||||||
  IN        PFN_IS_EQUAL    EqualTestFunction
 | 
					  IN        PFN_IS_EQUAL    EqualTestFunction
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/** Convert a hex number to its ASCII code.
 | 
					/** Parse and print a CmObjDesc.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 @param [in]  x   Hex number to convert.
 | 
					  @param [in]  CmObjDesc  The CmObjDesc to parse and print.
 | 
				
			||||||
                  Must be 0 <= x < 16.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 @return The ASCII code corresponding to x.
 | 
					 | 
				
			||||||
**/
 | 
					**/
 | 
				
			||||||
UINT8
 | 
					VOID
 | 
				
			||||||
EFIAPI
 | 
					EFIAPI
 | 
				
			||||||
AsciiFromHex (
 | 
					ParseCmObjDesc (
 | 
				
			||||||
  IN  UINT8   x
 | 
					  IN  CONST CM_OBJ_DESCRIPTOR * CmObjDesc
 | 
				
			||||||
  );
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/** Check if a HID is a valid PNP ID.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  @param     [in] Hid     The Hid to validate.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  @retval    TRUE         The Hid is a valid PNP ID.
 | 
					 | 
				
			||||||
  @retval    FALSE        The Hid is not a valid PNP ID.
 | 
					 | 
				
			||||||
**/
 | 
					 | 
				
			||||||
BOOLEAN
 | 
					 | 
				
			||||||
IsValidPnpId (
 | 
					 | 
				
			||||||
  IN  CONST CHAR8  * Hid
 | 
					 | 
				
			||||||
  );
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/** Check if a HID is a valid ACPI ID.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  @param     [in] Hid     The Hid to validate.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  @retval    TRUE         The Hid is a valid ACPI ID.
 | 
					 | 
				
			||||||
  @retval    FALSE        The Hid is not a valid ACPI ID.
 | 
					 | 
				
			||||||
**/
 | 
					 | 
				
			||||||
BOOLEAN
 | 
					 | 
				
			||||||
IsValidAcpiId (
 | 
					 | 
				
			||||||
  IN  CONST CHAR8  * Hid
 | 
					 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif // TABLE_HELPER_LIB_H_
 | 
					#endif // TABLE_HELPER_LIB_H_
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,11 +1,11 @@
 | 
				
			|||||||
/** @file
 | 
					/** @file
 | 
				
			||||||
  FADT Table Generator
 | 
					  FADT Table Generator
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
 | 
					  Copyright (c) 2017 - 2021, ARM Limited. All rights reserved.
 | 
				
			||||||
  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
					  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @par Reference(s):
 | 
					  @par Reference(s):
 | 
				
			||||||
  - ACPI 6.3 Specification, January 2019
 | 
					  - ACPI 6.4 Specification, January 2021
 | 
				
			||||||
 | 
					
 | 
				
			||||||
**/
 | 
					**/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -32,8 +32,8 @@ Requirements:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
/** This macro defines the FADT flag options for ARM Platforms.
 | 
					/** This macro defines the FADT flag options for ARM Platforms.
 | 
				
			||||||
*/
 | 
					*/
 | 
				
			||||||
#define FADT_FLAGS  (EFI_ACPI_6_3_HW_REDUCED_ACPI |          \
 | 
					#define FADT_FLAGS  (EFI_ACPI_6_4_HW_REDUCED_ACPI |          \
 | 
				
			||||||
                     EFI_ACPI_6_3_LOW_POWER_S0_IDLE_CAPABLE)
 | 
					                     EFI_ACPI_6_4_LOW_POWER_S0_IDLE_CAPABLE)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/** This macro defines the valid mask for the FADT flag option
 | 
					/** This macro defines the valid mask for the FADT flag option
 | 
				
			||||||
    if HW_REDUCED_ACPI flag in the table is set.
 | 
					    if HW_REDUCED_ACPI flag in the table is set.
 | 
				
			||||||
@@ -42,47 +42,47 @@ Requirements:
 | 
				
			|||||||
    22-31 (reserved).
 | 
					    22-31 (reserved).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Valid bits are:
 | 
					  Valid bits are:
 | 
				
			||||||
    EFI_ACPI_6_3_WBINVD                               BIT0
 | 
					    EFI_ACPI_6_4_WBINVD                               BIT0
 | 
				
			||||||
    EFI_ACPI_6_3_PWR_BUTTON                           BIT4
 | 
					    EFI_ACPI_6_4_PWR_BUTTON                           BIT4
 | 
				
			||||||
    EFI_ACPI_6_3_SLP_BUTTON                           BIT5
 | 
					    EFI_ACPI_6_4_SLP_BUTTON                           BIT5
 | 
				
			||||||
    EFI_ACPI_6_3_FIX_RTC                              BIT6
 | 
					    EFI_ACPI_6_4_FIX_RTC                              BIT6
 | 
				
			||||||
    EFI_ACPI_6_3_DCK_CAP                              BIT9
 | 
					    EFI_ACPI_6_4_DCK_CAP                              BIT9
 | 
				
			||||||
    EFI_ACPI_6_3_RESET_REG_SUP                        BIT10
 | 
					    EFI_ACPI_6_4_RESET_REG_SUP                        BIT10
 | 
				
			||||||
    EFI_ACPI_6_3_SEALED_CASE                          BIT11
 | 
					    EFI_ACPI_6_4_SEALED_CASE                          BIT11
 | 
				
			||||||
    EFI_ACPI_6_3_HEADLESS                             BIT12
 | 
					    EFI_ACPI_6_4_HEADLESS                             BIT12
 | 
				
			||||||
    EFI_ACPI_6_3_USE_PLATFORM_CLOCK                   BIT15
 | 
					    EFI_ACPI_6_4_USE_PLATFORM_CLOCK                   BIT15
 | 
				
			||||||
    EFI_ACPI_6_3_FORCE_APIC_CLUSTER_MODEL             BIT18
 | 
					    EFI_ACPI_6_4_FORCE_APIC_CLUSTER_MODEL             BIT18
 | 
				
			||||||
    EFI_ACPI_6_3_FORCE_APIC_PHYSICAL_DESTINATION_MODE BIT19
 | 
					    EFI_ACPI_6_4_FORCE_APIC_PHYSICAL_DESTINATION_MODE BIT19
 | 
				
			||||||
    EFI_ACPI_6_3_HW_REDUCED_ACPI                      BIT20
 | 
					    EFI_ACPI_6_4_HW_REDUCED_ACPI                      BIT20
 | 
				
			||||||
    EFI_ACPI_6_3_LOW_POWER_S0_IDLE_CAPABLE            BIT21
 | 
					    EFI_ACPI_6_4_LOW_POWER_S0_IDLE_CAPABLE            BIT21
 | 
				
			||||||
*/
 | 
					*/
 | 
				
			||||||
#define VALID_HARDWARE_REDUCED_FLAG_MASK  (                   \
 | 
					#define VALID_HARDWARE_REDUCED_FLAG_MASK  (                   \
 | 
				
			||||||
          EFI_ACPI_6_3_WBINVD                               | \
 | 
					          EFI_ACPI_6_4_WBINVD                               | \
 | 
				
			||||||
          EFI_ACPI_6_3_PWR_BUTTON                           | \
 | 
					          EFI_ACPI_6_4_PWR_BUTTON                           | \
 | 
				
			||||||
          EFI_ACPI_6_3_SLP_BUTTON                           | \
 | 
					          EFI_ACPI_6_4_SLP_BUTTON                           | \
 | 
				
			||||||
          EFI_ACPI_6_3_FIX_RTC                              | \
 | 
					          EFI_ACPI_6_4_FIX_RTC                              | \
 | 
				
			||||||
          EFI_ACPI_6_3_DCK_CAP                              | \
 | 
					          EFI_ACPI_6_4_DCK_CAP                              | \
 | 
				
			||||||
          EFI_ACPI_6_3_RESET_REG_SUP                        | \
 | 
					          EFI_ACPI_6_4_RESET_REG_SUP                        | \
 | 
				
			||||||
          EFI_ACPI_6_3_SEALED_CASE                          | \
 | 
					          EFI_ACPI_6_4_SEALED_CASE                          | \
 | 
				
			||||||
          EFI_ACPI_6_3_HEADLESS                             | \
 | 
					          EFI_ACPI_6_4_HEADLESS                             | \
 | 
				
			||||||
          EFI_ACPI_6_3_USE_PLATFORM_CLOCK                   | \
 | 
					          EFI_ACPI_6_4_USE_PLATFORM_CLOCK                   | \
 | 
				
			||||||
          EFI_ACPI_6_3_FORCE_APIC_CLUSTER_MODEL             | \
 | 
					          EFI_ACPI_6_4_FORCE_APIC_CLUSTER_MODEL             | \
 | 
				
			||||||
          EFI_ACPI_6_3_FORCE_APIC_PHYSICAL_DESTINATION_MODE | \
 | 
					          EFI_ACPI_6_4_FORCE_APIC_PHYSICAL_DESTINATION_MODE | \
 | 
				
			||||||
          EFI_ACPI_6_3_HW_REDUCED_ACPI                      | \
 | 
					          EFI_ACPI_6_4_HW_REDUCED_ACPI                      | \
 | 
				
			||||||
          EFI_ACPI_6_3_LOW_POWER_S0_IDLE_CAPABLE)
 | 
					          EFI_ACPI_6_4_LOW_POWER_S0_IDLE_CAPABLE)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#pragma pack(1)
 | 
					#pragma pack(1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/** The AcpiFadt is a template EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE
 | 
					/** The AcpiFadt is a template EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE
 | 
				
			||||||
    structure used for generating the FADT Table.
 | 
					    structure used for generating the FADT Table.
 | 
				
			||||||
  Note: fields marked with "{Template}" will be updated dynamically.
 | 
					  Note: fields marked with "{Template}" will be updated dynamically.
 | 
				
			||||||
*/
 | 
					*/
 | 
				
			||||||
STATIC
 | 
					STATIC
 | 
				
			||||||
EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE AcpiFadt = {
 | 
					EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE AcpiFadt = {
 | 
				
			||||||
  ACPI_HEADER (
 | 
					  ACPI_HEADER (
 | 
				
			||||||
    EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE,
 | 
					    EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE,
 | 
				
			||||||
    EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE,
 | 
					    EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE,
 | 
				
			||||||
    EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE_REVISION
 | 
					    EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_REVISION
 | 
				
			||||||
    ),
 | 
					    ),
 | 
				
			||||||
  // UINT32     FirmwareCtrl
 | 
					  // UINT32     FirmwareCtrl
 | 
				
			||||||
  0,
 | 
					  0,
 | 
				
			||||||
@@ -91,7 +91,7 @@ EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE AcpiFadt = {
 | 
				
			|||||||
  // UINT8      Reserved0
 | 
					  // UINT8      Reserved0
 | 
				
			||||||
  EFI_ACPI_RESERVED_BYTE,
 | 
					  EFI_ACPI_RESERVED_BYTE,
 | 
				
			||||||
  // UINT8      PreferredPmProfile
 | 
					  // UINT8      PreferredPmProfile
 | 
				
			||||||
  EFI_ACPI_6_3_PM_PROFILE_UNSPECIFIED,  // {Template}: Power Management Profile
 | 
					  EFI_ACPI_6_4_PM_PROFILE_UNSPECIFIED,  // {Template}: Power Management Profile
 | 
				
			||||||
  // UINT16     SciInt
 | 
					  // UINT16     SciInt
 | 
				
			||||||
  0,
 | 
					  0,
 | 
				
			||||||
  // UINT32     SmiCmd
 | 
					  // UINT32     SmiCmd
 | 
				
			||||||
@@ -160,37 +160,37 @@ EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE AcpiFadt = {
 | 
				
			|||||||
  0,
 | 
					  0,
 | 
				
			||||||
  // UINT32     Flags
 | 
					  // UINT32     Flags
 | 
				
			||||||
  FADT_FLAGS,
 | 
					  FADT_FLAGS,
 | 
				
			||||||
  // EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE  ResetReg
 | 
					  // EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE  ResetReg
 | 
				
			||||||
  NULL_GAS,
 | 
					  NULL_GAS,
 | 
				
			||||||
  // UINT8      ResetValue
 | 
					  // UINT8      ResetValue
 | 
				
			||||||
  0,
 | 
					  0,
 | 
				
			||||||
  // UINT16     ArmBootArch
 | 
					  // UINT16     ArmBootArch
 | 
				
			||||||
  EFI_ACPI_6_3_ARM_PSCI_COMPLIANT,  // {Template}: ARM Boot Architecture Flags
 | 
					  EFI_ACPI_6_4_ARM_PSCI_COMPLIANT,  // {Template}: ARM Boot Architecture Flags
 | 
				
			||||||
  // UINT8      MinorRevision
 | 
					  // UINT8      MinorRevision
 | 
				
			||||||
  EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION,
 | 
					  EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION,
 | 
				
			||||||
  // UINT64     XFirmwareCtrl
 | 
					  // UINT64     XFirmwareCtrl
 | 
				
			||||||
  0,
 | 
					  0,
 | 
				
			||||||
  // UINT64     XDsdt
 | 
					  // UINT64     XDsdt
 | 
				
			||||||
  0,
 | 
					  0,
 | 
				
			||||||
  // EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE  XPm1aEvtBlk
 | 
					  // EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE  XPm1aEvtBlk
 | 
				
			||||||
  NULL_GAS,
 | 
					  NULL_GAS,
 | 
				
			||||||
  // EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE  XPm1bEvtBlk
 | 
					  // EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE  XPm1bEvtBlk
 | 
				
			||||||
  NULL_GAS,
 | 
					  NULL_GAS,
 | 
				
			||||||
  // EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE  XPm1aCntBlk
 | 
					  // EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE  XPm1aCntBlk
 | 
				
			||||||
  NULL_GAS,
 | 
					  NULL_GAS,
 | 
				
			||||||
  // EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE  XPm1bCntBlk
 | 
					  // EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE  XPm1bCntBlk
 | 
				
			||||||
  NULL_GAS,
 | 
					  NULL_GAS,
 | 
				
			||||||
  // EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE  XPm2CntBlk
 | 
					  // EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE  XPm2CntBlk
 | 
				
			||||||
  NULL_GAS,
 | 
					  NULL_GAS,
 | 
				
			||||||
  // EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE  XPmTmrBlk
 | 
					  // EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE  XPmTmrBlk
 | 
				
			||||||
  NULL_GAS,
 | 
					  NULL_GAS,
 | 
				
			||||||
  // EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE  XGpe0Blk
 | 
					  // EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE  XGpe0Blk
 | 
				
			||||||
  NULL_GAS,
 | 
					  NULL_GAS,
 | 
				
			||||||
  // EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE  XGpe1Blk
 | 
					  // EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE  XGpe1Blk
 | 
				
			||||||
  NULL_GAS,
 | 
					  NULL_GAS,
 | 
				
			||||||
  // EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE  SleepControlReg
 | 
					  // EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE  SleepControlReg
 | 
				
			||||||
  NULL_GAS,
 | 
					  NULL_GAS,
 | 
				
			||||||
  // EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE  SleepStatusReg
 | 
					  // EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE  SleepStatusReg
 | 
				
			||||||
  NULL_GAS,
 | 
					  NULL_GAS,
 | 
				
			||||||
  // UINT64     HypervisorVendorIdentity
 | 
					  // UINT64     HypervisorVendorIdentity
 | 
				
			||||||
  EFI_ACPI_RESERVED_QWORD  // {Template}: Hypervisor Vendor ID
 | 
					  EFI_ACPI_RESERVED_QWORD  // {Template}: Hypervisor Vendor ID
 | 
				
			||||||
@@ -532,7 +532,7 @@ BuildFadtTable (
 | 
				
			|||||||
             This,
 | 
					             This,
 | 
				
			||||||
             (EFI_ACPI_DESCRIPTION_HEADER*)&AcpiFadt,
 | 
					             (EFI_ACPI_DESCRIPTION_HEADER*)&AcpiFadt,
 | 
				
			||||||
             AcpiTableInfo,
 | 
					             AcpiTableInfo,
 | 
				
			||||||
             sizeof (EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE)
 | 
					             sizeof (EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE)
 | 
				
			||||||
             );
 | 
					             );
 | 
				
			||||||
  if (EFI_ERROR (Status)) {
 | 
					  if (EFI_ERROR (Status)) {
 | 
				
			||||||
    DEBUG ((
 | 
					    DEBUG ((
 | 
				
			||||||
@@ -614,9 +614,9 @@ ACPI_TABLE_GENERATOR FadtGenerator = {
 | 
				
			|||||||
  // Generator Description
 | 
					  // Generator Description
 | 
				
			||||||
  L"ACPI.STD.FADT.GENERATOR",
 | 
					  L"ACPI.STD.FADT.GENERATOR",
 | 
				
			||||||
  // ACPI Table Signature
 | 
					  // ACPI Table Signature
 | 
				
			||||||
  EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE,
 | 
					  EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE,
 | 
				
			||||||
  // ACPI Table Revision supported by this Generator
 | 
					  // ACPI Table Revision supported by this Generator
 | 
				
			||||||
  EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE_REVISION,
 | 
					  EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_REVISION,
 | 
				
			||||||
  // Minimum supported ACPI Table Revision
 | 
					  // Minimum supported ACPI Table Revision
 | 
				
			||||||
  EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_REVISION,
 | 
					  EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_REVISION,
 | 
				
			||||||
  // Creator ID
 | 
					  // Creator ID
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,11 +1,11 @@
 | 
				
			|||||||
/** @file
 | 
					/** @file
 | 
				
			||||||
  GTDT Table Generator
 | 
					  GTDT Table Generator
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
 | 
					  Copyright (c) 2017 - 2021, ARM Limited. All rights reserved.
 | 
				
			||||||
  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
					  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @par Reference(s):
 | 
					  @par Reference(s):
 | 
				
			||||||
  - ACPI 6.3 Specification - January 2019
 | 
					  - ACPI 6.4 Specification - January 2021
 | 
				
			||||||
 | 
					
 | 
				
			||||||
**/
 | 
					**/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -41,7 +41,7 @@ GET_OBJECT_LIST (
 | 
				
			|||||||
  CM_ARM_GENERIC_TIMER_INFO
 | 
					  CM_ARM_GENERIC_TIMER_INFO
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/** This macro expands to a function that retrieves the SBSA Generic
 | 
					/** This macro expands to a function that retrieves the Arm Generic
 | 
				
			||||||
    Watchdog Timer Information from the Configuration Manager.
 | 
					    Watchdog Timer Information from the Configuration Manager.
 | 
				
			||||||
*/
 | 
					*/
 | 
				
			||||||
GET_OBJECT_LIST (
 | 
					GET_OBJECT_LIST (
 | 
				
			||||||
@@ -91,7 +91,7 @@ EFI_STATUS
 | 
				
			|||||||
EFIAPI
 | 
					EFIAPI
 | 
				
			||||||
AddGenericTimerInfo (
 | 
					AddGenericTimerInfo (
 | 
				
			||||||
  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL         * CONST CfgMgrProtocol,
 | 
					  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL         * CONST CfgMgrProtocol,
 | 
				
			||||||
  IN        EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE * CONST Gtdt,
 | 
					  IN        EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE * CONST Gtdt,
 | 
				
			||||||
  IN  CONST UINT32                                               PlatformTimerCount,
 | 
					  IN  CONST UINT32                                               PlatformTimerCount,
 | 
				
			||||||
  IN  CONST UINT32                                               AcpiTableRevision
 | 
					  IN  CONST UINT32                                               AcpiTableRevision
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
@@ -133,7 +133,7 @@ AddGenericTimerInfo (
 | 
				
			|||||||
    GenericTimerInfo->CounterReadBaseAddress;
 | 
					    GenericTimerInfo->CounterReadBaseAddress;
 | 
				
			||||||
  Gtdt->PlatformTimerCount = PlatformTimerCount;
 | 
					  Gtdt->PlatformTimerCount = PlatformTimerCount;
 | 
				
			||||||
  Gtdt->PlatformTimerOffset = (PlatformTimerCount == 0) ? 0 :
 | 
					  Gtdt->PlatformTimerOffset = (PlatformTimerCount == 0) ? 0 :
 | 
				
			||||||
    sizeof (EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE);
 | 
					    sizeof (EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (AcpiTableRevision > EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION) {
 | 
					  if (AcpiTableRevision > EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION) {
 | 
				
			||||||
    Gtdt->VirtualPL2TimerGSIV = GenericTimerInfo->VirtualPL2TimerGSIV;
 | 
					    Gtdt->VirtualPL2TimerGSIV = GenericTimerInfo->VirtualPL2TimerGSIV;
 | 
				
			||||||
@@ -143,7 +143,7 @@ AddGenericTimerInfo (
 | 
				
			|||||||
  return Status;
 | 
					  return Status;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/** Add the SBSA Generic Watchdog Timers to the GTDT table.
 | 
					/** Add the Arm Generic Watchdog Timers to the GTDT table.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @param [in]  Gtdt             Pointer to the GTDT Table.
 | 
					  @param [in]  Gtdt             Pointer to the GTDT Table.
 | 
				
			||||||
  @param [in]  WatchdogOffset   Offset to the watchdog information in the
 | 
					  @param [in]  WatchdogOffset   Offset to the watchdog information in the
 | 
				
			||||||
@@ -154,26 +154,26 @@ AddGenericTimerInfo (
 | 
				
			|||||||
STATIC
 | 
					STATIC
 | 
				
			||||||
VOID
 | 
					VOID
 | 
				
			||||||
AddGenericWatchdogList (
 | 
					AddGenericWatchdogList (
 | 
				
			||||||
  IN EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE  * CONST Gtdt,
 | 
					  IN EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE  * CONST Gtdt,
 | 
				
			||||||
  IN CONST UINT32                                          WatchdogOffset,
 | 
					  IN CONST UINT32                                          WatchdogOffset,
 | 
				
			||||||
  IN CONST CM_ARM_GENERIC_WATCHDOG_INFO            *       WatchdogInfoList,
 | 
					  IN CONST CM_ARM_GENERIC_WATCHDOG_INFO            *       WatchdogInfoList,
 | 
				
			||||||
  IN       UINT32                                          WatchdogCount
 | 
					  IN       UINT32                                          WatchdogCount
 | 
				
			||||||
  )
 | 
					  )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE  * Watchdog;
 | 
					  EFI_ACPI_6_4_GTDT_ARM_GENERIC_WATCHDOG_STRUCTURE  * Watchdog;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ASSERT (Gtdt != NULL);
 | 
					  ASSERT (Gtdt != NULL);
 | 
				
			||||||
  ASSERT (WatchdogInfoList != NULL);
 | 
					  ASSERT (WatchdogInfoList != NULL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Watchdog = (EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE *)
 | 
					  Watchdog = (EFI_ACPI_6_4_GTDT_ARM_GENERIC_WATCHDOG_STRUCTURE *)
 | 
				
			||||||
             ((UINT8*)Gtdt + WatchdogOffset);
 | 
					             ((UINT8*)Gtdt + WatchdogOffset);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  while (WatchdogCount-- != 0) {
 | 
					  while (WatchdogCount-- != 0) {
 | 
				
			||||||
    // Add watchdog entry
 | 
					    // Add watchdog entry
 | 
				
			||||||
    DEBUG ((DEBUG_INFO, "GTDT: Watchdog = 0x%p\n", Watchdog));
 | 
					    DEBUG ((DEBUG_INFO, "GTDT: Watchdog = 0x%p\n", Watchdog));
 | 
				
			||||||
    Watchdog->Type = EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG;
 | 
					    Watchdog->Type = EFI_ACPI_6_4_GTDT_ARM_GENERIC_WATCHDOG;
 | 
				
			||||||
    Watchdog->Length =
 | 
					    Watchdog->Length =
 | 
				
			||||||
      sizeof (EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE);
 | 
					      sizeof (EFI_ACPI_6_4_GTDT_ARM_GENERIC_WATCHDOG_STRUCTURE);
 | 
				
			||||||
    Watchdog->Reserved = EFI_ACPI_RESERVED_BYTE;
 | 
					    Watchdog->Reserved = EFI_ACPI_RESERVED_BYTE;
 | 
				
			||||||
    Watchdog->RefreshFramePhysicalAddress =
 | 
					    Watchdog->RefreshFramePhysicalAddress =
 | 
				
			||||||
      WatchdogInfoList->RefreshFrameAddress;
 | 
					      WatchdogInfoList->RefreshFrameAddress;
 | 
				
			||||||
@@ -249,7 +249,7 @@ IsGtFrameNumberEqual (
 | 
				
			|||||||
STATIC
 | 
					STATIC
 | 
				
			||||||
EFI_STATUS
 | 
					EFI_STATUS
 | 
				
			||||||
AddGTBlockTimerFrames (
 | 
					AddGTBlockTimerFrames (
 | 
				
			||||||
  IN       EFI_ACPI_6_3_GTDT_GT_BLOCK_TIMER_STRUCTURE *       GtBlockFrame,
 | 
					  IN       EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE *       GtBlockFrame,
 | 
				
			||||||
  IN CONST CM_ARM_GTBLOCK_TIMER_FRAME_INFO            *       GTBlockTimerFrameList,
 | 
					  IN CONST CM_ARM_GTBLOCK_TIMER_FRAME_INFO            *       GTBlockTimerFrameList,
 | 
				
			||||||
  IN       UINT32                                             GTBlockFrameCount
 | 
					  IN       UINT32                                             GTBlockFrameCount
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
@@ -329,15 +329,15 @@ STATIC
 | 
				
			|||||||
EFI_STATUS
 | 
					EFI_STATUS
 | 
				
			||||||
AddGTBlockList (
 | 
					AddGTBlockList (
 | 
				
			||||||
  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL     * CONST CfgMgrProtocol,
 | 
					  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL     * CONST CfgMgrProtocol,
 | 
				
			||||||
  IN EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE    * CONST Gtdt,
 | 
					  IN EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE    * CONST Gtdt,
 | 
				
			||||||
  IN CONST UINT32                                            GTBlockOffset,
 | 
					  IN CONST UINT32                                            GTBlockOffset,
 | 
				
			||||||
  IN CONST CM_ARM_GTBLOCK_INFO                       *       GTBlockInfo,
 | 
					  IN CONST CM_ARM_GTBLOCK_INFO                       *       GTBlockInfo,
 | 
				
			||||||
  IN       UINT32                                            BlockTimerCount
 | 
					  IN       UINT32                                            BlockTimerCount
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  EFI_STATUS                                    Status;
 | 
					  EFI_STATUS                                    Status;
 | 
				
			||||||
  EFI_ACPI_6_3_GTDT_GT_BLOCK_STRUCTURE        * GTBlock;
 | 
					  EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE        * GTBlock;
 | 
				
			||||||
  EFI_ACPI_6_3_GTDT_GT_BLOCK_TIMER_STRUCTURE  * GtBlockFrame;
 | 
					  EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE  * GtBlockFrame;
 | 
				
			||||||
  CM_ARM_GTBLOCK_TIMER_FRAME_INFO             * GTBlockTimerFrameList;
 | 
					  CM_ARM_GTBLOCK_TIMER_FRAME_INFO             * GTBlockTimerFrameList;
 | 
				
			||||||
  UINT32                                        GTBlockTimerFrameCount;
 | 
					  UINT32                                        GTBlockTimerFrameCount;
 | 
				
			||||||
  UINTN                                         Length;
 | 
					  UINTN                                         Length;
 | 
				
			||||||
@@ -345,7 +345,7 @@ AddGTBlockList (
 | 
				
			|||||||
  ASSERT (Gtdt != NULL);
 | 
					  ASSERT (Gtdt != NULL);
 | 
				
			||||||
  ASSERT (GTBlockInfo != NULL);
 | 
					  ASSERT (GTBlockInfo != NULL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  GTBlock = (EFI_ACPI_6_3_GTDT_GT_BLOCK_STRUCTURE *)((UINT8*)Gtdt +
 | 
					  GTBlock = (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE *)((UINT8*)Gtdt +
 | 
				
			||||||
              GTBlockOffset);
 | 
					              GTBlockOffset);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  while (BlockTimerCount-- != 0) {
 | 
					  while (BlockTimerCount-- != 0) {
 | 
				
			||||||
@@ -367,8 +367,8 @@ AddGTBlockList (
 | 
				
			|||||||
      return Status;
 | 
					      return Status;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Length = sizeof (EFI_ACPI_6_3_GTDT_GT_BLOCK_STRUCTURE) +
 | 
					    Length = sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE) +
 | 
				
			||||||
               (sizeof (EFI_ACPI_6_3_GTDT_GT_BLOCK_TIMER_STRUCTURE) *
 | 
					               (sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE) *
 | 
				
			||||||
                GTBlockInfo->GTBlockTimerFrameCount);
 | 
					                GTBlockInfo->GTBlockTimerFrameCount);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Check that the length of the GT block does not
 | 
					    // Check that the length of the GT block does not
 | 
				
			||||||
@@ -386,15 +386,15 @@ AddGTBlockList (
 | 
				
			|||||||
      return Status;
 | 
					      return Status;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    GTBlock->Type = EFI_ACPI_6_3_GTDT_GT_BLOCK;
 | 
					    GTBlock->Type = EFI_ACPI_6_4_GTDT_GT_BLOCK;
 | 
				
			||||||
    GTBlock->Length = (UINT16)Length;
 | 
					    GTBlock->Length = (UINT16)Length;
 | 
				
			||||||
    GTBlock->Reserved = EFI_ACPI_RESERVED_BYTE;
 | 
					    GTBlock->Reserved = EFI_ACPI_RESERVED_BYTE;
 | 
				
			||||||
    GTBlock->CntCtlBase = GTBlockInfo->GTBlockPhysicalAddress;
 | 
					    GTBlock->CntCtlBase = GTBlockInfo->GTBlockPhysicalAddress;
 | 
				
			||||||
    GTBlock->GTBlockTimerCount = GTBlockInfo->GTBlockTimerFrameCount;
 | 
					    GTBlock->GTBlockTimerCount = GTBlockInfo->GTBlockTimerFrameCount;
 | 
				
			||||||
    GTBlock->GTBlockTimerOffset =
 | 
					    GTBlock->GTBlockTimerOffset =
 | 
				
			||||||
      sizeof (EFI_ACPI_6_3_GTDT_GT_BLOCK_STRUCTURE);
 | 
					      sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    GtBlockFrame = (EFI_ACPI_6_3_GTDT_GT_BLOCK_TIMER_STRUCTURE*)
 | 
					    GtBlockFrame = (EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE*)
 | 
				
			||||||
      ((UINT8*)GTBlock + GTBlock->GTBlockTimerOffset);
 | 
					      ((UINT8*)GTBlock + GTBlock->GTBlockTimerOffset);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Add GT Block Timer frames
 | 
					    // Add GT Block Timer frames
 | 
				
			||||||
@@ -413,7 +413,7 @@ AddGTBlockList (
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Next GTBlock
 | 
					    // Next GTBlock
 | 
				
			||||||
    GTBlock = (EFI_ACPI_6_3_GTDT_GT_BLOCK_STRUCTURE *)((UINT8*)GTBlock +
 | 
					    GTBlock = (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE *)((UINT8*)GTBlock +
 | 
				
			||||||
               GTBlock->Length);
 | 
					               GTBlock->Length);
 | 
				
			||||||
    GTBlockInfo++;
 | 
					    GTBlockInfo++;
 | 
				
			||||||
  }// for
 | 
					  }// for
 | 
				
			||||||
@@ -460,7 +460,7 @@ BuildGtdtTable (
 | 
				
			|||||||
  UINT32                                          BlockTimerCount;
 | 
					  UINT32                                          BlockTimerCount;
 | 
				
			||||||
  CM_ARM_GENERIC_WATCHDOG_INFO                  * WatchdogInfoList;
 | 
					  CM_ARM_GENERIC_WATCHDOG_INFO                  * WatchdogInfoList;
 | 
				
			||||||
  CM_ARM_GTBLOCK_INFO                           * GTBlockInfo;
 | 
					  CM_ARM_GTBLOCK_INFO                           * GTBlockInfo;
 | 
				
			||||||
  EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE  * Gtdt;
 | 
					  EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE  * Gtdt;
 | 
				
			||||||
  UINT32                                          Idx;
 | 
					  UINT32                                          Idx;
 | 
				
			||||||
  UINT32                                          GTBlockOffset;
 | 
					  UINT32                                          GTBlockOffset;
 | 
				
			||||||
  UINT32                                          WatchdogOffset;
 | 
					  UINT32                                          WatchdogOffset;
 | 
				
			||||||
@@ -527,11 +527,11 @@ BuildGtdtTable (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  // Calculate the GTDT Table Size
 | 
					  // Calculate the GTDT Table Size
 | 
				
			||||||
  PlatformTimerCount = 0;
 | 
					  PlatformTimerCount = 0;
 | 
				
			||||||
  TableSize = sizeof (EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE);
 | 
					  TableSize = sizeof (EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE);
 | 
				
			||||||
  if (BlockTimerCount != 0) {
 | 
					  if (BlockTimerCount != 0) {
 | 
				
			||||||
    GTBlockOffset = TableSize;
 | 
					    GTBlockOffset = TableSize;
 | 
				
			||||||
    PlatformTimerCount += BlockTimerCount;
 | 
					    PlatformTimerCount += BlockTimerCount;
 | 
				
			||||||
    TableSize += (sizeof (EFI_ACPI_6_3_GTDT_GT_BLOCK_STRUCTURE) *
 | 
					    TableSize += (sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE) *
 | 
				
			||||||
                  BlockTimerCount);
 | 
					                  BlockTimerCount);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for (Idx = 0; Idx < BlockTimerCount; Idx++) {
 | 
					    for (Idx = 0; Idx < BlockTimerCount; Idx++) {
 | 
				
			||||||
@@ -546,7 +546,7 @@ BuildGtdtTable (
 | 
				
			|||||||
          ));
 | 
					          ));
 | 
				
			||||||
        goto error_handler;
 | 
					        goto error_handler;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      TableSize += (sizeof (EFI_ACPI_6_3_GTDT_GT_BLOCK_TIMER_STRUCTURE) *
 | 
					      TableSize += (sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE) *
 | 
				
			||||||
        GTBlockInfo[Idx].GTBlockTimerFrameCount);
 | 
					        GTBlockInfo[Idx].GTBlockTimerFrameCount);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -562,7 +562,7 @@ BuildGtdtTable (
 | 
				
			|||||||
  if (WatchdogCount != 0) {
 | 
					  if (WatchdogCount != 0) {
 | 
				
			||||||
    WatchdogOffset = TableSize;
 | 
					    WatchdogOffset = TableSize;
 | 
				
			||||||
    PlatformTimerCount += WatchdogCount;
 | 
					    PlatformTimerCount += WatchdogCount;
 | 
				
			||||||
    TableSize += (sizeof (EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE) *
 | 
					    TableSize += (sizeof (EFI_ACPI_6_4_GTDT_ARM_GENERIC_WATCHDOG_STRUCTURE) *
 | 
				
			||||||
                  WatchdogCount);
 | 
					                  WatchdogCount);
 | 
				
			||||||
    DEBUG ((
 | 
					    DEBUG ((
 | 
				
			||||||
      DEBUG_INFO,
 | 
					      DEBUG_INFO,
 | 
				
			||||||
@@ -585,7 +585,7 @@ BuildGtdtTable (
 | 
				
			|||||||
    goto error_handler;
 | 
					    goto error_handler;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Gtdt = (EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE*)*Table;
 | 
					  Gtdt = (EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE*)*Table;
 | 
				
			||||||
  DEBUG ((
 | 
					  DEBUG ((
 | 
				
			||||||
    DEBUG_INFO,
 | 
					    DEBUG_INFO,
 | 
				
			||||||
    "GTDT: Gtdt = 0x%p TableSize = 0x%x\n",
 | 
					    "GTDT: Gtdt = 0x%p TableSize = 0x%x\n",
 | 
				
			||||||
@@ -712,9 +712,9 @@ ACPI_TABLE_GENERATOR GtdtGenerator = {
 | 
				
			|||||||
  // Generator Description
 | 
					  // Generator Description
 | 
				
			||||||
  L"ACPI.STD.GTDT.GENERATOR",
 | 
					  L"ACPI.STD.GTDT.GENERATOR",
 | 
				
			||||||
  // ACPI Table Signature
 | 
					  // ACPI Table Signature
 | 
				
			||||||
  EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE,
 | 
					  EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE,
 | 
				
			||||||
  // ACPI Table Revision supported by this Generator
 | 
					  // ACPI Table Revision supported by this Generator
 | 
				
			||||||
  EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION,
 | 
					  EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION,
 | 
				
			||||||
  // Minimum ACPI Table Revision supported by this Generator
 | 
					  // Minimum ACPI Table Revision supported by this Generator
 | 
				
			||||||
  EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION,
 | 
					  EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION,
 | 
				
			||||||
  // Creator ID
 | 
					  // Creator ID
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,21 +10,19 @@
 | 
				
			|||||||
  - Generic ACPI for Arm Components 1.0 Platform Design Document
 | 
					  - Generic ACPI for Arm Components 1.0 Platform Design Document
 | 
				
			||||||
**/
 | 
					**/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <IndustryStandard/DebugPort2Table.h>
 | 
					 | 
				
			||||||
#include <Library/AcpiLib.h>
 | 
					#include <Library/AcpiLib.h>
 | 
				
			||||||
#include <Library/BaseLib.h>
 | 
					#include <Library/BaseLib.h>
 | 
				
			||||||
#include <Library/BaseMemoryLib.h>
 | 
					#include <Library/BaseMemoryLib.h>
 | 
				
			||||||
#include <Library/DebugLib.h>
 | 
					#include <Library/DebugLib.h>
 | 
				
			||||||
#include <Library/MemoryAllocationLib.h>
 | 
					#include <Library/MemoryAllocationLib.h>
 | 
				
			||||||
#include <Library/UefiBootServicesTableLib.h>
 | 
					 | 
				
			||||||
#include <Protocol/AcpiTable.h>
 | 
					#include <Protocol/AcpiTable.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Module specific include files.
 | 
					// Module specific include files.
 | 
				
			||||||
#include <AcpiTableGenerator.h>
 | 
					#include <AcpiTableGenerator.h>
 | 
				
			||||||
#include <ConfigurationManagerObject.h>
 | 
					#include <ConfigurationManagerObject.h>
 | 
				
			||||||
#include <ConfigurationManagerHelper.h>
 | 
					#include <ConfigurationManagerHelper.h>
 | 
				
			||||||
 | 
					#include <Library/AcpiHelperLib.h>
 | 
				
			||||||
#include <Library/AmlLib/AmlLib.h>
 | 
					#include <Library/AmlLib/AmlLib.h>
 | 
				
			||||||
#include <Library/TableHelperLib.h>
 | 
					 | 
				
			||||||
#include <Protocol/ConfigurationManagerProtocol.h>
 | 
					#include <Protocol/ConfigurationManagerProtocol.h>
 | 
				
			||||||
#include "SsdtCmn600Generator.h"
 | 
					#include "SsdtCmn600Generator.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -286,7 +284,7 @@ FixupCmn600Info (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  // Get the first Rd node in the "_CRS" object.
 | 
					  // Get the first Rd node in the "_CRS" object.
 | 
				
			||||||
  // This is the PERIPHBASE node.
 | 
					  // This is the PERIPHBASE node.
 | 
				
			||||||
  Status = AmlNameOpCrsGetFirstRdNode (NameOpCrsNode, &CmnPeriphBaseRdNode);
 | 
					  Status = AmlNameOpGetFirstRdNode (NameOpCrsNode, &CmnPeriphBaseRdNode);
 | 
				
			||||||
  if (EFI_ERROR (Status)) {
 | 
					  if (EFI_ERROR (Status)) {
 | 
				
			||||||
    goto error_handler;
 | 
					    goto error_handler;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
@@ -309,7 +307,7 @@ FixupCmn600Info (
 | 
				
			|||||||
  // Get the QWord node corresponding to the ROOTNODEBASE.
 | 
					  // Get the QWord node corresponding to the ROOTNODEBASE.
 | 
				
			||||||
  // It is the second Resource Data element in the BufferNode's
 | 
					  // It is the second Resource Data element in the BufferNode's
 | 
				
			||||||
  // variable list of arguments.
 | 
					  // variable list of arguments.
 | 
				
			||||||
  Status = AmlNameOpCrsGetNextRdNode (
 | 
					  Status = AmlNameOpGetNextRdNode (
 | 
				
			||||||
             CmnPeriphBaseRdNode,
 | 
					             CmnPeriphBaseRdNode,
 | 
				
			||||||
             &CmnRootNodeBaseRdNode
 | 
					             &CmnRootNodeBaseRdNode
 | 
				
			||||||
             );
 | 
					             );
 | 
				
			||||||
@@ -338,8 +336,8 @@ FixupCmn600Info (
 | 
				
			|||||||
  // Resource Data nodes.
 | 
					  // Resource Data nodes.
 | 
				
			||||||
  for (Index = 0; Index < Cmn600Info->DtcCount; Index++) {
 | 
					  for (Index = 0; Index < Cmn600Info->DtcCount; Index++) {
 | 
				
			||||||
    DtcInt = &Cmn600Info->DtcInterrupt[Index];
 | 
					    DtcInt = &Cmn600Info->DtcInterrupt[Index];
 | 
				
			||||||
    Status = AmlCodeGenCrsAddRdInterrupt (
 | 
					
 | 
				
			||||||
               NameOpCrsNode,
 | 
					    Status = AmlCodeGenRdInterrupt (
 | 
				
			||||||
               ((DtcInt->Flags &
 | 
					               ((DtcInt->Flags &
 | 
				
			||||||
                 EFI_ACPI_EXTENDED_INTERRUPT_FLAG_PRODUCER_CONSUMER_MASK) != 0),
 | 
					                 EFI_ACPI_EXTENDED_INTERRUPT_FLAG_PRODUCER_CONSUMER_MASK) != 0),
 | 
				
			||||||
               ((DtcInt->Flags &
 | 
					               ((DtcInt->Flags &
 | 
				
			||||||
@@ -349,7 +347,9 @@ FixupCmn600Info (
 | 
				
			|||||||
               ((DtcInt->Flags &
 | 
					               ((DtcInt->Flags &
 | 
				
			||||||
                 EFI_ACPI_EXTENDED_INTERRUPT_FLAG_SHARABLE_MASK) != 0),
 | 
					                 EFI_ACPI_EXTENDED_INTERRUPT_FLAG_SHARABLE_MASK) != 0),
 | 
				
			||||||
               (UINT32*)&DtcInt->Interrupt,
 | 
					               (UINT32*)&DtcInt->Interrupt,
 | 
				
			||||||
               1
 | 
					               1,
 | 
				
			||||||
 | 
					               NameOpCrsNode,
 | 
				
			||||||
 | 
					               NULL
 | 
				
			||||||
               );
 | 
					               );
 | 
				
			||||||
    if (EFI_ERROR (Status)) {
 | 
					    if (EFI_ERROR (Status)) {
 | 
				
			||||||
      goto error_handler;
 | 
					      goto error_handler;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,7 @@
 | 
				
			|||||||
## @file
 | 
					## @file
 | 
				
			||||||
# Ssdt CMN-600 Table Generator
 | 
					# Ssdt CMN-600 Table Generator
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  Copyright (c) 2020, Arm Limited. All rights reserved.<BR>
 | 
					#  Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
					#  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
@@ -29,6 +29,7 @@
 | 
				
			|||||||
  DynamicTablesPkg/DynamicTablesPkg.dec
 | 
					  DynamicTablesPkg/DynamicTablesPkg.dec
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[LibraryClasses]
 | 
					[LibraryClasses]
 | 
				
			||||||
 | 
					  AcpiHelperLib
 | 
				
			||||||
  AmlLib
 | 
					  AmlLib
 | 
				
			||||||
  BaseLib
 | 
					  BaseLib
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -0,0 +1,134 @@
 | 
				
			|||||||
 | 
					/** @file
 | 
				
			||||||
 | 
					  SSDT Cpu Topology Table Generator.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
 | 
				
			||||||
 | 
					  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @par Reference(s):
 | 
				
			||||||
 | 
					    - ACPI 6.3 Specification - January 2019 - s8.4 Declaring Processors
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifndef SSDT_CPU_TOPOLOGY_GENERATOR_H_
 | 
				
			||||||
 | 
					#define SSDT_CPU_TOPOLOGY_GENERATOR_H_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#pragma pack(1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Mask for the flags that need to be checked.
 | 
				
			||||||
 | 
					#define PPTT_PROCESSOR_MASK   (                                               \
 | 
				
			||||||
 | 
					          (EFI_ACPI_6_3_PPTT_PACKAGE_PHYSICAL)          |                     \
 | 
				
			||||||
 | 
					          (EFI_ACPI_6_3_PPTT_PROCESSOR_ID_VALID << 1)   |                     \
 | 
				
			||||||
 | 
					          (EFI_ACPI_6_3_PPTT_NODE_IS_LEAF << 3))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Mask for the cpu flags.
 | 
				
			||||||
 | 
					#define PPTT_CPU_PROCESSOR_MASK   (                                           \
 | 
				
			||||||
 | 
					          (EFI_ACPI_6_3_PPTT_PACKAGE_NOT_PHYSICAL)      |                     \
 | 
				
			||||||
 | 
					          (EFI_ACPI_6_3_PPTT_PROCESSOR_ID_VALID << 1)   |                     \
 | 
				
			||||||
 | 
					          (EFI_ACPI_6_3_PPTT_NODE_IS_LEAF << 3))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Mask for the cluster flags.
 | 
				
			||||||
 | 
					// Even though a _UID is generated for clusters, it is simpler to use
 | 
				
			||||||
 | 
					// EFI_ACPI_6_3_PPTT_PROCESSOR_ID_INVALID and to not match the cluster id of
 | 
				
			||||||
 | 
					// the PPTT table (not sure the PPTT table is generated).
 | 
				
			||||||
 | 
					#define PPTT_CLUSTER_PROCESSOR_MASK   (                                       \
 | 
				
			||||||
 | 
					          (EFI_ACPI_6_3_PPTT_PACKAGE_NOT_PHYSICAL)      |                     \
 | 
				
			||||||
 | 
					          (EFI_ACPI_6_3_PPTT_PROCESSOR_ID_INVALID << 1) |                     \
 | 
				
			||||||
 | 
					          (EFI_ACPI_6_3_PPTT_NODE_IS_NOT_LEAF << 3))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** LPI states are stored in the ASL namespace at '\_SB_.Lxxx',
 | 
				
			||||||
 | 
					    with xxx being the node index of the LPI state.
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
 | 
					#define SB_SCOPE                            "\\_SB_"
 | 
				
			||||||
 | 
					#define SB_SCOPE_PREFIX                     SB_SCOPE "."
 | 
				
			||||||
 | 
					/// Size of the SB_SCOPE_PREFIX string.
 | 
				
			||||||
 | 
					#define SB_SCOPE_PREFIX_SIZE                sizeof (SB_SCOPE_PREFIX)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/// HID for a processor device.
 | 
				
			||||||
 | 
					#define ACPI_HID_PROCESSOR_DEVICE           "ACPI0007"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/// HID for a processor container device.
 | 
				
			||||||
 | 
					#define ACPI_HID_PROCESSOR_CONTAINER_DEVICE "ACPI0010"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** Node names of Cpus and Clusters are 'Cxxx', and 'Lxxx' for LPI states.
 | 
				
			||||||
 | 
					    The 'xxx' is an index on 12 bits is given to node name,
 | 
				
			||||||
 | 
					    thus the limitation in the number of nodes.
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
 | 
					#define MAX_NODE_COUNT                      (1 << 12)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** A structure used to handle the Lpi structures referencing.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  A CM_ARM_PROC_HIERARCHY_INFO structure references a CM_ARM_OBJ_REF.
 | 
				
			||||||
 | 
					  This CM_ARM_OBJ_REF references CM_ARM_LPI_INFO structures.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Example:
 | 
				
			||||||
 | 
					  (Cpu0)                                   (Cpu1)
 | 
				
			||||||
 | 
					  CM_ARM_PROC_HIERARCHY_INFO               CM_ARM_PROC_HIERARCHY_INFO
 | 
				
			||||||
 | 
					              |                                       |
 | 
				
			||||||
 | 
					              +----------------------------------------
 | 
				
			||||||
 | 
					              |
 | 
				
			||||||
 | 
					              v
 | 
				
			||||||
 | 
					  (List of references to Lpi states)
 | 
				
			||||||
 | 
					  CM_ARM_OBJ_REF
 | 
				
			||||||
 | 
					              |
 | 
				
			||||||
 | 
					              +----------------------------------------
 | 
				
			||||||
 | 
					              |                                       |
 | 
				
			||||||
 | 
					              v                                       v
 | 
				
			||||||
 | 
					  (A first Lpi state)                       (A second Lpi state)
 | 
				
			||||||
 | 
					  CM_ARM_LPI_INFO[0]                        CM_ARM_LPI_INFO[1]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Here, Cpu0 and Cpu1 have the same Lpi states. Both CM_ARM_PROC_HIERARCHY_INFO
 | 
				
			||||||
 | 
					  structures reference the same CM_ARM_OBJ_REF. An entry is created in the
 | 
				
			||||||
 | 
					  TokenTable such as:
 | 
				
			||||||
 | 
					  0 <-> CM_ARM_OBJ_REF
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  This will lead to the creation of this pseudo-ASL code where Cpu0 and Cpu1
 | 
				
			||||||
 | 
					  return the same object at \_SB.L000:
 | 
				
			||||||
 | 
					  Scope (\_SB) {
 | 
				
			||||||
 | 
					    Device (C000) {
 | 
				
			||||||
 | 
					      [...]
 | 
				
			||||||
 | 
					      Method (_LPI) {
 | 
				
			||||||
 | 
					        Return (\_SB.L000)
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    } // C000
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Device (C001) {
 | 
				
			||||||
 | 
					      [...]
 | 
				
			||||||
 | 
					      Method (_LPI) {
 | 
				
			||||||
 | 
					        Return (\_SB.L000)
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    } // C001
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Lpi states
 | 
				
			||||||
 | 
					    Name (L000, Package (0x05) {
 | 
				
			||||||
 | 
					      [...]
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
 | 
					typedef struct TokenTable {
 | 
				
			||||||
 | 
					  /// TokenTable, a table allowing to map:
 | 
				
			||||||
 | 
					  /// Index <-> CM_OBJECT_TOKEN (to CM_ARM_LPI_INFO structures).
 | 
				
			||||||
 | 
					  CM_OBJECT_TOKEN             * Table;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  /// Last used index of the TokenTable.
 | 
				
			||||||
 | 
					  /// LastIndex is bound by ProcNodeCount.
 | 
				
			||||||
 | 
					  UINT32                        LastIndex;
 | 
				
			||||||
 | 
					} TOKEN_TABLE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** A structure holding the Cpu topology generator and additional private data.
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
 | 
					typedef struct AcpiCpuTopologyGenerator {
 | 
				
			||||||
 | 
					  /// ACPI Table generator header
 | 
				
			||||||
 | 
					  ACPI_TABLE_GENERATOR          Header;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Private fields are defined from here.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  /// Private object used to handle token referencing.
 | 
				
			||||||
 | 
					  TOKEN_TABLE                   TokenTable;
 | 
				
			||||||
 | 
					  /// List of CM_ARM_PROC_HIERARCHY_INFO CM objects.
 | 
				
			||||||
 | 
					  CM_ARM_PROC_HIERARCHY_INFO  * ProcNodeList;
 | 
				
			||||||
 | 
					  /// Count of CM_ARM_PROC_HIERARCHY_INFO CM objects.
 | 
				
			||||||
 | 
					  UINT32                        ProcNodeCount;
 | 
				
			||||||
 | 
					} ACPI_CPU_TOPOLOGY_GENERATOR;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#pragma pack()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#endif // SSDT_CPU_TOPOLOGY_GENERATOR_H_
 | 
				
			||||||
@@ -0,0 +1,33 @@
 | 
				
			|||||||
 | 
					## @file
 | 
				
			||||||
 | 
					# Ssdt Cpu Topology Table Generator
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#  Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
				
			||||||
 | 
					##
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[Defines]
 | 
				
			||||||
 | 
					  INF_VERSION    = 0x0001001B
 | 
				
			||||||
 | 
					  BASE_NAME      = SsdtCpuTopologyLibArm
 | 
				
			||||||
 | 
					  FILE_GUID      = F2835EB6-4B05-48D4-A475-147DA0F3755C
 | 
				
			||||||
 | 
					  VERSION_STRING = 1.0
 | 
				
			||||||
 | 
					  MODULE_TYPE    = DXE_DRIVER
 | 
				
			||||||
 | 
					  LIBRARY_CLASS  = NULL|DXE_DRIVER
 | 
				
			||||||
 | 
					  CONSTRUCTOR    = AcpiSsdtCpuTopologyLibConstructor
 | 
				
			||||||
 | 
					  DESTRUCTOR     = AcpiSsdtCpuTopologyLibDestructor
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[Sources]
 | 
				
			||||||
 | 
					  SsdtCpuTopologyGenerator.c
 | 
				
			||||||
 | 
					  SsdtCpuTopologyGenerator.h
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[Packages]
 | 
				
			||||||
 | 
					  MdePkg/MdePkg.dec
 | 
				
			||||||
 | 
					  MdeModulePkg/MdeModulePkg.dec
 | 
				
			||||||
 | 
					  EmbeddedPkg/EmbeddedPkg.dec
 | 
				
			||||||
 | 
					  ArmPlatformPkg/ArmPlatformPkg.dec
 | 
				
			||||||
 | 
					  DynamicTablesPkg/DynamicTablesPkg.dec
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[LibraryClasses]
 | 
				
			||||||
 | 
					  AcpiHelperLib
 | 
				
			||||||
 | 
					  AmlLib
 | 
				
			||||||
 | 
					  BaseLib
 | 
				
			||||||
@@ -6,21 +6,19 @@
 | 
				
			|||||||
  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
					  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
				
			||||||
**/
 | 
					**/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <IndustryStandard/DebugPort2Table.h>
 | 
					 | 
				
			||||||
#include <Library/AcpiLib.h>
 | 
					#include <Library/AcpiLib.h>
 | 
				
			||||||
#include <Library/BaseLib.h>
 | 
					#include <Library/BaseLib.h>
 | 
				
			||||||
#include <Library/BaseMemoryLib.h>
 | 
					#include <Library/BaseMemoryLib.h>
 | 
				
			||||||
#include <Library/DebugLib.h>
 | 
					#include <Library/DebugLib.h>
 | 
				
			||||||
#include <Library/MemoryAllocationLib.h>
 | 
					#include <Library/MemoryAllocationLib.h>
 | 
				
			||||||
#include <Library/UefiBootServicesTableLib.h>
 | 
					 | 
				
			||||||
#include <Protocol/AcpiTable.h>
 | 
					#include <Protocol/AcpiTable.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Module specific include files.
 | 
					// Module specific include files.
 | 
				
			||||||
#include <AcpiTableGenerator.h>
 | 
					#include <AcpiTableGenerator.h>
 | 
				
			||||||
#include <ConfigurationManagerObject.h>
 | 
					#include <ConfigurationManagerObject.h>
 | 
				
			||||||
#include <ConfigurationManagerHelper.h>
 | 
					#include <ConfigurationManagerHelper.h>
 | 
				
			||||||
 | 
					#include <Library/AcpiHelperLib.h>
 | 
				
			||||||
#include <Library/SsdtSerialPortFixupLib.h>
 | 
					#include <Library/SsdtSerialPortFixupLib.h>
 | 
				
			||||||
#include <Library/TableHelperLib.h>
 | 
					 | 
				
			||||||
#include <Protocol/ConfigurationManagerProtocol.h>
 | 
					#include <Protocol/ConfigurationManagerProtocol.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/** ARM standard SSDT Serial Port Table Generator
 | 
					/** ARM standard SSDT Serial Port Table Generator
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,7 @@
 | 
				
			|||||||
## @file
 | 
					## @file
 | 
				
			||||||
# Ssdt Serial Port Table Generator
 | 
					# Ssdt Serial Port Table Generator
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.<BR>
 | 
					#  Copyright (c) 2019 - 2021, Arm Limited. All rights reserved.<BR>
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
					#  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
@@ -27,7 +27,7 @@
 | 
				
			|||||||
  DynamicTablesPkg/DynamicTablesPkg.dec
 | 
					  DynamicTablesPkg/DynamicTablesPkg.dec
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[LibraryClasses]
 | 
					[LibraryClasses]
 | 
				
			||||||
 | 
					  AcpiHelperLib
 | 
				
			||||||
  AmlLib
 | 
					  AmlLib
 | 
				
			||||||
  BaseLib
 | 
					  BaseLib
 | 
				
			||||||
  TableHelperLib
 | 
					 | 
				
			||||||
  SsdtSerialPortFixupLib
 | 
					  SsdtSerialPortFixupLib
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										210
									
								
								DynamicTablesPkg/Library/Common/AcpiHelperLib/AcpiHelper.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										210
									
								
								DynamicTablesPkg/Library/Common/AcpiHelperLib/AcpiHelper.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,210 @@
 | 
				
			|||||||
 | 
					/** @file
 | 
				
			||||||
 | 
					  Acpi Helper
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.<BR>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <Library/BaseLib.h>
 | 
				
			||||||
 | 
					#include <Library/DebugLib.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Module specific include files.
 | 
				
			||||||
 | 
					#include <Library/AcpiHelperLib.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** Convert a hex number to its ASCII code.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 @param [in]  Hex   Hex number to convert.
 | 
				
			||||||
 | 
					                    Must be 0 <= x < 16.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 @return The ASCII code corresponding to x.
 | 
				
			||||||
 | 
					         -1 if error.
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					UINT8
 | 
				
			||||||
 | 
					EFIAPI
 | 
				
			||||||
 | 
					AsciiFromHex (
 | 
				
			||||||
 | 
					  IN  UINT8   Hex
 | 
				
			||||||
 | 
					  )
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  if (Hex < 10) {
 | 
				
			||||||
 | 
					    return (UINT8)(Hex + '0');
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if (Hex < 16) {
 | 
				
			||||||
 | 
					    return (UINT8)(Hex - 10 + 'A');
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  ASSERT (FALSE);
 | 
				
			||||||
 | 
					  return (UINT8)-1;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** Convert an ASCII char representing an hexadecimal number
 | 
				
			||||||
 | 
					    to its integer value.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 @param [in]  Char  Char to convert.
 | 
				
			||||||
 | 
					                    Must be between '0'-'9' or 'A'-'F' or 'a'-'f'.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 @return The corresponding integer (between 0-16).
 | 
				
			||||||
 | 
					         -1 if error.
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					UINT8
 | 
				
			||||||
 | 
					EFIAPI
 | 
				
			||||||
 | 
					HexFromAscii (
 | 
				
			||||||
 | 
					  IN  CHAR8   Char
 | 
				
			||||||
 | 
					  )
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  if ((Char >= '0') && (Char <= '9')) {
 | 
				
			||||||
 | 
					    return (UINT8)(Char - '0');
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if ((Char >= 'A') && (Char <= 'F')) {
 | 
				
			||||||
 | 
					    return (UINT8)(Char - 'A' + 10);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if ((Char >= 'a') && (Char <= 'f')) {
 | 
				
			||||||
 | 
					    return (UINT8)(Char - 'a' + 10);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  ASSERT (FALSE);
 | 
				
			||||||
 | 
					  return (UINT8)-1;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** Check if a HID is a valid PNP ID.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @param     [in] Hid     The Hid to validate.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @retval    TRUE         The Hid is a valid PNP ID.
 | 
				
			||||||
 | 
					  @retval    FALSE        The Hid is not a valid PNP ID.
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					BOOLEAN
 | 
				
			||||||
 | 
					IsValidPnpId (
 | 
				
			||||||
 | 
					  IN  CONST CHAR8  * Hid
 | 
				
			||||||
 | 
					  )
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  UINTN Index;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if (AsciiStrLen (Hid) != 7) {
 | 
				
			||||||
 | 
					    return FALSE;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // A valid PNP ID must be of the form "AAA####"
 | 
				
			||||||
 | 
					  // where A is an uppercase letter and # is a hex digit.
 | 
				
			||||||
 | 
					  for (Index = 0; Index < 3; Index++) {
 | 
				
			||||||
 | 
					    if (!IS_UPPER_CHAR (Hid[Index])) {
 | 
				
			||||||
 | 
					      return FALSE;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  for (Index = 3; Index < 7; Index++) {
 | 
				
			||||||
 | 
					    if (!IS_UPPER_HEX (Hid[Index])) {
 | 
				
			||||||
 | 
					      return FALSE;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  return TRUE;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** Check if a HID is a valid ACPI ID.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @param     [in] Hid     The Hid to validate.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @retval    TRUE         The Hid is a valid ACPI ID.
 | 
				
			||||||
 | 
					  @retval    FALSE        The Hid is not a valid ACPI ID.
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					BOOLEAN
 | 
				
			||||||
 | 
					IsValidAcpiId (
 | 
				
			||||||
 | 
					  IN  CONST CHAR8  * Hid
 | 
				
			||||||
 | 
					  )
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  UINTN Index;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if (AsciiStrLen (Hid) != 8) {
 | 
				
			||||||
 | 
					    return FALSE;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // A valid ACPI ID must be of the form "NNNN####"
 | 
				
			||||||
 | 
					  // where N is an uppercase letter or a digit ('0'-'9')
 | 
				
			||||||
 | 
					  // and # is a hex digit.
 | 
				
			||||||
 | 
					  for (Index = 0; Index < 4; Index++) {
 | 
				
			||||||
 | 
					    if (!(IS_UPPER_CHAR (Hid[Index]) || IS_DIGIT (Hid[Index]))) {
 | 
				
			||||||
 | 
					      return FALSE;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  for (Index = 4; Index < 8; Index++) {
 | 
				
			||||||
 | 
					    if (!IS_UPPER_HEX (Hid[Index])) {
 | 
				
			||||||
 | 
					      return FALSE;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  return TRUE;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** Convert a EisaId string to its compressed UINT32 equivalent.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Cf. ACPI 6.4 specification, s19.3.4 "ASL Macros": "Eisaid"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @param  [in]  EisaIdStr   Input EisaId string.
 | 
				
			||||||
 | 
					  @param  [out] EisaIdInt   Output EisaId UINT32 (compressed).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @retval EFI_SUCCESS             The function completed successfully.
 | 
				
			||||||
 | 
					  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					EFI_STATUS
 | 
				
			||||||
 | 
					EFIAPI
 | 
				
			||||||
 | 
					AmlGetEisaIdFromString (
 | 
				
			||||||
 | 
					  IN  CONST CHAR8   * EisaIdStr,
 | 
				
			||||||
 | 
					  OUT       UINT32  * EisaIdInt
 | 
				
			||||||
 | 
					  )
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  if ((EisaIdStr == NULL)         ||
 | 
				
			||||||
 | 
					      (!IsValidPnpId (EisaIdStr)) ||
 | 
				
			||||||
 | 
					      (EisaIdInt == NULL)) {
 | 
				
			||||||
 | 
					    ASSERT (0);
 | 
				
			||||||
 | 
					    return EFI_INVALID_PARAMETER;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  /* Cf. ACPI 6.4 specification, s19.3.4 "ASL Macros": "Eisaid"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Converts and compresses the 7-character text argument into its corresponding
 | 
				
			||||||
 | 
					  4-byte numeric EISA ID encoding (Integer). This can be used when declaring
 | 
				
			||||||
 | 
					  IDs for devices that are EISA IDs.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  The algorithm used to convert the TextID is as shown in the following
 | 
				
			||||||
 | 
					  example:
 | 
				
			||||||
 | 
					    Starting with a seven character input string "PNP0303", we want to create
 | 
				
			||||||
 | 
					    a DWordConst. This string contains a three character manufacturer code
 | 
				
			||||||
 | 
					    "PNP", a three character hex product identifier "030", and a one character
 | 
				
			||||||
 | 
					    revision identifier "3".
 | 
				
			||||||
 | 
					    The compressed manufacturer code is created as follows:
 | 
				
			||||||
 | 
					      1) Find hex ASCII value for each letter
 | 
				
			||||||
 | 
					      2) Subtract 40h from each ASCII value
 | 
				
			||||||
 | 
					      3) Retain 5 least significant bits for each letter and discard remaining
 | 
				
			||||||
 | 
					         0's:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      Byte 0:
 | 
				
			||||||
 | 
					        Bit 7: reserved (0)
 | 
				
			||||||
 | 
					        Bit 6-2: 1st character of compressed mfg code "P"
 | 
				
			||||||
 | 
					        Bit 1-0: Upper 2 bits of 2nd character of mfg code "N"
 | 
				
			||||||
 | 
					      Byte 1:
 | 
				
			||||||
 | 
					        Bit 7-5: Lower 3 bits of 2nd character of mfg code "N"
 | 
				
			||||||
 | 
					        Bit 4-0: 3rd character of mfg code "P"
 | 
				
			||||||
 | 
					      Byte 2:
 | 
				
			||||||
 | 
					        Bit 7-4: 1st hex digit of product number "0"
 | 
				
			||||||
 | 
					        Bit 3-0: 2nd hex digit of product number "3"
 | 
				
			||||||
 | 
					      Byte 3:
 | 
				
			||||||
 | 
					        Bit 7-4: 3rd hex digit of product number "0"
 | 
				
			||||||
 | 
					        Bit 3-0: 4th hex digit of product number "3"
 | 
				
			||||||
 | 
					  */
 | 
				
			||||||
 | 
					  *EisaIdInt = SwapBytes32 (
 | 
				
			||||||
 | 
					    ((EisaIdStr[0] - 0x40) << 26)       |
 | 
				
			||||||
 | 
					    ((EisaIdStr[1] - 0x40) << 21)       |
 | 
				
			||||||
 | 
					    ((EisaIdStr[2] - 0x40) << 16)       |
 | 
				
			||||||
 | 
					    (HexFromAscii (EisaIdStr[3]) << 12) |
 | 
				
			||||||
 | 
					    (HexFromAscii (EisaIdStr[4]) << 8)  |
 | 
				
			||||||
 | 
					    (HexFromAscii (EisaIdStr[5]) << 4)  |
 | 
				
			||||||
 | 
					    (HexFromAscii (EisaIdStr[6]))
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  return EFI_SUCCESS;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -0,0 +1,25 @@
 | 
				
			|||||||
 | 
					## @file
 | 
				
			||||||
 | 
					#  Acpi Helper
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#  Copyright (c) 2021, ARM Limited. All rights reserved.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
				
			||||||
 | 
					##
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[Defines]
 | 
				
			||||||
 | 
					  INF_VERSION    = 0x0001001B
 | 
				
			||||||
 | 
					  BASE_NAME      = AcpiHelperLib
 | 
				
			||||||
 | 
					  FILE_GUID      = 45968FB4-A724-46FC-822D-F9E557601F9B
 | 
				
			||||||
 | 
					  VERSION_STRING = 1.0
 | 
				
			||||||
 | 
					  MODULE_TYPE    = DXE_DRIVER
 | 
				
			||||||
 | 
					  LIBRARY_CLASS  = AcpiHelperLib
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[Sources]
 | 
				
			||||||
 | 
					  AcpiHelper.c
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[Packages]
 | 
				
			||||||
 | 
					  MdePkg/MdePkg.dec
 | 
				
			||||||
 | 
					  DynamicTablesPkg/DynamicTablesPkg.dec
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[LibraryClasses]
 | 
				
			||||||
 | 
					  BaseLib
 | 
				
			||||||
@@ -2,7 +2,7 @@
 | 
				
			|||||||
  AML Print Function.
 | 
					  AML Print Function.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved. <BR>
 | 
					  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved. <BR>
 | 
				
			||||||
  Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.<BR>
 | 
					  Copyright (c) 2019 - 2021, Arm Limited. All rights reserved.<BR>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
					  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
				
			||||||
**/
 | 
					**/
 | 
				
			||||||
@@ -199,7 +199,7 @@ AmlDbgPrintNodeHeader (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  DEBUG ((
 | 
					  DEBUG ((
 | 
				
			||||||
    DEBUG_INFO,
 | 
					    DEBUG_INFO,
 | 
				
			||||||
    "%3d | %-15s | ",
 | 
					    "%3d | %-15a | ",
 | 
				
			||||||
    Level,
 | 
					    Level,
 | 
				
			||||||
    NodeTypeStrTbl[Node->NodeType]
 | 
					    NodeTypeStrTbl[Node->NodeType]
 | 
				
			||||||
    ));
 | 
					    ));
 | 
				
			||||||
@@ -227,7 +227,7 @@ AmlDbgPrintDataNode (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  AmlDbgPrintNodeHeader ((AML_NODE_HEADER*)DataNode, Level);
 | 
					  AmlDbgPrintNodeHeader ((AML_NODE_HEADER*)DataNode, Level);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  DEBUG ((DEBUG_INFO, "%-36s | ", NodeDataTypeStrTbl[DataNode->DataType]));
 | 
					  DEBUG ((DEBUG_INFO, "%-36a | ", NodeDataTypeStrTbl[DataNode->DataType]));
 | 
				
			||||||
  DEBUG ((DEBUG_INFO, "0x%04x | ", DataNode->Size));
 | 
					  DEBUG ((DEBUG_INFO, "0x%04x | ", DataNode->Size));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if ((DataNode->DataType == EAmlNodeDataTypeNameString) ||
 | 
					  if ((DataNode->DataType == EAmlNodeDataTypeNameString) ||
 | 
				
			||||||
@@ -300,13 +300,13 @@ AmlDbgPrintObjectNode (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  // Print a string corresponding to the field object OpCode/SubOpCode.
 | 
					  // Print a string corresponding to the field object OpCode/SubOpCode.
 | 
				
			||||||
  if (AmlNodeHasAttribute (ObjectNode, AML_IS_FIELD_ELEMENT)) {
 | 
					  if (AmlNodeHasAttribute (ObjectNode, AML_IS_FIELD_ELEMENT)) {
 | 
				
			||||||
    DEBUG ((DEBUG_INFO, "%-15s ", AmlGetFieldOpCodeStr (
 | 
					    DEBUG ((DEBUG_INFO, "%-15a ", AmlGetFieldOpCodeStr (
 | 
				
			||||||
                                    ObjectNode->AmlByteEncoding->OpCode,
 | 
					                                    ObjectNode->AmlByteEncoding->OpCode,
 | 
				
			||||||
                                    0
 | 
					                                    0
 | 
				
			||||||
                                    )));
 | 
					                                    )));
 | 
				
			||||||
  } else {
 | 
					  } else {
 | 
				
			||||||
    // Print a string corresponding to the object OpCode/SubOpCode.
 | 
					    // Print a string corresponding to the object OpCode/SubOpCode.
 | 
				
			||||||
    DEBUG ((DEBUG_INFO, "%-15s | ", AmlGetOpCodeStr (
 | 
					    DEBUG ((DEBUG_INFO, "%-15a | ", AmlGetOpCodeStr (
 | 
				
			||||||
                                      ObjectNode->AmlByteEncoding->OpCode,
 | 
					                                      ObjectNode->AmlByteEncoding->OpCode,
 | 
				
			||||||
                                      ObjectNode->AmlByteEncoding->SubOpCode)
 | 
					                                      ObjectNode->AmlByteEncoding->SubOpCode)
 | 
				
			||||||
                                      ));
 | 
					                                      ));
 | 
				
			||||||
@@ -378,19 +378,19 @@ AmlDbgPrintTableHeader (
 | 
				
			|||||||
  DEBUG ((DEBUG_INFO, "Lvl | Node Type       |\n"));
 | 
					  DEBUG ((DEBUG_INFO, "Lvl | Node Type       |\n"));
 | 
				
			||||||
  DEBUG ((
 | 
					  DEBUG ((
 | 
				
			||||||
    DEBUG_INFO,
 | 
					    DEBUG_INFO,
 | 
				
			||||||
    "    | %-15s | Signature| Length     | Rev | CSum | OemId  | "
 | 
					    "    | %-15a | Signature| Length     | Rev | CSum | OemId  | "
 | 
				
			||||||
      "OemTableId       | OemRev   | CreatorId| CreatorRev\n",
 | 
					      "OemTableId       | OemRev   | CreatorId| CreatorRev\n",
 | 
				
			||||||
    NodeTypeStrTbl[EAmlNodeRoot]
 | 
					    NodeTypeStrTbl[EAmlNodeRoot]
 | 
				
			||||||
    ));
 | 
					    ));
 | 
				
			||||||
  DEBUG ((
 | 
					  DEBUG ((
 | 
				
			||||||
    DEBUG_INFO,
 | 
					    DEBUG_INFO,
 | 
				
			||||||
    "    | %-15s | Op   | SubOp| OpName          | MaxI| Attribute  | "
 | 
					    "    | %-15a | Op   | SubOp| OpName          | MaxI| Attribute  | "
 | 
				
			||||||
      "PkgLen | NodeName (opt)\n",
 | 
					      "PkgLen | NodeName (opt)\n",
 | 
				
			||||||
    NodeTypeStrTbl[EAmlNodeObject]
 | 
					    NodeTypeStrTbl[EAmlNodeObject]
 | 
				
			||||||
    ));
 | 
					    ));
 | 
				
			||||||
  DEBUG ((
 | 
					  DEBUG ((
 | 
				
			||||||
    DEBUG_INFO,
 | 
					    DEBUG_INFO,
 | 
				
			||||||
    "    | %-15s | Data Type                            | Size   | "
 | 
					    "    | %-15a | Data Type                            | Size   | "
 | 
				
			||||||
      "Buffer\n",
 | 
					      "Buffer\n",
 | 
				
			||||||
    NodeTypeStrTbl[EAmlNodeData]
 | 
					    NodeTypeStrTbl[EAmlNodeData]
 | 
				
			||||||
    ));
 | 
					    ));
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,7 +2,7 @@
 | 
				
			|||||||
  AML grammar definitions.
 | 
					  AML grammar definitions.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved. <BR>
 | 
					  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved. <BR>
 | 
				
			||||||
  Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.<BR>
 | 
					  Copyright (c) 2019 - 2021, Arm Limited. All rights reserved.<BR>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
					  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
				
			||||||
**/
 | 
					**/
 | 
				
			||||||
@@ -803,3 +803,88 @@ AmlComputePkgLengthWidth (
 | 
				
			|||||||
  // Length < 2^6
 | 
					  // Length < 2^6
 | 
				
			||||||
  return 1;
 | 
					  return 1;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** Given a length, compute the value of a PkgLen.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  In AML, some object have a PkgLen, telling the size of the AML object.
 | 
				
			||||||
 | 
					  It can be encoded in 1 to 4 bytes. The bytes used to encode the PkgLen is
 | 
				
			||||||
 | 
					  itself counted in the PkgLen value.
 | 
				
			||||||
 | 
					  This means that if an AML object sees its size increment/decrement,
 | 
				
			||||||
 | 
					  the number of bytes used to encode the PkgLen value can itself
 | 
				
			||||||
 | 
					  increment/decrement.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  For instance, the AML encoding of a DeviceOp is:
 | 
				
			||||||
 | 
					    DefDevice := DeviceOp PkgLength NameString TermList
 | 
				
			||||||
 | 
					  If:
 | 
				
			||||||
 | 
					   - sizeof (NameString) = 4 (the name is "DEV0" for instance);
 | 
				
			||||||
 | 
					   - sizeof (TermList) = (2^6-6)
 | 
				
			||||||
 | 
					  then the PkgLen is encoded on 1 byte. Indeed, its value is:
 | 
				
			||||||
 | 
					    sizeof (PkgLen) + sizeof (NameString) + sizeof (TermList) =
 | 
				
			||||||
 | 
					    sizeof (PkgLen) + 4 + (2^6-6)
 | 
				
			||||||
 | 
					  So:
 | 
				
			||||||
 | 
					    PkgLen = sizeof (PkgLen) + (2^6-2)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  The input arguments Length and PkgLen represent, for the DefDevice:
 | 
				
			||||||
 | 
					    DefDevice := DeviceOp PkgLength NameString TermList
 | 
				
			||||||
 | 
					                                    |------Length-----|
 | 
				
			||||||
 | 
					                          |--------*PgkLength---------|
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @param  [in]  Length  The length to encode as a PkgLen.
 | 
				
			||||||
 | 
					                        Length cannot exceed 2^28 - 4 (4 bytes for the
 | 
				
			||||||
 | 
					                        PkgLen encoding).
 | 
				
			||||||
 | 
					                        The size of the PkgLen encoding bytes should not be
 | 
				
			||||||
 | 
					                        counted in this length value.
 | 
				
			||||||
 | 
					  @param  [out] PkgLen  If success, contains the value of the PkgLen,
 | 
				
			||||||
 | 
					                        ready to encode in the PkgLen format.
 | 
				
			||||||
 | 
					                        This value takes into account the size of PkgLen
 | 
				
			||||||
 | 
					                        encoding.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @retval EFI_SUCCESS             The function completed successfully.
 | 
				
			||||||
 | 
					  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					EFI_STATUS
 | 
				
			||||||
 | 
					EFIAPI
 | 
				
			||||||
 | 
					AmlComputePkgLength (
 | 
				
			||||||
 | 
					  IN  UINT32    Length,
 | 
				
			||||||
 | 
					  OUT UINT32  * PkgLen
 | 
				
			||||||
 | 
					  )
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  UINT32  PkgLenWidth;
 | 
				
			||||||
 | 
					  UINT32  ReComputedPkgLenWidth;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if (PkgLen == NULL) {
 | 
				
			||||||
 | 
					    ASSERT (0);
 | 
				
			||||||
 | 
					    return EFI_INVALID_PARAMETER;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Compute the PkgLenWidth.
 | 
				
			||||||
 | 
					  PkgLenWidth = AmlComputePkgLengthWidth (Length);
 | 
				
			||||||
 | 
					  if (PkgLenWidth == 0) {
 | 
				
			||||||
 | 
					    ASSERT (0);
 | 
				
			||||||
 | 
					    return EFI_INVALID_PARAMETER;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Add it to the Length.
 | 
				
			||||||
 | 
					  Length += PkgLenWidth;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Check that adding the PkgLenWidth didn't trigger a domino effect,
 | 
				
			||||||
 | 
					  // increasing the encoding width of the PkgLen again.
 | 
				
			||||||
 | 
					  // The PkgLen is encoded in at most 4 bytes. It is possible to increase
 | 
				
			||||||
 | 
					  // the PkgLen width if its encoding is less than 3 bytes.
 | 
				
			||||||
 | 
					  ReComputedPkgLenWidth = AmlComputePkgLengthWidth (Length);
 | 
				
			||||||
 | 
					  if (ReComputedPkgLenWidth != PkgLenWidth) {
 | 
				
			||||||
 | 
					    if ((ReComputedPkgLenWidth != 0)   &&
 | 
				
			||||||
 | 
					        (ReComputedPkgLenWidth < 4)) {
 | 
				
			||||||
 | 
					      // No need to recompute the PkgLen since a new threshold cannot
 | 
				
			||||||
 | 
					      // be reached by incrementing the value by one.
 | 
				
			||||||
 | 
					      Length += 1;
 | 
				
			||||||
 | 
					    } else {
 | 
				
			||||||
 | 
					      ASSERT (0);
 | 
				
			||||||
 | 
					      return EFI_INVALID_PARAMETER;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  *PkgLen = Length;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  return EFI_SUCCESS;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,7 +2,7 @@
 | 
				
			|||||||
  AML grammar definitions.
 | 
					  AML grammar definitions.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved. <BR>
 | 
					  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved. <BR>
 | 
				
			||||||
  Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.<BR>
 | 
					  Copyright (c) 2019 - 2021, Arm Limited. All rights reserved.<BR>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
					  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
				
			||||||
**/
 | 
					**/
 | 
				
			||||||
@@ -326,5 +326,50 @@ AmlComputePkgLengthWidth (
 | 
				
			|||||||
  IN  UINT32  Length
 | 
					  IN  UINT32  Length
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** Given a length, compute the value of a PkgLen.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  In AML, some object have a PkgLen, telling the size of the AML object.
 | 
				
			||||||
 | 
					  It can be encoded in 1 to 4 bytes. The bytes used to encode the PkgLen is
 | 
				
			||||||
 | 
					  itself counted in the PkgLen value.
 | 
				
			||||||
 | 
					  This means that if an AML object sees its size increment/decrement,
 | 
				
			||||||
 | 
					  the number of bytes used to encode the PkgLen value can itself
 | 
				
			||||||
 | 
					  increment/decrement.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  For instance, the AML encoding of a DeviceOp is:
 | 
				
			||||||
 | 
					    DefDevice := DeviceOp PkgLength NameString TermList
 | 
				
			||||||
 | 
					  If:
 | 
				
			||||||
 | 
					   - sizeof (NameString) = 4 (the name is "DEV0" for instance);
 | 
				
			||||||
 | 
					   - sizeof (TermList) = (2^6-6)
 | 
				
			||||||
 | 
					  then the PkgLen is encoded on 1 byte. Indeed, its value is:
 | 
				
			||||||
 | 
					    sizeof (PkgLen) + sizeof (NameString) + sizeof (TermList) =
 | 
				
			||||||
 | 
					    sizeof (PkgLen) + 4 + (2^6-6)
 | 
				
			||||||
 | 
					  So:
 | 
				
			||||||
 | 
					    PkgLen = sizeof (PkgLen) + (2^6-2)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  The input arguments Length and PkgLen represent, for the DefDevice:
 | 
				
			||||||
 | 
					    DefDevice := DeviceOp PkgLength NameString TermList
 | 
				
			||||||
 | 
					                                    |------Length-----|
 | 
				
			||||||
 | 
					                          |--------*PgkLength---------|
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @param  [in]  Length  The length to encode as a PkgLen.
 | 
				
			||||||
 | 
					                        Length cannot exceed 2^28 - 4 (4 bytes for the
 | 
				
			||||||
 | 
					                        PkgLen encoding).
 | 
				
			||||||
 | 
					                        The size of the PkgLen encoding bytes should not be
 | 
				
			||||||
 | 
					                        counted in this length value.
 | 
				
			||||||
 | 
					  @param  [out] PkgLen  If success, contains the value of the PkgLen,
 | 
				
			||||||
 | 
					                        ready to encode in the PkgLen format.
 | 
				
			||||||
 | 
					                        This value takes into account the size of PkgLen
 | 
				
			||||||
 | 
					                        encoding.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @retval EFI_SUCCESS             The function completed successfully.
 | 
				
			||||||
 | 
					  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					EFI_STATUS
 | 
				
			||||||
 | 
					EFIAPI
 | 
				
			||||||
 | 
					AmlComputePkgLength (
 | 
				
			||||||
 | 
					  IN  UINT32    Length,
 | 
				
			||||||
 | 
					  OUT UINT32  * PkgLen
 | 
				
			||||||
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif // AML_H_
 | 
					#endif // AML_H_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,7 @@
 | 
				
			|||||||
## @file
 | 
					## @file
 | 
				
			||||||
#  AML Generation Library
 | 
					#  AML Generation Library
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.<BR>
 | 
					#  Copyright (c) 2019 - 2021, Arm Limited. All rights reserved.<BR>
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
					#  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
@@ -66,6 +66,7 @@
 | 
				
			|||||||
  DynamicTablesPkg/DynamicTablesPkg.dec
 | 
					  DynamicTablesPkg/DynamicTablesPkg.dec
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[LibraryClasses]
 | 
					[LibraryClasses]
 | 
				
			||||||
 | 
					  AcpiHelperLib
 | 
				
			||||||
  BaseLib
 | 
					  BaseLib
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[BuildOptions]
 | 
					[BuildOptions]
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,7 @@
 | 
				
			|||||||
/** @file
 | 
					/** @file
 | 
				
			||||||
  AML Api.
 | 
					  AML Api.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Copyright (c) 2020, Arm Limited. All rights reserved.<BR>
 | 
					  Copyright (c) 2020 - 2021, Arm Limited. All rights reserved.<BR>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
					  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
				
			||||||
**/
 | 
					**/
 | 
				
			||||||
@@ -222,7 +222,7 @@ AmlNameOpUpdateString (
 | 
				
			|||||||
  return Status;
 | 
					  return Status;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/** Get the first Resource Data element contained in a "_CRS" object.
 | 
					/** Get the first Resource Data element contained in a named object.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  In the following ASL code, the function will return the Resource Data
 | 
					  In the following ASL code, the function will return the Resource Data
 | 
				
			||||||
  node corresponding to the "QWordMemory ()" ASL macro.
 | 
					  node corresponding to the "QWordMemory ()" ASL macro.
 | 
				
			||||||
@@ -233,35 +233,33 @@ AmlNameOpUpdateString (
 | 
				
			|||||||
  )
 | 
					  )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Note:
 | 
					  Note:
 | 
				
			||||||
   - The "_CRS" object must be declared using ASL "Name (Declare Named Object)".
 | 
					  "_CRS" names defined as methods are not handled by this function.
 | 
				
			||||||
   - "_CRS" declared using ASL "Method (Declare Control Method)" is not
 | 
					  They must be defined as names, using the "Name ()" statement.
 | 
				
			||||||
     supported.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @param  [in] NameOpCrsNode  NameOp object node defining a "_CRS" object.
 | 
					  @param  [in] NameOpNode   NameOp object node defining a named object.
 | 
				
			||||||
                              Must have an OpCode=AML_NAME_OP, SubOpCode=0.
 | 
					                            Must have an OpCode=AML_NAME_OP, SubOpCode=0.
 | 
				
			||||||
                              NameOp object nodes are defined in ASL
 | 
					                            NameOp object nodes are defined in ASL
 | 
				
			||||||
                              using the "Name ()" function.
 | 
					                            using the "Name ()" function.
 | 
				
			||||||
  @param  [out] OutRdNode     Pointer to the first Resource Data element of
 | 
					  @param  [out] OutRdNode   Pointer to the first Resource Data element of
 | 
				
			||||||
                              the "_CRS" object. A Resource Data element
 | 
					                            the named object. A Resource Data element
 | 
				
			||||||
                              is stored in a data node.
 | 
					                            is stored in a data node.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @retval EFI_SUCCESS             The function completed successfully.
 | 
					  @retval EFI_SUCCESS             The function completed successfully.
 | 
				
			||||||
  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
					  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
				
			||||||
**/
 | 
					**/
 | 
				
			||||||
EFI_STATUS
 | 
					EFI_STATUS
 | 
				
			||||||
EFIAPI
 | 
					EFIAPI
 | 
				
			||||||
AmlNameOpCrsGetFirstRdNode (
 | 
					AmlNameOpGetFirstRdNode (
 | 
				
			||||||
  IN  AML_OBJECT_NODE_HANDLE   NameOpCrsNode,
 | 
					  IN  AML_OBJECT_NODE_HANDLE   NameOpNode,
 | 
				
			||||||
  OUT AML_DATA_NODE_HANDLE   * OutRdNode
 | 
					  OUT AML_DATA_NODE_HANDLE   * OutRdNode
 | 
				
			||||||
  )
 | 
					  )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  AML_OBJECT_NODE_HANDLE  BufferOpNode;
 | 
					  AML_OBJECT_NODE_HANDLE  BufferOpNode;
 | 
				
			||||||
  AML_DATA_NODE_HANDLE    FirstRdNode;
 | 
					  AML_DATA_NODE_HANDLE    FirstRdNode;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if ((NameOpCrsNode == NULL)                                              ||
 | 
					  if ((NameOpNode == NULL)                                              ||
 | 
				
			||||||
      (AmlGetNodeType ((AML_NODE_HANDLE)NameOpCrsNode) != EAmlNodeObject)  ||
 | 
					      (AmlGetNodeType ((AML_NODE_HANDLE)NameOpNode) != EAmlNodeObject)  ||
 | 
				
			||||||
      (!AmlNodeHasOpCode (NameOpCrsNode, AML_NAME_OP, 0))                  ||
 | 
					      (!AmlNodeHasOpCode (NameOpNode, AML_NAME_OP, 0))                  ||
 | 
				
			||||||
      (!AmlNameOpCompareName (NameOpCrsNode, "_CRS"))                      ||
 | 
					 | 
				
			||||||
      (OutRdNode == NULL)) {
 | 
					      (OutRdNode == NULL)) {
 | 
				
			||||||
    ASSERT (0);
 | 
					    ASSERT (0);
 | 
				
			||||||
    return EFI_INVALID_PARAMETER;
 | 
					    return EFI_INVALID_PARAMETER;
 | 
				
			||||||
@@ -269,10 +267,10 @@ AmlNameOpCrsGetFirstRdNode (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  *OutRdNode = NULL;
 | 
					  *OutRdNode = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Get the _CRS value which is represented as a BufferOp object node
 | 
					  // Get the value of the variable which is represented as a BufferOp object
 | 
				
			||||||
  // which is the 2nd fixed argument (i.e. index 1).
 | 
					  // node which is the 2nd fixed argument (i.e. index 1).
 | 
				
			||||||
  BufferOpNode = (AML_OBJECT_NODE_HANDLE)AmlGetFixedArgument (
 | 
					  BufferOpNode = (AML_OBJECT_NODE_HANDLE)AmlGetFixedArgument (
 | 
				
			||||||
                                           NameOpCrsNode,
 | 
					                                           NameOpNode,
 | 
				
			||||||
                                           EAmlParseIndexTerm1
 | 
					                                           EAmlParseIndexTerm1
 | 
				
			||||||
                                           );
 | 
					                                           );
 | 
				
			||||||
  if ((BufferOpNode == NULL)                                             ||
 | 
					  if ((BufferOpNode == NULL)                                             ||
 | 
				
			||||||
@@ -310,11 +308,12 @@ AmlNameOpCrsGetFirstRdNode (
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
  )
 | 
					  )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  The CurrRdNode Resource Data node must be defined in an object named "_CRS"
 | 
					  Note:
 | 
				
			||||||
  and defined by a "Name ()" ASL function.
 | 
					  "_CRS" names defined as methods are not handled by this function.
 | 
				
			||||||
 | 
					  They must be defined as names, using the "Name ()" statement.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @param  [in]  CurrRdNode   Pointer to the current Resource Data element of
 | 
					  @param  [in]  CurrRdNode   Pointer to the current Resource Data element of
 | 
				
			||||||
                             the "_CRS" object.
 | 
					                             the named object.
 | 
				
			||||||
  @param  [out] OutRdNode    Pointer to the Resource Data element following
 | 
					  @param  [out] OutRdNode    Pointer to the Resource Data element following
 | 
				
			||||||
                             the CurrRdNode.
 | 
					                             the CurrRdNode.
 | 
				
			||||||
                             Contain a NULL pointer if CurrRdNode is the
 | 
					                             Contain a NULL pointer if CurrRdNode is the
 | 
				
			||||||
@@ -327,12 +326,12 @@ AmlNameOpCrsGetFirstRdNode (
 | 
				
			|||||||
**/
 | 
					**/
 | 
				
			||||||
EFI_STATUS
 | 
					EFI_STATUS
 | 
				
			||||||
EFIAPI
 | 
					EFIAPI
 | 
				
			||||||
AmlNameOpCrsGetNextRdNode (
 | 
					AmlNameOpGetNextRdNode (
 | 
				
			||||||
  IN  AML_DATA_NODE_HANDLE    CurrRdNode,
 | 
					  IN  AML_DATA_NODE_HANDLE    CurrRdNode,
 | 
				
			||||||
  OUT AML_DATA_NODE_HANDLE  * OutRdNode
 | 
					  OUT AML_DATA_NODE_HANDLE  * OutRdNode
 | 
				
			||||||
  )
 | 
					  )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  AML_OBJECT_NODE_HANDLE     NameOpCrsNode;
 | 
					  AML_OBJECT_NODE_HANDLE     NameOpNode;
 | 
				
			||||||
  AML_OBJECT_NODE_HANDLE     BufferOpNode;
 | 
					  AML_OBJECT_NODE_HANDLE     BufferOpNode;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if ((CurrRdNode == NULL)                                              ||
 | 
					  if ((CurrRdNode == NULL)                                              ||
 | 
				
			||||||
@@ -356,12 +355,11 @@ AmlNameOpCrsGetNextRdNode (
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // The parent of the BufferOpNode must be a NameOp node.
 | 
					  // The parent of the BufferOpNode must be a NameOp node.
 | 
				
			||||||
  NameOpCrsNode = (AML_OBJECT_NODE_HANDLE)AmlGetParent (
 | 
					  NameOpNode = (AML_OBJECT_NODE_HANDLE)AmlGetParent (
 | 
				
			||||||
                                            (AML_NODE_HANDLE)BufferOpNode
 | 
					                                         (AML_NODE_HANDLE)BufferOpNode
 | 
				
			||||||
                                            );
 | 
					                                         );
 | 
				
			||||||
  if ((NameOpCrsNode == NULL)                             ||
 | 
					  if ((NameOpNode == NULL)  ||
 | 
				
			||||||
      (!AmlNodeHasOpCode (NameOpCrsNode, AML_NAME_OP, 0)) ||
 | 
					      (!AmlNodeHasOpCode (NameOpNode, AML_NAME_OP, 0))) {
 | 
				
			||||||
      (!AmlNameOpCompareName (NameOpCrsNode, "_CRS"))) {
 | 
					 | 
				
			||||||
    ASSERT (0);
 | 
					    ASSERT (0);
 | 
				
			||||||
    return EFI_INVALID_PARAMETER;
 | 
					    return EFI_INVALID_PARAMETER;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
@@ -380,3 +378,88 @@ AmlNameOpCrsGetNextRdNode (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  return EFI_SUCCESS;
 | 
					  return EFI_SUCCESS;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// DEPRECATED APIS
 | 
				
			||||||
 | 
					#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** DEPRECATED API
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Get the first Resource Data element contained in a "_CRS" object.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  In the following ASL code, the function will return the Resource Data
 | 
				
			||||||
 | 
					  node corresponding to the "QWordMemory ()" ASL macro.
 | 
				
			||||||
 | 
					  Name (_CRS, ResourceTemplate() {
 | 
				
			||||||
 | 
					      QWordMemory (...) {...},
 | 
				
			||||||
 | 
					      Interrupt (...) {...}
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Note:
 | 
				
			||||||
 | 
					   - The "_CRS" object must be declared using ASL "Name (Declare Named Object)".
 | 
				
			||||||
 | 
					   - "_CRS" declared using ASL "Method (Declare Control Method)" is not
 | 
				
			||||||
 | 
					     supported.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @ingroup UserApis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @param  [in] NameOpCrsNode  NameOp object node defining a "_CRS" object.
 | 
				
			||||||
 | 
					                              Must have an OpCode=AML_NAME_OP, SubOpCode=0.
 | 
				
			||||||
 | 
					                              NameOp object nodes are defined in ASL
 | 
				
			||||||
 | 
					                              using the "Name ()" function.
 | 
				
			||||||
 | 
					  @param  [out] OutRdNode     Pointer to the first Resource Data element of
 | 
				
			||||||
 | 
					                              the "_CRS" object. A Resource Data element
 | 
				
			||||||
 | 
					                              is stored in a data node.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @retval EFI_SUCCESS             The function completed successfully.
 | 
				
			||||||
 | 
					  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					EFI_STATUS
 | 
				
			||||||
 | 
					EFIAPI
 | 
				
			||||||
 | 
					AmlNameOpCrsGetFirstRdNode (
 | 
				
			||||||
 | 
					  IN  AML_OBJECT_NODE_HANDLE   NameOpCrsNode,
 | 
				
			||||||
 | 
					  OUT AML_DATA_NODE_HANDLE   * OutRdNode
 | 
				
			||||||
 | 
					  )
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  return AmlNameOpGetFirstRdNode (NameOpCrsNode, OutRdNode);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** DEPRECATED API
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Get the Resource Data element following the CurrRdNode Resource Data.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  In the following ASL code, if CurrRdNode corresponds to the first
 | 
				
			||||||
 | 
					  "QWordMemory ()" ASL macro, the function will return the Resource Data
 | 
				
			||||||
 | 
					  node corresponding to the "Interrupt ()" ASL macro.
 | 
				
			||||||
 | 
					  Name (_CRS, ResourceTemplate() {
 | 
				
			||||||
 | 
					      QwordMemory (...) {...},
 | 
				
			||||||
 | 
					      Interrupt (...) {...}
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  The CurrRdNode Resource Data node must be defined in an object named "_CRS"
 | 
				
			||||||
 | 
					  and defined by a "Name ()" ASL function.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @ingroup UserApis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @param  [in]  CurrRdNode   Pointer to the current Resource Data element of
 | 
				
			||||||
 | 
					                             the "_CRS" variable.
 | 
				
			||||||
 | 
					  @param  [out] OutRdNode    Pointer to the Resource Data element following
 | 
				
			||||||
 | 
					                             the CurrRdNode.
 | 
				
			||||||
 | 
					                             Contain a NULL pointer if CurrRdNode is the
 | 
				
			||||||
 | 
					                             last Resource Data element in the list.
 | 
				
			||||||
 | 
					                             The "End Tag" is not considered as a resource
 | 
				
			||||||
 | 
					                             data element and is not returned.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @retval EFI_SUCCESS             The function completed successfully.
 | 
				
			||||||
 | 
					  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					EFI_STATUS
 | 
				
			||||||
 | 
					EFIAPI
 | 
				
			||||||
 | 
					AmlNameOpCrsGetNextRdNode (
 | 
				
			||||||
 | 
					  IN  AML_DATA_NODE_HANDLE    CurrRdNode,
 | 
				
			||||||
 | 
					  OUT AML_DATA_NODE_HANDLE  * OutRdNode
 | 
				
			||||||
 | 
					  )
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  return AmlNameOpGetNextRdNode (CurrRdNode, OutRdNode);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#endif // DISABLE_NEW_DEPRECATED_INTERFACES
 | 
				
			||||||
 
 | 
				
			|||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -1,7 +1,7 @@
 | 
				
			|||||||
/** @file
 | 
					/** @file
 | 
				
			||||||
  AML Resource Data Code Generation.
 | 
					  AML Resource Data Code Generation.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Copyright (c) 2020, Arm Limited. All rights reserved.<BR>
 | 
					  Copyright (c) 2020 - 2021, Arm Limited. All rights reserved.<BR>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
					  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -24,12 +24,18 @@
 | 
				
			|||||||
    If NewRdNode is not NULL, update its value to RdNode.
 | 
					    If NewRdNode is not NULL, update its value to RdNode.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @param [in]  RdNode       Newly created Resource Data node.
 | 
					  @param [in]  RdNode       Newly created Resource Data node.
 | 
				
			||||||
  @param [in]  ParentNode   If not NULL, add the generated node
 | 
					                            RdNode is deleted if an error occurs.
 | 
				
			||||||
                            to the end of the variable list of
 | 
					  @param [in]  ParentNode   If not NULL, ParentNode must:
 | 
				
			||||||
                            argument of the ParentNode, but
 | 
					                             - be a NameOp node, i.e. have the AML_NAME_OP
 | 
				
			||||||
                            before the "End Tag" Resource Data.
 | 
					                               opcode (cf "Name ()" ASL statement)
 | 
				
			||||||
                            Must be a BufferOpNode.
 | 
					                             - contain a list of resource data elements
 | 
				
			||||||
  @param [out] NewRdNode    If not NULL, update the its value to RdNode.
 | 
					                               (cf "ResourceTemplate ()" ASL statement)
 | 
				
			||||||
 | 
					                            RdNode is then added at the end of the variable
 | 
				
			||||||
 | 
					                            list of resource data elements, but before the
 | 
				
			||||||
 | 
					                            "End Tag" Resource Data.
 | 
				
			||||||
 | 
					  @param [out] NewRdNode    If not NULL:
 | 
				
			||||||
 | 
					                             - and Success, contains RdNode.
 | 
				
			||||||
 | 
					                             - and Error, reset to NULL.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @retval  EFI_SUCCESS            The function completed successfully.
 | 
					  @retval  EFI_SUCCESS            The function completed successfully.
 | 
				
			||||||
  @retval  EFI_INVALID_PARAMETER  Invalid parameter.
 | 
					  @retval  EFI_INVALID_PARAMETER  Invalid parameter.
 | 
				
			||||||
@@ -43,57 +49,85 @@ LinkRdNode (
 | 
				
			|||||||
  OUT AML_DATA_NODE     ** NewRdNode
 | 
					  OUT AML_DATA_NODE     ** NewRdNode
 | 
				
			||||||
  )
 | 
					  )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  EFI_STATUS    Status;
 | 
					  EFI_STATUS        Status;
 | 
				
			||||||
  EFI_STATUS    Status1;
 | 
					  EFI_STATUS        Status1;
 | 
				
			||||||
 | 
					  AML_OBJECT_NODE   *BufferOpNode;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if (NewRdNode != NULL) {
 | 
				
			||||||
 | 
					    *NewRdNode = NULL;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if (ParentNode != NULL) {
 | 
				
			||||||
 | 
					    // Check this is a NameOp node.
 | 
				
			||||||
 | 
					    if ((!AmlNodeHasOpCode (ParentNode, AML_NAME_OP, 0))) {
 | 
				
			||||||
 | 
					      ASSERT (0);
 | 
				
			||||||
 | 
					      Status = EFI_INVALID_PARAMETER;
 | 
				
			||||||
 | 
					      goto error_handler;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Get the value which is represented as a BufferOp object node
 | 
				
			||||||
 | 
					    // which is the 2nd fixed argument (i.e. index 1).
 | 
				
			||||||
 | 
					    BufferOpNode = (AML_OBJECT_NODE_HANDLE)AmlGetFixedArgument (
 | 
				
			||||||
 | 
					                                             ParentNode,
 | 
				
			||||||
 | 
					                                             EAmlParseIndexTerm1
 | 
				
			||||||
 | 
					                                             );
 | 
				
			||||||
 | 
					    if ((BufferOpNode == NULL)                                             ||
 | 
				
			||||||
 | 
					        (AmlGetNodeType ((AML_NODE_HANDLE)BufferOpNode) != EAmlNodeObject) ||
 | 
				
			||||||
 | 
					        (!AmlNodeHasOpCode (BufferOpNode, AML_BUFFER_OP, 0))) {
 | 
				
			||||||
 | 
					      ASSERT (0);
 | 
				
			||||||
 | 
					      Status = EFI_INVALID_PARAMETER;
 | 
				
			||||||
 | 
					      goto error_handler;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Add RdNode as the last element, but before the EndTag.
 | 
				
			||||||
 | 
					    Status = AmlAppendRdNode (BufferOpNode, RdNode);
 | 
				
			||||||
 | 
					    if (EFI_ERROR (Status)) {
 | 
				
			||||||
 | 
					      ASSERT (0);
 | 
				
			||||||
 | 
					      goto error_handler;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (NewRdNode != NULL) {
 | 
					  if (NewRdNode != NULL) {
 | 
				
			||||||
    *NewRdNode = RdNode;
 | 
					    *NewRdNode = RdNode;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Add RdNode as the last element, but before the EndTag.
 | 
					 | 
				
			||||||
  if (ParentNode != NULL) {
 | 
					 | 
				
			||||||
    Status = AmlAppendRdNode (ParentNode, RdNode);
 | 
					 | 
				
			||||||
    if (EFI_ERROR (Status)) {
 | 
					 | 
				
			||||||
      ASSERT (0);
 | 
					 | 
				
			||||||
      Status1 = AmlDeleteTree ((AML_NODE_HEADER*)RdNode);
 | 
					 | 
				
			||||||
      ASSERT_EFI_ERROR (Status1);
 | 
					 | 
				
			||||||
      // Return original error.
 | 
					 | 
				
			||||||
      return Status;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  return EFI_SUCCESS;
 | 
					  return EFI_SUCCESS;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					error_handler:
 | 
				
			||||||
 | 
					  Status1 = AmlDeleteTree ((AML_NODE_HEADER*)RdNode);
 | 
				
			||||||
 | 
					  ASSERT_EFI_ERROR (Status1);
 | 
				
			||||||
 | 
					  // Return original error.
 | 
				
			||||||
 | 
					  return Status;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/** Code generation for the "Interrupt ()" ASL function.
 | 
					/** Code generation for the "Interrupt ()" ASL function.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  This function creates a Resource Data element corresponding to the
 | 
					 | 
				
			||||||
  "Interrupt ()" ASL function and stores it in an AML Data Node.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  The Resource Data effectively created is an Extended Interrupt Resource
 | 
					  The Resource Data effectively created is an Extended Interrupt Resource
 | 
				
			||||||
  Data. See ACPI 6.3 specification, s6.4.3.6 "Extended Interrupt Descriptor"
 | 
					  Data. Cf ACPI 6.4:
 | 
				
			||||||
  for more information about Extended Interrupt Resource Data.
 | 
					   - s6.4.3.6 "Extended Interrupt Descriptor"
 | 
				
			||||||
 | 
					   - s19.6.64 "Interrupt (Interrupt Resource Descriptor Macro)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  This function allocates memory to create a data node. It is the caller's
 | 
					  The created resource data node can be:
 | 
				
			||||||
  responsibility to either:
 | 
					   - appended to the list of resource data elements of the NameOpNode.
 | 
				
			||||||
   - attach this node to an AML tree;
 | 
					     In such case NameOpNode must be defined by a the "Name ()" ASL statement
 | 
				
			||||||
   - delete this node.
 | 
					     and initially contain a "ResourceTemplate ()".
 | 
				
			||||||
 | 
					   - returned through the NewRdNode parameter.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @param [in]  ResourceConsumer    The device consumes the specified interrupt
 | 
					  @param  [in]  ResourceConsumer The device consumes the specified interrupt
 | 
				
			||||||
                                   or produces it for use by a child device.
 | 
					                                 or produces it for use by a child device.
 | 
				
			||||||
  @param [in]  EdgeTriggered       The interrupt is edge triggered or
 | 
					  @param  [in]  EdgeTriggered    The interrupt is edge triggered or
 | 
				
			||||||
                                   level triggered.
 | 
					                                 level triggered.
 | 
				
			||||||
  @param [in]  ActiveLow           The interrupt is active-high or active-low.
 | 
					  @param  [in]  ActiveLow        The interrupt is active-high or active-low.
 | 
				
			||||||
  @param [in]  Shared              The interrupt can be shared with other
 | 
					  @param  [in]  Shared           The interrupt can be shared with other
 | 
				
			||||||
                                   devices or not (Exclusive).
 | 
					                                 devices or not (Exclusive).
 | 
				
			||||||
  @param [in]  IrqList             Interrupt list. Must be non-NULL.
 | 
					  @param  [in]  IrqList          Interrupt list. Must be non-NULL.
 | 
				
			||||||
  @param [in]  IrqCount            Interrupt count. Must be non-zero.
 | 
					  @param  [in]  IrqCount         Interrupt count. Must be non-zero.
 | 
				
			||||||
  @param [in]  ParentNode          If not NULL, add the generated node
 | 
					  @param  [in]  NameOpNode       NameOp object node defining a named object.
 | 
				
			||||||
                                   to the end of the variable list of
 | 
					                                 If provided, append the new resource data node
 | 
				
			||||||
                                   argument of the ParentNode, but
 | 
					                                 to the list of resource data elements of this
 | 
				
			||||||
                                   before the "End Tag" Resource Data.
 | 
					                                 node.
 | 
				
			||||||
                                   Must be a BufferOpNode.
 | 
					  @param  [out] NewRdNode        If provided and success,
 | 
				
			||||||
  @param  [out] NewRdNode          If success, contains the generated node.
 | 
					                                 contain the created node.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @retval EFI_SUCCESS             The function completed successfully.
 | 
					  @retval EFI_SUCCESS             The function completed successfully.
 | 
				
			||||||
  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
					  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
				
			||||||
@@ -101,15 +135,15 @@ LinkRdNode (
 | 
				
			|||||||
**/
 | 
					**/
 | 
				
			||||||
EFI_STATUS
 | 
					EFI_STATUS
 | 
				
			||||||
EFIAPI
 | 
					EFIAPI
 | 
				
			||||||
AmlCodeGenInterrupt (
 | 
					AmlCodeGenRdInterrupt (
 | 
				
			||||||
  IN  BOOLEAN             ResourceConsumer,
 | 
					  IN  BOOLEAN                 ResourceConsumer,
 | 
				
			||||||
  IN  BOOLEAN             EdgeTriggered,
 | 
					  IN  BOOLEAN                 EdgeTriggered,
 | 
				
			||||||
  IN  BOOLEAN             ActiveLow,
 | 
					  IN  BOOLEAN                 ActiveLow,
 | 
				
			||||||
  IN  BOOLEAN             Shared,
 | 
					  IN  BOOLEAN                 Shared,
 | 
				
			||||||
  IN  UINT32            * IrqList,
 | 
					  IN  UINT32                  *IrqList,
 | 
				
			||||||
  IN  UINT8               IrqCount,
 | 
					  IN  UINT8                   IrqCount,
 | 
				
			||||||
  IN  AML_OBJECT_NODE   * ParentNode,   OPTIONAL
 | 
					  IN  AML_OBJECT_NODE_HANDLE  NameOpNode, OPTIONAL
 | 
				
			||||||
  OUT AML_DATA_NODE    ** NewRdNode     OPTIONAL
 | 
					  OUT AML_DATA_NODE_HANDLE    *NewRdNode  OPTIONAL
 | 
				
			||||||
  )
 | 
					  )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  EFI_STATUS                               Status;
 | 
					  EFI_STATUS                               Status;
 | 
				
			||||||
@@ -120,16 +154,19 @@ AmlCodeGenInterrupt (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  if ((IrqList == NULL) ||
 | 
					  if ((IrqList == NULL) ||
 | 
				
			||||||
      (IrqCount == 0)   ||
 | 
					      (IrqCount == 0)   ||
 | 
				
			||||||
      ((ParentNode == NULL) && (NewRdNode == NULL))) {
 | 
					      ((NameOpNode == NULL) && (NewRdNode == NULL))) {
 | 
				
			||||||
    ASSERT (0);
 | 
					    ASSERT (0);
 | 
				
			||||||
    return EFI_INVALID_PARAMETER;
 | 
					    return EFI_INVALID_PARAMETER;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Header
 | 
				
			||||||
  RdInterrupt.Header.Header.Bits.Name =
 | 
					  RdInterrupt.Header.Header.Bits.Name =
 | 
				
			||||||
    ACPI_LARGE_EXTENDED_IRQ_DESCRIPTOR_NAME;
 | 
					    ACPI_LARGE_EXTENDED_IRQ_DESCRIPTOR_NAME;
 | 
				
			||||||
  RdInterrupt.Header.Header.Bits.Type = ACPI_LARGE_ITEM_FLAG;
 | 
					  RdInterrupt.Header.Header.Bits.Type = ACPI_LARGE_ITEM_FLAG;
 | 
				
			||||||
  RdInterrupt.Header.Length = sizeof (EFI_ACPI_EXTENDED_INTERRUPT_DESCRIPTOR) -
 | 
					  RdInterrupt.Header.Length = sizeof (EFI_ACPI_EXTENDED_INTERRUPT_DESCRIPTOR) -
 | 
				
			||||||
                                sizeof (ACPI_LARGE_RESOURCE_HEADER);
 | 
					                                sizeof (ACPI_LARGE_RESOURCE_HEADER);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Body
 | 
				
			||||||
  RdInterrupt.InterruptVectorFlags = (ResourceConsumer ? BIT0 : 0) |
 | 
					  RdInterrupt.InterruptVectorFlags = (ResourceConsumer ? BIT0 : 0) |
 | 
				
			||||||
                                     (EdgeTriggered ? BIT1 : 0)    |
 | 
					                                     (EdgeTriggered ? BIT1 : 0)    |
 | 
				
			||||||
                                     (ActiveLow ? BIT2 : 0)        |
 | 
					                                     (ActiveLow ? BIT2 : 0)        |
 | 
				
			||||||
@@ -153,10 +190,215 @@ AmlCodeGenInterrupt (
 | 
				
			|||||||
    return Status;
 | 
					    return Status;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return LinkRdNode (RdNode, ParentNode, NewRdNode);
 | 
					  return LinkRdNode (RdNode, NameOpNode, NewRdNode);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/** Add an Interrupt Resource Data node.
 | 
					/** Code generation for the "Register ()" ASL function.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  The Resource Data effectively created is a Generic Register Descriptor.
 | 
				
			||||||
 | 
					  Data. Cf ACPI 6.4:
 | 
				
			||||||
 | 
					   - s6.4.3.7 "Generic Register Descriptor".
 | 
				
			||||||
 | 
					   - s19.6.114 "Register".
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  The created resource data node can be:
 | 
				
			||||||
 | 
					   - appended to the list of resource data elements of the NameOpNode.
 | 
				
			||||||
 | 
					     In such case NameOpNode must be defined by a the "Name ()" ASL statement
 | 
				
			||||||
 | 
					     and initially contain a "ResourceTemplate ()".
 | 
				
			||||||
 | 
					   - returned through the NewRdNode parameter.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @param [in]  AddressSpace    Address space where the register exists.
 | 
				
			||||||
 | 
					                               Can be one of I/O space, System Memory, etc.
 | 
				
			||||||
 | 
					  @param [in]  BitWidth        Number of bits in the register.
 | 
				
			||||||
 | 
					  @param [in]  BitOffset       Offset in bits from the start of the register
 | 
				
			||||||
 | 
					                               indicated by the Address.
 | 
				
			||||||
 | 
					  @param [in]  Address         Register address.
 | 
				
			||||||
 | 
					  @param [in]  AccessSize      Size of data values used when accessing the
 | 
				
			||||||
 | 
					                               address space. Can be one of:
 | 
				
			||||||
 | 
					                                 0 - Undefined, legacy (EFI_ACPI_6_4_UNDEFINED)
 | 
				
			||||||
 | 
					                                 1 - Byte access (EFI_ACPI_6_4_BYTE)
 | 
				
			||||||
 | 
					                                 2 - Word access (EFI_ACPI_6_4_WORD)
 | 
				
			||||||
 | 
					                                 3 - DWord access (EFI_ACPI_6_4_DWORD)
 | 
				
			||||||
 | 
					                                 4 - QWord access (EFI_ACPI_6_4_QWORD)
 | 
				
			||||||
 | 
					  @param  [in]  NameOpNode       NameOp object node defining a named object.
 | 
				
			||||||
 | 
					                                 If provided, append the new resource data node
 | 
				
			||||||
 | 
					                                 to the list of resource data elements of this
 | 
				
			||||||
 | 
					                                 node.
 | 
				
			||||||
 | 
					  @param  [out] NewRdNode        If provided and success,
 | 
				
			||||||
 | 
					                                 contain the created node.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @retval EFI_SUCCESS             The function completed successfully.
 | 
				
			||||||
 | 
					  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
				
			||||||
 | 
					  @retval EFI_OUT_OF_RESOURCES    Could not allocate memory.
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					EFI_STATUS
 | 
				
			||||||
 | 
					EFIAPI
 | 
				
			||||||
 | 
					AmlCodeGenRdRegister (
 | 
				
			||||||
 | 
					  IN  UINT8                   AddressSpace,
 | 
				
			||||||
 | 
					  IN  UINT8                   BitWidth,
 | 
				
			||||||
 | 
					  IN  UINT8                   BitOffset,
 | 
				
			||||||
 | 
					  IN  UINT64                  Address,
 | 
				
			||||||
 | 
					  IN  UINT8                   AccessSize,
 | 
				
			||||||
 | 
					  IN  AML_OBJECT_NODE_HANDLE  NameOpNode, OPTIONAL
 | 
				
			||||||
 | 
					  OUT AML_DATA_NODE_HANDLE    *NewRdNode  OPTIONAL
 | 
				
			||||||
 | 
					  )
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  EFI_STATUS                             Status;
 | 
				
			||||||
 | 
					  AML_DATA_NODE                        * RdNode;
 | 
				
			||||||
 | 
					  EFI_ACPI_GENERIC_REGISTER_DESCRIPTOR   RdRegister;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if ((AccessSize > EFI_ACPI_6_4_QWORD)  ||
 | 
				
			||||||
 | 
					      ((NameOpNode == NULL) && (NewRdNode == NULL))) {
 | 
				
			||||||
 | 
					    ASSERT (0);
 | 
				
			||||||
 | 
					    return EFI_INVALID_PARAMETER;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Header
 | 
				
			||||||
 | 
					  RdRegister.Header.Header.Bits.Name =
 | 
				
			||||||
 | 
					    ACPI_LARGE_GENERIC_REGISTER_DESCRIPTOR_NAME;
 | 
				
			||||||
 | 
					  RdRegister.Header.Header.Bits.Type = ACPI_LARGE_ITEM_FLAG;
 | 
				
			||||||
 | 
					  RdRegister.Header.Length = sizeof (EFI_ACPI_GENERIC_REGISTER_DESCRIPTOR) -
 | 
				
			||||||
 | 
					                               sizeof (ACPI_LARGE_RESOURCE_HEADER);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Body
 | 
				
			||||||
 | 
					  RdRegister.AddressSpaceId = AddressSpace;
 | 
				
			||||||
 | 
					  RdRegister.RegisterBitWidth = BitWidth;
 | 
				
			||||||
 | 
					  RdRegister.RegisterBitOffset = BitOffset;
 | 
				
			||||||
 | 
					  RdRegister.AddressSize = AccessSize;
 | 
				
			||||||
 | 
					  RdRegister.RegisterAddress = Address;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Status = AmlCreateDataNode (
 | 
				
			||||||
 | 
					             EAmlNodeDataTypeResourceData,
 | 
				
			||||||
 | 
					             (UINT8*)&RdRegister,
 | 
				
			||||||
 | 
					             sizeof (EFI_ACPI_GENERIC_REGISTER_DESCRIPTOR),
 | 
				
			||||||
 | 
					             &RdNode
 | 
				
			||||||
 | 
					             );
 | 
				
			||||||
 | 
					  if (EFI_ERROR (Status)) {
 | 
				
			||||||
 | 
					    ASSERT (0);
 | 
				
			||||||
 | 
					    return Status;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  return LinkRdNode (RdNode, NameOpNode, NewRdNode);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** Code generation for the EndTag resource data.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  The EndTag resource data is automatically generated by the ASL compiler
 | 
				
			||||||
 | 
					  at the end of a list of resource data elements. Thus, it doesn't have
 | 
				
			||||||
 | 
					  a corresponding ASL function.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  This function allocates memory to create a data node. It is the caller's
 | 
				
			||||||
 | 
					  responsibility to either:
 | 
				
			||||||
 | 
					   - attach this node to an AML tree;
 | 
				
			||||||
 | 
					   - delete this node.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  ACPI 6.4, s6.4.2.9 "End Tag":
 | 
				
			||||||
 | 
					  "This checksum is generated such that adding it to the sum of all the data
 | 
				
			||||||
 | 
					  bytes will produce a zero sum."
 | 
				
			||||||
 | 
					  "If the checksum field is zero, the resource data is treated as if the
 | 
				
			||||||
 | 
					  checksum operation succeeded. Configuration proceeds normally."
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  To avoid re-computing checksums, if a new resource data elements is
 | 
				
			||||||
 | 
					  added/removed/modified in a list of resource data elements, the AmlLib
 | 
				
			||||||
 | 
					  resets the checksum to 0.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @param [in]  CheckSum        CheckSum to store in the EndTag.
 | 
				
			||||||
 | 
					                               To ignore/avoid computing the checksum,
 | 
				
			||||||
 | 
					                               give 0.
 | 
				
			||||||
 | 
					  @param [in]  ParentNode      If not NULL, add the generated node
 | 
				
			||||||
 | 
					                               to the end of the variable list of
 | 
				
			||||||
 | 
					                               argument of the ParentNode.
 | 
				
			||||||
 | 
					                               The ParentNode must not initially contain
 | 
				
			||||||
 | 
					                               an EndTag resource data element.
 | 
				
			||||||
 | 
					  @param  [out] NewRdNode      If success, contains the generated node.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @retval EFI_SUCCESS             The function completed successfully.
 | 
				
			||||||
 | 
					  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
				
			||||||
 | 
					  @retval EFI_OUT_OF_RESOURCES    Could not allocate memory.
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					EFI_STATUS
 | 
				
			||||||
 | 
					EFIAPI
 | 
				
			||||||
 | 
					AmlCodeGenEndTag (
 | 
				
			||||||
 | 
					  IN  UINT8               CheckSum,   OPTIONAL
 | 
				
			||||||
 | 
					  IN  AML_OBJECT_NODE   * ParentNode, OPTIONAL
 | 
				
			||||||
 | 
					  OUT AML_DATA_NODE    ** NewRdNode   OPTIONAL
 | 
				
			||||||
 | 
					  )
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  EFI_STATUS                      Status;
 | 
				
			||||||
 | 
					  AML_DATA_NODE                 * RdNode;
 | 
				
			||||||
 | 
					  EFI_ACPI_END_TAG_DESCRIPTOR     EndTag;
 | 
				
			||||||
 | 
					  ACPI_SMALL_RESOURCE_HEADER      SmallResHdr;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if ((ParentNode == NULL) && (NewRdNode == NULL)) {
 | 
				
			||||||
 | 
					    ASSERT (0);
 | 
				
			||||||
 | 
					    return EFI_INVALID_PARAMETER;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  RdNode = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Header
 | 
				
			||||||
 | 
					  SmallResHdr.Bits.Length = sizeof (EFI_ACPI_END_TAG_DESCRIPTOR) -
 | 
				
			||||||
 | 
					                              sizeof (ACPI_SMALL_RESOURCE_HEADER);
 | 
				
			||||||
 | 
					  SmallResHdr.Bits.Name = ACPI_SMALL_END_TAG_DESCRIPTOR_NAME;
 | 
				
			||||||
 | 
					  SmallResHdr.Bits.Type = ACPI_SMALL_ITEM_FLAG;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Body
 | 
				
			||||||
 | 
					  EndTag.Desc = SmallResHdr.Byte;
 | 
				
			||||||
 | 
					  EndTag.Checksum = CheckSum;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Status = AmlCreateDataNode (
 | 
				
			||||||
 | 
					             EAmlNodeDataTypeResourceData,
 | 
				
			||||||
 | 
					             (UINT8*)&EndTag,
 | 
				
			||||||
 | 
					             sizeof (EFI_ACPI_END_TAG_DESCRIPTOR),
 | 
				
			||||||
 | 
					             &RdNode
 | 
				
			||||||
 | 
					             );
 | 
				
			||||||
 | 
					  if (EFI_ERROR (Status)) {
 | 
				
			||||||
 | 
					    ASSERT (0);
 | 
				
			||||||
 | 
					    return Status;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if (NewRdNode != NULL) {
 | 
				
			||||||
 | 
					    *NewRdNode = RdNode;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if (ParentNode != NULL) {
 | 
				
			||||||
 | 
					    // Check the BufferOp doesn't contain any resource data yet.
 | 
				
			||||||
 | 
					    // This is a hard check: do not allow to add an EndTag if the BufferNode
 | 
				
			||||||
 | 
					    // already has resource data elements attached. Indeed, the EndTag should
 | 
				
			||||||
 | 
					    // have already been added.
 | 
				
			||||||
 | 
					    if (AmlGetNextVariableArgument ((AML_NODE_HEADER*)ParentNode, NULL) !=
 | 
				
			||||||
 | 
					          NULL) {
 | 
				
			||||||
 | 
					      ASSERT (0);
 | 
				
			||||||
 | 
					      Status = EFI_INVALID_PARAMETER;
 | 
				
			||||||
 | 
					      goto error_handler;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Add the EndTag RdNode. Indeed, the AmlAppendRdNode function
 | 
				
			||||||
 | 
					    // is looking for an EndTag, which we are adding here.
 | 
				
			||||||
 | 
					    Status = AmlVarListAddTail (
 | 
				
			||||||
 | 
					               (AML_NODE_HEADER*)ParentNode,
 | 
				
			||||||
 | 
					               (AML_NODE_HEADER*)RdNode
 | 
				
			||||||
 | 
					               );
 | 
				
			||||||
 | 
					    if (EFI_ERROR (Status)) {
 | 
				
			||||||
 | 
					      ASSERT (0);
 | 
				
			||||||
 | 
					      goto error_handler;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  return Status;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					error_handler:
 | 
				
			||||||
 | 
					  if (RdNode != NULL) {
 | 
				
			||||||
 | 
					    AmlDeleteTree ((AML_NODE_HEADER*)RdNode);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  return Status;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// DEPRECATED APIS
 | 
				
			||||||
 | 
					#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** DEPRECATED API
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Add an Interrupt Resource Data node.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  This function creates a Resource Data element corresponding to the
 | 
					  This function creates a Resource Data element corresponding to the
 | 
				
			||||||
  "Interrupt ()" ASL function, stores it in an AML Data Node.
 | 
					  "Interrupt ()" ASL function, stores it in an AML Data Node.
 | 
				
			||||||
@@ -180,6 +422,8 @@ AmlCodeGenInterrupt (
 | 
				
			|||||||
               ...
 | 
					               ...
 | 
				
			||||||
             }
 | 
					             }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @ingroup UserApis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @param  [in]  NameOpCrsNode    NameOp object node defining a "_CRS" object.
 | 
					  @param  [in]  NameOpCrsNode    NameOp object node defining a "_CRS" object.
 | 
				
			||||||
                                 Must have an OpCode=AML_NAME_OP, SubOpCode=0.
 | 
					                                 Must have an OpCode=AML_NAME_OP, SubOpCode=0.
 | 
				
			||||||
                                 NameOp object nodes are defined in ASL
 | 
					                                 NameOp object nodes are defined in ASL
 | 
				
			||||||
@@ -211,46 +455,16 @@ AmlCodeGenCrsAddRdInterrupt (
 | 
				
			|||||||
  IN  UINT8                   IrqCount
 | 
					  IN  UINT8                   IrqCount
 | 
				
			||||||
  )
 | 
					  )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  EFI_STATUS              Status;
 | 
					  return AmlCodeGenRdInterrupt (
 | 
				
			||||||
 | 
					           ResourceConsumer,
 | 
				
			||||||
  AML_OBJECT_NODE_HANDLE  BufferOpNode;
 | 
					           EdgeTriggered,
 | 
				
			||||||
 | 
					           ActiveLow,
 | 
				
			||||||
  if ((IrqList == NULL)                                                   ||
 | 
					           Shared,
 | 
				
			||||||
      (IrqCount == 0)                                                     ||
 | 
					           IrqList,
 | 
				
			||||||
      (!AmlNodeHasOpCode (NameOpCrsNode, AML_NAME_OP, 0))                 ||
 | 
					           IrqCount,
 | 
				
			||||||
      (!AmlNameOpCompareName (NameOpCrsNode, "_CRS"))) {
 | 
					           NameOpCrsNode,
 | 
				
			||||||
    ASSERT (0);
 | 
					           NULL
 | 
				
			||||||
    return EFI_INVALID_PARAMETER;
 | 
					           );
 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  // Get the _CRS value which is represented as a BufferOp object node
 | 
					 | 
				
			||||||
  // which is the 2nd fixed argument (i.e. index 1).
 | 
					 | 
				
			||||||
  BufferOpNode = (AML_OBJECT_NODE_HANDLE)AmlGetFixedArgument (
 | 
					 | 
				
			||||||
                                           NameOpCrsNode,
 | 
					 | 
				
			||||||
                                           EAmlParseIndexTerm1
 | 
					 | 
				
			||||||
                                           );
 | 
					 | 
				
			||||||
  if ((BufferOpNode == NULL)                                             ||
 | 
					 | 
				
			||||||
      (AmlGetNodeType ((AML_NODE_HANDLE)BufferOpNode) != EAmlNodeObject) ||
 | 
					 | 
				
			||||||
      (!AmlNodeHasOpCode (BufferOpNode, AML_BUFFER_OP, 0))) {
 | 
					 | 
				
			||||||
    ASSERT (0);
 | 
					 | 
				
			||||||
    return EFI_INVALID_PARAMETER;
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  // Generate the Extended Interrupt Resource Data node,
 | 
					 | 
				
			||||||
  // and attach it as the last variable argument of the BufferOpNode.
 | 
					 | 
				
			||||||
  Status = AmlCodeGenInterrupt (
 | 
					 | 
				
			||||||
             ResourceConsumer,
 | 
					 | 
				
			||||||
             EdgeTriggered,
 | 
					 | 
				
			||||||
             ActiveLow,
 | 
					 | 
				
			||||||
             Shared,
 | 
					 | 
				
			||||||
             IrqList,
 | 
					 | 
				
			||||||
             IrqCount,
 | 
					 | 
				
			||||||
             BufferOpNode,
 | 
					 | 
				
			||||||
             NULL
 | 
					 | 
				
			||||||
             );
 | 
					 | 
				
			||||||
  if (EFI_ERROR (Status)) {
 | 
					 | 
				
			||||||
    ASSERT (0);
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  return Status;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#endif // DISABLE_NEW_DEPRECATED_INTERFACES
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,7 @@
 | 
				
			|||||||
/** @file
 | 
					/** @file
 | 
				
			||||||
  AML Resource Data Code Generation.
 | 
					  AML Resource Data Code Generation.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.<BR>
 | 
					  Copyright (c) 2019 - 2021, Arm Limited. All rights reserved.<BR>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
					  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
				
			||||||
**/
 | 
					**/
 | 
				
			||||||
@@ -11,33 +11,32 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
/** Code generation for the "Interrupt ()" ASL function.
 | 
					/** Code generation for the "Interrupt ()" ASL function.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  This function creates a Resource Data element corresponding to the
 | 
					 | 
				
			||||||
  "Interrupt ()" ASL function and stores it in an AML Data Node.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  The Resource Data effectively created is an Extended Interrupt Resource
 | 
					  The Resource Data effectively created is an Extended Interrupt Resource
 | 
				
			||||||
  Data. See ACPI 6.3 specification, s6.4.3.6 "Extended Interrupt Descriptor"
 | 
					  Data. Cf ACPI 6.4:
 | 
				
			||||||
  for more information about Extended Interrupt Resource Data.
 | 
					   - s6.4.3.6 "Extended Interrupt Descriptor"
 | 
				
			||||||
 | 
					   - s19.6.64 "Interrupt (Interrupt Resource Descriptor Macro)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  This function allocates memory to create a data node. It is the caller's
 | 
					  The created resource data node can be:
 | 
				
			||||||
  responsibility to either:
 | 
					   - appended to the list of resource data elements of the NameOpNode.
 | 
				
			||||||
   - attach this node to an AML tree;
 | 
					     In such case NameOpNode must be defined by a the "Name ()" ASL statement
 | 
				
			||||||
   - delete this node.
 | 
					     and initially contain a "ResourceTemplate ()".
 | 
				
			||||||
 | 
					   - returned through the NewRdNode parameter.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @param [in]  ResourceConsumer    The device consumes the specified interrupt
 | 
					  @param  [in]  ResourceConsumer The device consumes the specified interrupt
 | 
				
			||||||
                                   or produces it for use by a child device.
 | 
					                                 or produces it for use by a child device.
 | 
				
			||||||
  @param [in]  EdgeTriggered       The interrupt is edge triggered or
 | 
					  @param  [in]  EdgeTriggered    The interrupt is edge triggered or
 | 
				
			||||||
                                   level triggered.
 | 
					                                 level triggered.
 | 
				
			||||||
  @param [in]  ActiveLow           The interrupt is active-high or active-low.
 | 
					  @param  [in]  ActiveLow        The interrupt is active-high or active-low.
 | 
				
			||||||
  @param [in]  Shared              The interrupt can be shared with other
 | 
					  @param  [in]  Shared           The interrupt can be shared with other
 | 
				
			||||||
                                   devices or not (Exclusive).
 | 
					                                 devices or not (Exclusive).
 | 
				
			||||||
  @param [in]  IrqList             Interrupt list. Must be non-NULL.
 | 
					  @param  [in]  IrqList          Interrupt list. Must be non-NULL.
 | 
				
			||||||
  @param [in]  IrqCount            Interrupt count. Must be non-zero.
 | 
					  @param  [in]  IrqCount         Interrupt count. Must be non-zero.
 | 
				
			||||||
  @param [in]  ParentNode          If not NULL, add the generated node
 | 
					  @param  [in]  NameOpNode       NameOp object node defining a named object.
 | 
				
			||||||
                                   to the end of the variable list of
 | 
					                                 If provided, append the new resource data node
 | 
				
			||||||
                                   argument of the ParentNode, but
 | 
					                                 to the list of resource data elements of this
 | 
				
			||||||
                                   before the "End Tag" Resource Data.
 | 
					                                 node.
 | 
				
			||||||
                                   Must be a BufferOpNode.
 | 
					  @param  [out] NewRdNode        If provided and success,
 | 
				
			||||||
  @param  [out] NewRdNode          If success, contains the generated node.
 | 
					                                 contain the created node.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @retval EFI_SUCCESS             The function completed successfully.
 | 
					  @retval EFI_SUCCESS             The function completed successfully.
 | 
				
			||||||
  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
					  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
				
			||||||
@@ -45,15 +44,107 @@
 | 
				
			|||||||
**/
 | 
					**/
 | 
				
			||||||
EFI_STATUS
 | 
					EFI_STATUS
 | 
				
			||||||
EFIAPI
 | 
					EFIAPI
 | 
				
			||||||
AmlCodeGenInterrupt (
 | 
					AmlCodeGenRdInterrupt (
 | 
				
			||||||
  IN  BOOLEAN             ResourceConsumer,
 | 
					  IN  BOOLEAN                 ResourceConsumer,
 | 
				
			||||||
  IN  BOOLEAN             EdgeTriggered,
 | 
					  IN  BOOLEAN                 EdgeTriggered,
 | 
				
			||||||
  IN  BOOLEAN             ActiveLow,
 | 
					  IN  BOOLEAN                 ActiveLow,
 | 
				
			||||||
  IN  BOOLEAN             Shared,
 | 
					  IN  BOOLEAN                 Shared,
 | 
				
			||||||
  IN  UINT32            * IrqList,
 | 
					  IN  UINT32                  *IrqList,
 | 
				
			||||||
  IN  UINT8               IrqCount,
 | 
					  IN  UINT8                   IrqCount,
 | 
				
			||||||
  IN  AML_OBJECT_NODE   * ParentNode,   OPTIONAL
 | 
					  IN  AML_OBJECT_NODE_HANDLE  NameOpNode, OPTIONAL
 | 
				
			||||||
  OUT AML_DATA_NODE    ** NewRdNode     OPTIONAL
 | 
					  OUT AML_DATA_NODE_HANDLE    *NewRdNode  OPTIONAL
 | 
				
			||||||
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** Code generation for the "Register ()" ASL function.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  The Resource Data effectively created is a Generic Register Descriptor.
 | 
				
			||||||
 | 
					  Data. Cf ACPI 6.4:
 | 
				
			||||||
 | 
					   - s6.4.3.7 "Generic Register Descriptor".
 | 
				
			||||||
 | 
					   - s19.6.114 "Register".
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  The created resource data node can be:
 | 
				
			||||||
 | 
					   - appended to the list of resource data elements of the NameOpNode.
 | 
				
			||||||
 | 
					     In such case NameOpNode must be defined by a the "Name ()" ASL statement
 | 
				
			||||||
 | 
					     and initially contain a "ResourceTemplate ()".
 | 
				
			||||||
 | 
					   - returned through the NewRdNode parameter.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @param [in]  AddressSpace    Address space where the register exists.
 | 
				
			||||||
 | 
					                               Can be one of I/O space, System Memory, etc.
 | 
				
			||||||
 | 
					  @param [in]  BitWidth        Number of bits in the register.
 | 
				
			||||||
 | 
					  @param [in]  BitOffset       Offset in bits from the start of the register
 | 
				
			||||||
 | 
					                               indicated by the Address.
 | 
				
			||||||
 | 
					  @param [in]  Address         Register address.
 | 
				
			||||||
 | 
					  @param [in]  AccessSize      Size of data values used when accessing the
 | 
				
			||||||
 | 
					                               address space. Can be one of:
 | 
				
			||||||
 | 
					                                 0 - Undefined, legacy (EFI_ACPI_6_4_UNDEFINED)
 | 
				
			||||||
 | 
					                                 1 - Byte access (EFI_ACPI_6_4_BYTE)
 | 
				
			||||||
 | 
					                                 2 - Word access (EFI_ACPI_6_4_WORD)
 | 
				
			||||||
 | 
					                                 3 - DWord access (EFI_ACPI_6_4_DWORD)
 | 
				
			||||||
 | 
					                                 4 - QWord access (EFI_ACPI_6_4_QWORD)
 | 
				
			||||||
 | 
					  @param  [in]  NameOpNode       NameOp object node defining a named object.
 | 
				
			||||||
 | 
					                                 If provided, append the new resource data node
 | 
				
			||||||
 | 
					                                 to the list of resource data elements of this
 | 
				
			||||||
 | 
					                                 node.
 | 
				
			||||||
 | 
					  @param  [out] NewRdNode        If provided and success,
 | 
				
			||||||
 | 
					                                 contain the created node.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @retval EFI_SUCCESS             The function completed successfully.
 | 
				
			||||||
 | 
					  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
				
			||||||
 | 
					  @retval EFI_OUT_OF_RESOURCES    Could not allocate memory.
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					EFI_STATUS
 | 
				
			||||||
 | 
					EFIAPI
 | 
				
			||||||
 | 
					AmlCodeGenRdRegister (
 | 
				
			||||||
 | 
					  IN  UINT8                   AddressSpace,
 | 
				
			||||||
 | 
					  IN  UINT8                   BitWidth,
 | 
				
			||||||
 | 
					  IN  UINT8                   BitOffset,
 | 
				
			||||||
 | 
					  IN  UINT64                  Address,
 | 
				
			||||||
 | 
					  IN  UINT8                   AccessSize,
 | 
				
			||||||
 | 
					  IN  AML_OBJECT_NODE_HANDLE  NameOpNode, OPTIONAL
 | 
				
			||||||
 | 
					  OUT AML_DATA_NODE_HANDLE    *NewRdNode  OPTIONAL
 | 
				
			||||||
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** Code generation for the EndTag resource data.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  The EndTag resource data is automatically generated by the ASL compiler
 | 
				
			||||||
 | 
					  at the end of a list of resource data elements. Thus, it doesn't have
 | 
				
			||||||
 | 
					  a corresponding ASL function.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  This function allocates memory to create a data node. It is the caller's
 | 
				
			||||||
 | 
					  responsibility to either:
 | 
				
			||||||
 | 
					   - attach this node to an AML tree;
 | 
				
			||||||
 | 
					   - delete this node.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  ACPI 6.4, s6.4.2.9 "End Tag":
 | 
				
			||||||
 | 
					  "This checksum is generated such that adding it to the sum of all the data
 | 
				
			||||||
 | 
					  bytes will produce a zero sum."
 | 
				
			||||||
 | 
					  "If the checksum field is zero, the resource data is treated as if the
 | 
				
			||||||
 | 
					  checksum operation succeeded. Configuration proceeds normally."
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  To avoid re-computing checksums, if a new resource data elements is
 | 
				
			||||||
 | 
					  added/removed/modified in a list of resource data elements, the AmlLib
 | 
				
			||||||
 | 
					  resets the checksum to 0.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @param [in]  CheckSum        CheckSum to store in the EndTag.
 | 
				
			||||||
 | 
					                               To ignore/avoid computing the checksum,
 | 
				
			||||||
 | 
					                               give 0.
 | 
				
			||||||
 | 
					  @param [in]  ParentNode      If not NULL, add the generated node
 | 
				
			||||||
 | 
					                               to the end of the variable list of
 | 
				
			||||||
 | 
					                               argument of the ParentNode.
 | 
				
			||||||
 | 
					                               The ParentNode must not initially contain
 | 
				
			||||||
 | 
					                               an EndTag resource data element.
 | 
				
			||||||
 | 
					  @param  [out] NewRdNode      If success, contains the generated node.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @retval EFI_SUCCESS             The function completed successfully.
 | 
				
			||||||
 | 
					  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
				
			||||||
 | 
					  @retval EFI_OUT_OF_RESOURCES    Could not allocate memory.
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					EFI_STATUS
 | 
				
			||||||
 | 
					EFIAPI
 | 
				
			||||||
 | 
					AmlCodeGenEndTag (
 | 
				
			||||||
 | 
					  IN  UINT8               CheckSum,   OPTIONAL
 | 
				
			||||||
 | 
					  IN  AML_OBJECT_NODE   * ParentNode, OPTIONAL
 | 
				
			||||||
 | 
					  OUT AML_DATA_NODE    ** NewRdNode   OPTIONAL
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif // AML_RESOURCE_DATA_CODE_GEN_H_
 | 
					#endif // AML_RESOURCE_DATA_CODE_GEN_H_
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -101,3 +101,36 @@ AmlRdGetSize (
 | 
				
			|||||||
  return ((ACPI_SMALL_RESOURCE_HEADER*)Header)->Bits.Length +
 | 
					  return ((ACPI_SMALL_RESOURCE_HEADER*)Header)->Bits.Length +
 | 
				
			||||||
           sizeof (ACPI_SMALL_RESOURCE_HEADER);
 | 
					           sizeof (ACPI_SMALL_RESOURCE_HEADER);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** Set the Checksum of an EndTag resource data.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  ACPI 6.4, s6.4.2.9 "End Tag":
 | 
				
			||||||
 | 
					  "This checksum is generated such that adding it to the sum of all the data
 | 
				
			||||||
 | 
					  bytes will produce a zero sum."
 | 
				
			||||||
 | 
					  "If the checksum field is zero, the resource data is treated as if the
 | 
				
			||||||
 | 
					  checksum operation succeeded. Configuration proceeds normally."
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @param  [in]  Header     Pointer to the first byte of a resource data.
 | 
				
			||||||
 | 
					  @param  [in]  CheckSum   Checksum value to set.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @retval EFI_SUCCESS             The function completed successfully.
 | 
				
			||||||
 | 
					  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					EFI_STATUS
 | 
				
			||||||
 | 
					EFIAPI
 | 
				
			||||||
 | 
					AmlRdSetEndTagChecksum (
 | 
				
			||||||
 | 
					  IN  CONST AML_RD_HEADER   * Header,
 | 
				
			||||||
 | 
					  IN        UINT8             CheckSum
 | 
				
			||||||
 | 
					  )
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  if ((Header == NULL)  ||
 | 
				
			||||||
 | 
					      !AmlRdCompareDescId (
 | 
				
			||||||
 | 
					        Header,
 | 
				
			||||||
 | 
					        AML_RD_BUILD_SMALL_DESC_ID (ACPI_SMALL_END_TAG_DESCRIPTOR_NAME))) {
 | 
				
			||||||
 | 
					    ASSERT (0);
 | 
				
			||||||
 | 
					    return EFI_INVALID_PARAMETER;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  ((EFI_ACPI_END_TAG_DESCRIPTOR*)Header)->Checksum = CheckSum;
 | 
				
			||||||
 | 
					  return EFI_SUCCESS;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -171,4 +171,25 @@ AmlRdGetSize (
 | 
				
			|||||||
  IN  CONST AML_RD_HEADER   * Header
 | 
					  IN  CONST AML_RD_HEADER   * Header
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** Set the Checksum of an EndTag resource data.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  ACPI 6.4, s6.4.2.9 "End Tag":
 | 
				
			||||||
 | 
					  "This checksum is generated such that adding it to the sum of all the data
 | 
				
			||||||
 | 
					  bytes will produce a zero sum."
 | 
				
			||||||
 | 
					  "If the checksum field is zero, the resource data is treated as if the
 | 
				
			||||||
 | 
					  checksum operation succeeded. Configuration proceeds normally."
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @param  [in]  Header     Pointer to the first byte of a resource data.
 | 
				
			||||||
 | 
					  @param  [in]  CheckSum   Checksum value to set.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @retval EFI_SUCCESS             The function completed successfully.
 | 
				
			||||||
 | 
					  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					EFI_STATUS
 | 
				
			||||||
 | 
					EFIAPI
 | 
				
			||||||
 | 
					AmlRdSetEndTagChecksum (
 | 
				
			||||||
 | 
					  IN  CONST AML_RD_HEADER   * Header,
 | 
				
			||||||
 | 
					  IN        UINT8             CheckSum
 | 
				
			||||||
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif // AML_RESOURCE_DATA_H_
 | 
					#endif // AML_RESOURCE_DATA_H_
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -43,8 +43,6 @@ AmlCloneNode (
 | 
				
			|||||||
    return EFI_INVALID_PARAMETER;
 | 
					    return EFI_INVALID_PARAMETER;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  *ClonedNode = NULL;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  if (IS_AML_DATA_NODE (Node)) {
 | 
					  if (IS_AML_DATA_NODE (Node)) {
 | 
				
			||||||
    DataNode = (AML_DATA_NODE*)Node;
 | 
					    DataNode = (AML_DATA_NODE*)Node;
 | 
				
			||||||
    Status = AmlCreateDataNode (
 | 
					    Status = AmlCreateDataNode (
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -79,7 +79,9 @@ AmlDeleteRootNode (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  @param  [in]  SdtHeader       Pointer to an ACPI DSDT/SSDT header to copy
 | 
					  @param  [in]  SdtHeader       Pointer to an ACPI DSDT/SSDT header to copy
 | 
				
			||||||
                                the data from.
 | 
					                                the data from.
 | 
				
			||||||
  @param  [out] NewRootNodePtr  The created AML_ROOT_NODE.
 | 
					  @param  [out] NewRootNodePtr  If success, contains the created
 | 
				
			||||||
 | 
					                                AML_ROOT_NODE.
 | 
				
			||||||
 | 
					                                Otherwise reset to NULL.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @retval EFI_SUCCESS             The function completed successfully.
 | 
					  @retval EFI_SUCCESS             The function completed successfully.
 | 
				
			||||||
  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
					  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
				
			||||||
@@ -101,6 +103,8 @@ AmlCreateRootNode (
 | 
				
			|||||||
    return EFI_INVALID_PARAMETER;
 | 
					    return EFI_INVALID_PARAMETER;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  *NewRootNodePtr = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  RootNode = AllocateZeroPool (sizeof (AML_ROOT_NODE));
 | 
					  RootNode = AllocateZeroPool (sizeof (AML_ROOT_NODE));
 | 
				
			||||||
  if (RootNode == NULL) {
 | 
					  if (RootNode == NULL) {
 | 
				
			||||||
    ASSERT (0);
 | 
					    ASSERT (0);
 | 
				
			||||||
@@ -163,7 +167,9 @@ AmlDeleteObjectNode (
 | 
				
			|||||||
  @param  [in]  PkgLength         PkgLength of the node if the AmlByteEncoding
 | 
					  @param  [in]  PkgLength         PkgLength of the node if the AmlByteEncoding
 | 
				
			||||||
                                  has the PkgLen attribute.
 | 
					                                  has the PkgLen attribute.
 | 
				
			||||||
                                  0 otherwise.
 | 
					                                  0 otherwise.
 | 
				
			||||||
  @param  [out] NewObjectNodePtr  The created AML_OBJECT_NODE.
 | 
					  @param  [out] NewObjectNodePtr  If success, contains the created
 | 
				
			||||||
 | 
					                                  AML_OBJECT_NODE.
 | 
				
			||||||
 | 
					                                  Otherwise reset to NULL.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @retval EFI_SUCCESS             The function completed successfully.
 | 
					  @retval EFI_SUCCESS             The function completed successfully.
 | 
				
			||||||
  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
					  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
				
			||||||
@@ -186,6 +192,8 @@ AmlCreateObjectNode (
 | 
				
			|||||||
    return EFI_INVALID_PARAMETER;
 | 
					    return EFI_INVALID_PARAMETER;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  *NewObjectNodePtr = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ObjectNode = AllocateZeroPool (sizeof (AML_OBJECT_NODE));
 | 
					  ObjectNode = AllocateZeroPool (sizeof (AML_OBJECT_NODE));
 | 
				
			||||||
  if (ObjectNode == NULL) {
 | 
					  if (ObjectNode == NULL) {
 | 
				
			||||||
    ASSERT (0);
 | 
					    ASSERT (0);
 | 
				
			||||||
@@ -252,7 +260,9 @@ AmlDeleteDataNode (
 | 
				
			|||||||
                                this node. Data is copied from there.
 | 
					                                this node. Data is copied from there.
 | 
				
			||||||
  @param  [in]  DataSize        Number of bytes to consider at the address
 | 
					  @param  [in]  DataSize        Number of bytes to consider at the address
 | 
				
			||||||
                                pointed by Data.
 | 
					                                pointed by Data.
 | 
				
			||||||
  @param  [out] NewDataNodePtr  The created AML_DATA_NODE.
 | 
					  @param  [out] NewDataNodePtr  If success, contains the created
 | 
				
			||||||
 | 
					                                AML_DATA_NODE.
 | 
				
			||||||
 | 
					                                Otherwise reset to NULL.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @retval EFI_SUCCESS             The function completed successfully.
 | 
					  @retval EFI_SUCCESS             The function completed successfully.
 | 
				
			||||||
  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
					  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
				
			||||||
@@ -284,6 +294,8 @@ AmlCreateDataNode (
 | 
				
			|||||||
    return EFI_INVALID_PARAMETER;
 | 
					    return EFI_INVALID_PARAMETER;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  *NewDataNodePtr = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  DataNode = AllocateZeroPool (sizeof (AML_DATA_NODE));
 | 
					  DataNode = AllocateZeroPool (sizeof (AML_DATA_NODE));
 | 
				
			||||||
  if (DataNode == NULL) {
 | 
					  if (DataNode == NULL) {
 | 
				
			||||||
    ASSERT (0);
 | 
					    ASSERT (0);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,7 +17,9 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  @param  [in]  SdtHeader       Pointer to an ACPI DSDT/SSDT header to copy
 | 
					  @param  [in]  SdtHeader       Pointer to an ACPI DSDT/SSDT header to copy
 | 
				
			||||||
                                the data from.
 | 
					                                the data from.
 | 
				
			||||||
  @param  [out] NewRootNodePtr  The created AML_ROOT_NODE.
 | 
					  @param  [out] NewRootNodePtr  If success, contains the created
 | 
				
			||||||
 | 
					                                AML_ROOT_NODE.
 | 
				
			||||||
 | 
					                                Otherwise reset to NULL.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @retval EFI_SUCCESS             The function completed successfully.
 | 
					  @retval EFI_SUCCESS             The function completed successfully.
 | 
				
			||||||
  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
					  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
				
			||||||
@@ -36,7 +38,9 @@ AmlCreateRootNode (
 | 
				
			|||||||
  @param  [in]  PkgLength         PkgLength of the node if the AmlByteEncoding
 | 
					  @param  [in]  PkgLength         PkgLength of the node if the AmlByteEncoding
 | 
				
			||||||
                                  has the PkgLen attribute.
 | 
					                                  has the PkgLen attribute.
 | 
				
			||||||
                                  0 otherwise.
 | 
					                                  0 otherwise.
 | 
				
			||||||
  @param  [out] NewObjectNodePtr  The created AML_OBJECT_NODE.
 | 
					  @param  [out] NewObjectNodePtr  If success, contains the created
 | 
				
			||||||
 | 
					                                  AML_OBJECT_NODE.
 | 
				
			||||||
 | 
					                                  Otherwise reset to NULL.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @retval EFI_SUCCESS             The function completed successfully.
 | 
					  @retval EFI_SUCCESS             The function completed successfully.
 | 
				
			||||||
  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
					  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
				
			||||||
@@ -57,7 +61,9 @@ AmlCreateObjectNode (
 | 
				
			|||||||
                                this node. Data is copied from there.
 | 
					                                this node. Data is copied from there.
 | 
				
			||||||
  @param  [in]  DataSize        Number of bytes to consider at the address
 | 
					  @param  [in]  DataSize        Number of bytes to consider at the address
 | 
				
			||||||
                                pointed by Data.
 | 
					                                pointed by Data.
 | 
				
			||||||
  @param  [out] NewDataNodePtr  The created AML_DATA_NODE.
 | 
					  @param  [out] NewDataNodePtr  If success, contains the created
 | 
				
			||||||
 | 
					                                AML_DATA_NODE.
 | 
				
			||||||
 | 
					                                Otherwise reset to NULL.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @retval EFI_SUCCESS             The function completed successfully.
 | 
					  @retval EFI_SUCCESS             The function completed successfully.
 | 
				
			||||||
  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
					  @retval EFI_INVALID_PARAMETER   Invalid parameter.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -513,6 +513,13 @@ AmlUpdateDataNode (
 | 
				
			|||||||
        ASSERT (0);
 | 
					        ASSERT (0);
 | 
				
			||||||
        return EFI_INVALID_PARAMETER;
 | 
					        return EFI_INVALID_PARAMETER;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      Status = AmlSetRdListCheckSum (ParentNode, 0);
 | 
				
			||||||
 | 
					      if (EFI_ERROR (Status)) {
 | 
				
			||||||
 | 
					        ASSERT (0);
 | 
				
			||||||
 | 
					        return Status;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      break;
 | 
					      break;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    case EAmlNodeDataTypeFieldPkgLen:
 | 
					    case EAmlNodeDataTypeFieldPkgLen:
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -566,8 +566,7 @@ AmlAppendRdNode (
 | 
				
			|||||||
  )
 | 
					  )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  EFI_STATUS        Status;
 | 
					  EFI_STATUS        Status;
 | 
				
			||||||
  AML_DATA_NODE   * CurrRdNode;
 | 
					  AML_DATA_NODE   * LastRdNode;
 | 
				
			||||||
  AML_RD_HEADER     RdDataType;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (!AmlNodeCompareOpCode (BufferOpNode, AML_BUFFER_OP, 0)  ||
 | 
					  if (!AmlNodeCompareOpCode (BufferOpNode, AML_BUFFER_OP, 0)  ||
 | 
				
			||||||
      !IS_AML_DATA_NODE (NewRdNode)                           ||
 | 
					      !IS_AML_DATA_NODE (NewRdNode)                           ||
 | 
				
			||||||
@@ -576,56 +575,39 @@ AmlAppendRdNode (
 | 
				
			|||||||
    return EFI_INVALID_PARAMETER;
 | 
					    return EFI_INVALID_PARAMETER;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Get the first Resource data node in the variable list of
 | 
					  // To avoid re-computing checksums, if a new resource data elements is
 | 
				
			||||||
  // argument of the BufferOp node.
 | 
					  // added/removed/modified in a list of resource data elements, the AmlLib
 | 
				
			||||||
  CurrRdNode = (AML_DATA_NODE*)AmlGetNextVariableArgument (
 | 
					  // resets the checksum to 0.
 | 
				
			||||||
 | 
					  // It is possible to have only one Resource Data in a BufferOp with
 | 
				
			||||||
 | 
					  // no EndTag, but it should not be possible to add a new Resource Data
 | 
				
			||||||
 | 
					  // in the list in this case.
 | 
				
			||||||
 | 
					  Status = AmlSetRdListCheckSum (BufferOpNode, 0);
 | 
				
			||||||
 | 
					  if (EFI_ERROR (Status)) {
 | 
				
			||||||
 | 
					    ASSERT (0);
 | 
				
			||||||
 | 
					    return Status;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Get the last Resource data node in the variable list of argument of the
 | 
				
			||||||
 | 
					  // BufferOp node. This must be an EndTag, otherwise setting the checksum
 | 
				
			||||||
 | 
					  // would have failed.
 | 
				
			||||||
 | 
					  LastRdNode = (AML_DATA_NODE*)AmlGetPreviousVariableArgument (
 | 
				
			||||||
                                 (AML_NODE_HEADER*)BufferOpNode,
 | 
					                                 (AML_NODE_HEADER*)BufferOpNode,
 | 
				
			||||||
                                 NULL
 | 
					                                 NULL
 | 
				
			||||||
                                 );
 | 
					                                 );
 | 
				
			||||||
  if ((CurrRdNode == NULL)             ||
 | 
					  if ((LastRdNode == NULL)             ||
 | 
				
			||||||
      !IS_AML_DATA_NODE (CurrRdNode)   ||
 | 
					      !IS_AML_DATA_NODE (LastRdNode)   ||
 | 
				
			||||||
      (CurrRdNode->DataType != EAmlNodeDataTypeResourceData)) {
 | 
					      (LastRdNode->DataType != EAmlNodeDataTypeResourceData)) {
 | 
				
			||||||
    ASSERT (0);
 | 
					    ASSERT (0);
 | 
				
			||||||
    return EFI_INVALID_PARAMETER;
 | 
					    return EFI_INVALID_PARAMETER;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Iterate through the Resource Data nodes to find the End Tag.
 | 
					  // Add NewRdNode before the EndTag.
 | 
				
			||||||
  while (TRUE) {
 | 
					  Status = AmlVarListAddBefore (
 | 
				
			||||||
    Status = AmlGetResourceDataType (CurrRdNode, &RdDataType);
 | 
					             (AML_NODE_HEADER*)LastRdNode,
 | 
				
			||||||
    if (EFI_ERROR (Status)) {
 | 
					             (AML_NODE_HEADER*)NewRdNode)
 | 
				
			||||||
      ASSERT (0);
 | 
					             ;
 | 
				
			||||||
      return Status;
 | 
					  ASSERT_EFI_ERROR (Status);
 | 
				
			||||||
    }
 | 
					  return Status;
 | 
				
			||||||
 | 
					 | 
				
			||||||
    // If the Resource Data is an End Tag,
 | 
					 | 
				
			||||||
    // add the new node before and return.
 | 
					 | 
				
			||||||
    if (AmlRdCompareDescId (
 | 
					 | 
				
			||||||
          &RdDataType,
 | 
					 | 
				
			||||||
          AML_RD_BUILD_SMALL_DESC_ID (ACPI_SMALL_END_TAG_DESCRIPTOR_NAME))) {
 | 
					 | 
				
			||||||
      Status = AmlVarListAddBefore (
 | 
					 | 
				
			||||||
                 (AML_NODE_HEADER*)CurrRdNode,
 | 
					 | 
				
			||||||
                 (AML_NODE_HEADER*)NewRdNode)
 | 
					 | 
				
			||||||
                 ;
 | 
					 | 
				
			||||||
      if (EFI_ERROR (Status)) {
 | 
					 | 
				
			||||||
        ASSERT (0);
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
      return Status;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // Get the next Resource Data node.
 | 
					 | 
				
			||||||
    // If this was the last node and no End Tag was found, return error.
 | 
					 | 
				
			||||||
    // It is possible to have only one Resource Data in a BufferOp,
 | 
					 | 
				
			||||||
    // but it should not be possible to add a new Resource Data in the list
 | 
					 | 
				
			||||||
    // in this case.
 | 
					 | 
				
			||||||
    CurrRdNode = (AML_DATA_NODE*)AmlGetSiblingVariableArgument (
 | 
					 | 
				
			||||||
                                   (AML_NODE_HEADER*)CurrRdNode
 | 
					 | 
				
			||||||
                                   );
 | 
					 | 
				
			||||||
    if (!IS_AML_DATA_NODE (CurrRdNode)  ||
 | 
					 | 
				
			||||||
        (CurrRdNode->DataType != EAmlNodeDataTypeResourceData)) {
 | 
					 | 
				
			||||||
      ASSERT (0);
 | 
					 | 
				
			||||||
      return EFI_INVALID_PARAMETER;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  } // while
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/** Replace the fixed argument at the Index of the ParentNode with the NewNode.
 | 
					/** Replace the fixed argument at the Index of the ParentNode with the NewNode.
 | 
				
			||||||
 
 | 
				
			|||||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user