]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UnixPkg/MiscSubClassPlatformDxe/MiscBiosVendorFunction.c
UnixPkg: Remove UnixPkg files (It is replaced by EmulatorPkg)
[mirror_edk2.git] / UnixPkg / MiscSubClassPlatformDxe / MiscBiosVendorFunction.c
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscBiosVendorFunction.c b/UnixPkg/MiscSubClassPlatformDxe/MiscBiosVendorFunction.c
deleted file mode 100644 (file)
index fbfb52f..0000000
+++ /dev/null
@@ -1,196 +0,0 @@
-/** @file\r
-  BIOS vendor information boot time changes.\r
-  Misc. subclass type 2.\r
-  SMBIOS type 0.\r
-\r
-  Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
-  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
-**/\r
-\r
-#include "MiscSubClassDriver.h"\r
-\r
-/**\r
-  This function returns the value & exponent to Base2 for a given\r
-  Hex value. This is used to calculate the BiosPhysicalDeviceSize.\r
-\r
-  @param Value                      The hex value which is to be converted into value-exponent form\r
-  @param Exponent                   The exponent out of the conversion\r
-\r
-  @retval EFI_SUCCESS               All parameters were valid and *Value & *Exponent have been set.\r
-  @retval EFI_INVALID_PARAMETER     Invalid parameter was found.\r
-  \r
-**/\r
-EFI_STATUS  \r
-GetValueExponentBase2(\r
-  IN OUT UINTN        *Value,\r
-  OUT    UINTN        *Exponent\r
-  )\r
-{\r
-  if ((Value == NULL) || (Exponent == NULL)) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-  \r
-  while ((*Value % 2) == 0) {\r
-    *Value=*Value/2;\r
-    (*Exponent)++;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
-  Field Filling Function. Transform an EFI_EXP_BASE2_DATA to a byte, with '64k'\r
-  as the unit.\r
-\r
-  @param  Base2Data              Pointer to Base2_Data\r
-\r
-  @retval EFI_SUCCESS            Transform successfully.       \r
-  @retval EFI_INVALID_PARAMETER  Invalid parameter was found.    \r
-\r
-**/\r
-UINT16\r
-Base2ToByteWith64KUnit (\r
-  IN      EFI_EXP_BASE2_DATA  *Base2Data\r
-  )\r
-{  \r
-  UINT16              Value;\r
-  UINT16              Exponent;\r
-\r
-  Value     = Base2Data->Value;\r
-  Exponent  = Base2Data->Exponent;\r
-  Exponent -= 16;\r
-  Value <<= Exponent;\r
-\r
-  return Value;\r
-}\r
-\r
-\r
-/**\r
-  This function makes boot time changes to the contents of the\r
-  MiscBiosVendor (Type 0).\r
-\r
-  @param  RecordData                 Pointer to copy of RecordData from the Data Table.\r
-\r
-  @retval EFI_SUCCESS                All parameters were valid.\r
-  @retval EFI_UNSUPPORTED            Unexpected RecordType value.\r
-  @retval EFI_INVALID_PARAMETER      Invalid parameter was found.\r
-\r
-**/\r
-MISC_SMBIOS_TABLE_FUNCTION(MiscBiosVendor)\r
-{\r
-  CHAR8                 *OptionalStrStart;\r
-  UINTN                 VendorStrLen;\r
-  UINTN                 VerStrLen;\r
-  UINTN                 DateStrLen;\r
-  CHAR16                *Version;\r
-  CHAR16                *ReleaseDate;\r
-  EFI_STATUS            Status;\r
-  EFI_STRING            Char16String;\r
-  STRING_REF            TokenToGet;\r
-  STRING_REF            TokenToUpdate;\r
-  SMBIOS_TABLE_TYPE0    *SmbiosRecord;\r
-  EFI_SMBIOS_HANDLE     SmbiosHandle;\r
-  EFI_MISC_BIOS_VENDOR *ForType0InputData;\r
-\r
-  ForType0InputData        = (EFI_MISC_BIOS_VENDOR *)RecordData;\r
-\r
-  //\r
-  // First check for invalid parameters.\r
-  //\r
-  if (RecordData == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  Version = (CHAR16 *) PcdGetPtr (PcdFirmwareVersionString);\r
-  if (StrLen (Version) > 0) {     \r
-    TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_VERSION);\r
-    HiiSetString (mHiiHandle, TokenToUpdate, Version, NULL);\r
-  }\r
-  \r
-  ReleaseDate = (CHAR16 *) PcdGetPtr (PcdFirmwareReleaseDateString);\r
-  if (StrLen(ReleaseDate) > 0) {\r
-    TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_RELEASE_DATE);\r
-    HiiSetString (mHiiHandle, TokenToUpdate, ReleaseDate, NULL);\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_BIOS_VENDOR);\r
-  Char16String = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  VendorStrLen = StrLen(Char16String);\r
-  if (VendorStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_BIOS_VERSION);\r
-  Version = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  VerStrLen = StrLen(Version);\r
-  if (VerStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_BIOS_RELEASE_DATE);\r
-  ReleaseDate = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  DateStrLen = StrLen(ReleaseDate);\r
-  if (DateStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-  \r
-  //\r
-  // Two zeros following the last string.\r
-  //\r
-  SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE0) + VendorStrLen + 1 + VerStrLen + 1 + DateStrLen + 1 + 1);\r
-  ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE0) + VendorStrLen + 1 + VerStrLen + 1 + DateStrLen + 1 + 1);\r
-\r
-  SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_BIOS_INFORMATION;\r
-  SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE0);\r
-  //\r
-  // Make handle chosen by smbios protocol.add automatically.\r
-  //\r
-  SmbiosRecord->Hdr.Handle = 0;\r
-  //\r
-  // Vendor will be the 1st optional string following the formatted structure.\r
-  //\r
-  SmbiosRecord->Vendor = 1;  \r
-  //\r
-  // Version will be the 2nd optional string following the formatted structure.\r
-  //\r
-  SmbiosRecord->BiosVersion = 2;\r
-  SmbiosRecord->BiosSegment = (UINT16)ForType0InputData->BiosStartingAddress;\r
-  //\r
-  // ReleaseDate will be the 3rd optional string following the formatted structure.\r
-  //\r
-  SmbiosRecord->BiosReleaseDate = 3;\r
-  //\r
-  // Nt32 has no PCD value to indicate BIOS Size, just fill 0 for simply.\r
-  //\r
-  SmbiosRecord->BiosSize = 0;\r
-  SmbiosRecord->BiosCharacteristics = *(MISC_BIOS_CHARACTERISTICS*)(&ForType0InputData->BiosCharacteristics1);\r
-  //\r
-  // CharacterExtensionBytes also store in ForType0InputData->BiosCharacteristics1 later two bytes to save size.\r
-  //\r
-  SmbiosRecord->BIOSCharacteristicsExtensionBytes[0] = *((UINT8 *) &ForType0InputData->BiosCharacteristics1 + 4);\r
-  SmbiosRecord->BIOSCharacteristicsExtensionBytes[1] = *((UINT8 *) &ForType0InputData->BiosCharacteristics1 + 5);\r
-\r
-  SmbiosRecord->SystemBiosMajorRelease = ForType0InputData->BiosMajorRelease;\r
-  SmbiosRecord->SystemBiosMinorRelease = ForType0InputData->BiosMinorRelease;\r
-  SmbiosRecord->EmbeddedControllerFirmwareMajorRelease = ForType0InputData->BiosEmbeddedFirmwareMajorRelease;\r
-  SmbiosRecord->EmbeddedControllerFirmwareMinorRelease = ForType0InputData->BiosEmbeddedFirmwareMinorRelease;\r
-\r
-  OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);\r
-  UnicodeStrToAsciiStr(Char16String, OptionalStrStart);\r
-  UnicodeStrToAsciiStr(Version, OptionalStrStart + VendorStrLen + 1);\r
-  UnicodeStrToAsciiStr(ReleaseDate, OptionalStrStart + VendorStrLen + 1 + VerStrLen + 1);\r
-  //\r
-  // Now we have got the full smbios record, call smbios protocol to add this record.\r
-  //\r
-  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
-\r
-  FreePool(SmbiosRecord);\r
-  return Status;\r
-}\r