<FlashDefinitionFile>dummy.fdf</FlashDefinitionFile>
</Flash>
<FrameworkModules>
+ <ModuleSA SupArchList="IA32 X64 EBC IPF" PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674" ModuleGuid="1EC0F53A-FDE0-4576-8F25-7A1A410F58EB">
+ <Libraries>
+ <Instance ModuleGuid="ff5c7a2c-ab7a-4366-8616-11c6e53247b6" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
+ <Instance ModuleGuid="a86fbfca-0183-4eeb-aa8a-762e3b7da1f3" ModuleVersion="1.0" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec" PackageVersion="0.3"/>
+ <Instance ModuleGuid="8c690838-7a22-45c4-aa58-a33e3e515cd4" ModuleVersion="1.0" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec" PackageVersion="0.3"/>
+ <Instance ModuleGuid="9dbf6f25-0da2-4a1d-8e12-e78de6ab4d0e" ModuleVersion="1.0" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec" PackageVersion="0.3"/>
+ <Instance ModuleGuid="9ba1d976-0624-41a3-8650-28165e8d9ae8" ModuleVersion="1.0" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec" PackageVersion="0.3"/>
+ <Instance ModuleGuid="fd44e603-002a-4b29-9f5f-529e815b6165" ModuleVersion="1.0" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec" PackageVersion="0.3"/>
+ <Instance ModuleGuid="a804239b-4155-446f-acc8-f0825d74908c" ModuleVersion="1.0" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec" PackageVersion="0.3"/>
+ <Instance ModuleGuid="926c9cd0-4bb8-479b-9ac4-8a2a23f85307" ModuleVersion="1.0" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec" PackageVersion="0.3"/>
+ <Instance ModuleGuid="fa177ff7-1fc7-458d-a358-d9d62ae61cec" ModuleVersion="1.0" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec" PackageVersion="0.3"/>
+ <Instance ModuleGuid="9643128f-ac24-4b3e-b6be-d8849a306153" ModuleVersion="1.0" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec" PackageVersion="0.3"/>
+ <Instance ModuleGuid="27d67720-ea68-48ae-93da-a3a074c90e30" ModuleVersion="1.0" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec" PackageVersion="0.3"/>
+ <Instance ModuleGuid="e6e9c1f8-2c8a-4f4b-a27c-c382e4bb8e67" ModuleVersion="1.0" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec" PackageVersion="0.3"/>
+ <Instance ModuleGuid="b5a05743-9b71-489b-a0ed-a0eb3950d23b" ModuleVersion="1.0" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec" PackageVersion="0.3"/>
+ <Instance ModuleGuid="E4541241-8897-411a-91F8-7D7E45837146" ModuleVersion="1.0" PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674" PackageVersion="0.3"/>
+ <Instance ModuleGuid="54D2878F-25CD-4a2b-8420-EBD18E609C76" ModuleVersion="1.0" PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674" PackageVersion="0.3"/>
+ </Libraries>
+ <PcdBuildDefinition>
+ <PcdData ItemType="FIXED_AT_BUILD">
+ <C_Name>PcdMaximumUnicodeStringLength</C_Name>
+ <Token>0x00000001</Token>
+ <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <DatumType>UINT32</DatumType>
+ <MaxDatumSize>4</MaxDatumSize>
+ <Value>1000000</Value>
+ </PcdData>
+ <PcdData ItemType="FIXED_AT_BUILD">
+ <C_Name>PcdMaximumAsciiStringLength</C_Name>
+ <Token>0x00000002</Token>
+ <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <DatumType>UINT32</DatumType>
+ <MaxDatumSize>4</MaxDatumSize>
+ <Value>1000000</Value>
+ </PcdData>
+ <PcdData ItemType="FIXED_AT_BUILD">
+ <C_Name>PcdDebugPropertyMask</C_Name>
+ <Token>0x00000005</Token>
+ <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <DatumType>UINT8</DatumType>
+ <MaxDatumSize>1</MaxDatumSize>
+ <Value>0x0f</Value>
+ </PcdData>
+ <PcdData ItemType="FIXED_AT_BUILD">
+ <C_Name>PcdSpinLockTimeout</C_Name>
+ <Token>0x00000004</Token>
+ <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <DatumType>UINT32</DatumType>
+ <MaxDatumSize>4</MaxDatumSize>
+ <Value>10000000</Value>
+ </PcdData>
+ <PcdData ItemType="PATCHABLE_IN_MODULE">
+ <C_Name>PcdDebugPrintErrorLevel</C_Name>
+ <Token>0x00000006</Token>
+ <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <DatumType>UINT32</DatumType>
+ <MaxDatumSize>4</MaxDatumSize>
+ <Value>0x80000000</Value>
+ </PcdData>
+ <PcdData ItemType="FIXED_AT_BUILD">
+ <C_Name>PcdMaximumLinkedListLength</C_Name>
+ <Token>0x00000003</Token>
+ <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <DatumType>UINT32</DatumType>
+ <MaxDatumSize>4</MaxDatumSize>
+ <Value>1000000</Value>
+ </PcdData>
+ <PcdData ItemType="FIXED_AT_BUILD">
+ <C_Name>PcdReportStatusCodePropertyMask</C_Name>
+ <Token>0x00000007</Token>
+ <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <DatumType>UINT8</DatumType>
+ <MaxDatumSize>1</MaxDatumSize>
+ <Value>0x07</Value>
+ </PcdData>
+ <PcdData ItemType="FIXED_AT_BUILD">
+ <C_Name>PcdDebugClearMemoryValue</C_Name>
+ <Token>0x00000008</Token>
+ <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <DatumType>UINT8</DatumType>
+ <MaxDatumSize>1</MaxDatumSize>
+ <Value>0xAF</Value>
+ </PcdData>
+ <PcdData ItemType="FIXED_AT_BUILD">
+ <C_Name>PcdVpdBaseAddress</C_Name>
+ <Token>0x00010010</Token>
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <DatumType>UINT32</DatumType>
+ <MaxDatumSize>4</MaxDatumSize>
+ <Value>0x0</Value>
+ </PcdData>
+ <PcdData ItemType="FEATURE_FLAG">
+ <C_Name>PcdDxePcdDatabaseTraverseEnabled</C_Name>
+ <Token>0x00010021</Token>
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <DatumType>BOOLEAN</DatumType>
+ <MaxDatumSize>1</MaxDatumSize>
+ <Value>TRUE</Value>
+ </PcdData>
+ <PcdData ItemType="FEATURE_FLAG">\r
+ <C_Name>PcdStatusCodeUseSerial</C_Name>\r
+ <Token>0x00010022</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>BOOLEAN</DatumType>\r
+ <MaxDatumSize>1</MaxDatumSize>
+ <Value>FALSE</Value>\r
+ </PcdData>\r
+ <PcdData ItemType="FEATURE_FLAG">\r
+ <C_Name>PcdStatusCodeUseMemory</C_Name>\r
+ <Token>0x00010023</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>BOOLEAN</DatumType>\r
+ <MaxDatumSize>1</MaxDatumSize>
+ <Value>FALSE</Value>\r
+ </PcdData>\r
+ <PcdData ItemType="FEATURE_FLAG">\r
+ <C_Name>PcdStatusCodeUseOEM</C_Name>\r
+ <Token>0x00010024</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>BOOLEAN</DatumType>\r
+ <MaxDatumSize>1</MaxDatumSize>
+ <Value>FALSE</Value>\r
+ </PcdData>\r
+ <PcdData ItemType="PATCHABLE_IN_MODULE">\r
+ <C_Name>PcdStatusCodeMemorySize</C_Name>\r
+ <Token>0x00010025</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>UINT16</DatumType>\r
+ <MaxDatumSize>2</MaxDatumSize>
+ <Value>1</Value>\r
+ </PcdData>\r
+ </PcdBuildDefinition>
+ <ModuleSaBuildOptions>
+ <FvBinding>FV_RECOVERY</FvBinding>
+ <FfsFormatKey>PE32_PEIM</FfsFormatKey>
+ </ModuleSaBuildOptions>
+ </ModuleSA>
<ModuleSA SupArchList="IA32" PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674" ModuleGuid="80CF7257-87AB-47f9-A3FE-D50B76D89541">
<Libraries>
<Instance ModuleGuid="ff5c7a2c-ab7a-4366-8616-11c6e53247b6" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
<FfsFormatKey>BS_DRIVER</FfsFormatKey>
</ModuleSaBuildOptions>
</ModuleSA>
+ <ModuleSA SupArchList="X64 EBC IPF" PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674" ModuleGuid="FEDE0A1B-BCA2-4A9F-BB2B-D9FD7DEC2E9F">
+ <Libraries>
+ <Instance ModuleGuid="331deb15-454b-48d8-9b74-70d01f3f3556" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
+ <Instance ModuleGuid="ff5c7a2c-ab7a-4366-8616-11c6e53247b6" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
+ <Instance ModuleGuid="bda39d3a-451b-4350-8266-81ab10fa0523" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
+ <Instance ModuleGuid="27d67720-ea68-48ae-93da-a3a074c90e30" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
+ <Instance ModuleGuid="3ddc3b12-99ea-4364-b315-6310a2050be5" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
+ <Instance ModuleGuid="fd44e603-002a-4b29-9f5f-529e815b6165" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
+ <Instance ModuleGuid="f12b59c9-76d0-4661-ad7c-f04d1bef0558" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
+ <Instance ModuleGuid="4674739d-3195-4fb2-8094-ac1d22d00194" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
+ <Instance ModuleGuid="a86fbfca-0183-4eeb-aa8a-762e3b7da1f3" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
+ <Instance ModuleGuid="3a004ba5-efe0-4a61-9f1a-267a46ae5ba9" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
+ <Instance ModuleGuid="b5a05743-9b71-489b-a0ed-a0eb3950d23b" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
+ <Instance ModuleGuid="926c9cd0-4bb8-479b-9ac4-8a2a23f85307" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
+ <Instance ModuleGuid="E4541241-8897-411a-91F8-7D7E45837146" PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674"/>
+ <Instance ModuleGuid="54D2878F-25CD-4a2b-8420-EBD18E609C76" PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674"/>
+ <Instance ModuleGuid="b1ee6c28-54aa-4d17-b705-3e28ccb27b2e" PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674"/>
+ </Libraries>
+ <PcdBuildDefinition>
+ <PcdData ItemType="FIXED_AT_BUILD">
+ <C_Name>PcdMaximumUnicodeStringLength</C_Name>
+ <Token>0x00000001</Token>
+ <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <DatumType>UINT32</DatumType>
+ <MaxDatumSize>4</MaxDatumSize>
+ <Value>1000000</Value>
+ </PcdData>
+ <PcdData ItemType="FIXED_AT_BUILD">
+ <C_Name>PcdMaximumAsciiStringLength</C_Name>
+ <Token>0x00000002</Token>
+ <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <DatumType>UINT32</DatumType>
+ <MaxDatumSize>4</MaxDatumSize>
+ <Value>1000000</Value>
+ </PcdData>
+ <PcdData ItemType="FIXED_AT_BUILD">
+ <C_Name>PcdDebugPropertyMask</C_Name>
+ <Token>0x00000005</Token>
+ <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <DatumType>UINT8</DatumType>
+ <MaxDatumSize>1</MaxDatumSize>
+ <Value>0x0f</Value>
+ </PcdData>
+ <PcdData ItemType="FIXED_AT_BUILD">
+ <C_Name>PcdSpinLockTimeout</C_Name>
+ <Token>0x00000004</Token>
+ <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <DatumType>UINT32</DatumType>
+ <MaxDatumSize>4</MaxDatumSize>
+ <Value>10000000</Value>
+ </PcdData>
+ <PcdData ItemType="PATCHABLE_IN_MODULE">
+ <C_Name>PcdDebugPrintErrorLevel</C_Name>
+ <Token>0x00000006</Token>
+ <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <DatumType>UINT32</DatumType>
+ <MaxDatumSize>4</MaxDatumSize>
+ <Value>0x80000000</Value>
+ </PcdData>
+ <PcdData ItemType="FIXED_AT_BUILD">
+ <C_Name>PcdMaximumLinkedListLength</C_Name>
+ <Token>0x00000003</Token>
+ <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <DatumType>UINT32</DatumType>
+ <MaxDatumSize>4</MaxDatumSize>
+ <Value>1000000</Value>
+ </PcdData>
+ <PcdData ItemType="FIXED_AT_BUILD">
+ <C_Name>PcdDebugClearMemoryValue</C_Name>
+ <Token>0x00000008</Token>
+ <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <DatumType>UINT8</DatumType>
+ <MaxDatumSize>1</MaxDatumSize>
+ <Value>0xAF</Value>
+ </PcdData>
+ <PcdData ItemType="FIXED_AT_BUILD">
+ <C_Name>PcdReportStatusCodePropertyMask</C_Name>
+ <Token>0x00000007</Token>
+ <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <DatumType>UINT8</DatumType>
+ <MaxDatumSize>1</MaxDatumSize>
+ <Value>0x07</Value>
+ </PcdData>
+ <PcdData ItemType="FIXED_AT_BUILD">
+ <C_Name>PcdVpdBaseAddress</C_Name>
+ <Token>0x00010010</Token>
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <DatumType>UINT32</DatumType>
+ <MaxDatumSize>4</MaxDatumSize>
+ <Value>0x0</Value>
+ </PcdData>
+ <PcdData ItemType="FEATURE_FLAG">
+ <C_Name>PcdDxePcdDatabaseTraverseEnabled</C_Name>
+ <Token>0x00010021</Token>
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <DatumType>BOOLEAN</DatumType>
+ <MaxDatumSize>1</MaxDatumSize>
+ <Value>TRUE</Value>
+ </PcdData>
+ <PcdData ItemType="FEATURE_FLAG">\r
+ <C_Name>PcdStatusCodeUseEfiSerial</C_Name>\r
+ <Token>0x00010026</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>BOOLEAN</DatumType>
+ <MaxDatumSize>1</MaxDatumSize>
+ <Value>FALSE</Value>
+ </PcdData>\r
+ <PcdData ItemType="FEATURE_FLAG">\r
+ <C_Name>PcdStatusCodeUseHardSerial</C_Name>\r
+ <Token>0x00010027</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>BOOLEAN</DatumType>\r
+ <MaxDatumSize>1</MaxDatumSize>
+ <Value>FALSE</Value>
+ </PcdData>\r
+ <PcdData ItemType="FEATURE_FLAG">\r
+ <C_Name>PcdStatusCodeUseRuntimeMemory</C_Name>\r
+ <Token>0x00010028</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>BOOLEAN</DatumType>\r
+ <MaxDatumSize>1</MaxDatumSize>
+ <Value>FALSE</Value>
+ </PcdData>\r
+ <PcdData ItemType="FEATURE_FLAG">\r
+ <C_Name>PcdStatusCodeUseDataHub</C_Name>\r
+ <Token>0x00010029</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>BOOLEAN</DatumType>\r
+ <MaxDatumSize>1</MaxDatumSize>
+ <Value>FALSE</Value>
+ </PcdData>\r
+ <PcdData ItemType="FEATURE_FLAG">\r
+ <C_Name>PcdStatusCodeUseOEM</C_Name>\r
+ <Token>0x00010024</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>BOOLEAN</DatumType>\r
+ <MaxDatumSize>1</MaxDatumSize>
+ <Value>FALSE</Value>\r
+ </PcdData>\r
+ <PcdData ItemType="FEATURE_FLAG">\r
+ <C_Name>PcdStatusCodeReplayInSerial</C_Name>\r
+ <Token>0x0001002a</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>BOOLEAN</DatumType>\r
+ <MaxDatumSize>1</MaxDatumSize>
+ <Value>FALSE</Value>
+ </PcdData>\r
+ <PcdData ItemType="FEATURE_FLAG">\r
+ <C_Name>PcdStatusCodeReplayInRuntimeMemory</C_Name>\r
+ <Token>0x0001002b</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>BOOLEAN</DatumType>\r
+ <MaxDatumSize>1</MaxDatumSize>
+ <Value>FALSE</Value>
+ </PcdData>\r
+ <PcdData ItemType="FEATURE_FLAG">\r
+ <C_Name>PcdStatusCodeReplayInDataHub</C_Name>\r
+ <Token>0x0001002c</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>BOOLEAN</DatumType>\r
+ <MaxDatumSize>1</MaxDatumSize>
+ <Value>FALSE</Value>
+ </PcdData>\r
+ <PcdData ItemType="FEATURE_FLAG">\r
+ <C_Name>PcdStatusCodeReplayInOEM</C_Name>\r
+ <Token>0x0001002c</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>BOOLEAN</DatumType>\r
+ <MaxDatumSize>1</MaxDatumSize>
+ <Value>FALSE</Value>
+ </PcdData>\r
+ <PcdData ItemType="PATCHABLE_IN_MODULE">\r
+ <C_Name>PcdStatusCodeRuntimeMemorySize</C_Name>\r
+ <Token>0x0001002d</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>UINT16</DatumType>\r
+ <MaxDatumSize>2</MaxDatumSize>
+ <Value>128</Value>
+ </PcdData>\r
+ </PcdBuildDefinition>
+ <ModuleSaBuildOptions>
+ <FvBinding>FV_RECOVERY</FvBinding>
+ <FfsFormatKey>BS_DRIVER</FfsFormatKey>
+ </ModuleSaBuildOptions>
+ </ModuleSA>
+ <ModuleSA SupArchList="IPF" PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674" ModuleGuid="FEDE0A1B-BCA2-4A9F-BB2B-D9FD7DEC2E9F">
+ <Libraries>
+ <Instance ModuleGuid="331deb15-454b-48d8-9b74-70d01f3f3556" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
+ <Instance ModuleGuid="ff5c7a2c-ab7a-4366-8616-11c6e53247b6" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
+ <Instance ModuleGuid="bda39d3a-451b-4350-8266-81ab10fa0523" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
+ <Instance ModuleGuid="27d67720-ea68-48ae-93da-a3a074c90e30" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
+ <Instance ModuleGuid="3ddc3b12-99ea-4364-b315-6310a2050be5" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
+ <Instance ModuleGuid="fd44e603-002a-4b29-9f5f-529e815b6165" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
+ <Instance ModuleGuid="f12b59c9-76d0-4661-ad7c-f04d1bef0558" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
+ <Instance ModuleGuid="4674739d-3195-4fb2-8094-ac1d22d00194" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
+ <Instance ModuleGuid="a86fbfca-0183-4eeb-aa8a-762e3b7da1f3" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
+ <Instance ModuleGuid="3a004ba5-efe0-4a61-9f1a-267a46ae5ba9" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
+ <Instance ModuleGuid="b5a05743-9b71-489b-a0ed-a0eb3950d23b" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
+ <Instance ModuleGuid="926c9cd0-4bb8-479b-9ac4-8a2a23f85307" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
+ <Instance ModuleGuid="E4541241-8897-411a-91F8-7D7E45837146" PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674"/>
+ <Instance ModuleGuid="54D2878F-25CD-4a2b-8420-EBD18E609C76" PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674"/>
+ <Instance ModuleGuid="b1ee6c28-54aa-4d17-b705-3e28ccb27b2e" PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674"/>
+ <Instance ModuleGuid="61999c3c-72a5-4506-a4ff-4271d18a1d14" PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674"/>
+
+ </Libraries>
+ <PcdBuildDefinition>
+ <PcdData ItemType="FIXED_AT_BUILD">
+ <C_Name>PcdMaximumUnicodeStringLength</C_Name>
+ <Token>0x00000001</Token>
+ <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <DatumType>UINT32</DatumType>
+ <MaxDatumSize>4</MaxDatumSize>
+ <Value>1000000</Value>
+ </PcdData>
+ <PcdData ItemType="FIXED_AT_BUILD">
+ <C_Name>PcdMaximumAsciiStringLength</C_Name>
+ <Token>0x00000002</Token>
+ <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <DatumType>UINT32</DatumType>
+ <MaxDatumSize>4</MaxDatumSize>
+ <Value>1000000</Value>
+ </PcdData>
+ <PcdData ItemType="FIXED_AT_BUILD">
+ <C_Name>PcdDebugPropertyMask</C_Name>
+ <Token>0x00000005</Token>
+ <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <DatumType>UINT8</DatumType>
+ <MaxDatumSize>1</MaxDatumSize>
+ <Value>0x0f</Value>
+ </PcdData>
+ <PcdData ItemType="FIXED_AT_BUILD">
+ <C_Name>PcdSpinLockTimeout</C_Name>
+ <Token>0x00000004</Token>
+ <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <DatumType>UINT32</DatumType>
+ <MaxDatumSize>4</MaxDatumSize>
+ <Value>10000000</Value>
+ </PcdData>
+ <PcdData ItemType="PATCHABLE_IN_MODULE">
+ <C_Name>PcdDebugPrintErrorLevel</C_Name>
+ <Token>0x00000006</Token>
+ <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <DatumType>UINT32</DatumType>
+ <MaxDatumSize>4</MaxDatumSize>
+ <Value>0x80000000</Value>
+ </PcdData>
+ <PcdData ItemType="FIXED_AT_BUILD">
+ <C_Name>PcdMaximumLinkedListLength</C_Name>
+ <Token>0x00000003</Token>
+ <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <DatumType>UINT32</DatumType>
+ <MaxDatumSize>4</MaxDatumSize>
+ <Value>1000000</Value>
+ </PcdData>
+ <PcdData ItemType="FIXED_AT_BUILD">
+ <C_Name>PcdDebugClearMemoryValue</C_Name>
+ <Token>0x00000008</Token>
+ <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <DatumType>UINT8</DatumType>
+ <MaxDatumSize>1</MaxDatumSize>
+ <Value>0xAF</Value>
+ </PcdData>
+ <PcdData ItemType="FIXED_AT_BUILD">
+ <C_Name>PcdReportStatusCodePropertyMask</C_Name>
+ <Token>0x00000007</Token>
+ <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <DatumType>UINT8</DatumType>
+ <MaxDatumSize>1</MaxDatumSize>
+ <Value>0x07</Value>
+ </PcdData>
+ <PcdData ItemType="FIXED_AT_BUILD">
+ <C_Name>PcdVpdBaseAddress</C_Name>
+ <Token>0x00010010</Token>
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <DatumType>UINT32</DatumType>
+ <MaxDatumSize>4</MaxDatumSize>
+ <Value>0x0</Value>
+ </PcdData>
+ <PcdData ItemType="FEATURE_FLAG">
+ <C_Name>PcdDxePcdDatabaseTraverseEnabled</C_Name>
+ <Token>0x00010021</Token>
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <DatumType>BOOLEAN</DatumType>
+ <MaxDatumSize>1</MaxDatumSize>
+ <Value>TRUE</Value>
+ </PcdData>
+ <PcdData ItemType="FEATURE_FLAG">\r
+ <C_Name>PcdStatusCodeUseEfiSerial</C_Name>\r
+ <Token>0x00010026</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>BOOLEAN</DatumType>
+ <MaxDatumSize>1</MaxDatumSize>
+ <Value>FALSE</Value>
+ </PcdData>\r
+ <PcdData ItemType="FEATURE_FLAG">\r
+ <C_Name>PcdStatusCodeUseHardSerial</C_Name>\r
+ <Token>0x00010027</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>BOOLEAN</DatumType>\r
+ <MaxDatumSize>1</MaxDatumSize>
+ <Value>FALSE</Value>
+ </PcdData>\r
+ <PcdData ItemType="FEATURE_FLAG">\r
+ <C_Name>PcdStatusCodeUseRuntimeMemory</C_Name>\r
+ <Token>0x00010028</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>BOOLEAN</DatumType>\r
+ <MaxDatumSize>1</MaxDatumSize>
+ <Value>FALSE</Value>
+ </PcdData>\r
+ <PcdData ItemType="FEATURE_FLAG">\r
+ <C_Name>PcdStatusCodeUseDataHub</C_Name>\r
+ <Token>0x00010029</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>BOOLEAN</DatumType>\r
+ <MaxDatumSize>1</MaxDatumSize>
+ <Value>FALSE</Value>
+ </PcdData>\r
+ <PcdData ItemType="FEATURE_FLAG">\r
+ <C_Name>PcdStatusCodeUseOEM</C_Name>\r
+ <Token>0x00010024</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>BOOLEAN</DatumType>\r
+ <MaxDatumSize>1</MaxDatumSize>
+ <Value>FALSE</Value>\r
+ </PcdData>\r
+ <PcdData ItemType="FEATURE_FLAG">\r
+ <C_Name>PcdStatusCodeReplayInSerial</C_Name>\r
+ <Token>0x0001002a</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>BOOLEAN</DatumType>\r
+ <MaxDatumSize>1</MaxDatumSize>
+ <Value>FALSE</Value>
+ </PcdData>\r
+ <PcdData ItemType="FEATURE_FLAG">\r
+ <C_Name>PcdStatusCodeReplayInRuntimeMemory</C_Name>\r
+ <Token>0x0001002b</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>BOOLEAN</DatumType>\r
+ <MaxDatumSize>1</MaxDatumSize>
+ <Value>FALSE</Value>
+ </PcdData>\r
+ <PcdData ItemType="FEATURE_FLAG">\r
+ <C_Name>PcdStatusCodeReplayInDataHub</C_Name>\r
+ <Token>0x0001002c</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>BOOLEAN</DatumType>\r
+ <MaxDatumSize>1</MaxDatumSize>
+ <Value>FALSE</Value>
+ </PcdData>\r
+ <PcdData ItemType="FEATURE_FLAG">\r
+ <C_Name>PcdStatusCodeReplayInOEM</C_Name>\r
+ <Token>0x0001002c</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>BOOLEAN</DatumType>\r
+ <MaxDatumSize>1</MaxDatumSize>
+ <Value>FALSE</Value>
+ </PcdData>\r
+ <PcdData ItemType="PATCHABLE_IN_MODULE">\r
+ <C_Name>PcdStatusCodeRuntimeMemorySize</C_Name>\r
+ <Token>0x0001002d</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>UINT16</DatumType>\r
+ <MaxDatumSize>2</MaxDatumSize>
+ <Value>128</Value>
+ </PcdData>\r
+ </PcdBuildDefinition>
+ <ModuleSaBuildOptions>
+ <FvBinding>FV_RECOVERY</FvBinding>
+ <FfsFormatKey>BS_DRIVER</FfsFormatKey>
+ </ModuleSaBuildOptions>
+ </ModuleSA>
+
+
<ModuleSA SupArchList="X64" PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674" ModuleGuid="80CF7257-87AB-47f9-A3FE-D50B76D89541">
<Libraries>
<Instance ModuleGuid="ff5c7a2c-ab7a-4366-8616-11c6e53247b6" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
<IncludeHeader>Include/Library/CustomDecompressLib.h</IncludeHeader>\r
<HelpText/>\r
</LibraryClass>\r
- <LibraryClass Name="EdkBsDataHubStatusCodeLib">\r
- <IncludeHeader>Include/Library/EdkBsDataHubStatusCodeLib.h</IncludeHeader>\r
- <HelpText/>\r
- </LibraryClass>\r
<LibraryClass Name="EdkDxeSalLib">\r
<IncludeHeader>Include/Library/EdkDxeSalLib.h</IncludeHeader>\r
<HelpText/>\r
<IncludeHeader>Include/Library/EdkIfrSupportLib.h</IncludeHeader>\r
<HelpText/>\r
</LibraryClass>\r
- <LibraryClass Name="EdkMemoryStatusCodeLib">\r
- <IncludeHeader>Include/Library/EdkMemoryStatusCodeLib.h</IncludeHeader>\r
- <HelpText/>\r
- </LibraryClass>\r
<LibraryClass Name="EdkPeCoffLoaderLib">\r
<IncludeHeader>Include/Library/EdkPeCoffLoaderLib.h</IncludeHeader>\r
<HelpText/>\r
<IncludeHeader>Include/Library/EdkPeCoffLoaderX64Lib.h</IncludeHeader>\r
<HelpText/>\r
</LibraryClass>\r
- <LibraryClass Name="EdkRtMemoryStatusCodeLib">\r
- <IncludeHeader>Include/Library/EdkRtMemoryStatusCodeLib.h</IncludeHeader>\r
- <HelpText/>\r
- </LibraryClass>\r
- <LibraryClass Name="EdkRtPlatformStatusCodeLib">\r
- <IncludeHeader>Include/Library/EdkRtPlatformStatusCodeLib.h</IncludeHeader>\r
- <HelpText/>\r
- </LibraryClass>\r
<LibraryClass Name="EdkScsiLib">\r
<IncludeHeader>Include/Library/EdkScsiLib.h</IncludeHeader>\r
<HelpText/>\r
<IncludeHeader>Include/Library/TianoDecompressLib.h</IncludeHeader>\r
<HelpText/>\r
</LibraryClass>\r
+ <LibraryClass Name="SerialPortLib">\r
+ <IncludeHeader>Include/Library/SerialPortLib.h</IncludeHeader>\r
+ <HelpText/>\r
+ </LibraryClass>\r
+ <LibraryClass Name="OemHookStatusCodeLib">\r
+ <IncludeHeader>Include/Library/OemHookStatusCodeLib.h</IncludeHeader>\r
+ <HelpText/>\r
+ </LibraryClass>\r
</LibraryClassDeclarations>\r
<IndustryStdIncludes>\r
<IndustryStdHeader Name="CapsuleName">\r
<IncludeHeader>Include/Library/CustomDecompressLib.h</IncludeHeader>\r
<HelpText/>\r
</IndustryStdHeader>\r
- <IndustryStdHeader Name="EdkBsDataHubStatusCodeLib">\r
- <IncludeHeader>Include/Library/EdkBsDataHubStatusCodeLib.h</IncludeHeader>\r
- <HelpText/>\r
- </IndustryStdHeader>\r
<IndustryStdHeader Name="EdkDxeSalLib">\r
<IncludeHeader>Include/Library/EdkDxeSalLib.h</IncludeHeader>\r
<HelpText/>\r
<IncludeHeader>Include/Library/EdkIfrSupportLib.h</IncludeHeader>\r
<HelpText/>\r
</IndustryStdHeader>\r
- <IndustryStdHeader Name="EdkMemoryStatusCodeLib">\r
- <IncludeHeader>Include/Library/EdkMemoryStatusCodeLib.h</IncludeHeader>\r
- <HelpText/>\r
- </IndustryStdHeader>\r
<IndustryStdHeader Name="EdkPeCoffLoaderLib">\r
<IncludeHeader>Include/Library/EdkPeCoffLoaderLib.h</IncludeHeader>\r
<HelpText/>\r
<IncludeHeader>Include/Library/EdkPeCoffLoaderX64Lib.h</IncludeHeader>\r
<HelpText/>\r
</IndustryStdHeader>\r
- <IndustryStdHeader Name="EdkRtMemoryStatusCodeLib">\r
- <IncludeHeader>Include/Library/EdkRtMemoryStatusCodeLib.h</IncludeHeader>\r
- <HelpText/>\r
- </IndustryStdHeader>\r
- <IndustryStdHeader Name="EdkRtPlatformStatusCodeLib">\r
- <IncludeHeader>Include/Library/EdkRtPlatformStatusCodeLib.h</IncludeHeader>\r
- <HelpText/>\r
- </IndustryStdHeader>\r
<IndustryStdHeader Name="EdkScsiLib">\r
<IncludeHeader>Include/Library/EdkScsiLib.h</IncludeHeader>\r
<HelpText/>\r
<Filename>Library/EdkFvbServiceLib/EdkFvbServiceLib.msa</Filename>\r
<Filename>Library/EdkGraphicsLib/EdkGraphicsLib.msa</Filename>\r
<Filename>Library/EdkIfrSupportLib/EdkIfrSupportLib.msa</Filename>\r
- <Filename>Library/EdkMemoryStatusCodeLib/EdkMemoryStatusCodeLib.msa</Filename>\r
<Filename>Library/EdkNullCustomizedDecompressLib/EdkNullCustomizedDecompressLib.msa</Filename>\r
<Filename>Library/EdkPeCoffLoaderLib/EdkPeCoffLoaderLib.msa</Filename>\r
<Filename>Library/EdkPeCoffLoaderX64Lib/EdkPeCoffLoaderX64Lib.msa</Filename>\r
<Filename>Library/PeiPerformanceLib/PeiPerformanceLib.msa</Filename>\r
- <Filename>Library/EdkRuntimeStatusCodeLib/BsDataHubStatusCode/BsDataHubStatusCode.msa</Filename>\r
- <Filename>Library/EdkRuntimeStatusCodeLib/RtMemoryStatusCode/RtMemoryStatusCode.msa</Filename>\r
- <Filename>Library/EdkRuntimeStatusCodeLib/RtPlatformStatusCode/RtPlatformStatusCode.msa</Filename>\r
<Filename>Library/EdkScsiLib/EdkScsiLib.msa</Filename>\r
<Filename>Library/EdkUefiDebugLibConOut/EdkUefiDebugLibConOut.msa</Filename>\r
<Filename>Library/EdkUefiDebugLibStdErr/EdkUefiDebugLibStdErr.msa</Filename>\r
<Filename>Library/EdkUsbLib/EdkUsbLib.msa</Filename>\r
+ <Filename>Library/EdkSerialPortLibNull/EdkSerialPortLibNull.msa</Filename>\r
+ <Filename>Library/EdkOemHookStatusCodeLibNull/EdkOemHookStatusCodeLibNull.msa</Filename>\r
<Filename>Universal/Console/ConSplitter/Dxe/ConSplitter.msa</Filename>\r
<Filename>Universal/Console/GraphicsConsole/Dxe/GraphicsConsole.msa</Filename>\r
<Filename>Universal/Console/Terminal/Dxe/Terminal.msa</Filename>\r
<Filename>Universal/PCD/Dxe/Pcd.msa</Filename>\r
<Filename>Universal/Runtime/RuntimeDxe/Runtime.msa</Filename>\r
<Filename>Universal/Security/SecurityStub/Dxe/SecurityStub.msa</Filename>\r
- <Filename>Universal/StatusCode/RuntimeDxe/StatusCode.msa</Filename>\r
<Filename>Universal/UserInterface/HiiDataBase/Dxe/HiiDatabase.msa</Filename>\r
<Filename>Universal/UserInterface/DriverSample/DriverSample.msa</Filename>\r
<Filename>Universal/UserInterface/SetupBrowser/Dxe/SetupBrowser.msa</Filename>\r
<Filename>Universal/Variable/RuntimeDxe/Variable.msa</Filename>\r
<Filename>Universal/Capsule/RuntimeDxe/CapsuleRuntime.msa</Filename>\r
<Filename>Universal/WatchdogTimer/Dxe/WatchDogTimer.msa</Filename>\r
+ <Filename>Universal/StatusCode/Pei/PeiStatusCode.msa</Filename>\r
+ <Filename>Universal/StatusCode/Dxe/DxeStatusCode.msa</Filename>\r
</MsaFiles>\r
<PackageHeaders>\r
<IncludePkgHeader ModuleType="SEC">Include/EdkPeim.h</IncludePkgHeader>\r
<GuidValue>EC4DF5AF-4395-4CC9-94DE-77506D12C7B8</GuidValue>\r
<HelpText/>\r
</Entry>\r
+ <Entry Name="MemoryStatusCodeRecord">\r
+ <C_Name>gMemoryStatusCodeRecordGuid</C_Name>\r
+ <GuidValue>060CC026-4C0D-4DDA-8F41-595FEF00A502</GuidValue>\r
+ <HelpText/>\r
+ </Entry>\r
</GuidDeclarations>\r
<ProtocolDeclarations>\r
<Entry Name="Capsule">\r
<HelpText>This feature flag can be used to enable or disable the Pcd DXE database \r
traverse capability. Disable it can reduce the size of final image generated.</HelpText>\r
</PcdEntry>\r
+ <PcdEntry>\r
+ <C_Name>PcdStatusCodeUseSerial</C_Name>\r
+ <Token>0x00010022</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>BOOLEAN</DatumType>\r
+ <ValidUsage>FEATURE_FLAG</ValidUsage>\r
+ <DefaultValue>FALSE</DefaultValue>\r
+ <HelpText>This feature flag can be used to enable or disable report staus code to serial I/O. Disable it can reduce the size of final image generated.</HelpText>\r
+ </PcdEntry>\r
+ <PcdEntry>\r
+ <C_Name>PcdStatusCodeUseMemory</C_Name>\r
+ <Token>0x00010023</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>BOOLEAN</DatumType>\r
+ <ValidUsage>FEATURE_FLAG</ValidUsage>\r
+ <DefaultValue>FALSE</DefaultValue>\r
+ <HelpText>This feature flag can be used to enable or disable save statuc code in GUID'ed HOB. Disable it can reduce the size of final image generated.</HelpText>\r
+ </PcdEntry>\r
+ <PcdEntry>\r
+ <C_Name>PcdStatusCodeUseOEM</C_Name>\r
+ <Token>0x00010024</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>BOOLEAN</DatumType>\r
+ <ValidUsage>FEATURE_FLAG</ValidUsage>\r
+ <DefaultValue>FALSE</DefaultValue>\r
+ <HelpText>This feature flag can be used to enable or disable send status code to OEM device. Disable it can reduce the size of final image generated.</HelpText>\r
+ </PcdEntry>\r
+ <PcdEntry>\r
+ <C_Name>PcdStatusCodeMemorySize</C_Name>\r
+ <Token>0x00010025</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>UINT16</DatumType>\r
+ <ValidUsage>DYNAMIC</ValidUsage>\r
+ <DefaultValue>4</DefaultValue>\r
+ <HelpText>kbytes size of GUID'ed HOB, if the GUID'ed HOB is full, create new GUID'ed HOB with this size.</HelpText>\r
+ </PcdEntry>\r
+ <PcdEntry>\r
+ <C_Name>PcdStatusCodeUseEfiSerial</C_Name>\r
+ <Token>0x00010026</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>BOOLEAN</DatumType>\r
+ <ValidUsage>FEATURE_FLAG</ValidUsage>\r
+ <DefaultValue>FALSE</DefaultValue>\r
+ <HelpText>Use to switch on/off report status code through serial DXE.</HelpText>\r
+ </PcdEntry>\r
+ <PcdEntry>\r
+ <C_Name>PcdStatusCodeUseHardSerial</C_Name>\r
+ <Token>0x00010027</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>BOOLEAN</DatumType>\r
+ <ValidUsage>FEATURE_FLAG</ValidUsage>\r
+ <DefaultValue>FALSE</DefaultValue>\r
+ <HelpText>Use to switch on/off report status code to serial device.</HelpText>\r
+ </PcdEntry>\r
+ <PcdEntry>\r
+ <C_Name>PcdStatusCodeUseRuntimeMemory</C_Name>\r
+ <Token>0x00010028</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>BOOLEAN</DatumType>\r
+ <ValidUsage>FEATURE_FLAG</ValidUsage>\r
+ <DefaultValue>FALSE</DefaultValue>\r
+ <HelpText>Use to switch on/off save status code in runtime memory.</HelpText>\r
+ </PcdEntry>\r
+ <PcdEntry>\r
+ <C_Name>PcdStatusCodeUseDataHub</C_Name>\r
+ <Token>0x00010029</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>BOOLEAN</DatumType>\r
+ <ValidUsage>FEATURE_FLAG</ValidUsage>\r
+ <DefaultValue>FALSE</DefaultValue>\r
+ <HelpText>Use to switch on/off log status code in data hub.</HelpText>\r
+ </PcdEntry>\r
+ <PcdEntry>\r
+ <C_Name>PcdStatusCodeReplayInSerial</C_Name>\r
+ <Token>0x0001002a</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>BOOLEAN</DatumType>\r
+ <ValidUsage>FEATURE_FLAG</ValidUsage>\r
+ <DefaultValue>FALSE</DefaultValue>\r
+ <HelpText>Use to enable/dsable replay status code which saved in GUID'ed HOB in PEI phase to EFI serial.</HelpText>\r
+ </PcdEntry>\r
+ <PcdEntry>\r
+ <C_Name>PcdStatusCodeReplayInRuntimeMemory</C_Name>\r
+ <Token>0x0001002b</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>BOOLEAN</DatumType>\r
+ <ValidUsage>FEATURE_FLAG</ValidUsage>\r
+ <DefaultValue>FALSE</DefaultValue>\r
+ <HelpText>Use to enable/dsable replay status code which saved in GUID'ed HOB in PEI phase to EFI serial.</HelpText>\r
+ </PcdEntry>\r
+ <PcdEntry>\r
+ <C_Name>PcdStatusCodeReplayInDataHub</C_Name>\r
+ <Token>0x0001002c</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>BOOLEAN</DatumType>\r
+ <ValidUsage>FEATURE_FLAG</ValidUsage>\r
+ <DefaultValue>FALSE</DefaultValue>\r
+ <HelpText>Use to enable/dsable replay status code which saved in GUID'ed HOB in PEI phase to EFI serial.</HelpText>\r
+ </PcdEntry>\r
+ <PcdEntry>\r
+ <C_Name>PcdStatusCodeReplayInOEM</C_Name>\r
+ <Token>0x0001002c</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>BOOLEAN</DatumType>\r
+ <ValidUsage>FEATURE_FLAG</ValidUsage>\r
+ <DefaultValue>FALSE</DefaultValue>\r
+ <HelpText>Use to enable/dsable replay status code which saved in GUID'ed HOB in PEI phase to EFI serial.</HelpText>\r
+ </PcdEntry>\r
+ <PcdEntry>\r
+ <C_Name>PcdStatusCodeRuntimeMemorySize</C_Name>\r
+ <Token>0x0001002d</Token>\r
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <DatumType>UINT16</DatumType>\r
+ <ValidUsage>DYNAMIC</ValidUsage>\r
+ <DefaultValue>4</DefaultValue>\r
+ <HelpText>kbytes size of runtime memory.</HelpText>\r
+ </PcdEntry>\r
</PcdDeclarations>\r
</PackageSurfaceArea>\r
#include <Guid/PeiPeCoffLoader.h>\r
#include <Guid/CapsuleVendor.h>\r
#include <Guid/CompatibleMemoryTested.h>\r
+#include <Guid/MemoryStatusCodeRecord.h>\r
\r
#include <Ppi/StatusCodeMemory.h>\r
\r
#include <Guid/MemoryTypeInformation.h>\r
#include <Guid/CapsuleVendor.h>\r
#include <Guid/BootState.h>\r
+#include <Guid/MemoryStatusCodeRecord.h>\r
\r
#include <Ppi/PeiInMemory.h>\r
#include <Ppi/FlashMap.h>\r
--- /dev/null
+/*++\r
+\r
+Copyright (c) 2006, Intel Corporation \r
+All rights reserved. This program and the accompanying materials \r
+are licensed and made available under the terms and conditions of the BSD License \r
+which accompanies this distribution. The full text of the license may be found at \r
+http://opensource.org/licenses/bsd-license.php \r
+ \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+\r
+Module Name:\r
+\r
+ MemoryStatusCodeRecord.h\r
+ \r
+Abstract:\r
+\r
+ GUID used to identify status code records HOB that originate from the PEI status code \r
+\r
+--*/\r
+\r
+#ifndef _MEMORY_STATUS_CODE_RECORD_H__\r
+#define _MEMORY_STATUS_CODE_RECORD_H__\r
+\r
+#define MEMORY_STATUS_CODE_RECORD_GUID \\r
+ { \\r
+ 0x60cc026, 0x4c0d, 0x4dda, {0x8f, 0x41, 0x59, 0x5f, 0xef, 0x0, 0xa5, 0x2} \\r
+ }\r
+\r
+/**\r
+ Memory status code records packet structure :\r
+ +---------------+----------+----------+-----+----------+-----+----------+\r
+ | Packet Header | Record 1 | Record 2 | ... + Record n | ... | Record m |\r
+ +---------------+----------+----------+-----+----------+-----+----------+\r
+ ^ ^ ^\r
+ +--------- RecordIndex -----------+ |\r
+ +---------------- MaxRecordsNumber----------------------+\r
+**/\r
+typedef struct {\r
+ UINT16 PacketIndex; // Index of the Packet.\r
+ UINT16 RecordIndex; // Index of record in the packet.\r
+ UINT32 MaxRecordsNumber; // Max number of records in the packet.\r
+} MEMORY_STATUSCODE_PACKET_HEADER;\r
+\r
+typedef struct {\r
+ EFI_STATUS_CODE_TYPE CodeType;\r
+ EFI_STATUS_CODE_VALUE Value;\r
+ UINT32 Instance;\r
+} MEMORY_STATUSCODE_RECORD;\r
+\r
+\r
+extern EFI_GUID gMemoryStatusCodeRecordGuid;\r
+\r
+#endif\r
//#include <Ipf/SalApi.h>\r
\r
EFI_STATUS\r
+EFIAPI\r
RegisterEsalFunction (\r
IN UINT64 FunctionId,\r
IN EFI_GUID *ClassGuid,\r
;\r
\r
EFI_STATUS\r
+EFIAPI\r
RegisterEsalClass (\r
IN EFI_GUID *ClassGuid,\r
IN VOID *ModuleGlobal,\r
;\r
\r
SAL_RETURN_REGS\r
+EFIAPI\r
EfiCallEsalService (\r
IN EFI_GUID *ClassGuid,\r
IN UINT64 FunctionId,\r
;\r
\r
SAL_RETURN_REGS\r
+EFIAPI\r
SetEsalVirtualEntryPoint (\r
IN UINT64 EntryPoint,\r
IN UINT64 Gp\r
;\r
\r
SAL_RETURN_REGS\r
+EFIAPI\r
SetEsalPhysicalEntryPoint (\r
IN UINT64 EntryPoint,\r
IN UINT64 Gp\r
;\r
\r
SAL_RETURN_REGS\r
+EFIAPI\r
GetEsalEntryPoint (\r
VOID\r
)\r
;\r
\r
VOID\r
+EFIAPI\r
SalFlushCache (\r
IN EFI_PHYSICAL_ADDRESS Start,\r
IN UINT64 Length\r
--- /dev/null
+\r
+/** @file\r
+ OEM hook status code library functions with no library constructor/destructor\r
+\r
+ Copyright (c) 2006, Intel Corporation\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+ Module Name: OemHookStatusCodeLib.h\r
+\r
+**/\r
+\r
+#ifndef __OEM_HOOK_STATUSCODE_LIB__\r
+#define __OEM_HOOK_STATUSCODE_LIB__\r
+\r
+/**\r
+\r
+ Initialize OEM status code device .\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+OemHookStatusCodeInitialize (\r
+ VOID\r
+ );\r
+\r
+/**\r
+ Report status code to OEM device.\r
+ \r
+ @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions¡± below.\r
+ \r
+ @param Value Describes the current status of a hardware or software entity. \r
+ This included information about the class and subclass that is used to classify the entity \r
+ as well as an operation. For progress codes, the operation is the current activity. \r
+ For error codes, it is the exception. For debug codes, it is not defined at this time. \r
+ Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below. \r
+ Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r
+ \r
+ @param Instance The enumeration of a hardware or software entity within the system. \r
+ A system may contain multiple entities that match a class/subclass pairing. \r
+ The instance differentiates between them. An instance of 0 indicates that instance information is unavailable, \r
+ not meaningful, or not relevant. Valid instance numbers start with 1.\r
+\r
+\r
+ @param CallerId This optional parameter may be used to identify the caller. \r
+ This parameter allows the status code driver to apply different rules to different callers. \r
+ Type EFI_GUID is defined in InstallProtocolInterface() in the EFI 1.10 Specification.\r
+\r
+\r
+ @param Data This optional parameter may be used to pass additional data\r
+ \r
+ @return The function always return EFI_SUCCESS.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+OemHookStatusCodeReport (\r
+ IN EFI_STATUS_CODE_TYPE CodeType,\r
+ IN EFI_STATUS_CODE_VALUE Value,\r
+ IN UINT32 Instance,\r
+ IN EFI_GUID *CallerId, OPTIONAL\r
+ IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r
+ );\r
+\r
+#endif\r
--- /dev/null
+\r
+/** @file\r
+ Serial I/O Port library functions with no library constructor/destructor\r
+\r
+ Copyright (c) 2006, Intel Corporation\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+ Module Name: SerialPortLib.h\r
+\r
+**/\r
+\r
+#ifndef __SERIAL_PORT_LIB__\r
+#define __SERIAL_PORT_LIB__\r
+\r
+/**\r
+\r
+ Programmed hardware of Serial port.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+SerialPortInitialize (\r
+ VOID\r
+ );\r
+\r
+/**\r
+ Write data to serial device. \r
+ \r
+ If the buffer is NULL, then ASSERT(); \r
+ if NumberOfBytes is zero, then ASSERT(). \r
+\r
+ @param Buffer Point of data buffer which need to be writed.\r
+ @param NumberOfBytes Number of output bytes which are cached in Buffer.\r
+\r
+ @retval 0 Write data failed.\r
+ @retval !0 Actual number of bytes writed to serial device.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+SerialPortWrite (\r
+ IN UINT8 *Buffer,\r
+ IN UINTN NumberOfBytes\r
+);\r
+\r
+\r
+/**\r
+ Read data from serial device and save the datas in buffer.\r
+ \r
+ If the buffer is NULL, then ASSERT(); \r
+ if NumberOfBytes is zero, then ASSERT(). \r
+\r
+ @param Buffer Point of data buffer which need to be writed.\r
+ @param NumberOfBytes Number of output bytes which are cached in Buffer.\r
+\r
+ @retval 0 Read data failed.\r
+ @retval !0 Aactual number of bytes read from serial device.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+SerialPortRead (\r
+ OUT UINT8 *Buffer,\r
+ IN UINTN NumberOfBytes\r
+);\r
+\r
+\r
+#endif\r
}\r
\r
EFI_STATUS\r
+EFIAPI\r
RegisterEsalFunction (\r
IN UINT64 FunctionId,\r
IN EFI_GUID *ClassGuid,\r
}\r
\r
EFI_STATUS\r
+EFIAPI\r
RegisterEsalClass (\r
IN EFI_GUID *ClassGuid,\r
IN VOID *ModuleGlobal,\r
}\r
\r
SAL_RETURN_REGS\r
+EFIAPI\r
EfiCallEsalService (\r
IN EFI_GUID *ClassGuid,\r
IN UINT64 FunctionId,\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+Copyright (c) 2006, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+-->\r
+<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0">\r
+ <MsaHeader>\r
+ <ModuleName>EdkOemHookStatusCodeLibNull</ModuleName>\r
+ <ModuleType>PEIM</ModuleType>\r
+ <GuidValue>54D2878F-25CD-4a2b-8420-EBD18E609C76</GuidValue>\r
+ <Version>1.0</Version>\r
+ <Abstract>Memory Status Code Library for UEFI drivers</Abstract>\r
+ <Description>Lib to provide memory journal status code reporting Routines</Description>\r
+ <Copyright>Copyright (c) 2006, Intel Corporation.</Copyright>\r
+ <License>All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>\r
+ <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>\r
+ </MsaHeader>\r
+ <ModuleDefinitions>\r
+ <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>\r
+ <BinaryModule>false</BinaryModule>\r
+ <OutputFileBasename>EdkOemHookStatusCodeLibNull</OutputFileBasename>\r
+ </ModuleDefinitions>\r
+ <LibraryClassDefinitions>\r
+ <LibraryClass Usage="ALWAYS_PRODUCED">\r
+ <Keyword>OemHookStatusCodeLib</Keyword>\r
+ </LibraryClass>\r
+ </LibraryClassDefinitions>\r
+ <SourceFiles>\r
+ <Filename>OemHookStatusCodeLibNull.c</Filename>\r
+ </SourceFiles>\r
+ <PackageDependencies>\r
+ <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
+ <Package PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674"/>\r
+ </PackageDependencies>\r
+ <PPIs>\r
+ </PPIs>\r
+ <Externs>\r
+ <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
+ <Specification>EDK_RELEASE_VERSION 0x00020000</Specification>\r
+ </Externs>\r
+</ModuleSurfaceArea>
\ No newline at end of file
--- /dev/null
+/** @file\r
+ OEM hook status code library functions with no library constructor/destructor\r
+\r
+ Copyright (c) 2006, Intel Corporation\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+ Module Name: OemHookStatusCodeLibNull.c\r
+\r
+**/\r
+\r
+/**\r
+\r
+ Initialize OEM status code device .\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+OemHookStatusCodeInitialize (\r
+ VOID\r
+ )\r
+{\r
+ return;\r
+}\r
+\r
+/**\r
+ Report status code to OEM device.\r
+ \r
+ @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions¡± below.\r
+ \r
+ @param Value Describes the current status of a hardware or software entity. \r
+ This included information about the class and subclass that is used to classify the entity \r
+ as well as an operation. For progress codes, the operation is the current activity. \r
+ For error codes, it is the exception. For debug codes, it is not defined at this time. \r
+ Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below. \r
+ Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r
+ \r
+ @param Instance The enumeration of a hardware or software entity within the system. \r
+ A system may contain multiple entities that match a class/subclass pairing. \r
+ The instance differentiates between them. An instance of 0 indicates that instance information is unavailable, \r
+ not meaningful, or not relevant. Valid instance numbers start with 1.\r
+\r
+\r
+ @param CallerId This optional parameter may be used to identify the caller. \r
+ This parameter allows the status code driver to apply different rules to different callers. \r
+ Type EFI_GUID is defined in InstallProtocolInterface() in the EFI 1.10 Specification.\r
+\r
+\r
+ @param Data This optional parameter may be used to pass additional data\r
+ \r
+ @return The function always return EFI_SUCCESS.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+OemHookStatusCodeReport (\r
+ IN EFI_STATUS_CODE_TYPE CodeType,\r
+ IN EFI_STATUS_CODE_VALUE Value,\r
+ IN UINT32 Instance,\r
+ IN EFI_GUID *CallerId, OPTIONAL\r
+ IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r
+ )\r
+{\r
+ return EFI_UNSUPPORTED;\r
+}\r
+\r
+++ /dev/null
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation \r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-\r
-Module Name:\r
-\r
- BsDataHubStatusCode.c\r
-\r
-Abstract:\r
-\r
- This implements a status code listener that logs status codes into the data\r
- hub. This is only active during non-runtime DXE.\r
-\r
---*/\r
-#include "BsDataHubStatusCode.h"\r
-\r
-//\r
-// Globals only work at BootService Time. NOT at Runtime!\r
-//\r
-static EFI_DATA_HUB_PROTOCOL *mDataHub;\r
-static LIST_ENTRY mRecordBuffer;\r
-static INTN mRecordNum;\r
-static EFI_EVENT mLogDataHubEvent;\r
-static EFI_LOCK mStatusCodeReportLock;\r
-static BOOLEAN mEventHandlerActive = FALSE;\r
-\r
-STATUS_CODE_RECORD_LIST *\r
-GetRecordBuffer (\r
- VOID\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Returned buffer of length BYTES_PER_RECORD\r
-\r
-Arguments:\r
-\r
- None\r
-\r
-Returns:\r
-\r
- Entry in mRecordBuffer or NULL if non available\r
-\r
---*/\r
-{\r
- STATUS_CODE_RECORD_LIST *Buffer;\r
-\r
- gBS->AllocatePool (EfiBootServicesData, sizeof (STATUS_CODE_RECORD_LIST), (VOID **) &Buffer);\r
- if (Buffer == NULL) {\r
- return NULL;\r
- }\r
-\r
- ZeroMem (Buffer, sizeof (STATUS_CODE_RECORD_LIST));\r
- Buffer->Signature = BS_DATA_HUB_STATUS_CODE_SIGNATURE;\r
-\r
- return Buffer;\r
-}\r
-\r
-DATA_HUB_STATUS_CODE_DATA_RECORD *\r
-AquireEmptyRecordBuffer (\r
- VOID\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Allocate a mRecordBuffer entry in the form of a pointer.\r
-\r
-Arguments:\r
-\r
- None\r
-\r
-Returns:\r
-\r
- Pointer to new buffer. NULL if none exist.\r
-\r
---*/\r
-{\r
- STATUS_CODE_RECORD_LIST *DataBuffer;\r
-\r
- if (mRecordNum < MAX_RECORD_NUM) {\r
- DataBuffer = GetRecordBuffer ();\r
- if (DataBuffer != NULL) {\r
- EfiAcquireLock (&mStatusCodeReportLock);\r
- InsertTailList (&mRecordBuffer, &DataBuffer->Link);\r
- mRecordNum++;\r
- EfiReleaseLock (&mStatusCodeReportLock);\r
- return (DATA_HUB_STATUS_CODE_DATA_RECORD *) DataBuffer->RecordBuffer;\r
- }\r
- }\r
-\r
- return NULL;\r
-}\r
-\r
-EFI_STATUS\r
-ReleaseRecordBuffer (\r
- IN STATUS_CODE_RECORD_LIST *RecordBuffer\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Release a mRecordBuffer entry allocated by AquireEmptyRecordBuffer ().\r
-\r
-Arguments:\r
-\r
- RecordBuffer - Data to free\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - If DataRecord is valid\r
- EFI_UNSUPPORTED - The record list has empty\r
-\r
---*/\r
-{\r
- ASSERT (RecordBuffer != NULL);\r
- if (mRecordNum <= 0) {\r
- return EFI_UNSUPPORTED;\r
- }\r
-\r
- EfiAcquireLock (&mStatusCodeReportLock);\r
- RemoveEntryList (&RecordBuffer->Link);\r
- mRecordNum--;\r
- EfiReleaseLock (&mStatusCodeReportLock);\r
- gBS->FreePool (RecordBuffer);\r
- return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-BsDataHubReportStatusCode (\r
- IN EFI_STATUS_CODE_TYPE CodeType,\r
- IN EFI_STATUS_CODE_VALUE Value,\r
- IN UINT32 Instance,\r
- IN EFI_GUID * CallerId,\r
- IN EFI_STATUS_CODE_DATA * Data OPTIONAL\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Boot service report status code listener. This function logs the status code\r
- into the data hub.\r
-\r
-Arguments:\r
-\r
- Same as ReportStatusCode (See Tiano Runtime Specification)\r
-\r
-Returns:\r
-\r
- None\r
-\r
---*/\r
-{\r
- DATA_HUB_STATUS_CODE_DATA_RECORD *DataHub;\r
- UINT32 ErrorLevel;\r
- VA_LIST Marker;\r
- CHAR8 *Format;\r
- UINTN Index;\r
- CHAR16 FormatBuffer[BYTES_PER_RECORD];\r
-\r
- if (EfiAtRuntime ()) {\r
- //\r
- // For now all we do is post code at runtime\r
- //\r
- return EFI_SUCCESS;\r
- }\r
- //\r
- // If we had an error while in our event handler, then do nothing so\r
- // that we don't get in an endless loop.\r
- //\r
- if (mEventHandlerActive) {\r
- return EFI_SUCCESS;\r
- }\r
-\r
- DataHub = (DATA_HUB_STATUS_CODE_DATA_RECORD *) AquireEmptyRecordBuffer ();\r
- if (DataHub == NULL) {\r
- //\r
- // There are no empty record buffer in private buffers\r
- //\r
- return EFI_OUT_OF_RESOURCES;\r
- }\r
- //\r
- // Construct Data Hub Extended Data\r
- //\r
- DataHub->CodeType = CodeType;\r
- DataHub->Value = Value;\r
- DataHub->Instance = Instance;\r
-\r
- if (CallerId != NULL) {\r
- CopyMem (&DataHub->CallerId, CallerId, sizeof (EFI_GUID));\r
- } else {\r
- ZeroMem (&DataHub->CallerId, sizeof (EFI_GUID));\r
- }\r
-\r
- if (Data == NULL) {\r
- ZeroMem (&DataHub->Data, sizeof (EFI_STATUS_CODE_DATA));\r
- } else {\r
- //\r
- // Copy generic Header\r
- //\r
- CopyMem (&DataHub->Data, Data, sizeof (EFI_STATUS_CODE_DATA));\r
-\r
- if (ReportStatusCodeExtractDebugInfo (Data, &ErrorLevel, &Marker, &Format)) {\r
- //\r
- // Convert Ascii Format string to Unicode.\r
- //\r
- for (Index = 0; Format[Index] != '\0' && Index < (BYTES_PER_RECORD - 1); Index += 1) {\r
- FormatBuffer[Index] = (CHAR16) Format[Index];\r
- }\r
-\r
- FormatBuffer[Index] = L'\0';\r
-\r
- //\r
- // Put processed string into the buffer\r
- //\r
- Index = UnicodeVSPrint (\r
- (CHAR16 *) (DataHub + 1),\r
- BYTES_PER_RECORD - (sizeof (DATA_HUB_STATUS_CODE_DATA_RECORD)),\r
- FormatBuffer,\r
- Marker\r
- );\r
-\r
- //\r
- // DATA_HUB_STATUS_CODE_DATA_RECORD followed by VSPrint String Buffer\r
- //\r
- DataHub->Data.Size = (UINT16) (Index * sizeof (CHAR16));\r
-\r
- } else {\r
- //\r
- // Default behavior is to copy optional data\r
- //\r
- if (Data->Size > (BYTES_PER_RECORD - sizeof (DATA_HUB_STATUS_CODE_DATA_RECORD))) {\r
- DataHub->Data.Size = (UINT16) (BYTES_PER_RECORD - sizeof (DATA_HUB_STATUS_CODE_DATA_RECORD));\r
- }\r
-\r
- CopyMem (DataHub + 1, Data + 1, DataHub->Data.Size);\r
- }\r
- }\r
-\r
- gBS->SignalEvent (mLogDataHubEvent);\r
-\r
- return EFI_SUCCESS;\r
-}\r
-\r
-VOID\r
-EFIAPI\r
-LogDataHubEventHandler (\r
- IN EFI_EVENT Event,\r
- IN VOID *Context\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- The Event handler which will be notified to log data in Data Hub.\r
-\r
-Arguments:\r
-\r
- Event - Instance of the EFI_EVENT to signal whenever data is\r
- available to be logged in the system.\r
- Context - Context of the event.\r
-\r
-Returns:\r
-\r
- None.\r
-\r
---*/\r
-{\r
- EFI_STATUS Status;\r
- DATA_HUB_STATUS_CODE_DATA_RECORD *DataRecord;\r
- UINTN Size;\r
- UINT64 DataRecordClass;\r
- LIST_ENTRY *Link;\r
- STATUS_CODE_RECORD_LIST *BufferEntry;\r
-\r
- //\r
- // Set our global flag so we don't recurse if we get an error here.\r
- //\r
- mEventHandlerActive = TRUE;\r
-\r
- //\r
- // Log DataRecord in Data Hub.\r
- // If there are multiple DataRecords, Log all of them.\r
- //\r
- for (Link = mRecordBuffer.ForwardLink; Link != &mRecordBuffer;) {\r
- BufferEntry = CR (Link, STATUS_CODE_RECORD_LIST, Link, BS_DATA_HUB_STATUS_CODE_SIGNATURE);\r
- DataRecord = (DATA_HUB_STATUS_CODE_DATA_RECORD *) (BufferEntry->RecordBuffer);\r
- Link = Link->ForwardLink;\r
-\r
- //\r
- // Add in the size of the header we added.\r
- //\r
- Size = sizeof (DATA_HUB_STATUS_CODE_DATA_RECORD) + DataRecord->Data.Size;\r
-\r
- if ((DataRecord->CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) {\r
- DataRecordClass = EFI_DATA_RECORD_CLASS_PROGRESS_CODE;\r
- } else if ((DataRecord->CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) {\r
- DataRecordClass = EFI_DATA_RECORD_CLASS_ERROR;\r
- } else if ((DataRecord->CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) {\r
- DataRecordClass = EFI_DATA_RECORD_CLASS_DEBUG;\r
- } else {\r
- //\r
- // Should never get here.\r
- //\r
- DataRecordClass = EFI_DATA_RECORD_CLASS_DEBUG |\r
- EFI_DATA_RECORD_CLASS_ERROR |\r
- EFI_DATA_RECORD_CLASS_DATA |\r
- EFI_DATA_RECORD_CLASS_PROGRESS_CODE;\r
- }\r
-\r
- if (((DataRecord->Instance & EFI_D_ERROR) != 0) &&\r
- (((DataRecord->Instance & EFI_D_POOL) != 0) || ((DataRecord->Instance & EFI_D_PAGE) != 0))\r
- ) {\r
- //\r
- // If memory error, do not call LogData ().\r
- //\r
- DebugPrint ((UINTN)-1, "Memory Error\n");\r
- Status = EFI_OUT_OF_RESOURCES;\r
- } else {\r
- //\r
- // Log DataRecord in Data Hub\r
- //\r
- Status = mDataHub->LogData (\r
- mDataHub,\r
- &gEfiStatusCodeGuid,\r
- &gEfiStatusCodeRuntimeProtocolGuid,\r
- DataRecordClass,\r
- DataRecord,\r
- (UINT32) Size\r
- );\r
- }\r
-\r
- ReleaseRecordBuffer (BufferEntry);\r
- }\r
-\r
- mEventHandlerActive = FALSE;\r
-\r
- return ;\r
-}\r
-\r
-VOID\r
-BsDataHubStatusCodeInitialize (\r
- VOID\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Install a data hub listener.\r
-\r
-Arguments:\r
-\r
- (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - Logging Hub protocol installed\r
- Other - No protocol installed, unload driver.\r
-\r
---*/\r
-{\r
- EFI_STATUS Status;\r
-\r
- Status = gBS->LocateProtocol (&gEfiDataHubProtocolGuid, NULL, (VOID **) &mDataHub);\r
- //\r
- // Should never fail due to dependency grammer\r
- //\r
- ASSERT_EFI_ERROR (Status);\r
-\r
- //\r
- // Initialize FIFO\r
- //\r
- InitializeListHead (&mRecordBuffer);\r
- mRecordNum = 0;\r
-\r
- EfiInitializeLock (&mStatusCodeReportLock, EFI_TPL_HIGH_LEVEL);\r
-\r
- //\r
- // Create a Notify Event to log data in Data Hub\r
- //\r
- Status = gBS->CreateEvent (\r
- EFI_EVENT_NOTIFY_SIGNAL,\r
- EFI_TPL_CALLBACK,\r
- LogDataHubEventHandler,\r
- NULL,\r
- &mLogDataHubEvent\r
- );\r
-\r
-}\r
+++ /dev/null
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation \r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-\r
-Module Name:\r
-\r
- BsDataHubStatusCode.h\r
-\r
-Abstract:\r
-\r
- Header for the status code data hub logging component\r
-\r
---*/\r
-\r
-#ifndef _EFI_BS_DATA_HUB_STATUS_CODE_H_\r
-#define _EFI_BS_DATA_HUB_STATUS_CODE_H_\r
-\r
-//\r
-// Private data declarations\r
-//\r
-#define MAX_RECORD_NUM 1000\r
-#define BYTES_PER_RECORD EFI_STATUS_CODE_DATA_MAX_SIZE\r
-#define EMPTY_RECORD_TAG 0xFF\r
-\r
-#define BS_DATA_HUB_STATUS_CODE_SIGNATURE EFI_SIGNATURE_32 ('B', 'D', 'H', 'S')\r
-\r
-typedef struct {\r
- UINTN Signature;\r
- LIST_ENTRY Link;\r
- UINT8 RecordBuffer[BYTES_PER_RECORD];\r
-} STATUS_CODE_RECORD_LIST;\r
-\r
-//\r
-// Function prototypes\r
-//\r
-STATUS_CODE_RECORD_LIST *\r
-GetRecordBuffer (\r
- VOID\r
- )\r
-;\r
-\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Returned buffer of length BYTES_PER_RECORD\r
-\r
-Arguments:\r
-\r
- None\r
-\r
-Returns:\r
-\r
- Entry in mRecordBuffer or NULL if non available\r
-\r
---*/\r
-DATA_HUB_STATUS_CODE_DATA_RECORD *\r
-AquireEmptyRecordBuffer (\r
- VOID\r
- )\r
-;\r
-\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Allocate a mRecordBuffer entry in the form of a pointer.\r
-\r
-Arguments:\r
-\r
- None\r
-\r
-Returns:\r
-\r
- Pointer to new buffer. NULL if none exist.\r
-\r
---*/\r
-EFI_STATUS\r
-ReleaseRecordBuffer (\r
- IN STATUS_CODE_RECORD_LIST *RecordBuffer\r
- )\r
-;\r
-\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Release a mRecordBuffer entry allocated by AquireEmptyRecordBuffer ().\r
-\r
-Arguments:\r
-\r
- RecordBuffer - Data to free\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - If RecordBuffer is valid\r
- EFI_UNSUPPORTED - The record list has empty\r
-\r
---*/\r
-VOID\r
-EFIAPI\r
-LogDataHubEventHandler (\r
- IN EFI_EVENT Event,\r
- IN VOID *Context\r
- )\r
-;\r
-\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Event Handler that log in Status code in Data Hub.\r
-\r
-Arguments:\r
-\r
- (Standard EFI Event Handler - EFI_EVENT_NOTIFY)\r
-\r
-Returns:\r
-\r
- NONE\r
-\r
---*/\r
-#endif\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-Copyright (c) 2006, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution. The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
--->\r
-<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0">\r
- <MsaHeader>\r
- <ModuleName>EdkBsDataHubStatusCodeLib</ModuleName>\r
- <ModuleType>DXE_DRIVER</ModuleType>\r
- <GuidValue>041bf780-dc3e-49ab-8d67-4b86075440ea</GuidValue>\r
- <Version>1.0</Version>\r
- <Abstract>Data hub status code library</Abstract>\r
- <Description>Save status code in DATA HUB.</Description>\r
- <Copyright>Copyright (c) 2006, Intel Corporation.</Copyright>\r
- <License>All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>\r
- <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>\r
- </MsaHeader>\r
- <ModuleDefinitions>\r
- <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>\r
- <BinaryModule>false</BinaryModule>\r
- <OutputFileBasename>EdkBsDataHubStatusCodeLib</OutputFileBasename>\r
- </ModuleDefinitions>\r
- <LibraryClassDefinitions>\r
- <LibraryClass Usage="ALWAYS_PRODUCED">\r
- <Keyword>EdkBsDataHubStatusCodeLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>UefiLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>DebugLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>BaseLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>BaseMemoryLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>UefiRuntimeLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>ReportStatusCodeLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>PrintLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>UefiBootServicesTableLib</Keyword>\r
- </LibraryClass>\r
- </LibraryClassDefinitions>\r
- <SourceFiles>\r
- <Filename>BsDataHubStatusCode.c</Filename>\r
- <Filename>BsDataHubStatusCode.h</Filename>\r
- </SourceFiles>\r
- <PackageDependencies>\r
- <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
- <Package PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674"/>\r
- </PackageDependencies>\r
- <Protocols>\r
- <Protocol Usage="ALWAYS_CONSUMED">\r
- <ProtocolCName>gEfiStatusCodeRuntimeProtocolGuid</ProtocolCName>\r
- </Protocol>\r
- <Protocol Usage="ALWAYS_CONSUMED">\r
- <ProtocolCName>gEfiDataHubProtocolGuid</ProtocolCName>\r
- </Protocol>\r
- </Protocols>\r
- <Events>\r
- <CreateEvents>\r
- <EventTypes EventGuidCName="EFI_EVENT_NOTIFY_SIGNAL" Usage="ALWAYS_CONSUMED">\r
- <EventType>EVENT_GROUP_GUID</EventType>\r
- </EventTypes>\r
- </CreateEvents>\r
- </Events>\r
- <DataHubs>\r
- <DataHubRecord Usage="ALWAYS_CONSUMED">\r
- <DataHubCName>gEfiStatusCodeGuid</DataHubCName>\r
- </DataHubRecord>\r
- </DataHubs>\r
- <Guids>\r
- <GuidCNames Usage="ALWAYS_CONSUMED">\r
- <GuidCName>gEfiStatusCodeGuid</GuidCName>\r
- </GuidCNames>\r
- </Guids>\r
- <Externs>\r
- <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
- <Specification>EDK_RELEASE_VERSION 0x00020000</Specification>\r
- </Externs>\r
-</ModuleSurfaceArea>
\ No newline at end of file
+++ /dev/null
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation \r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-\r
-Module Name:\r
- \r
- RtMemoryStatusCode.c\r
- \r
-Abstract:\r
-\r
- EFI lib to provide memory journal status code reporting routines.\r
-\r
---*/\r
-\r
-#include <Ppi/StatusCodeMemory.h>\r
-\r
-//\r
-// Global variables\r
-//\r
-PEI_STATUS_CODE_MEMORY_PPI mStatusCodeMemoryPpi = { 0, 0, 0, 0 };\r
-\r
-//\r
-// Function implementations\r
-//\r
-EFI_STATUS\r
-RtMemoryReportStatusCode (\r
- IN EFI_STATUS_CODE_TYPE CodeType,\r
- IN EFI_STATUS_CODE_VALUE Value,\r
- IN UINT32 Instance,\r
- IN EFI_GUID * CallerId,\r
- IN EFI_STATUS_CODE_DATA * Data OPTIONAL\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Log a status code to a memory journal. If no memory journal exists, \r
- we will just return.\r
-\r
-Arguments:\r
-\r
- Same as ReportStatusCode AP\r
- \r
-Returns:\r
-\r
- EFI_SUCCESS This function always returns success\r
-\r
---*/\r
-{\r
- EFI_STATUS_CODE_ENTRY *CurrentEntry;\r
- UINT32 MaxEntry;\r
-\r
- //\r
- // We don't care to log debug codes.\r
- //\r
- if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) {\r
- return EFI_SUCCESS;\r
- }\r
- //\r
- // Update the latest entry in the journal.\r
- //\r
- MaxEntry = mStatusCodeMemoryPpi.Length / sizeof (EFI_STATUS_CODE_ENTRY);\r
- if (!MaxEntry) {\r
- //\r
- // If we don't have any entries, then we can return.\r
- // This effectively means that no memory buffer was passed forward from PEI.\r
- //\r
- return EFI_SUCCESS;\r
- }\r
-\r
- CurrentEntry = (EFI_STATUS_CODE_ENTRY *) (UINTN) (mStatusCodeMemoryPpi.Address + (mStatusCodeMemoryPpi.LastEntry * sizeof (EFI_STATUS_CODE_ENTRY)));\r
-\r
- mStatusCodeMemoryPpi.LastEntry = (mStatusCodeMemoryPpi.LastEntry + 1) % MaxEntry;\r
- if (mStatusCodeMemoryPpi.LastEntry == mStatusCodeMemoryPpi.FirstEntry) {\r
- mStatusCodeMemoryPpi.FirstEntry = (mStatusCodeMemoryPpi.FirstEntry + 1) % MaxEntry;\r
- }\r
-\r
- CurrentEntry->Type = CodeType;\r
- CurrentEntry->Value = Value;\r
- CurrentEntry->Instance = Instance;\r
-\r
- return EFI_SUCCESS;\r
-}\r
-\r
-VOID\r
-RtMemoryStatusCodeInitialize (\r
- VOID\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Initialization routine.\r
- Allocates heap space for storing Status Codes.\r
- Installs a PPI to point to that heap space.\r
- Installs a callback to switch to memory.\r
- Installs a callback to \r
-\r
-Arguments: \r
-\r
- (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)\r
-\r
-Returns: \r
-\r
- None\r
-\r
---*/\r
-{\r
- EFI_HOB_GUID_TYPE *GuidHob;\r
- PEI_STATUS_CODE_MEMORY_PPI **StatusCodeMemoryPpi;\r
-\r
- GuidHob = GetFirstGuidHob (&gPeiStatusCodeMemoryPpiGuid);\r
- if (GuidHob == NULL) {\r
- return;\r
- }\r
-\r
- StatusCodeMemoryPpi = GET_GUID_HOB_DATA (GuidHob);\r
-\r
- //\r
- // Copy data to our structure since the HOB will go away at runtime\r
- //\r
- // BUGBUG: Virtualize for RT\r
- //\r
- mStatusCodeMemoryPpi.FirstEntry = (*StatusCodeMemoryPpi)->FirstEntry;\r
- mStatusCodeMemoryPpi.LastEntry = (*StatusCodeMemoryPpi)->LastEntry;\r
- mStatusCodeMemoryPpi.Address = (*StatusCodeMemoryPpi)->Address;\r
- mStatusCodeMemoryPpi.Length = (*StatusCodeMemoryPpi)->Length;\r
-}\r
-\r
-VOID\r
-PlaybackStatusCodes (\r
- IN EFI_REPORT_STATUS_CODE ReportStatusCodeFunc\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Call the input ReportStatusCode function with every status code recorded in\r
- the journal.\r
-\r
-Arguments: \r
-\r
- ReportStatusCode ReportStatusCode function to call.\r
-\r
-Returns: \r
-\r
- None\r
-\r
---*/\r
-{\r
- UINTN MaxEntry;\r
- EFI_STATUS_CODE_ENTRY *CurrentEntry;\r
- UINTN Counter;\r
-\r
- if (ReportStatusCodeFunc == RtMemoryReportStatusCode) {\r
- return ;\r
- }\r
- //\r
- // Playback prior status codes to current listeners\r
- //\r
- MaxEntry = mStatusCodeMemoryPpi.Length / sizeof (EFI_STATUS_CODE_ENTRY);\r
- for (Counter = mStatusCodeMemoryPpi.FirstEntry; Counter != mStatusCodeMemoryPpi.LastEntry; Counter++) {\r
- //\r
- // Check if we have to roll back to beginning of queue buffer\r
- //\r
- if (Counter == MaxEntry) {\r
- Counter = 0;\r
- }\r
- //\r
- // Play current entry\r
- //\r
- CurrentEntry = (EFI_STATUS_CODE_ENTRY *) (UINTN) (mStatusCodeMemoryPpi.Address + (Counter * sizeof (EFI_STATUS_CODE_ENTRY)));\r
- ReportStatusCodeFunc (\r
- CurrentEntry->Type,\r
- CurrentEntry->Value,\r
- CurrentEntry->Instance,\r
- NULL,\r
- NULL\r
- );\r
- }\r
-}\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-Copyright (c) 2006, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution. The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
--->\r
-<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0">\r
- <MsaHeader>\r
- <ModuleName>EdkRtMemoryStatusCodeLib</ModuleName>\r
- <ModuleType>DXE_DRIVER</ModuleType>\r
- <GuidValue>1517564b-ab66-42b7-8903-731a95f314f9</GuidValue>\r
- <Version>1.0</Version>\r
- <Abstract>Runtime memory status code library</Abstract>\r
- <Description>Save status code in runtime memory heap.</Description>\r
- <Copyright>Copyright (c) 2006, Intel Corporation.</Copyright>\r
- <License>All rights reserved. This program and the accompanying materials\r
- are licensed and made available under the terms and conditions of the BSD License\r
- which accompanies this distribution. The full text of the license may be found at\r
- http://opensource.org/licenses/bsd-license.php\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>\r
- <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>\r
- </MsaHeader>\r
- <ModuleDefinitions>\r
- <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>\r
- <BinaryModule>false</BinaryModule>\r
- <OutputFileBasename>EdkRtMemoryStatusCodeLib</OutputFileBasename>\r
- </ModuleDefinitions>\r
- <LibraryClassDefinitions>\r
- <LibraryClass Usage="ALWAYS_PRODUCED">\r
- <Keyword>EdkRtMemoryStatusCodeLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>UefiLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>DebugLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>BaseLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>UefiRuntimeLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>ReportStatusCodeLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>PrintLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>HobLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>UefiBootServicesTableLib</Keyword>\r
- </LibraryClass>\r
- </LibraryClassDefinitions>\r
- <SourceFiles>\r
- <Filename>RtMemoryStatusCode.c</Filename>\r
- </SourceFiles>\r
- <PackageDependencies>\r
- <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
- <Package PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674"/>\r
- </PackageDependencies>\r
- <Externs>\r
- <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
- <Specification>EDK_RELEASE_VERSION 0x00020000</Specification>\r
- </Externs>\r
-</ModuleSurfaceArea>
\ No newline at end of file
+++ /dev/null
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation \r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-\r
-Module Name:\r
-\r
- RtPlatformStatusCode.c \r
- \r
-Abstract:\r
-\r
- Contains NT32 specific implementations required to use status codes.\r
-\r
---*/\r
-\r
-//\r
-// Globals only work at BootService Time. NOT at Runtime!\r
-//\r
-// \r
-\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *REPORT_STATUS_CODE_FUNCTION) (\r
- IN EFI_STATUS_CODE_TYPE Type,\r
- IN EFI_STATUS_CODE_VALUE Value,\r
- IN UINT32 Instance,\r
- IN EFI_GUID *CallerId OPTIONAL,\r
- IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r
- );\r
-\r
-REPORT_STATUS_CODE_FUNCTION mPeiReportStatusCode;\r
-\r
-//\r
-// Function implementations\r
-//\r
-EFI_STATUS\r
-RtPlatformReportStatusCode (\r
- IN EFI_STATUS_CODE_TYPE CodeType,\r
- IN EFI_STATUS_CODE_VALUE Value,\r
- IN UINT32 Instance,\r
- IN EFI_GUID * CallerId,\r
- IN EFI_STATUS_CODE_DATA * Data OPTIONAL\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Call all status code listeners in the MonoStatusCode.\r
-\r
-Arguments:\r
-\r
- Same as ReportStatusCode service\r
- \r
-Returns:\r
-\r
- EFI_SUCCESS Always returns success.\r
-\r
---*/\r
-{\r
- RtMemoryReportStatusCode (CodeType, Value, Instance, CallerId, Data);\r
- if (EfiAtRuntime ()) {\r
- //\r
- // For now all we do is post code at runtime\r
- //\r
- return EFI_SUCCESS;\r
- }\r
-\r
- BsDataHubReportStatusCode (CodeType, Value, Instance, CallerId, Data);\r
-\r
- //\r
- // Call back into PEI to get status codes. This is because SecMain contains\r
- // status code that reports to Win32.\r
- //\r
- if (mPeiReportStatusCode != NULL) {\r
- return mPeiReportStatusCode (CodeType, Value, Instance, CallerId, Data);\r
- }\r
-\r
- return EFI_SUCCESS;\r
-}\r
-\r
-VOID\r
-RtPlatformStatusCodeInitialize (\r
- VOID\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Initialize the status code listeners.\r
-\r
-Arguments:\r
-\r
- (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)\r
-\r
-Returns:\r
-\r
- None\r
-\r
---*/\r
-{\r
- EFI_HOB_GUID_TYPE *GuidHob;\r
- void *Pointer;\r
-\r
- RtMemoryStatusCodeInitialize ();\r
- BsDataHubStatusCodeInitialize ();\r
-\r
- //\r
- // Play any prior status codes to the data hub.\r
- //\r
- PlaybackStatusCodes (BsDataHubReportStatusCode);\r
-\r
- //\r
- // If PEI has a ReportStatusCode callback find it and use it before StdErr\r
- // is connected.\r
- //\r
- mPeiReportStatusCode = NULL;\r
-\r
- GuidHob = GetFirstGuidHob (&gEfiStatusCodeRuntimeProtocolGuid);\r
- if (NULL == GuidHob) {\r
- return;\r
- }\r
- Pointer = GET_GUID_HOB_DATA (GuidHob);\r
- mPeiReportStatusCode = (REPORT_STATUS_CODE_FUNCTION) (*(UINTN *) Pointer);\r
-}\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-Copyright (c) 2006, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution. The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
--->\r
-<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0">\r
- <MsaHeader>\r
- <ModuleName>EdkRtPlatformStatusCodeLib</ModuleName>\r
- <ModuleType>DXE_DRIVER</ModuleType>\r
- <GuidValue>68b157b5-9534-43ff-9cd3-6705e4e1d56c</GuidValue>\r
- <Version>1.0</Version>\r
- <Abstract>Runtime platform status code library</Abstract>\r
- <Description>Platform status code library</Description>\r
- <Copyright>Copyright (c) 2006, Intel Corporation.</Copyright>\r
- <License>All rights reserved. This program and the accompanying materials\r
- are licensed and made available under the terms and conditions of the BSD License\r
- which accompanies this distribution. The full text of the license may be found at\r
- http://opensource.org/licenses/bsd-license.php\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>\r
- <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>\r
- </MsaHeader>\r
- <ModuleDefinitions>\r
- <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>\r
- <BinaryModule>false</BinaryModule>\r
- <OutputFileBasename>EdkRtPlatformStatusCodeLib</OutputFileBasename>\r
- </ModuleDefinitions>\r
- <LibraryClassDefinitions>\r
- <LibraryClass Usage="ALWAYS_PRODUCED">\r
- <Keyword>EdkRtPlatformStatusCodeLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>UefiLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>DebugLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>BaseLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>UefiRuntimeLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>ReportStatusCodeLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>PrintLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>HobLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>EdkBsDataHubStatusCodeLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>EdkRtMemoryStatusCodeLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>UefiBootServicesTableLib</Keyword>\r
- </LibraryClass>\r
- </LibraryClassDefinitions>\r
- <SourceFiles>\r
- <Filename>RtPlatformStatusCode.c</Filename>\r
- </SourceFiles>\r
- <PackageDependencies>\r
- <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
- <Package PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674"/>\r
- </PackageDependencies>\r
- <Externs>\r
- <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
- <Specification>EDK_RELEASE_VERSION 0x00020000</Specification>\r
- </Externs>\r
-</ModuleSurfaceArea>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+Copyright (c) 2006, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+-->\r
+<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0">\r
+ <MsaHeader>\r
+ <ModuleName>EdkSerialPortLibNull</ModuleName>\r
+ <ModuleType>PEIM</ModuleType>\r
+ <GuidValue>E4541241-8897-411a-91F8-7D7E45837146</GuidValue>\r
+ <Version>1.0</Version>\r
+ <Abstract>Memory Status Code Library for UEFI drivers</Abstract>\r
+ <Description>Lib to provide memory journal status code reporting Routines</Description>\r
+ <Copyright>Copyright (c) 2006, Intel Corporation.</Copyright>\r
+ <License>All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>\r
+ <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>\r
+ </MsaHeader>\r
+ <ModuleDefinitions>\r
+ <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>\r
+ <BinaryModule>false</BinaryModule>\r
+ <OutputFileBasename>EdkSerialPortLibNull</OutputFileBasename>\r
+ </ModuleDefinitions>\r
+ <LibraryClassDefinitions>\r
+ <LibraryClass Usage="ALWAYS_PRODUCED">\r
+ <Keyword>SerialPortLib</Keyword>\r
+ </LibraryClass>\r
+ </LibraryClassDefinitions>\r
+ <SourceFiles>\r
+ <Filename>SerialPortLibNull.c</Filename>\r
+ </SourceFiles>\r
+ <PackageDependencies>\r
+ <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
+ <Package PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674"/>\r
+ </PackageDependencies>\r
+ <PPIs>\r
+ </PPIs>\r
+ <Externs>\r
+ <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
+ <Specification>EDK_RELEASE_VERSION 0x00020000</Specification>\r
+ </Externs>\r
+</ModuleSurfaceArea>
\ No newline at end of file
--- /dev/null
+/** @file\r
+ Serial I/O Port library functions with no library constructor/destructor\r
+\r
+ Copyright (c) 2006, Intel Corporation\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+ Module Name: SerialPortLibNull.c\r
+\r
+**/\r
+\r
+/**\r
+\r
+ Programmed hardware of Serial port.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+SerialPortInitialize (\r
+ VOID\r
+ )\r
+{\r
+ return EFI_UNSUPPORTED;\r
+}\r
+\r
+/**\r
+ Write data to serial device. \r
+ \r
+ If the buffer is NULL, then ASSERT(); \r
+ if NumberOfBytes is zero, then ASSERT(). \r
+\r
+ @param Buffer Point of data buffer which need to be writed.\r
+ @param NumberOfBytes Number of output bytes which are cached in Buffer.\r
+\r
+ @retval 0 Write data failed.\r
+ @retval !0 Actual number of bytes writed to serial device.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+SerialPortWrite (\r
+ IN UINT8 *Buffer,\r
+ IN UINTN NumberOfBytes\r
+)\r
+{\r
+ return 0;\r
+}\r
+\r
+\r
+/**\r
+ Read data from serial device and save the datas in buffer.\r
+ \r
+ If the buffer is NULL, then ASSERT(); \r
+ if NumberOfBytes is zero, then ASSERT(). \r
+\r
+ @param Buffer Point of data buffer which need to be writed.\r
+ @param NumberOfBytes Number of output bytes which are cached in Buffer.\r
+\r
+ @retval 0 Read data failed.\r
+ @retval !0 Aactual number of bytes read from serial device.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+SerialPortRead (\r
+ OUT UINT8 *Buffer,\r
+ IN UINTN NumberOfBytes\r
+)\r
+{\r
+ return 0;\r
+}\r
+\r
--- /dev/null
+/** @file\r
+ Status code driver for IA32/X64/EBC architecture.\r
+\r
+// Copyright (c) 2006, Intel Corporation. All rights reserved. \r
+// This software and associated documentation (if any) is furnished\r
+// under a license and may only be used or copied in accordance\r
+// with the terms of the license. Except as permitted by such\r
+// license, no part of this software or documentation may be\r
+// reproduced, stored in a retrieval system, or transmitted in any\r
+// form or by any means without the express written consent of\r
+// Intel Corporation.\r
+\r
+ Module Name: DxeStatusCodeCommon.c\r
+\r
+**/\r
+#include "DxeStatusCode.h"\r
+\r
+\r
+/**\r
+ Report status code to all supported device. \r
+ Calls into the workers which dispatches the platform specific\r
+ listeners. \r
+\r
+ @param Type Indicates the type of status code being reported. \r
+ The type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.\r
+ @param Value Describes the current status of a hardware or software entity. \r
+ This includes information about the class and subclass that is used to classify the entity \r
+ as well as an operation. For progress codes, the operation is the current activity. \r
+ For error codes, it is the exception. For debug codes, it is not defined at this time. \r
+ Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below. \r
+ Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r
+ @param Instance The enumeration of a hardware or software entity within the system. \r
+ A system may contain multiple entities that match a class/subclass pairing. \r
+ The instance differentiates between them. An instance of 0 indicates that instance \r
+ information is unavailable, not meaningful, or not relevant. Valid instance numbers start with 1.\r
+ @param CallerId This optional parameter may be used to identify the caller. \r
+ This parameter allows the status code driver to apply different rules to different callers.\r
+ @param Data This optional parameter may be used to pass additional data. \r
+ Type EFI_STATUS_CODE_DATA is defined in "Related Definitions" below. \r
+ The contents of this data type may have additional GUID-specific data. The standard GUIDs and \r
+ their associated data structures are defined in the Intel? Platform Innovation Framework for EFI Status Codes Specification.\r
+**/\r
+EFI_STATUS \r
+EFIAPI\r
+ReportDispatcher (\r
+ IN EFI_STATUS_CODE_TYPE Type,\r
+ IN EFI_STATUS_CODE_VALUE Value,\r
+ IN UINT32 Instance,\r
+ IN EFI_GUID *CallerId OPTIONAL,\r
+ IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r
+ );\r
+\r
+//\r
+// Declaration of status code protocol.\r
+// \r
+EFI_STATUS_CODE_PROTOCOL mEfiStatusCodeProtocol = {\r
+ ReportDispatcher\r
+};\r
+\r
+//\r
+// Delaration of DXE status code controller \r
+//\r
+DXE_STATUS_CODE_CONTROLLER gDxeStatusCode = {\r
+ //\r
+ // Initialize nest status as non nested. \r
+ // \r
+ 0,\r
+ {NULL, NULL}\r
+};\r
+\r
+/**\r
+\r
+ Install the ReportStatusCode runtime service.\r
+ \r
+ @param ImageHandle Image handle of the loaded driver\r
+ @param SystemTable Pointer to the System Table\r
+\r
+ @return The function always returns success.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+DxeStatusCodeDriverEntry (\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_SYSTEM_TABLE *SystemTable\r
+ )\r
+{\r
+ EFI_HANDLE Handle = NULL;\r
+ EFI_STATUS Status;\r
+\r
+ //\r
+ // Dispatch initialization request to supported devices\r
+ //\r
+ InitializationDispatcherWorker ();\r
+\r
+ //\r
+ // Install Status Code Architectural Protocol implementation as defined in Tiano\r
+ // Architecture Specification.\r
+ //\r
+ Status = gBS->InstallMultipleProtocolInterfaces (\r
+ &Handle,\r
+ &gEfiStatusCodeRuntimeProtocolGuid,\r
+ &mEfiStatusCodeProtocol,\r
+ NULL\r
+ );\r
+ ASSERT_EFI_ERROR (Status);\r
+\r
+ return Status;\r
+}\r
+\r
+/**\r
+ Report status code to all supported device. \r
+ Calls into the workers which dispatches the platform specific\r
+ listeners. \r
+\r
+ @param CodeType Indicates the type of status code being reported. \r
+ The type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.\r
+ @param Value Describes the current status of a hardware or software entity. \r
+ This includes information about the class and subclass that is used to classify the entity \r
+ as well as an operation. For progress codes, the operation is the current activity. \r
+ For error codes, it is the exception. For debug codes, it is not defined at this time. \r
+ Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below. \r
+ Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r
+ @param Instance The enumeration of a hardware or software entity within the system. \r
+ A system may contain multiple entities that match a class/subclass pairing. \r
+ The instance differentiates between them. An instance of 0 indicates that instance \r
+ information is unavailable, not meaningful, or not relevant. Valid instance numbers start with 1.\r
+ @param CallerId This optional parameter may be used to identify the caller. \r
+ This parameter allows the status code driver to apply different rules to different callers.\r
+ @param Data This optional parameter may be used to pass additional data. \r
+ Type EFI_STATUS_CODE_DATA is defined in "Related Definitions" below. \r
+ The contents of this data type may have additional GUID-specific data. The standard GUIDs and \r
+ their associated data structures are defined in the Intel? Platform Innovation Framework for EFI Status Codes Specification.\r
+**/\r
+EFI_STATUS \r
+EFIAPI\r
+ReportDispatcher (\r
+ IN EFI_STATUS_CODE_TYPE CodeType,\r
+ IN EFI_STATUS_CODE_VALUE Value,\r
+ IN UINT32 Instance,\r
+ IN EFI_GUID *CallerId OPTIONAL,\r
+ IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r
+ )\r
+{\r
+ //\r
+ // Use atom operation to avoid the reentant of report.\r
+ // If current status is not zero, then the function is reentrancy.\r
+ //\r
+ if (InterlockedCompareExchange32 (&gDxeStatusCode.StatusCodeNestStatus, 0, 1)) {\r
+ return EFI_DEVICE_ERROR;\r
+ }\r
+\r
+ if (FeaturePcdGet (PcdStatusCodeUseEfiSerial) || FeaturePcdGet (PcdStatusCodeUseHardSerial)) {\r
+ SerialStatusCodeReportWorker (\r
+ CodeType,\r
+ Value,\r
+ Instance,\r
+ CallerId,\r
+ Data\r
+ );\r
+ }\r
+ if (FeaturePcdGet (PcdStatusCodeUseRuntimeMemory)) {\r
+ RtMemoryStatusCodeReportWorker (\r
+ gDxeStatusCode.RtMemoryStatusCodeTable[PHYSICAL_MODE],\r
+ CodeType,\r
+ Value,\r
+ Instance\r
+ );\r
+ }\r
+ if (FeaturePcdGet (PcdStatusCodeUseDataHub)) {\r
+ DataHubStatusCodeReportWorker (\r
+ CodeType,\r
+ Value,\r
+ Instance,\r
+ CallerId,\r
+ Data\r
+ );\r
+ }\r
+ if (FeaturePcdGet (PcdStatusCodeUseOEM)) {\r
+ OemHookStatusCodeReport (\r
+ CodeType,\r
+ Value,\r
+ Instance,\r
+ CallerId,\r
+ Data\r
+ );\r
+ }\r
+\r
+ //\r
+ // Restore the nest status of report\r
+ //\r
+ InterlockedCompareExchange32 (&gDxeStatusCode.StatusCodeNestStatus, 1, 0);\r
+\r
+ return EFI_SUCCESS;\r
+}\r
+\r
+\r
+/**\r
+ Virtual address change notification call back. It converts global pointer \r
+ to virtual address.\r
+\r
+ @param Event Event whose notification function is being invoked.\r
+ @param Context Pointer to the notification function¡¯s context, which is\r
+ always zero in current implementation.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+VirtualAddressChangeCallBack (\r
+ IN EFI_EVENT Event,\r
+ IN VOID *Context\r
+ )\r
+{\r
+ //\r
+ // Convert memory status code table to virtual address;\r
+ //\r
+ EfiConvertPointer (\r
+ 0, \r
+ (VOID **) &gDxeStatusCode.RtMemoryStatusCodeTable[PHYSICAL_MODE]\r
+ );\r
+}\r
+\r
--- /dev/null
+#/*++\r
+#\r
+# Copyright (c) 2006, Intel Corporation \r
+# All rights reserved. This program and the accompanying materials \r
+# are licensed and made available under the terms and conditions of the BSD License \r
+# which accompanies this distribution. The full text of the license may be found at \r
+# http://opensource.org/licenses/bsd-license.php \r
+# \r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# \r
+# Module Name:\r
+#\r
+# Ia32StatusCode.dxs\r
+#\r
+# Abstract:\r
+#\r
+# Dependency expression source file.\r
+# \r
+#--*/ \r
+#include <AutoGen.h>\r
+#include <DxeDepex.h>\r
+\r
+DEPENDENCY_START\r
+ EFI_DATA_HUB_PROTOCOL_GUID AND EFI_CPU_IO_PROTOCOL_GUID\r
+DEPENDENCY_END\r
--- /dev/null
+/** @file\r
+ Data Hub status code worker in DXE.\r
+\r
+Copyright (c) 2006, Intel Corporation. All rights reserved. \r
+This software and associated documentation (if any) is furnished\r
+under a license and may only be used or copied in accordance\r
+with the terms of the license. Except as permitted by such\r
+license, no part of this software or documentation may be\r
+reproduced, stored in a retrieval system, or transmitted in any\r
+form or by any means without the express written consent of\r
+Intel Corporation.\r
+\r
+ Module Name: DataHubStatusCodeWorker.c\r
+\r
+**/\r
+#include "DxeStatusCode.h"\r
+\r
+//\r
+// Initialize FIFO to cache records.\r
+//\r
+EFI_LOCK mFifoLock = EFI_INITIALIZE_LOCK_VARIABLE (EFI_TPL_HIGH_LEVEL);\r
+LIST_ENTRY mRecordsFifo = INITIALIZE_LIST_HEAD_VARIABLE (mRecordsFifo);\r
+UINTN mNumberOfRecords = 0;\r
+\r
+EFI_EVENT mLogDataHubEvent;\r
+//\r
+// Cache data hub protocol.\r
+//\r
+EFI_DATA_HUB_PROTOCOL *mDataHubProtocol;\r
+\r
+\r
+/**\r
+ Return buffer of length DATAHUB_STATUSCODE_RECORD\r
+ \r
+ @retval NULL Can not allocate free memeory for record.\r
+ @retval !NULL Point to buffer of record.\r
+\r
+**/\r
+DATAHUB_STATUSCODE_RECORD *\r
+AcquireRecordBuffer (\r
+ VOID\r
+ )\r
+{\r
+ DATAHUB_STATUSCODE_RECORD *Record;\r
+\r
+ Record = (DATAHUB_STATUSCODE_RECORD *) AllocateZeroPool (sizeof (DATAHUB_STATUSCODE_RECORD));\r
+ if (NULL == Record) {\r
+ return NULL;\r
+ }\r
+ Record->Signature = DATAHUB_STATUS_CODE_SIGNATURE;\r
+\r
+ EfiAcquireLock (&mFifoLock);\r
+ InsertTailList (&mRecordsFifo, &Record->Node);\r
+ mNumberOfRecords++;\r
+ EfiReleaseLock (&mFifoLock);\r
+\r
+ return Record;\r
+}\r
+\r
+\r
+/**\r
+ Release a mRecordBuffer entry allocated by AcquirRecordBuffer ().\r
+\r
+ @param Record Point to record buffer which is acquired by AcquirRecordBuffer()\r
+ \r
+ @retval EFI_SUCCESS If DataRecord is valid.\r
+ @retval !EFI_SUCCESS The record list has empty.\r
+\r
+**/\r
+VOID\r
+FreeRecordBuffer (\r
+ IN DATAHUB_STATUSCODE_RECORD *Record\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+ Release a mRecordBuffer entry allocated by AquireEmptyRecordBuffer ().\r
+\r
+Arguments:\r
+\r
+ RecordBuffer - Data to free\r
+\r
+Returns:\r
+\r
+ EFI_SUCCESS - If DataRecord is valid\r
+ EFI_UNSUPPORTED - The record list has empty\r
+\r
+--*/\r
+{\r
+ ASSERT (Record != NULL);\r
+ ASSERT (mNumberOfRecords != 0);\r
+\r
+ EfiAcquireLock (&mFifoLock);\r
+ RemoveEntryList (&Record->Node);\r
+ mNumberOfRecords--;\r
+ EfiReleaseLock (&mFifoLock);\r
+\r
+ FreePool (Record);\r
+}\r
+\r
+\r
+/**\r
+ Report status code into DataHub.\r
+ \r
+ @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions¡± below.\r
+ \r
+ @param Value Describes the current status of a hardware or software entity. \r
+ This included information about the class and subclass that is used to classify the entity \r
+ as well as an operation. For progress codes, the operation is the current activity. \r
+ For error codes, it is the exception. For debug codes, it is not defined at this time. \r
+ Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below. \r
+ Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r
+ \r
+ @param Instance The enumeration of a hardware or software entity within the system. \r
+ A system may contain multiple entities that match a class/subclass pairing. \r
+ The instance differentiates between them. An instance of 0 indicates that instance information is unavailable, \r
+ not meaningful, or not relevant. Valid instance numbers start with 1.\r
+\r
+\r
+ @param CallerId This optional parameter may be used to identify the caller. \r
+ This parameter allows the status code driver to apply different rules to different callers. \r
+ Type EFI_GUID is defined in InstallProtocolInterface() in the EFI 1.10 Specification.\r
+\r
+\r
+ @param Data This optional parameter may be used to pass additional data\r
+ \r
+ @retval EFI_OUT_OF_RESOURCES Can not acquire record buffer.\r
+ @retval EFI_SUCCESS Success to cache status code and signal log data event.\r
+\r
+**/\r
+EFI_STATUS\r
+DataHubStatusCodeReportWorker (\r
+ IN EFI_STATUS_CODE_TYPE CodeType,\r
+ IN EFI_STATUS_CODE_VALUE Value,\r
+ IN UINT32 Instance,\r
+ IN EFI_GUID *CallerId,\r
+ IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r
+ )\r
+{\r
+ DATAHUB_STATUSCODE_RECORD *Record;\r
+ UINT32 ErrorLevel;\r
+ VA_LIST Marker;\r
+ CHAR8 *Format;\r
+ UINTN CharCount;\r
+\r
+ //\r
+ // See whether in runtime phase or not.\r
+ //\r
+ if (EfiAtRuntime ()) {\r
+ return EFI_SUCCESS;\r
+ }\r
+\r
+ Record = (DATAHUB_STATUSCODE_RECORD *) AcquireRecordBuffer ();\r
+ if (Record == NULL) {\r
+ //\r
+ // There are no empty record buffer in private buffers\r
+ //\r
+ return EFI_OUT_OF_RESOURCES;\r
+ }\r
+ //\r
+ // Construct Data Hub Extended Data\r
+ //\r
+ Record->CodeType = CodeType;\r
+ Record->Value = Value;\r
+ Record->Instance = Instance;\r
+\r
+ if (CallerId != NULL) {\r
+ CopyMem (&Record->CallerId, CallerId, sizeof (EFI_GUID));\r
+ }\r
+\r
+ if (Data != NULL) {\r
+ if (ReportStatusCodeExtractDebugInfo (Data, &ErrorLevel, &Marker, &Format)) {\r
+ CharCount = UnicodeVSPrintAsciiFormat (\r
+ (CHAR16 *) Record->ExtendData,\r
+ EFI_STATUS_CODE_DATA_MAX_SIZE,\r
+ Format,\r
+ Marker\r
+ );\r
+ //\r
+ // Change record data type from DebugType to String Type.\r
+ //\r
+ CopyGuid (&Record->Data.Type, &gEfiStatusCodeDataTypeStringGuid);\r
+ Record->Data.HeaderSize = Data->HeaderSize;\r
+ Record->Data.Size = (UINT16) ((CharCount + 1) * sizeof (CHAR16));\r
+ } else {\r
+ //\r
+ // Copy status code data header\r
+ //\r
+ CopyMem (&Record->Data, Data, sizeof (EFI_STATUS_CODE_DATA));\r
+\r
+ if (Data->Size > EFI_STATUS_CODE_DATA_MAX_SIZE) {\r
+ Record->Data.Size = EFI_STATUS_CODE_DATA_MAX_SIZE;\r
+ } \r
+ CopyMem (Record->ExtendData, Data + 1, Record->Data.Size);\r
+ }\r
+ }\r
+\r
+ gBS->SignalEvent (mLogDataHubEvent);\r
+\r
+ return EFI_SUCCESS;\r
+}\r
+\r
+\r
+/**\r
+ The Event handler which will be notified to log data in Data Hub.\r
+\r
+ @param Event Instance of the EFI_EVENT to signal whenever data is\r
+ available to be logged in the system.\r
+ @param Context Context of the event.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+LogDataHubEventCallBack (\r
+ IN EFI_EVENT Event,\r
+ IN VOID *Context\r
+ )\r
+{\r
+ DATAHUB_STATUSCODE_RECORD *Record;\r
+ UINTN Size;\r
+ UINT64 DataRecordClass;\r
+ LIST_ENTRY *Node;\r
+\r
+ //\r
+ // Log DataRecord in Data Hub.\r
+ // Journal records fifo to find all record entry.\r
+ //\r
+ //\r
+ for (Node = mRecordsFifo.ForwardLink; Node != &mRecordsFifo;) {\r
+ Record = CR (Node, DATAHUB_STATUSCODE_RECORD, Node, DATAHUB_STATUS_CODE_SIGNATURE);\r
+ Node = Node->ForwardLink;\r
+\r
+ //\r
+ // Add in the size of the header we added.\r
+ //\r
+ Size = sizeof (DATAHUB_STATUSCODE_RECORD) + Record->Data.Size;\r
+\r
+ if ((Record->CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) {\r
+ DataRecordClass = EFI_DATA_RECORD_CLASS_PROGRESS_CODE;\r
+ } else if ((Record->CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) {\r
+ DataRecordClass = EFI_DATA_RECORD_CLASS_ERROR;\r
+ } else if ((Record->CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) {\r
+ DataRecordClass = EFI_DATA_RECORD_CLASS_DEBUG;\r
+ } else {\r
+ //\r
+ // Should never get here.\r
+ //\r
+ DataRecordClass = EFI_DATA_RECORD_CLASS_DEBUG |\r
+ EFI_DATA_RECORD_CLASS_ERROR |\r
+ EFI_DATA_RECORD_CLASS_DATA |\r
+ EFI_DATA_RECORD_CLASS_PROGRESS_CODE;\r
+ }\r
+\r
+ //\r
+ // Log DataRecord in Data Hub\r
+ //\r
+ \r
+ mDataHubProtocol->LogData (\r
+ mDataHubProtocol,\r
+ &gEfiStatusCodeGuid,\r
+ &gEfiStatusCodeRuntimeProtocolGuid,\r
+ DataRecordClass,\r
+ Record,\r
+ (UINT32) Size\r
+ );\r
+\r
+ FreeRecordBuffer (Record);\r
+ }\r
+}\r
+\r
+\r
+/**\r
+ Initialize data hubstatus code.\r
+ Create a data hub listener.\r
+ \r
+ @return The function always return EFI_SUCCESS\r
+\r
+**/\r
+EFI_STATUS\r
+DataHubStatusCodeInitializeWorker (\r
+ VOID\r
+ )\r
+{\r
+ EFI_STATUS Status;\r
+\r
+ Status = gBS->LocateProtocol (\r
+ &gEfiDataHubProtocolGuid, \r
+ NULL, \r
+ (VOID **) &mDataHubProtocol\r
+ );\r
+ ASSERT_EFI_ERROR (Status);\r
+\r
+ //\r
+ // Create a Notify Event to log data in Data Hub\r
+ //\r
+ Status = gBS->CreateEvent (\r
+ EFI_EVENT_NOTIFY_SIGNAL,\r
+ EFI_TPL_CALLBACK,\r
+ LogDataHubEventCallBack,\r
+ NULL,\r
+ &mLogDataHubEvent\r
+ );\r
+\r
+ ASSERT_EFI_ERROR (Status);\r
+\r
+ return EFI_SUCCESS;\r
+}\r
+\r
+\r
--- /dev/null
+/** @file\r
+ Status Code Architectural Protocol implementation as defined in Tiano\r
+ Architecture Specification.\r
+\r
+ This driver has limited functionality at runtime and will not log to Data Hub\r
+ at runtime.\r
+\r
+ Notes:\r
+ This driver assumes the following ReportStatusCode strategy:\r
+ PEI -> uses PeiReportStatusCode\r
+ DXE IPL -> uses PeiReportStatusCode\r
+ early DXE -> uses PeiReportStatusCode via HOB\r
+ DXE -> This driver\r
+ RT -> This driver\r
+\r
+// Copyright (c) 2006, Intel Corporation. All rights reserved. \r
+// This software and associated documentation (if any) is furnished\r
+// under a license and may only be used or copied in accordance\r
+// with the terms of the license. Except as permitted by such\r
+// license, no part of this software or documentation may be\r
+// reproduced, stored in a retrieval system, or transmitted in any\r
+// form or by any means without the express written consent of\r
+// Intel Corporation.\r
+\r
+ Module Name: StatusCode.c\r
+\r
+**/\r
+\r
+#include "DxeStatusCode.h"\r
+\r
+/**\r
+ \r
+ Dispatch initialization request to sub status code devices based on \r
+ customized feature flags.\r
+ \r
+**/\r
+VOID\r
+InitializationDispatcherWorker (\r
+ VOID\r
+ )\r
+{\r
+ EFI_PEI_HOB_POINTERS Hob;\r
+ MEMORY_STATUSCODE_PACKET_HEADER *PacketHeader;\r
+ MEMORY_STATUSCODE_RECORD *Record;\r
+ UINTN ExpectedPacketIndex = 0;\r
+ UINTN Index;\r
+ VOID *HobStart;\r
+\r
+ //\r
+ // If enable UseSerial, then initialize serial port.\r
+ // if enable UseRuntimeMemory, then initialize runtime memory status code worker.\r
+ // if enable UseDataHub, then initialize data hub status code worker.\r
+ //\r
+ if (FeaturePcdGet (PcdStatusCodeUseEfiSerial)) {\r
+ EfiSerialStatusCodeInitializeWorker ();\r
+ }\r
+ if (FeaturePcdGet (PcdStatusCodeUseHardSerial)) {\r
+ SerialPortInitialize ();\r
+ }\r
+ if (FeaturePcdGet (PcdStatusCodeUseRuntimeMemory)) {\r
+ RtMemoryStatusCodeInitializeWorker ();\r
+ }\r
+ if (FeaturePcdGet (PcdStatusCodeUseDataHub)) {\r
+ DataHubStatusCodeInitializeWorker ();\r
+ }\r
+ if (FeaturePcdGet (PcdStatusCodeUseOEM)) {\r
+ OemHookStatusCodeInitialize ();\r
+ }\r
+\r
+ //\r
+ // Replay Status code which saved in GUID'ed HOB to all supported device. \r
+ //\r
+\r
+ // \r
+ // Journal GUID'ed HOBs to find all record entry, if found, \r
+ // then output record to support replay device.\r
+ //\r
+ Hob.Raw = GetFirstGuidHob (&gMemoryStatusCodeRecordGuid);\r
+ HobStart = Hob.Raw;\r
+ while (Hob.Raw != NULL) {\r
+ PacketHeader = (MEMORY_STATUSCODE_PACKET_HEADER *) GET_GUID_HOB_DATA (Hob.Guid);\r
+ if (PacketHeader->PacketIndex == ExpectedPacketIndex) {\r
+ Record = (MEMORY_STATUSCODE_RECORD *) (PacketHeader + 1);\r
+ for (Index = 0; Index < PacketHeader->RecordIndex; Index++) {\r
+ //\r
+ // Dispatch records to devices based on feature flag.\r
+ //\r
+ if (FeaturePcdGet (PcdStatusCodeReplayInSerial) && \r
+ (FeaturePcdGet (PcdStatusCodeUseHardSerial) ||\r
+ FeaturePcdGet (PcdStatusCodeUseEfiSerial))) {\r
+ SerialStatusCodeReportWorker (\r
+ Record[Index].CodeType,\r
+ Record[Index].Value,\r
+ Record[Index].Instance,\r
+ NULL,\r
+ NULL\r
+ );\r
+ }\r
+ if (FeaturePcdGet (PcdStatusCodeReplayInRuntimeMemory) &&\r
+ FeaturePcdGet (PcdStatusCodeUseRuntimeMemory)) {\r
+ RtMemoryStatusCodeReportWorker (\r
+ gDxeStatusCode.RtMemoryStatusCodeTable[PHYSICAL_MODE],\r
+ Record[Index].CodeType,\r
+ Record[Index].Value,\r
+ Record[Index].Instance\r
+ );\r
+ }\r
+ if (FeaturePcdGet (PcdStatusCodeReplayInDataHub) &&\r
+ FeaturePcdGet (PcdStatusCodeUseDataHub)) {\r
+ DataHubStatusCodeReportWorker (\r
+ Record[Index].CodeType,\r
+ Record[Index].Value,\r
+ Record[Index].Instance,\r
+ NULL,\r
+ NULL\r
+ );\r
+ }\r
+ if (FeaturePcdGet (PcdStatusCodeReplayInOEM) &&\r
+ FeaturePcdGet (PcdStatusCodeUseOEM)) {\r
+ OemHookStatusCodeReport (\r
+ Record[Index].CodeType,\r
+ Record[Index].Value,\r
+ Record[Index].Instance,\r
+ NULL,\r
+ NULL\r
+ );\r
+ }\r
+ }\r
+ ExpectedPacketIndex++;\r
+\r
+ //\r
+ // See whether there is gap of packet or not\r
+ //\r
+ if (HobStart) {\r
+ HobStart = NULL;\r
+ Hob.Raw = HobStart;\r
+ continue;\r
+ }\r
+ } else if (HobStart != NULL) {\r
+ //\r
+ // Cache the found packet for improve the performance\r
+ //\r
+ HobStart = Hob.Raw;\r
+ }\r
+\r
+ Hob.Raw = GetNextGuidHob (&gMemoryStatusCodeRecordGuid, Hob.Raw);\r
+ }\r
+}\r
+\r
--- /dev/null
+/*++\r
+\r
+Copyright (c) 2006, Intel Corporation. All rights reserved. \r
+This software and associated documentation (if any) is furnished\r
+under a license and may only be used or copied in accordance\r
+with the terms of the license. Except as permitted by such\r
+license, no part of this software or documentation may be\r
+reproduced, stored in a retrieval system, or transmitted in any\r
+form or by any means without the express written consent of\r
+Intel Corporation.\r
+\r
+Module Name:\r
+\r
+ DxeStatusCode.h\r
+\r
+Abstract:\r
+\r
+ Header file of EFI DXE/RT Status Code.\r
+\r
+--*/\r
+\r
+#ifndef __DXE_STATUS_CODE_H__\r
+#define __DXE_STATUS_CODE_H__\r
+\r
+//\r
+// Data hub worker definition \r
+//\r
+#define MAX_NUMBER_DATAHUB_RECORDS 1000\r
+#define DATAHUB_BYTES_PER_RECORD EFI_STATUS_CODE_DATA_MAX_SIZE\r
+#define EMPTY_RECORD_TAG 0xFF\r
+#define DATAHUB_STATUS_CODE_SIGNATURE EFI_SIGNATURE_32 ('B', 'D', 'H', 'S')\r
+\r
+//\r
+// Address type of pointer.\r
+// The point type always equal to PHYSICAL_MODE on IA32/X64/EBC architecture\r
+// Otherwise, VIRTUAL_MODE/PHYSICAL_MODE would be used on Ipf architecture, \r
+// \r
+enum {\r
+ PHYSICAL_MODE,\r
+ VIRTUAL_MODE\r
+};\r
+\r
+typedef struct {\r
+ UINTN Signature;\r
+ LIST_ENTRY Node;\r
+ EFI_STATUS_CODE_TYPE CodeType;\r
+ EFI_STATUS_CODE_VALUE Value;\r
+ UINT32 Instance;\r
+ EFI_GUID CallerId;\r
+ EFI_STATUS_CODE_DATA Data;\r
+ UINT8 ExtendData[EFI_STATUS_CODE_DATA_MAX_SIZE];\r
+} DATAHUB_STATUSCODE_RECORD;\r
+\r
+\r
+//\r
+// Runtime memory status code worker definition \r
+// \r
+typedef struct {\r
+ UINT32 RecordIndex;\r
+ UINT32 NumberOfRecords;\r
+ UINT32 MaxRecordsNumber;\r
+} RUNTIME_MEMORY_STATUSCODE_HEADER;\r
+\r
+\r
+typedef struct {\r
+ //\r
+ // Report operation nest status. \r
+ // If it is set, then the report operation has nested.\r
+ // \r
+ UINT32 StatusCodeNestStatus;\r
+ //\r
+ // Runtime status code management header, the records buffer is following it.\r
+ // \r
+ RUNTIME_MEMORY_STATUSCODE_HEADER *RtMemoryStatusCodeTable[2];\r
+} DXE_STATUS_CODE_CONTROLLER;\r
+\r
+\r
+/**\r
+ \r
+ Dispatch initialization request to sub status code devices based on \r
+ customized feature flags.\r
+ \r
+**/\r
+VOID\r
+InitializationDispatcherWorker (\r
+ VOID\r
+ );\r
+\r
+\r
+/**\r
+ Initialize serial status code worker.\r
+ \r
+ @return The function always return EFI_SUCCESS\r
+\r
+**/\r
+EFI_STATUS\r
+EfiSerialStatusCodeInitializeWorker (\r
+ VOID\r
+ );\r
+\r
+\r
+/**\r
+ Convert status code value and extended data to readable ASCII string, send string to serial I/O device.\r
+ \r
+ @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions¡± below.\r
+ \r
+ @param Value Describes the current status of a hardware or software entity. \r
+ This included information about the class and subclass that is used to classify the entity \r
+ as well as an operation. For progress codes, the operation is the current activity. \r
+ For error codes, it is the exception. For debug codes, it is not defined at this time. \r
+ Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below. \r
+ Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r
+ \r
+ @param Instance The enumeration of a hardware or software entity within the system. \r
+ A system may contain multiple entities that match a class/subclass pairing. \r
+ The instance differentiates between them. An instance of 0 indicates that instance information is unavailable, \r
+ not meaningful, or not relevant. Valid instance numbers start with 1.\r
+\r
+\r
+ @param CallerId This optional parameter may be used to identify the caller. \r
+ This parameter allows the status code driver to apply different rules to different callers. \r
+ Type EFI_GUID is defined in InstallProtocolInterface() in the EFI 1.10 Specification.\r
+\r
+\r
+ @param Data This optional parameter may be used to pass additional data\r
+ \r
+ @return The function always return EFI_SUCCESS.\r
+\r
+**/\r
+EFI_STATUS\r
+SerialStatusCodeReportWorker (\r
+ IN EFI_STATUS_CODE_TYPE CodeType,\r
+ IN EFI_STATUS_CODE_VALUE Value,\r
+ IN UINT32 Instance,\r
+ IN EFI_GUID *CallerId,\r
+ IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r
+ );\r
+\r
+/**\r
+ Initialize runtime memory status code.\r
+ \r
+ @return The function always return EFI_SUCCESS\r
+\r
+**/\r
+EFI_STATUS\r
+RtMemoryStatusCodeInitializeWorker (\r
+ VOID\r
+ );\r
+\r
+/**\r
+ Report status code into runtime memory. If the runtime pool is full, roll back to the \r
+ first record and overwrite it.\r
+ \r
+ @param RtMemoryStatusCodeTable \r
+ Point to Runtime memory table header.\r
+\r
+ @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions¡± below.\r
+ \r
+ @param Value Describes the current status of a hardware or software entity. \r
+ This included information about the class and subclass that is used to classify the entity \r
+ as well as an operation. For progress codes, the operation is the current activity. \r
+ For error codes, it is the exception. For debug codes, it is not defined at this time. \r
+ Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below. \r
+ Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r
+ \r
+ @param Instance The enumeration of a hardware or software entity within the system. \r
+ A system may contain multiple entities that match a class/subclass pairing. \r
+ The instance differentiates between them. An instance of 0 indicates that instance information is unavailable, \r
+ not meaningful, or not relevant. Valid instance numbers start with 1.\r
+ \r
+ @return The function always return EFI_SUCCESS.\r
+\r
+**/\r
+EFI_STATUS\r
+RtMemoryStatusCodeReportWorker (\r
+ RUNTIME_MEMORY_STATUSCODE_HEADER *RtMemoryStatusCodeTable,\r
+ IN EFI_STATUS_CODE_TYPE CodeType,\r
+ IN EFI_STATUS_CODE_VALUE Value,\r
+ IN UINT32 Instance\r
+ );\r
+\r
+/**\r
+ Initialize data hubstatus code.\r
+ Create a data hub listener.\r
+ \r
+ @return The function always return EFI_SUCCESS\r
+\r
+**/\r
+EFI_STATUS\r
+DataHubStatusCodeInitializeWorker (\r
+ VOID\r
+ );\r
+\r
+\r
+/**\r
+ Report status code into DataHub.\r
+ \r
+ @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions¡± below.\r
+ \r
+ @param Value Describes the current status of a hardware or software entity. \r
+ This included information about the class and subclass that is used to classify the entity \r
+ as well as an operation. For progress codes, the operation is the current activity. \r
+ For error codes, it is the exception. For debug codes, it is not defined at this time. \r
+ Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below. \r
+ Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r
+ \r
+ @param Instance The enumeration of a hardware or software entity within the system. \r
+ A system may contain multiple entities that match a class/subclass pairing. \r
+ The instance differentiates between them. An instance of 0 indicates that instance information is unavailable, \r
+ not meaningful, or not relevant. Valid instance numbers start with 1.\r
+\r
+\r
+ @param CallerId This optional parameter may be used to identify the caller. \r
+ This parameter allows the status code driver to apply different rules to different callers. \r
+ Type EFI_GUID is defined in InstallProtocolInterface() in the EFI 1.10 Specification.\r
+\r
+\r
+ @param Data This optional parameter may be used to pass additional data\r
+ \r
+ @retval EFI_OUT_OF_RESOURCES Can not acquire record buffer.\r
+ @retval EFI_SUCCESS Success to cache status code and signal log data event.\r
+\r
+**/\r
+EFI_STATUS\r
+DataHubStatusCodeReportWorker (\r
+ IN EFI_STATUS_CODE_TYPE CodeType,\r
+ IN EFI_STATUS_CODE_VALUE Value,\r
+ IN UINT32 Instance,\r
+ IN EFI_GUID *CallerId,\r
+ IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r
+ );\r
+\r
+//\r
+// declaration of DXE status code controller.\r
+// \r
+extern DXE_STATUS_CODE_CONTROLLER gDxeStatusCode;\r
+\r
+#endif\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--Copyright (c) 2006, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.-->\r
+<ModuleSurfaceArea xsi:schemaLocation="http://www.TianoCore.org/2006/Edk2.0 http://www.TianoCore.org/2006/Edk2.0/SurfaceArea.xsd" xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
+ <MsaHeader>\r
+ <ModuleName>DxeStatusCode</ModuleName>\r
+ <ModuleType>DXE_RUNTIME_DRIVER</ModuleType>\r
+ <GuidValue>FEDE0A1B-BCA2-4A9F-BB2B-D9FD7DEC2E9F</GuidValue>\r
+ <Version>1.0</Version>\r
+ <Abstract>DXE status code driver.</Abstract>\r
+ <Description>\r
+ Status Code Architectural Protocol implementation as defined in Tiano\r
+ Architecture Specification. This driver has limited functionality \r
+ at runtime and will not log to Data Hub at runtime.\r
+ </Description>\r
+ <Copyright>Copyright (c) 2006, Intel Corporation.</Copyright>\r
+ <License>All rights reserved.\r
+ This software and associated documentation (if any) is furnished\r
+ under a license and may only be used or copied in accordance\r
+ with the terms of the license. Except as permitted by such\r
+ license, no part of this software or documentation may be\r
+ reproduced, stored in a retrieval system, or transmitted in any\r
+ form or by any means without the express written consent of\r
+ Intel Corporation.</License>\r
+ <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>\r
+ </MsaHeader>\r
+ <ModuleDefinitions>\r
+ <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>\r
+ <BinaryModule>false</BinaryModule>\r
+ <OutputFileBasename>DxeStatusCode</OutputFileBasename>\r
+ </ModuleDefinitions>\r
+ <LibraryClassDefinitions>\r
+ <LibraryClass Usage="ALWAYS_CONSUMED">\r
+ <Keyword>BaseLib</Keyword>\r
+ </LibraryClass>\r
+ <LibraryClass Usage="ALWAYS_CONSUMED">\r
+ <Keyword>BaseMemoryLib</Keyword>\r
+ </LibraryClass>\r
+ <LibraryClass Usage="ALWAYS_CONSUMED">\r
+ <Keyword>DebugLib</Keyword>\r
+ </LibraryClass>\r
+ <LibraryClass Usage="ALWAYS_CONSUMED">\r
+ <Keyword>ReportStatusCodeLib</Keyword>\r
+ </LibraryClass>\r
+ <LibraryClass Usage="ALWAYS_CONSUMED">\r
+ <Keyword>PrintLib</Keyword>\r
+ </LibraryClass>\r
+ <LibraryClass Usage="ALWAYS_CONSUMED">\r
+ <Keyword>PcdLib</Keyword>\r
+ </LibraryClass>\r
+ <LibraryClass Usage="ALWAYS_CONSUMED">\r
+ <Keyword>HobLib</Keyword>\r
+ </LibraryClass>\r
+ <LibraryClass Usage="ALWAYS_CONSUMED">\r
+ <Keyword>UefiDriverEntryPoint</Keyword>\r
+ </LibraryClass>\r
+ <LibraryClass Usage="ALWAYS_CONSUMED">\r
+ <Keyword>UefiBootServicesTableLib</Keyword>\r
+ </LibraryClass>\r
+ <LibraryClass Usage="ALWAYS_CONSUMED">\r
+ <Keyword>UefiLib</Keyword>\r
+ </LibraryClass>\r
+ <LibraryClass Usage="ALWAYS_CONSUMED">\r
+ <Keyword>MemoryAllocationLib</Keyword>\r
+ </LibraryClass>\r
+ <LibraryClass Usage="ALWAYS_CONSUMED">\r
+ <Keyword>UefiRuntimeLib</Keyword>\r
+ </LibraryClass>\r
+ <LibraryClass Usage="ALWAYS_CONSUMED">\r
+ <Keyword>SerialPortLib</Keyword>\r
+ </LibraryClass>\r
+ <LibraryClass Usage="ALWAYS_CONSUMED">\r
+ <Keyword>OemHookStatusCodeLib</Keyword>\r
+ </LibraryClass>\r
+ <LibraryClass Usage="ALWAYS_CONSUMED">\r
+ <Keyword>EdkDxeSalLib</Keyword>\r
+ </LibraryClass>\r
+ </LibraryClassDefinitions>\r
+ <SourceFiles>\r
+ <Filename>DxeStatusCode.c</Filename>\r
+ <Filename>DataHubStatusCodeWorker.c</Filename>\r
+ <Filename>RtMemoryStatusCodeWorker.c</Filename>\r
+ <Filename>SerialStatusCodeWorker.c</Filename>\r
+ <Filename SupArchList="IA32">Common/DxeStatusCodeCommon.c</Filename>\r
+ <Filename SupArchList="IA32">Common/StatusCode.dxs</Filename>\r
+ <Filename SupArchList="X64">Common/DxeStatusCodeCommon.c</Filename>\r
+ <Filename SupArchList="X64">Common/StatusCode.dxs</Filename>\r
+ <Filename SupArchList="EBC">Common/DxeStatusCodeCommon.c</Filename>\r
+ <Filename SupArchList="EBC">Common/StatusCode.dxs</Filename>\r
+ <Filename SupArchList="IPF">Ipf/DxeStatusCodeIpf.c</Filename>\r
+ <Filename SupArchList="IPF">Ipf/StatusCode.dxs</Filename>\r
+ </SourceFiles>\r
+ <PackageDependencies>\r
+ <Package PackageGuid="5E0E9358-46B6-4AE2-8218-4AB8B9BBDCEC"/>\r
+ <Package PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674"/>\r
+ </PackageDependencies>\r
+ <Protocols>\r
+ <Protocol Usage="ALWAYS_CONSUMED">\r
+ <ProtocolCName>gEfiExtendedSalStatusCodeServicesProtocolGuid</ProtocolCName>\r
+ </Protocol>\r
+ <Protocol Usage="ALWAYS_CONSUMED">\r
+ <ProtocolCName>gEfiSerialIoProtocolGuid</ProtocolCName>\r
+ </Protocol>\r
+ <Protocol Usage="ALWAYS_CONSUMED">\r
+ <ProtocolCName>gEfiDataHubProtocolGuid</ProtocolCName>\r
+ </Protocol>\r
+ </Protocols>\r
+ <Guids> \r
+ <GuidCNames Usage="SOMETIMES_CONSUMED">\r
+ <GuidCName>gMemoryStatusCodeRecordGuid</GuidCName>\r
+ </GuidCNames>\r
+ <GuidCNames Usage="SOMETIMES_CONSUMED">\r
+ <GuidCName>gEfiStatusCodeDataTypeStringGuid</GuidCName>\r
+ </GuidCNames>\r
+ <GuidCNames Usage="SOMETIMES_CONSUMED">\r
+ <GuidCName>gEfiStatusCodeGuid</GuidCName>\r
+ </GuidCNames>\r
+ </Guids>\r
+ <Externs>\r
+ <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
+ <Specification>EDK_RELEASE_VERSION 0x00020000</Specification>\r
+ <Extern>\r
+ <ModuleEntryPoint>DxeStatusCodeDriverEntry</ModuleEntryPoint>\r
+ </Extern>\r
+ <Extern>\r
+ <SetVirtualAddressMapCallBack>VirtualAddressChangeCallBack</SetVirtualAddressMapCallBack>\r
+ </Extern>\r
+ </Externs>\r
+ <PcdCoded>\r
+ <PcdEntry PcdItemType="FEATURE_FLAG">\r
+ <C_Name>PcdStatusCodeUseHardSerial</C_Name>\r
+ <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <HelpText/>\r
+ </PcdEntry>\r
+ <PcdEntry PcdItemType="FEATURE_FLAG">\r
+ <C_Name>PcdStatusCodeUseEfiSerial</C_Name>\r
+ <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <HelpText/>\r
+ </PcdEntry>\r
+ <PcdEntry PcdItemType="FEATURE_FLAG">\r
+ <C_Name>PcdStatusCodeUseRuntimeMemory</C_Name>\r
+ <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <HelpText/>\r
+ </PcdEntry>\r
+ <PcdEntry PcdItemType="FEATURE_FLAG">\r
+ <C_Name>PcdStatusCodeUseDataHub</C_Name>\r
+ <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <HelpText/>\r
+ </PcdEntry>\r
+ <PcdEntry PcdItemType="FEATURE_FLAG">\r
+ <C_Name>PcdStatusCodeUseOEM</C_Name>\r
+ <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <HelpText/>\r
+ </PcdEntry>\r
+ <PcdEntry PcdItemType="FEATURE_FLAG">\r
+ <C_Name>PcdStatusCodeReplayInSerial</C_Name>\r
+ <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <HelpText/>\r
+ </PcdEntry>\r
+ <PcdEntry PcdItemType="FEATURE_FLAG">\r
+ <C_Name>PcdStatusCodeReplayInDataHub</C_Name>\r
+ <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <HelpText/>\r
+ </PcdEntry>\r
+ <PcdEntry PcdItemType="FEATURE_FLAG">\r
+ <C_Name>PcdStatusCodeReplayInRuntimeMemory</C_Name>\r
+ <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <HelpText/>\r
+ </PcdEntry>\r
+ <PcdEntry PcdItemType="FEATURE_FLAG">\r
+ <C_Name>PcdStatusCodeReplayInOEM</C_Name>\r
+ <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <HelpText/>\r
+ </PcdEntry>\r
+ <PcdEntry PcdItemType="DYNAMIC">\r
+ <C_Name>PcdStatusCodeRuntimeMemory</C_Name>\r
+ <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <HelpText/>\r
+ </PcdEntry>\r
+ </PcdCoded>\r
+</ModuleSurfaceArea>
\ No newline at end of file
--- /dev/null
+/** @file\r
+ Status code driver for IA32/X64/EBC architecture.\r
+\r
+// Copyright (c) 2006, Intel Corporation. All rights reserved. \r
+// This software and associated documentation (if any) is furnished\r
+// under a license and may only be used or copied in accordance\r
+// with the terms of the license. Except as permitted by such\r
+// license, no part of this software or documentation may be\r
+// reproduced, stored in a retrieval system, or transmitted in any\r
+// form or by any means without the express written consent of\r
+// Intel Corporation.\r
+\r
+ Module Name: DxeStatusCodeIpf.c\r
+\r
+**/\r
+\r
+#include "DxeStatusCode.h"\r
+\r
+\r
+//\r
+// Delaration of DXE status code controller \r
+//\r
+DXE_STATUS_CODE_CONTROLLER gDxeStatusCode = {\r
+ //\r
+ // Initialize nest status as non nested. \r
+ // \r
+ 0,\r
+ {NULL, NULL}\r
+};\r
+\r
+/**\r
+\r
+ Main entry for Extended SAL ReportStatusCode Services\r
+\r
+ @param FunctionId Function Id which needed to be called\r
+ @param Arg2 Efi status code type\r
+ @param Arg3 Efi status code value\r
+ @param Arg4 Instance number \r
+ @param Arg5 Caller Id\r
+ @param Arg6 Efi status code data\r
+ @param Arg7 Not used \r
+ @param Arg8 Not used \r
+ @param ExtendedSalProc Esal Proc pointer \r
+ @param VirtualMode If this function is called in virtual mode\r
+ @param Global This module's global variable pointer\r
+ \r
+ @return Value returned in SAL_RETURN_REGS\r
+\r
+--*/\r
+SAL_RETURN_REGS\r
+EFIAPI\r
+ReportEsalServiceEntry (\r
+ IN UINT64 FunctionId,\r
+ IN UINT64 Arg2,\r
+ IN UINT64 Arg3,\r
+ IN UINT64 Arg4,\r
+ IN UINT64 Arg5,\r
+ IN UINT64 Arg6,\r
+ IN UINT64 Arg7,\r
+ IN UINT64 Arg8,\r
+ IN SAL_EXTENDED_SAL_PROC ExtendedSalProc,\r
+ IN BOOLEAN VirtualMode,\r
+ IN VOID *Global\r
+ )\r
+{\r
+ SAL_RETURN_REGS ReturnVal;\r
+ DXE_STATUS_CODE_CONTROLLER *DxeStatusCode;\r
+\r
+ switch (FunctionId) {\r
+\r
+ case ReportStatusCodeService:\r
+\r
+ DxeStatusCode = (DXE_STATUS_CODE_CONTROLLER *) Global;\r
+\r
+ //\r
+ // Use atom operation to avoid the reentant of report.\r
+ // If current status is not zero, then the function is reentrancy.\r
+ //\r
+ if (InterlockedCompareExchange32 (&DxeStatusCode->StatusCodeNestStatus, 0, 1)) {\r
+ ReturnVal.Status = EFI_DEVICE_ERROR ;\r
+ return ReturnVal;\r
+ }\r
+\r
+ if (FeaturePcdGet (PcdStatusCodeUseEfiSerial) || FeaturePcdGet (PcdStatusCodeUseHardSerial)) {\r
+ SerialStatusCodeReportWorker (\r
+ (EFI_STATUS_CODE_TYPE) Arg2,\r
+ (EFI_STATUS_CODE_VALUE) Arg3,\r
+ (UINT32) Arg4,\r
+ (EFI_GUID *) Arg5,\r
+ (EFI_STATUS_CODE_DATA *) Arg6\r
+ );\r
+ }\r
+ if (FeaturePcdGet (PcdStatusCodeUseRuntimeMemory)) {\r
+ RtMemoryStatusCodeReportWorker (\r
+ DxeStatusCode->RtMemoryStatusCodeTable[VirtualMode],\r
+ (EFI_STATUS_CODE_TYPE) Arg2,\r
+ (EFI_STATUS_CODE_VALUE) Arg3,\r
+ (UINT32) Arg4\r
+ );\r
+ }\r
+ if (FeaturePcdGet (PcdStatusCodeUseDataHub)) {\r
+ DataHubStatusCodeReportWorker (\r
+ (EFI_STATUS_CODE_TYPE) Arg2,\r
+ (EFI_STATUS_CODE_VALUE) Arg3,\r
+ (UINT32) Arg4,\r
+ (EFI_GUID *) Arg5,\r
+ (EFI_STATUS_CODE_DATA *) Arg6\r
+ );\r
+ }\r
+ if (FeaturePcdGet (PcdStatusCodeUseOEM)) {\r
+ OemHookStatusCodeReport (\r
+ (EFI_STATUS_CODE_TYPE) Arg2,\r
+ (EFI_STATUS_CODE_VALUE) Arg3,\r
+ (UINT32) Arg4,\r
+ (EFI_GUID *) Arg5,\r
+ (EFI_STATUS_CODE_DATA *) Arg6\r
+ );\r
+ }\r
+\r
+ //\r
+ // Restore the nest status of report\r
+ //\r
+ InterlockedCompareExchange32 (&DxeStatusCode->StatusCodeNestStatus, 1, 0);\r
+\r
+ ReturnVal.Status = EFI_SUCCESS;\r
+\r
+ break;\r
+\r
+ default:\r
+ ReturnVal.Status = EFI_SAL_INVALID_ARGUMENT;\r
+ break;\r
+ }\r
+\r
+ return ReturnVal;\r
+}\r
+\r
+/**\r
+\r
+ Install the ReportStatusCode runtime service.\r
+\r
+ @param ImageHandle Image handle of the loaded driver\r
+ @param SystemTable Pointer to the System Table\r
+\r
+ @return The function always returns success.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+DxeStatusCodeDriverEntry (\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_SYSTEM_TABLE *SystemTable\r
+ )\r
+{\r
+ //\r
+ // Dispatch initialization request to supported devices\r
+ //\r
+ InitializationDispatcherWorker ();\r
+\r
+ //\r
+ // Initialize ESAL capabilities.\r
+ //\r
+ RegisterEsalClass (\r
+ &gEfiExtendedSalStatusCodeServicesProtocolGuid,\r
+ &gDxeStatusCode,\r
+ ReportEsalServiceEntry,\r
+ StatusCode,\r
+ NULL\r
+ );\r
+\r
+ return EFI_SUCCESS;\r
+}\r
+\r
+\r
+/**\r
+ Virtual address change notification call back. It converts physical mode global pointer to \r
+ virtual mode.\r
+\r
+ @param Event Event whose notification function is being invoked.\r
+ @param Context Pointer to the notification function¡¯s context, which is\r
+ always zero in current implementation.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+VirtualAddressChangeCallBack (\r
+ IN EFI_EVENT Event,\r
+ IN VOID *Context\r
+ )\r
+{\r
+ gDxeStatusCode.RtMemoryStatusCodeTable[VIRTUAL_MODE] = \r
+ gDxeStatusCode.RtMemoryStatusCodeTable[PHYSICAL_MODE];\r
+\r
+ //\r
+ // Convert the physical mode pointer to virtual mode point.\r
+ //\r
+ EfiConvertPointer (\r
+ 0,\r
+ (VOID **) &gDxeStatusCode.RtMemoryStatusCodeTable[VIRTUAL_MODE]\r
+ );\r
+}\r
+\r
--- /dev/null
+#/*++\r
+#\r
+// Copyright (c) 2006, Intel Corporation. All rights reserved. \r
+// This software and associated documentation (if any) is furnished\r
+// under a license and may only be used or copied in accordance\r
+// with the terms of the license. Except as permitted by such\r
+// license, no part of this software or documentation may be\r
+// reproduced, stored in a retrieval system, or transmitted in any\r
+// form or by any means without the express written consent of\r
+// Intel Corporation.\r
+# \r
+# Module Name:\r
+#\r
+# IpfStatusCode.dxs\r
+#\r
+# Abstract:\r
+#\r
+# Dependency expression source file.\r
+# \r
+#--*/ \r
+\r
+#include <AutoGen.h>\r
+#include <DxeDepex.h>\r
+\r
+DEPENDENCY_START\r
+ EFI_DATA_HUB_PROTOCOL_GUID AND EFI_EXTENDED_SAL_BASE_IO_SERVICES_PROTOCOL_GUID\r
+DEPENDENCY_END\r
--- /dev/null
+/** @file\r
+ Runtime memory status code worker in DXE.\r
+\r
+Copyright (c) 2006, Intel Corporation. All rights reserved. \r
+This software and associated documentation (if any) is furnished\r
+under a license and may only be used or copied in accordance\r
+with the terms of the license. Except as permitted by such\r
+license, no part of this software or documentation may be\r
+reproduced, stored in a retrieval system, or transmitted in any\r
+form or by any means without the express written consent of\r
+Intel Corporation.\r
+\r
+ Module Name: RtMemoryStatusCodeWorker.c\r
+\r
+**/\r
+\r
+#include "DxeStatusCode.h"\r
+\r
+/**\r
+ Initialize runtime memory status code.\r
+ \r
+ @return The function always return EFI_SUCCESS\r
+\r
+**/\r
+EFI_STATUS\r
+RtMemoryStatusCodeInitializeWorker (\r
+ VOID\r
+ )\r
+{\r
+ RUNTIME_MEMORY_STATUSCODE_HEADER *RtMemoryStatusCodeTable;\r
+\r
+ //\r
+ // Allocate runtime memory status code pool.\r
+ //\r
+ RtMemoryStatusCodeTable = \r
+ (RUNTIME_MEMORY_STATUSCODE_HEADER *) AllocatePool (\r
+ sizeof (RUNTIME_MEMORY_STATUSCODE_HEADER) + PcdGet16 (PcdStatusCodeRuntimeMemorySize) * 1024\r
+ );\r
+\r
+ ASSERT (NULL != RtMemoryStatusCodeTable);\r
+\r
+ RtMemoryStatusCodeTable->RecordIndex = 0;\r
+ RtMemoryStatusCodeTable->NumberOfRecords = 0;\r
+ RtMemoryStatusCodeTable->MaxRecordsNumber = \r
+ (PcdGet16 (PcdStatusCodeRuntimeMemorySize) * 1024) / sizeof (MEMORY_STATUSCODE_RECORD);\r
+\r
+ gDxeStatusCode.RtMemoryStatusCodeTable[PHYSICAL_MODE] = RtMemoryStatusCodeTable;\r
+ return EFI_SUCCESS;\r
+}\r
+\r
+\r
+/**\r
+ Report status code into runtime memory. If the runtime pool is full, roll back to the \r
+ first record and overwrite it.\r
+ \r
+ @param RtMemoryStatusCodeTable \r
+ Point to Runtime memory table header.\r
+\r
+ @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions¡± below.\r
+ \r
+ @param Value Describes the current status of a hardware or software entity. \r
+ This included information about the class and subclass that is used to classify the entity \r
+ as well as an operation. For progress codes, the operation is the current activity. \r
+ For error codes, it is the exception. For debug codes, it is not defined at this time. \r
+ Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below. \r
+ Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r
+ \r
+ @param Instance The enumeration of a hardware or software entity within the system. \r
+ A system may contain multiple entities that match a class/subclass pairing. \r
+ The instance differentiates between them. An instance of 0 indicates that instance information is unavailable, \r
+ not meaningful, or not relevant. Valid instance numbers start with 1.\r
+ \r
+ @return The function always return EFI_SUCCESS.\r
+\r
+**/\r
+EFI_STATUS\r
+RtMemoryStatusCodeReportWorker (\r
+ RUNTIME_MEMORY_STATUSCODE_HEADER *RtMemoryStatusCodeTable,\r
+ IN EFI_STATUS_CODE_TYPE CodeType,\r
+ IN EFI_STATUS_CODE_VALUE Value,\r
+ IN UINT32 Instance\r
+ )\r
+{\r
+ MEMORY_STATUSCODE_RECORD *Record;\r
+\r
+ ASSERT (NULL != RtMemoryStatusCodeTable);\r
+\r
+ //\r
+ // Locate current record buffer.\r
+ //\r
+ Record = (MEMORY_STATUSCODE_RECORD *) (RtMemoryStatusCodeTable + 1);\r
+ Record = &Record[RtMemoryStatusCodeTable->RecordIndex++];\r
+\r
+ //\r
+ // Save status code.\r
+ //\r
+ Record->CodeType = CodeType;\r
+ Record->Value = Value;\r
+ Record->Instance = Instance;\r
+\r
+ //\r
+ // Record total number of records, we compare the number with max records number,\r
+ // if it is bigger than the max number, then the roll back had happened, the record index points to \r
+ // the first record. if it is less then max number, then the zero index is the first record.\r
+ //\r
+ RtMemoryStatusCodeTable->NumberOfRecords++;\r
+ if (RtMemoryStatusCodeTable->RecordIndex == RtMemoryStatusCodeTable->MaxRecordsNumber) {\r
+ //\r
+ // Roll back record index.\r
+ //\r
+ RtMemoryStatusCodeTable->RecordIndex = 0;\r
+ }\r
+\r
+\r
+ return EFI_SUCCESS;\r
+}\r
+\r
+\r
+\r
--- /dev/null
+\r
+/** @file\r
+ Serial I/O status code reporting worker.\r
+\r
+Copyright (c) 2006, Intel Corporation. All rights reserved. \r
+This software and associated documentation (if any) is furnished\r
+under a license and may only be used or copied in accordance\r
+with the terms of the license. Except as permitted by such\r
+license, no part of this software or documentation may be\r
+reproduced, stored in a retrieval system, or transmitted in any\r
+form or by any means without the express written consent of\r
+Intel Corporation.\r
+\r
+ Module Name: SerialStatusCodeWorker.c\r
+\r
+**/\r
+\r
+EFI_SERIAL_IO_PROTOCOL *SerialIoProtocol;\r
+\r
+/**\r
+ Initialize serial status code worker.\r
+ \r
+ @return The function always return EFI_SUCCESS\r
+\r
+**/\r
+EFI_STATUS\r
+EfiSerialStatusCodeInitializeWorker (\r
+ VOID\r
+ )\r
+{\r
+ EFI_STATUS Status;\r
+\r
+ Status = gBS->LocateProtocol (\r
+ &gEfiSerialIoProtocolGuid,\r
+ NULL,\r
+ (VOID **) &SerialIoProtocol\r
+ );\r
+\r
+ ASSERT_EFI_ERROR (Status);\r
+\r
+ return EFI_SUCCESS;\r
+}\r
+\r
+\r
+/**\r
+ Convert status code value and extended data to readable ASCII string, send string to serial I/O device.\r
+ \r
+ @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions¡± below.\r
+ \r
+ @param Value Describes the current status of a hardware or software entity. \r
+ This included information about the class and subclass that is used to classify the entity \r
+ as well as an operation. For progress codes, the operation is the current activity. \r
+ For error codes, it is the exception. For debug codes, it is not defined at this time. \r
+ Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below. \r
+ Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r
+ \r
+ @param Instance The enumeration of a hardware or software entity within the system. \r
+ A system may contain multiple entities that match a class/subclass pairing. \r
+ The instance differentiates between them. An instance of 0 indicates that instance information is unavailable, \r
+ not meaningful, or not relevant. Valid instance numbers start with 1.\r
+\r
+\r
+ @param CallerId This optional parameter may be used to identify the caller. \r
+ This parameter allows the status code driver to apply different rules to different callers. \r
+ Type EFI_GUID is defined in InstallProtocolInterface() in the EFI 1.10 Specification.\r
+\r
+\r
+ @param Data This optional parameter may be used to pass additional data\r
+ \r
+ @return The function always return EFI_SUCCESS.\r
+\r
+**/\r
+EFI_STATUS\r
+SerialStatusCodeReportWorker (\r
+ IN EFI_STATUS_CODE_TYPE CodeType,\r
+ IN EFI_STATUS_CODE_VALUE Value,\r
+ IN UINT32 Instance,\r
+ IN EFI_GUID *CallerId,\r
+ IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r
+ )\r
+{\r
+ CHAR8 *Filename;\r
+ CHAR8 *Description;\r
+ CHAR8 *Format;\r
+ CHAR8 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE];\r
+ UINT32 ErrorLevel;\r
+ UINT32 LineNumber;\r
+ UINTN CharCount;\r
+ VA_LIST Marker;\r
+ EFI_DEBUG_INFO *DebugInfo;\r
+\r
+ Buffer[0] = '\0';\r
+\r
+ if (Data != NULL &&\r
+ ReportStatusCodeExtractAssertInfo (CodeType, Value, Data, &Filename, &Description, &LineNumber)) {\r
+ //\r
+ // Print ASSERT() information into output buffer.\r
+ //\r
+ CharCount = AsciiSPrint (\r
+ Buffer,\r
+ EFI_STATUS_CODE_DATA_MAX_SIZE,\r
+ "\n\rDXE_ASSERT!: %a (%d): %a\n\r",\r
+ Filename,\r
+ LineNumber,\r
+ Description\r
+ );\r
+ } else if (Data != NULL &&\r
+ ReportStatusCodeExtractDebugInfo (Data, &ErrorLevel, &Marker, &Format)) {\r
+ //\r
+ // Print DEBUG() information into output buffer.\r
+ //\r
+ CharCount = AsciiVSPrint (\r
+ Buffer, \r
+ EFI_STATUS_CODE_DATA_MAX_SIZE, \r
+ Format, \r
+ Marker\r
+ );\r
+ } else if (Data != NULL && \r
+ CompareGuid (&Data->Type, &gEfiStatusCodeSpecificDataGuid) &&\r
+ (CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) {\r
+ //\r
+ // Print specific data into output buffer.\r
+ //\r
+ DebugInfo = (EFI_DEBUG_INFO *) (Data + 1);\r
+ Marker = (VA_LIST) (DebugInfo + 1);\r
+ Format = (CHAR8 *) (((UINT64 *) Marker) + 12);\r
+\r
+ CharCount = AsciiVSPrint (Buffer, EFI_STATUS_CODE_DATA_MAX_SIZE, Format, Marker);\r
+ } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) {\r
+ //\r
+ // Print ERROR information into output buffer.\r
+ //\r
+ CharCount = AsciiSPrint (Buffer, EFI_STATUS_CODE_DATA_MAX_SIZE, "ERROR: C%x:V%x I%x", CodeType, Value, Instance);\r
+\r
+ //\r
+ // Make sure we don't try to print values that weren't intended to be printed, especially NULL GUID pointers.\r
+ //\r
+ \r
+ if (CallerId != NULL) {\r
+ CharCount += AsciiSPrint (\r
+ &Buffer[CharCount - 1],\r
+ (EFI_STATUS_CODE_DATA_MAX_SIZE - (sizeof (Buffer[0]) * CharCount)),\r
+ " %g",\r
+ CallerId\r
+ );\r
+ }\r
+\r
+ if (Data) {\r
+ CharCount += AsciiSPrint (\r
+ &Buffer[CharCount - 1],\r
+ (EFI_STATUS_CODE_DATA_MAX_SIZE - (sizeof (Buffer[0]) * CharCount)),\r
+ " %x",\r
+ Data\r
+ );\r
+ }\r
+\r
+ CharCount += AsciiSPrint (\r
+ &Buffer[CharCount - 1],\r
+ (EFI_STATUS_CODE_DATA_MAX_SIZE - (sizeof (Buffer[0]) * CharCount)),\r
+ "\n\r"\r
+ );\r
+ } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) {\r
+ CharCount = AsciiSPrint (Buffer, EFI_STATUS_CODE_DATA_MAX_SIZE, "PROGRESS CODE: V%x I%x\n\r", Value, Instance);\r
+ } else {\r
+ CharCount = AsciiSPrint (Buffer, EFI_STATUS_CODE_DATA_MAX_SIZE, "Undefined: C%x:V%x I%x\n\r", CodeType, Value, Instance);\r
+ }\r
+\r
+\r
+ if (FeaturePcdGet (PcdStatusCodeUseHardSerial)) {\r
+ //\r
+ // Callout to SerialPort Lib function to do print.\r
+ //\r
+ SerialPortWrite (Buffer, CharCount);\r
+ }\r
+ if (FeaturePcdGet (PcdStatusCodeUseEfiSerial)) {\r
+ SerialIoProtocol->Write (\r
+ SerialIoProtocol,\r
+ &CharCount,\r
+ Buffer\r
+ );\r
+ }\r
+\r
+ return EFI_SUCCESS;\r
+}\r
--- /dev/null
+/** @file\r
+ Memory status code worker in PEI.\r
+\r
+Copyright (c) 2006, Intel Corporation. All rights reserved. \r
+This software and associated documentation (if any) is furnished\r
+under a license and may only be used or copied in accordance\r
+with the terms of the license. Except as permitted by such\r
+license, no part of this software or documentation may be\r
+reproduced, stored in a retrieval system, or transmitted in any\r
+form or by any means without the express written consent of\r
+Intel Corporation.\r
+\r
+ Module Name: MemoryStatusCodeWorker.c\r
+\r
+**/\r
+\r
+/**\r
+ Create one memory status code GUID'ed HOB, use PacketIndex \r
+ to identify the packet.\r
+\r
+ @param PacketIndex Index of records packet. \r
+ \r
+ @return The function always return EFI_SUCCESS\r
+\r
+**/\r
+MEMORY_STATUSCODE_PACKET_HEADER *\r
+CreateMemoryStatusCodePacket (\r
+ UINT16 PacketIndex\r
+ )\r
+{\r
+ MEMORY_STATUSCODE_PACKET_HEADER *PacketHeader;\r
+\r
+ //\r
+ // Build GUID'ed HOB with PCD defined size.\r
+ //\r
+ PacketHeader =\r
+ (MEMORY_STATUSCODE_PACKET_HEADER *) BuildGuidHob (\r
+ &gMemoryStatusCodeRecordGuid, \r
+ (PcdGet16 (PcdStatusCodeMemorySize) * 1024) + sizeof (MEMORY_STATUSCODE_PACKET_HEADER));\r
+ ASSERT (PacketHeader != NULL);\r
+\r
+ PacketHeader->MaxRecordsNumber = (PcdGet16 (PcdStatusCodeMemorySize) * 1024)/ sizeof (MEMORY_STATUSCODE_RECORD);\r
+ PacketHeader->PacketIndex = PacketIndex;\r
+ PacketHeader->RecordIndex = 0;\r
+\r
+ return PacketHeader;\r
+}\r
+\r
+\r
+\r
+/**\r
+ Initialize memory status code.\r
+ Create one GUID'ed HOB with PCD defined size. If create required size \r
+ GUID'ed HOB failed, then ASSERT().\r
+ \r
+ @return The function always return EFI_SUCCESS\r
+\r
+**/\r
+EFI_STATUS\r
+MemoryStatusCodeInitializeWorker (\r
+ VOID\r
+ )\r
+{\r
+ //\r
+ // Create first memory status code GUID'ed HOB.\r
+ //\r
+ CreateMemoryStatusCodePacket (0);\r
+\r
+ return EFI_SUCCESS;\r
+}\r
+\r
+\r
+/**\r
+ Report status code into GUID'ed HOB..\r
+ \r
+ @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions¡± below.\r
+ \r
+ @param Value Describes the current status of a hardware or software entity. \r
+ This included information about the class and subclass that is used to classify the entity \r
+ as well as an operation. For progress codes, the operation is the current activity. \r
+ For error codes, it is the exception. For debug codes, it is not defined at this time. \r
+ Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below. \r
+ Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r
+ \r
+ @param Instance The enumeration of a hardware or software entity within the system. \r
+ A system may contain multiple entities that match a class/subclass pairing. \r
+ The instance differentiates between them. An instance of 0 indicates that instance information is unavailable, \r
+ not meaningful, or not relevant. Valid instance numbers start with 1.\r
+ \r
+ @return The function always return EFI_SUCCESS.\r
+\r
+**/\r
+EFI_STATUS\r
+MemoryStatusCodeReportWorker (\r
+ IN EFI_STATUS_CODE_TYPE CodeType,\r
+ IN EFI_STATUS_CODE_VALUE Value,\r
+ IN UINT32 Instance\r
+ )\r
+{\r
+\r
+ EFI_PEI_HOB_POINTERS Hob;\r
+ MEMORY_STATUSCODE_PACKET_HEADER *PacketHeader;\r
+ MEMORY_STATUSCODE_RECORD *Record = NULL;\r
+ UINT16 PacketIndex = 0;;\r
+\r
+ //\r
+ // Journal GUID'ed HOBs to find empty record entry, if found, then save status code in it.\r
+ // otherwise, create a new GUID'ed HOB.\r
+ //\r
+ Hob.Raw = GetFirstGuidHob (&gMemoryStatusCodeRecordGuid);\r
+ while (Hob.Raw != NULL) {\r
+ PacketHeader = (MEMORY_STATUSCODE_PACKET_HEADER *) GET_GUID_HOB_DATA (Hob.Guid);\r
+\r
+ //\r
+ // Check whether pccket is full or not.\r
+ //\r
+ if (PacketHeader->RecordIndex < PacketHeader->MaxRecordsNumber) {\r
+ Record = (MEMORY_STATUSCODE_RECORD *) (PacketHeader + 1);\r
+ Record = &Record[PacketHeader->RecordIndex++];\r
+ break;\r
+ }\r
+ //\r
+ // Cache number of found packet in PacketIndex.\r
+ //\r
+ PacketIndex++;\r
+\r
+ Hob.Raw = GetNextGuidHob (&gMemoryStatusCodeRecordGuid, Hob.Raw);\r
+ }\r
+\r
+ if (NULL == Record) {\r
+ //\r
+ // In order to save status code , create new packet. \r
+ //\r
+ PacketHeader = CreateMemoryStatusCodePacket (PacketIndex);\r
+\r
+ Record = (MEMORY_STATUSCODE_RECORD *) (PacketHeader + 1); \r
+ Record = &Record[PacketHeader->RecordIndex++];\r
+ }\r
+\r
+ Record->CodeType = CodeType;\r
+ Record->Instance = Instance;\r
+ Record->Value = Value;\r
+\r
+ return EFI_SUCCESS;\r
+}\r
--- /dev/null
+\r
+/** @file\r
+ Generic PeiStatusCode Module.\r
+\r
+// Copyright (c) 2006, Intel Corporation. All rights reserved. \r
+// This software and associated documentation (if any) is furnished\r
+// under a license and may only be used or copied in accordance\r
+// with the terms of the license. Except as permitted by such\r
+// license, no part of this software or documentation may be\r
+// reproduced, stored in a retrieval system, or transmitted in any\r
+// form or by any means without the express written consent of\r
+// Intel Corporation.\r
+\r
+ Module Name: PeiStatusCode.c\r
+\r
+**/\r
+\r
+#include "PeiStatusCode.h"\r
+\r
+/**\r
+ Report status code to all supported device.\r
+ * \r
+ * \r
+ @param PeiServices\r
+\r
+ @param Type Indicates the type of status code being reported. \r
+ The type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.\r
+ @param Value Describes the current status of a hardware or software entity. \r
+ This includes information about the class and subclass that is used to classify the entity \r
+ as well as an operation. For progress codes, the operation is the current activity. \r
+ For error codes, it is the exception. For debug codes, it is not defined at this time. \r
+ Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below. \r
+ Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r
+ @param Instance The enumeration of a hardware or software entity within the system. \r
+ A system may contain multiple entities that match a class/subclass pairing. \r
+ The instance differentiates between them. An instance of 0 indicates that instance \r
+ information is unavailable, not meaningful, or not relevant. Valid instance numbers start with 1.\r
+ @param CallerId This optional parameter may be used to identify the caller. \r
+ This parameter allows the status code driver to apply different rules to different callers.\r
+ @param Data This optional parameter may be used to pass additional data. \r
+ Type EFI_STATUS_CODE_DATA is defined in "Related Definitions" below. \r
+ The contents of this data type may have additional GUID-specific data. The standard GUIDs and \r
+ their associated data structures are defined in the Intel? Platform Innovation Framework for EFI Status Codes Specification.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+ReportDispatcher (\r
+ IN EFI_PEI_SERVICES **PeiServices,\r
+ IN EFI_STATUS_CODE_TYPE Type,\r
+ IN EFI_STATUS_CODE_VALUE Value,\r
+ IN UINT32 Instance,\r
+ IN EFI_GUID *CallerId OPTIONAL,\r
+ IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r
+ );\r
+\r
+\r
+EFI_PEI_PROGRESS_CODE_PPI mStatusCodePpi = { \r
+ ReportDispatcher\r
+ };\r
+\r
+EFI_PEI_PPI_DESCRIPTOR mStatusCodePpiDescriptor = {\r
+ EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,\r
+ &gEfiPeiStatusCodePpiGuid,\r
+ &mStatusCodePpi\r
+ };\r
+\r
+/**\r
+ Report status code to all supported device.\r
+ * \r
+ * \r
+ @param PeiServices\r
+\r
+ @param CodeType Indicates the type of status code being reported. \r
+ The type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.\r
+ @param Value Describes the current status of a hardware or software entity. \r
+ This includes information about the class and subclass that is used to classify the entity \r
+ as well as an operation. For progress codes, the operation is the current activity. \r
+ For error codes, it is the exception. For debug codes, it is not defined at this time. \r
+ Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below. \r
+ Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r
+ @param Instance The enumeration of a hardware or software entity within the system. \r
+ A system may contain multiple entities that match a class/subclass pairing. \r
+ The instance differentiates between them. An instance of 0 indicates that instance \r
+ information is unavailable, not meaningful, or not relevant. Valid instance numbers start with 1.\r
+ @param CallerId This optional parameter may be used to identify the caller. \r
+ This parameter allows the status code driver to apply different rules to different callers.\r
+ @param Data This optional parameter may be used to pass additional data. \r
+ Type EFI_STATUS_CODE_DATA is defined in "Related Definitions" below. \r
+ The contents of this data type may have additional GUID-specific data. The standard GUIDs and \r
+ their associated data structures are defined in the Intel? Platform Innovation Framework for EFI Status Codes Specification.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+ReportDispatcher (\r
+ IN EFI_PEI_SERVICES **PeiServices,\r
+ IN EFI_STATUS_CODE_TYPE CodeType,\r
+ IN EFI_STATUS_CODE_VALUE Value,\r
+ IN UINT32 Instance,\r
+ IN EFI_GUID *CallerId OPTIONAL,\r
+ IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r
+ )\r
+{\r
+ if (FeaturePcdGet (PcdStatusCodeUseSerial)) {\r
+ SerialStatusCodeReportWorker (\r
+ CodeType,\r
+ Value,\r
+ Instance,\r
+ CallerId,\r
+ Data\r
+ );\r
+ }\r
+ if (FeaturePcdGet (PcdStatusCodeUseMemory)) {\r
+ MemoryStatusCodeReportWorker (\r
+ CodeType,\r
+ Value,\r
+ Instance\r
+ );\r
+ }\r
+ if (FeaturePcdGet (PcdStatusCodeUseOEM)) {\r
+ OemHookStatusCodeReport (\r
+ CodeType,\r
+ Value,\r
+ Instance,\r
+ CallerId,\r
+ Data\r
+ );\r
+ }\r
+\r
+ return EFI_SUCCESS;\r
+}\r
+\r
+/**\r
+ Initialize PEI status codes and publish the status code \r
+ PPI.\r
+\r
+ @param FfsHeader FV this PEIM was loaded from.\r
+ @param PeiServices General purpose services available to every PEIM.\r
+ \r
+ @return The function always returns success.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+PeiStatusCodeDriverEntry (\r
+ IN EFI_FFS_FILE_HEADER *FfsHeader,\r
+ IN EFI_PEI_SERVICES **PeiServices\r
+ )\r
+{\r
+ EFI_STATUS Status;\r
+\r
+ //\r
+ // Dispatch initialization request to sub-statuscode-devices.\r
+ // If enable UseSerial, then initialize serial port.\r
+ // if enable UseMemory, then initialize memory status code worker.\r
+ // if enable UseOEM, then initialize Oem status code.\r
+ //\r
+ if (FeaturePcdGet (PcdStatusCodeUseSerial)) {\r
+ SerialPortInitialize();\r
+ }\r
+ if (FeaturePcdGet (PcdStatusCodeUseMemory)) {\r
+ MemoryStatusCodeInitializeWorker ();\r
+ }\r
+ if (FeaturePcdGet (PcdStatusCodeUseOEM)) {\r
+ OemHookStatusCodeInitialize ();\r
+ }\r
+\r
+ //\r
+ // Install PeiStatusCodePpi. \r
+ // PeiServices use this Ppi to output status code.\r
+ // use library\r
+ Status = PeiServicesInstallPpi (&mStatusCodePpiDescriptor);\r
+ ASSERT_EFI_ERROR (Status);\r
+ \r
+ return EFI_SUCCESS;\r
+}\r
+\r
--- /dev/null
+\r
+/** @file\r
+ Heade file of status code PEIM\r
+\r
+ Copyright (c) 2006, Intel Corporation\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+ Module Name: PeiStatusCode.h\r
+\r
+**/\r
+\r
+#ifndef __PEI_STATUS_CODE_H__\r
+#define __PEI_STATUS_CODE_H__\r
+\r
+\r
+/**\r
+ Convert status code value and extended data to readable ASCII string, send string to serial I/O device.\r
+ \r
+ @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions¡± below.\r
+ \r
+ @param Value Describes the current status of a hardware or software entity. \r
+ This included information about the class and subclass that is used to classify the entity \r
+ as well as an operation. For progress codes, the operation is the current activity. \r
+ For error codes, it is the exception. For debug codes, it is not defined at this time. \r
+ Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below. \r
+ Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r
+ \r
+ @param Instance The enumeration of a hardware or software entity within the system. \r
+ A system may contain multiple entities that match a class/subclass pairing. \r
+ The instance differentiates between them. An instance of 0 indicates that instance information is unavailable, \r
+ not meaningful, or not relevant. Valid instance numbers start with 1.\r
+\r
+\r
+ @param CallerId This optional parameter may be used to identify the caller. \r
+ This parameter allows the status code driver to apply different rules to different callers. \r
+ Type EFI_GUID is defined in InstallProtocolInterface() in the EFI 1.10 Specification.\r
+\r
+\r
+ @param Data This optional parameter may be used to pass additional data\r
+ \r
+ @return The function always return EFI_SUCCESS.\r
+\r
+**/\r
+EFI_STATUS\r
+SerialStatusCodeReportWorker (\r
+ IN EFI_STATUS_CODE_TYPE CodeType,\r
+ IN EFI_STATUS_CODE_VALUE Value,\r
+ IN UINT32 Instance,\r
+ IN EFI_GUID *CallerId,\r
+ IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r
+ );\r
+\r
+\r
+/**\r
+ Initialize memory status code.\r
+ Create one GUID'ed HOB with PCD defined size. If create required size \r
+ GUID'ed HOB failed, then ASSERT().\r
+ \r
+ @return The function always return EFI_SUCCESS\r
+\r
+**/\r
+EFI_STATUS\r
+MemoryStatusCodeInitializeWorker (\r
+ VOID\r
+ );\r
+\r
+/**\r
+ Report status code into GUID'ed HOB.\r
+ \r
+ @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions¡± below.\r
+ \r
+ @param Value Describes the current status of a hardware or software entity. \r
+ This included information about the class and subclass that is used to classify the entity \r
+ as well as an operation. For progress codes, the operation is the current activity. \r
+ For error codes, it is the exception. For debug codes, it is not defined at this time. \r
+ Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below. \r
+ Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r
+ \r
+ @param Instance The enumeration of a hardware or software entity within the system. \r
+ A system may contain multiple entities that match a class/subclass pairing. \r
+ The instance differentiates between them. An instance of 0 indicates that instance information is unavailable, \r
+ not meaningful, or not relevant. Valid instance numbers start with 1.\r
+ \r
+ @return The function always return EFI_SUCCESS.\r
+\r
+**/\r
+EFI_STATUS\r
+MemoryStatusCodeReportWorker (\r
+ IN EFI_STATUS_CODE_TYPE CodeType,\r
+ IN EFI_STATUS_CODE_VALUE Value,\r
+ IN UINT32 Instance\r
+ );\r
+\r
+#endif\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--Copyright (c) 2006, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.-->\r
+<ModuleSurfaceArea xsi:schemaLocation="http://www.TianoCore.org/2006/Edk2.0 http://www.TianoCore.org/2006/Edk2.0/SurfaceArea.xsd" xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
+ <MsaHeader>\r
+ <ModuleName>PeiStatusCode</ModuleName>\r
+ <ModuleType>PEIM</ModuleType>\r
+ <GuidValue>1EC0F53A-FDE0-4576-8F25-7A1A410F58EB</GuidValue>\r
+ <Version>1.0</Version>\r
+ <Abstract>Generic Status code Pei driver</Abstract>\r
+ <Description>Customized output devices based on feature flags.</Description>\r
+ <Copyright>Copyright (c) 2006, Intel Corporation.</Copyright>\r
+ <License>All rights reserved.\r
+ This software and associated documentation (if any) is furnished\r
+ under a license and may only be used or copied in accordance\r
+ with the terms of the license. Except as permitted by such\r
+ license, no part of this software or documentation may be\r
+ reproduced, stored in a retrieval system, or transmitted in any\r
+ form or by any means without the express written consent of\r
+ Intel Corporation.</License>\r
+ <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>\r
+ </MsaHeader>\r
+ <ModuleDefinitions>\r
+ <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>\r
+ <BinaryModule>false</BinaryModule>\r
+ <OutputFileBasename>PeiStatusCode</OutputFileBasename>\r
+ </ModuleDefinitions>\r
+ <LibraryClassDefinitions>\r
+ <LibraryClass Usage="ALWAYS_CONSUMED">\r
+ <Keyword>BaseLib</Keyword>\r
+ </LibraryClass>\r
+ <LibraryClass Usage="ALWAYS_CONSUMED">\r
+ <Keyword>BaseMemoryLib</Keyword>\r
+ </LibraryClass>\r
+ <LibraryClass Usage="ALWAYS_CONSUMED">\r
+ <Keyword>DebugLib</Keyword>\r
+ </LibraryClass>\r
+ <LibraryClass Usage="ALWAYS_CONSUMED">\r
+ <Keyword>PrintLib</Keyword>\r
+ </LibraryClass>\r
+ <LibraryClass Usage="ALWAYS_CONSUMED">\r
+ <Keyword>ReportStatusCodeLib</Keyword>\r
+ </LibraryClass>\r
+ <LibraryClass Usage="ALWAYS_CONSUMED">\r
+ <Keyword>SerialPortLib</Keyword>\r
+ </LibraryClass>\r
+ <LibraryClass Usage="ALWAYS_CONSUMED">\r
+ <Keyword>HobLib</Keyword>\r
+ </LibraryClass>\r
+ <LibraryClass Usage="ALWAYS_CONSUMED">\r
+ <Keyword>PcdLib</Keyword>\r
+ </LibraryClass>\r
+ <LibraryClass Usage="ALWAYS_CONSUMED">\r
+ <Keyword>PeiServicesLib</Keyword>\r
+ </LibraryClass>\r
+ <LibraryClass Usage="ALWAYS_CONSUMED">\r
+ <Keyword>OemHookStatusCodeLib</Keyword>\r
+ </LibraryClass>\r
+ </LibraryClassDefinitions>\r
+ <SourceFiles>\r
+ <Filename>SerialStatusCodeWorker.c</Filename>\r
+ <Filename>MemoryStausCodeWorker.c</Filename>\r
+ <Filename>PeiStatusCode.c</Filename>\r
+ <Filename>PeiStatusCode.c</Filename>\r
+ </SourceFiles>\r
+ <PackageDependencies>\r
+ <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
+ <Package PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674"/>\r
+ </PackageDependencies>\r
+ <PPIs>\r
+ <Ppi Usage="ALWAYS_CONSUMED">\r
+ <PpiCName>gEfiPeiStatusCodePpiGuid</PpiCName>\r
+ </Ppi>\r
+ </PPIs>\r
+ <Guids> \r
+ <GuidCNames Usage="SOMETIMES_CONSUMED">\r
+ <GuidCName>gMemoryStatusCodeRecordGuid</GuidCName>\r
+ </GuidCNames>\r
+ </Guids>\r
+ <Externs>\r
+ <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
+ <Specification>EDK_RELEASE_VERSION 0x00020000</Specification>\r
+ <Extern>\r
+ <ModuleEntryPoint>PeiStatusCodeDriverEntry</ModuleEntryPoint>\r
+ </Extern>\r
+ </Externs>\r
+ <PcdCoded>\r
+ <PcdEntry PcdItemType="FEATURE_FLAG">\r
+ <C_Name>PcdStatusCodeUseSerial</C_Name>\r
+ <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <HelpText/>\r
+ </PcdEntry>\r
+ <PcdEntry PcdItemType="FEATURE_FLAG">\r
+ <C_Name>PcdStatusCodeUseMemory</C_Name>\r
+ <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <HelpText/>\r
+ </PcdEntry>\r
+ <PcdEntry PcdItemType="FEATURE_FLAG">\r
+ <C_Name>PcdStatusCodeUseOEM</C_Name>\r
+ <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <HelpText/>\r
+ </PcdEntry>\r
+ <PcdEntry PcdItemType="DYNAMIC">\r
+ <C_Name>PcdStatusCodeMemorySize</C_Name>\r
+ <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+ <HelpText/>\r
+ </PcdEntry>\r
+ </PcdCoded>\r
+</ModuleSurfaceArea>\r
--- /dev/null
+\r
+/** @file\r
+ Serial I/O status code reporting worker.\r
+\r
+Copyright (c) 2006, Intel Corporation. All rights reserved. \r
+This software and associated documentation (if any) is furnished\r
+under a license and may only be used or copied in accordance\r
+with the terms of the license. Except as permitted by such\r
+license, no part of this software or documentation may be\r
+reproduced, stored in a retrieval system, or transmitted in any\r
+form or by any means without the express written consent of\r
+Intel Corporation.\r
+\r
+ Module Name: SerialStatusCodeWorker.c\r
+\r
+**/\r
+\r
+/**\r
+ Convert status code value and extended data to readable ASCII string, send string to serial I/O device.\r
+ \r
+ @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions¡± below.\r
+ \r
+ @param Value Describes the current status of a hardware or software entity. \r
+ This included information about the class and subclass that is used to classify the entity \r
+ as well as an operation. For progress codes, the operation is the current activity. \r
+ For error codes, it is the exception. For debug codes, it is not defined at this time. \r
+ Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below. \r
+ Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r
+ \r
+ @param Instance The enumeration of a hardware or software entity within the system. \r
+ A system may contain multiple entities that match a class/subclass pairing. \r
+ The instance differentiates between them. An instance of 0 indicates that instance information is unavailable, \r
+ not meaningful, or not relevant. Valid instance numbers start with 1.\r
+\r
+\r
+ @param CallerId This optional parameter may be used to identify the caller. \r
+ This parameter allows the status code driver to apply different rules to different callers. \r
+ Type EFI_GUID is defined in InstallProtocolInterface() in the EFI 1.10 Specification.\r
+\r
+\r
+ @param Data This optional parameter may be used to pass additional data\r
+ \r
+ @return The function always return EFI_SUCCESS.\r
+\r
+**/\r
+EFI_STATUS\r
+SerialStatusCodeReportWorker (\r
+ IN EFI_STATUS_CODE_TYPE CodeType,\r
+ IN EFI_STATUS_CODE_VALUE Value,\r
+ IN UINT32 Instance,\r
+ IN EFI_GUID *CallerId,\r
+ IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r
+ )\r
+{\r
+ CHAR8 *Filename;\r
+ CHAR8 *Description;\r
+ CHAR8 *Format;\r
+ CHAR8 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE];\r
+ UINT32 ErrorLevel;\r
+ UINT32 LineNumber;\r
+ UINTN CharCount;\r
+ VA_LIST Marker;\r
+ EFI_DEBUG_INFO *DebugInfo;\r
+\r
+ Buffer[0] = '\0';\r
+\r
+ if (Data != NULL &&\r
+ ReportStatusCodeExtractAssertInfo (CodeType, Value, Data, &Filename, &Description, &LineNumber)) {\r
+ //\r
+ // Print ASSERT() information into output buffer.\r
+ //\r
+ CharCount = AsciiSPrint (\r
+ Buffer,\r
+ EFI_STATUS_CODE_DATA_MAX_SIZE,\r
+ "\n\rPEI_ASSERT!: %a (%d): %a\n\r",\r
+ Filename,\r
+ LineNumber,\r
+ Description\r
+ );\r
+ } else if (Data != NULL &&\r
+ ReportStatusCodeExtractDebugInfo (Data, &ErrorLevel, &Marker, &Format)) {\r
+ //\r
+ // Print DEBUG() information into output buffer.\r
+ //\r
+ CharCount = AsciiVSPrint (\r
+ Buffer, \r
+ EFI_STATUS_CODE_DATA_MAX_SIZE, \r
+ Format, \r
+ Marker\r
+ );\r
+ } else if (Data != NULL && \r
+ CompareGuid (&Data->Type, &gEfiStatusCodeSpecificDataGuid) &&\r
+ (CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) {\r
+ //\r
+ // Print specific data into output buffer.\r
+ //\r
+ DebugInfo = (EFI_DEBUG_INFO *) (Data + 1);\r
+ Marker = (VA_LIST) (DebugInfo + 1);\r
+ Format = (CHAR8 *) (((UINT64 *) Marker) + 12);\r
+\r
+ CharCount = AsciiVSPrint (Buffer, EFI_STATUS_CODE_DATA_MAX_SIZE, Format, Marker);\r
+ } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) {\r
+ //\r
+ // Print ERROR information into output buffer.\r
+ //\r
+ CharCount = AsciiSPrint (Buffer, EFI_STATUS_CODE_DATA_MAX_SIZE, "ERROR: C%x:V%x I%x", CodeType, Value, Instance);\r
+\r
+ //\r
+ // Make sure we don't try to print values that weren't intended to be printed, especially NULL GUID pointers.\r
+ //\r
+ \r
+ if (CallerId != NULL) {\r
+ CharCount += AsciiSPrint (\r
+ &Buffer[CharCount - 1],\r
+ (EFI_STATUS_CODE_DATA_MAX_SIZE - (sizeof (Buffer[0]) * CharCount)),\r
+ " %g",\r
+ CallerId\r
+ );\r
+ }\r
+\r
+ if (Data) {\r
+ CharCount += AsciiSPrint (\r
+ &Buffer[CharCount - 1],\r
+ (EFI_STATUS_CODE_DATA_MAX_SIZE - (sizeof (Buffer[0]) * CharCount)),\r
+ " %x",\r
+ Data\r
+ );\r
+ }\r
+\r
+ CharCount += AsciiSPrint (\r
+ &Buffer[CharCount - 1],\r
+ (EFI_STATUS_CODE_DATA_MAX_SIZE - (sizeof (Buffer[0]) * CharCount)),\r
+ "\n\r"\r
+ );\r
+ } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) {\r
+ CharCount = AsciiSPrint (Buffer, EFI_STATUS_CODE_DATA_MAX_SIZE, "PROGRESS CODE: V%x I%x\n\r", Value, Instance);\r
+ } else {\r
+ CharCount = AsciiSPrint (Buffer, EFI_STATUS_CODE_DATA_MAX_SIZE, "Undefined: C%x:V%x I%x\n\r", CodeType, Value, Instance);\r
+ }\r
+\r
+ //\r
+ // Callout to SerialPort Lib function to do print.\r
+ //\r
+ SerialPortWrite (Buffer, CharCount);\r
+\r
+ return EFI_SUCCESS;\r
+}\r
+++ /dev/null
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation \r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-\r
-Module Name:\r
-\r
- DebugAssert.c\r
-\r
-Abstract:\r
-\r
- Produce EfiDebugAssertProtocol to enable EfiUtilityLib to function.\r
- The EfiUtilityLib is used by the EFI shell!\r
-\r
---*/\r
-\r
-#include "StatusCode.h"\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-StatusCodeDebugAssert (\r
- IN EFI_DEBUG_ASSERT_PROTOCOL *This,\r
- IN CHAR8 *FileName,\r
- IN INTN LineNumber,\r
- IN CHAR8 *Description\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-StatusCodeDebugPrint (\r
- IN EFI_DEBUG_ASSERT_PROTOCOL *This,\r
- IN UINTN ErrorLevel,\r
- IN CHAR8 *Format,\r
- IN VA_LIST Marker\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-StatusCodePostCode (\r
- IN EFI_DEBUG_ASSERT_PROTOCOL * This,\r
- IN UINT16 PostCode,\r
- IN CHAR8 *PostCodeString OPTIONAL\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-StatusCodeGetErrorLevel (\r
- IN EFI_DEBUG_ASSERT_PROTOCOL *This,\r
- IN UINTN *ErrorLevel\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-StatusCodeSetErrorLevel (\r
- IN EFI_DEBUG_ASSERT_PROTOCOL *This,\r
- IN UINTN ErrorLevel\r
- );\r
-\r
-//\r
-// Protocol instance, there can be only one.\r
-//\r
-EFI_HANDLE mHandle = NULL;\r
-EFI_DEBUG_ASSERT_PROTOCOL mDebugAssertProtocol = {\r
- StatusCodeDebugAssert,\r
- StatusCodeDebugPrint,\r
- StatusCodePostCode,\r
- StatusCodeGetErrorLevel,\r
- StatusCodeSetErrorLevel\r
-};\r
-\r
-//\r
-// Function implementations\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-StatusCodeDebugAssert (\r
- IN EFI_DEBUG_ASSERT_PROTOCOL *This,\r
- IN CHAR8 *FileName,\r
- IN INTN LineNumber,\r
- IN CHAR8 *Description\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Worker function for ASSERT (). If Error Logging hub is loaded log ASSERT\r
- information. If Error Logging hub is not loaded CpuBreakpoint ().\r
- \r
-Arguments:\r
-\r
- This - Protocol instance.\r
- FileName - File name of failing routine.\r
- LineNumber - Line number of failing ASSERT().\r
- Description - Description, usually the assertion,\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS The function always completes successfully.\r
-\r
---*/\r
-{\r
- DebugAssert (FileName, LineNumber, Description);\r
-\r
- return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-StatusCodeDebugPrint (\r
- IN EFI_DEBUG_ASSERT_PROTOCOL *This,\r
- IN UINTN ErrorLevel,\r
- IN CHAR8 *Format,\r
- IN VA_LIST Marker\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Worker function for DEBUG (). If Error Logging hub is loaded log ASSERT\r
- information. If Error Logging hub is not loaded do nothing.\r
- \r
-Arguments:\r
-\r
- This - Protocol Instance.\r
- ErrorLevel - If error level is set do the debug print.\r
- Format - String to use for the print, followed by Print arguments.\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS The function always completes successfully.\r
-\r
---*/\r
-{\r
- CHAR8 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE];\r
-\r
- AsciiVSPrint (Buffer, EFI_STATUS_CODE_DATA_MAX_SIZE, Format, Marker);\r
- DebugPrint (ErrorLevel, Buffer);\r
-\r
- return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-StatusCodeGetErrorLevel (\r
- IN EFI_DEBUG_ASSERT_PROTOCOL *This,\r
- IN UINTN *ErrorLevel\r
- )\r
-{\r
- *ErrorLevel = PcdGet32(PcdDebugPrintErrorLevel);\r
- return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-StatusCodeSetErrorLevel (\r
- IN EFI_DEBUG_ASSERT_PROTOCOL *This,\r
- IN UINTN ErrorLevel\r
- )\r
-{\r
- return EFI_UNSUPPORTED;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-StatusCodePostCode (\r
- IN EFI_DEBUG_ASSERT_PROTOCOL * This,\r
- IN UINT16 PostCode,\r
- IN CHAR8 *PostCodeString OPTIONAL\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Write the code to IO ports 80 and 81.\r
-\r
-Arguments:\r
-\r
- This - Protocol Instance.\r
- PostCode - Code to write\r
- PostCodeString - String, currently ignored.\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS The function always completes successfully.\r
-\r
---*/\r
-{\r
- IoWrite8 (0x80, (UINT8) (PostCode & 0xff));\r
- IoWrite8 (0x81, (UINT8) (PostCode >> 8));\r
-\r
- return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-InstallStatusCodeDebugAssert (\r
- VOID\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Install the status code debug assert protocol\r
-\r
-Arguments:\r
-\r
- None\r
-\r
-Returns:\r
-\r
- Results of call to InstallProtocolInterface.\r
-\r
---*/\r
-{\r
-\r
- DEBUG_CODE (\r
- gBS->InstallProtocolInterface (\r
- &mHandle,\r
- &gEfiDebugAssertProtocolGuid,\r
- EFI_NATIVE_INTERFACE,\r
- &mDebugAssertProtocol\r
- );\r
- );\r
-\r
- return EFI_SUCCESS;\r
-}\r
+++ /dev/null
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation \r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-\r
-Module Name:\r
- \r
- Ia32StatusCode.c\r
-\r
-Abstract:\r
-\r
- Installs the ReportStatusCode runtime service.\r
-\r
---*/\r
-\r
-#include "StatusCode.h"\r
-\r
-//\r
-//\r
-//\r
-EFI_HANDLE gStatusCodeHandle = NULL;\r
-\r
-const EFI_STATUS_CODE_PROTOCOL gStatusCodeInstance = {\r
- StatusCodeReportStatusCode\r
-};\r
-\r
-//\r
-// Define the driver entry point\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-InstallStatusCode (\r
- IN EFI_HANDLE ImageHandle,\r
- IN EFI_SYSTEM_TABLE *SystemTable\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Install the ReportStatusCode runtime service.\r
-\r
-Arguments:\r
-\r
- ImageHandle Image handle of the loaded driver\r
- SystemTable Pointer to the System Table\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS The function always returns success.\r
-\r
---*/\r
-{\r
- EFI_STATUS Status;\r
-\r
- //\r
- // Initialize RT status code\r
- //\r
- InitializeStatusCode (ImageHandle, SystemTable);\r
-\r
- Status = gBS->InstallMultipleProtocolInterfaces (\r
- &gStatusCodeHandle,\r
- &gEfiStatusCodeRuntimeProtocolGuid,\r
- &gStatusCodeInstance,\r
- NULL\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
-\r
- return Status;\r
-}\r
+++ /dev/null
-#/*++\r
-#\r
-# Copyright (c) 2006, Intel Corporation \r
-# All rights reserved. This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
-# \r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-# \r
-# Module Name:\r
-#\r
-# Ia32StatusCode.dxs\r
-#\r
-# Abstract:\r
-#\r
-# Dependency expression source file.\r
-# \r
-#--*/ \r
-#include <AutoGen.h>\r
-#include <DxeDepex.h>\r
-\r
-DEPENDENCY_START\r
- EFI_DATA_HUB_PROTOCOL_GUID AND EFI_CPU_IO_PROTOCOL_GUID\r
-DEPENDENCY_END\r
+++ /dev/null
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation \r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-\r
-Module Name:\r
-\r
- IpfStatusCode.c\r
-\r
-Abstract:\r
-\r
- Contains the IPF installation function and an ESAL entry.\r
-\r
---*/\r
-\r
-#include "StatusCode.h"\r
-\r
-SAL_RETURN_REGS\r
-ReportStatusCodeEsalServicesClassCommonEntry (\r
- IN UINT64 FunctionId,\r
- IN UINT64 Arg2,\r
- IN UINT64 Arg3,\r
- IN UINT64 Arg4,\r
- IN UINT64 Arg5,\r
- IN UINT64 Arg6,\r
- IN UINT64 Arg7,\r
- IN UINT64 Arg8,\r
- IN SAL_EXTENDED_SAL_PROC ExtendedSalProc,\r
- IN BOOLEAN VirtualMode,\r
- IN VOID *Global\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Main entry for Extended SAL ReportStatusCode Services\r
-\r
-Arguments:\r
-\r
- FunctionId Function Id which needed to be called\r
- Arg2 Efi status code type\r
- Arg3 Efi status code value\r
- Arg4 Instance number \r
- Arg5 Caller Id\r
- Arg6 Efi status code data\r
- Arg7 Not used \r
- Arg8 Not used \r
- ExtendedSalProc Esal Proc pointer \r
- VirtualMode If this function is called in virtual mode\r
- Global This module's global variable pointer\r
- \r
-Returns:\r
-\r
- SAL_RETURN_REGS\r
-\r
---*/\r
-{\r
- SAL_RETURN_REGS ReturnVal;\r
-\r
- switch (FunctionId) {\r
-\r
- case ReportStatusCodeService:\r
- ReturnVal.Status = StatusCodeReportStatusCode (\r
- (EFI_STATUS_CODE_TYPE) Arg2,\r
- (EFI_STATUS_CODE_VALUE) Arg3,\r
- (UINT32) Arg4,\r
- (EFI_GUID *) Arg5,\r
- (EFI_STATUS_CODE_DATA *) Arg6\r
- );\r
- break;\r
-\r
- default:\r
- ReturnVal.Status = EFI_SAL_INVALID_ARGUMENT;\r
- break;\r
- }\r
-\r
- return ReturnVal;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-InstallStatusCode (\r
- IN EFI_HANDLE ImageHandle,\r
- IN EFI_SYSTEM_TABLE *SystemTable\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Install the ReportStatusCode runtime service.\r
-\r
-Arguments:\r
-\r
- ImageHandle Image handle of the loaded driver\r
- SystemTable Pointer to the System Table\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS The function always returns success.\r
-\r
---*/\r
-{\r
- //\r
- // Initialize RT status code\r
- //\r
- InitializeStatusCode (ImageHandle, SystemTable);\r
-\r
- //\r
- // Initialize ESAL capabilities\r
- //\r
- RegisterEsalClass (\r
- &gEfiExtendedSalStatusCodeServicesProtocolGuid,\r
- NULL,\r
- ReportStatusCodeEsalServicesClassCommonEntry,\r
- StatusCode,\r
- NULL\r
- );\r
-\r
- return EFI_SUCCESS;\r
-}\r
+++ /dev/null
-#/*++\r
-#\r
-# Copyright (c) 2006, Intel Corporation \r
-# All rights reserved. This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
-# \r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-# \r
-# Module Name:\r
-#\r
-# IpfStatusCode.dxs\r
-#\r
-# Abstract:\r
-#\r
-# Dependency expression source file.\r
-# \r
-#--*/ \r
-\r
-#include <AutoGen.h>\r
-#include <DxeDepex.h>\r
-\r
-DEPENDENCY_START\r
- EFI_DATA_HUB_PROTOCOL_GUID AND EFI_EXTENDED_SAL_BASE_IO_SERVICES_PROTOCOL_GUID\r
-DEPENDENCY_END\r
+++ /dev/null
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation \r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-\r
-Module Name:\r
-\r
- StatusCode.c\r
-\r
-Abstract:\r
-\r
- Status Code Architectural Protocol implementation as defined in Tiano\r
- Architecture Specification.\r
-\r
- This driver also depends on the DataHub, and will log all status code info \r
- to the DataHub. Fatal Errors are Printed to Standard Error (StdErr) and not \r
- logged to the data hub (If you crash what good is the data in the data hub).\r
-\r
- This driver has limited functionality at runtime and will not log to Data Hub\r
- at runtime.\r
-\r
- Notes:\r
- This driver assumes the following ReportStatusCode strategy:\r
- PEI -> uses PeiReportStatusCode\r
- DXE IPL -> uses PeiReportStatusCode\r
- early DXE -> uses PeiReportStatusCode via HOB\r
- DXE -> This driver\r
- RT -> This driver\r
-\r
---*/\r
-\r
-#include "StatusCode.h"\r
-\r
-EFI_LOCK mStatusCodeLock;\r
-BOOLEAN mStatusCodeFlag = FALSE;\r
-\r
-//\r
-// Function implemenations\r
-//\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-StatusCodeReportStatusCode (\r
- IN EFI_STATUS_CODE_TYPE CodeType,\r
- IN EFI_STATUS_CODE_VALUE Value,\r
- IN UINT32 Instance,\r
- IN EFI_GUID *CallerId,\r
- IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Calls into the platform library which dispatches the platform specific\r
- listeners. For NT environments we still call back into PEI because the \r
- ReportStatusCode functionality requires Win32 services and is built into\r
- the SecMain.exe utility.\r
-\r
-Arguments:\r
-\r
- (See Tiano Runtime Specification)\r
-\r
-Returns:\r
-\r
- None\r
-\r
---*/\r
-{\r
- EFI_STATUS Status;\r
-\r
- //\r
- // Acquire the lock required to update mStatusCodeFlag\r
- //\r
- Status = EfiAcquireLockOrFail (&mStatusCodeLock);\r
- if (EFI_ERROR (Status)) {\r
- //\r
- // Check for reentrancy of the lock\r
- //\r
- return EFI_DEVICE_ERROR;\r
- }\r
- //\r
- // Check to see if we are already in the middle of a ReportStatusCode()\r
- //\r
- if (mStatusCodeFlag) {\r
- EfiReleaseLock (&mStatusCodeLock);\r
- return EFI_DEVICE_ERROR;\r
- }\r
- //\r
- // Set the flag to show we are in the middle of a ReportStatusCode()\r
- //\r
- mStatusCodeFlag = TRUE;\r
-\r
- //\r
- // Release the lock for updating mStatusCodeFlag\r
- //\r
- EfiReleaseLock (&mStatusCodeLock);\r
-\r
- //\r
- // Go do the work required to report a status code\r
- //\r
- RtPlatformReportStatusCode (CodeType, Value, Instance, CallerId, Data);\r
-\r
- //\r
- // Acquire the lock required to update mStatusCodeFlag\r
- //\r
- Status = EfiAcquireLockOrFail (&mStatusCodeLock);\r
- if (EFI_ERROR (Status)) {\r
- //\r
- // Check for reentrancy of the lock\r
- //\r
- return EFI_DEVICE_ERROR;\r
- }\r
- //\r
- // Clear the flag to show we are no longer in the middle of a ReportStatusCode()\r
- //\r
- mStatusCodeFlag = FALSE;\r
-\r
- //\r
- // Release the lock for updating mStatusCodeFlag\r
- //\r
- EfiReleaseLock (&mStatusCodeLock);\r
-\r
- return EFI_SUCCESS;\r
-}\r
-//\r
-// Protocol instance, there can be only one.\r
-//\r
-EFI_STATUS\r
-InitializeStatusCode (\r
- IN EFI_HANDLE ImageHandle,\r
- IN EFI_SYSTEM_TABLE *SystemTable\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Install Driver to produce Report Status Code Arch Protocol\r
-\r
-Arguments:\r
-\r
- (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - Logging Hub protocol installed\r
- Other - No protocol installed, unload driver.\r
-\r
---*/\r
-{\r
-\r
- EfiInitializeLock (&mStatusCodeLock, EFI_TPL_HIGH_LEVEL);\r
-\r
- //\r
- // Call the platform hook to initialize the different listeners.\r
- //\r
- RtPlatformStatusCodeInitialize ();\r
-\r
- //\r
- // Register a protocol that EfiUtilityLib can use to implement DEBUG () and ASSERT ()\r
- // Macros.\r
- //\r
- InstallStatusCodeDebugAssert ();\r
-\r
- return EFI_SUCCESS;\r
-}\r
+++ /dev/null
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation \r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-\r
-Module Name:\r
-\r
- StatusCode.h\r
-\r
-Abstract:\r
-\r
- EFI DXE/RT Status Code include file.\r
-\r
---*/\r
-\r
-#ifndef _EFI_RUNTIME_STATUS_CODE_H_\r
-#define _EFI_RUNTIME_STATUS_CODE_H_\r
-\r
-//\r
-// Function prototypes\r
-//\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-StatusCodeReportStatusCode (\r
- IN EFI_STATUS_CODE_TYPE CodeType,\r
- IN EFI_STATUS_CODE_VALUE Value,\r
- IN UINT32 Instance,\r
- IN EFI_GUID * CallerId,\r
- IN EFI_STATUS_CODE_DATA * Data OPTIONAL\r
- )\r
-;\r
-\r
-EFI_STATUS\r
-InitializeStatusCode (\r
- IN EFI_HANDLE ImageHandle,\r
- IN EFI_SYSTEM_TABLE *SystemTable\r
- )\r
-;\r
-\r
-EFI_STATUS\r
-InstallStatusCodeDebugAssert (\r
- VOID\r
- )\r
-;\r
-\r
-//\r
-// Driver entry point\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-InstallStatusCode (\r
- IN EFI_HANDLE ImageHandle,\r
- IN EFI_SYSTEM_TABLE *SystemTable\r
- )\r
-;\r
-\r
-#endif\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--Copyright (c) 2006, Intel Corporation
-All rights reserved. This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.-->\r
-<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0">\r
- <MsaHeader>\r
- <ModuleName>StatusCode</ModuleName>\r
- <ModuleType>DXE_RUNTIME_DRIVER</ModuleType>\r
- <GuidValue>9F455D3B-2B8A-4c06-960B-A71B9714B9CD</GuidValue>\r
- <Version>1.0</Version>\r
- <Abstract>Component description file for StatusCode module.</Abstract>\r
- <Description>This driver implement Status Code Architectural Protocol and log all status code info. </Description>\r
- <Copyright>Copyright (c) 2006, Intel Corporation</Copyright>\r
- <License>All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>\r
- <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>\r
- </MsaHeader>\r
- <ModuleDefinitions>\r
- <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>\r
- <BinaryModule>false</BinaryModule>\r
- <OutputFileBasename>StatusCode</OutputFileBasename>\r
- </ModuleDefinitions>\r
- <LibraryClassDefinitions>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>BaseLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>UefiRuntimeLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>UefiDriverEntryPoint</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>UefiLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>DebugLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>PrintLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>IoLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>EdkRtPlatformStatusCodeLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>EdkDxeSalLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>UefiBootServicesTableLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>PcdLib</Keyword>\r
- </LibraryClass>\r
- </LibraryClassDefinitions>\r
- <SourceFiles>\r
- <Filename>DebugAssert.c</Filename>\r
- <Filename>StatusCode.c</Filename>\r
- <Filename>StatusCode.h</Filename>\r
- <Filename SupArchList="IA32">Ia32/Ia32StatusCode.c</Filename>\r
- <Filename SupArchList="IA32">Ia32/Ia32StatusCode.dxs</Filename>\r
- <Filename SupArchList="X64">x64/x64StatusCode.c</Filename>\r
- <Filename SupArchList="X64">x64/x64StatusCode.dxs</Filename>\r
- <Filename SupArchList="IPF">Ipf/IpfStatusCode.c</Filename>\r
- <Filename SupArchList="IPF">Ipf/IpfStatusCode.dxs</Filename>\r
- </SourceFiles>\r
- <PackageDependencies>\r
- <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
- <Package PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674"/>\r
- </PackageDependencies>\r
- <Protocols>\r
- <Protocol Usage="ALWAYS_CONSUMED">\r
- <ProtocolCName>gEfiDebugAssertProtocolGuid</ProtocolCName>\r
- </Protocol>\r
- <Protocol Usage="ALWAYS_CONSUMED">\r
- <ProtocolCName>gEfiExtendedSalStatusCodeServicesProtocolGuid</ProtocolCName>\r
- </Protocol>\r
- </Protocols>\r
- <Externs>\r
- <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
- <Specification>EDK_RELEASE_VERSION 0x00020000</Specification>\r
- <Extern>\r
- <ModuleEntryPoint>InstallStatusCode</ModuleEntryPoint>\r
- </Extern>\r
- </Externs>\r
-</ModuleSurfaceArea>
\ No newline at end of file
+++ /dev/null
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation \r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-\r
-Module Name:\r
- \r
- x64StatusCode.c\r
-\r
-Abstract:\r
-\r
- Installs the ReportStatusCode runtime service.\r
-\r
---*/\r
-\r
-#include "StatusCode.h"\r
-\r
-//\r
-//\r
-//\r
-EFI_HANDLE gStatusCodeHandle = NULL;\r
-\r
-const EFI_STATUS_CODE_PROTOCOL gStatusCodeInstance = {\r
- StatusCodeReportStatusCode\r
-};\r
-\r
-//\r
-// Define the driver entry point\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-InstallStatusCode (\r
- IN EFI_HANDLE ImageHandle,\r
- IN EFI_SYSTEM_TABLE *SystemTable\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Install the ReportStatusCode runtime service.\r
-\r
-Arguments:\r
-\r
- ImageHandle Image handle of the loaded driver\r
- SystemTable Pointer to the System Table\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS The function always returns success.\r
-\r
---*/\r
-{\r
- EFI_STATUS Status;\r
-\r
- //\r
- // Initialize RT status code\r
- //\r
- InitializeStatusCode (ImageHandle, SystemTable);\r
-\r
- Status = gBS->InstallMultipleProtocolInterfaces (\r
- &gStatusCodeHandle,\r
- &gEfiStatusCodeRuntimeProtocolGuid,\r
- &gStatusCodeInstance,\r
- NULL\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
-\r
- return Status;\r
-}\r
+++ /dev/null
-#/*++\r
-#\r
-# Copyright (c) 2006, Intel Corporation \r
-# All rights reserved. This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
-# \r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-# \r
-# Module Name:\r
-#\r
-# x64StatusCode.dxs\r
-#\r
-# Abstract:\r
-#\r
-# Dependency expression source file.\r
-# \r
-#--*/ \r
-\r
-#include <AutoGen.h>\r
-#include <DxeDepex.h>\r
-\r
-DEPENDENCY_START\r
- EFI_DATA_HUB_PROTOCOL_GUID AND EFI_CPU_IO_PROTOCOL_GUID\r
-DEPENDENCY_END\r