Changeset 101318 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- Sep 29, 2023 3:13:07 PM (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
r101299 r101318 470 470 }; 471 471 472 473 /** 474 * VirtualBox firmware descriptor. 475 */ 476 typedef struct VBOXFWDESC 477 { 478 FirmwareType_T enmType; 479 bool fBuiltIn; 480 const char *pszFileName; 481 const char *pszUrl; 482 } VBoxFwDesc; 483 typedef const VBOXFWDESC *PVBOXFWDESC; 484 485 472 486 // constructor / destructor 473 487 ///////////////////////////////////////////////////////////////////////////// … … 1885 1899 } 1886 1900 1887 HRESULT VirtualBox::checkFirmwarePresent(FirmwareType_T aFirmwareType, 1901 HRESULT VirtualBox::checkFirmwarePresent(PlatformArchitecture_T aPlatformArchitecture, 1902 FirmwareType_T aFirmwareType, 1888 1903 const com::Utf8Str &aVersion, 1889 1904 com::Utf8Str &aUrl, … … 1893 1908 NOREF(aVersion); 1894 1909 1895 static const struct 1896 { 1897 FirmwareType_T enmType; 1898 bool fBuiltIn; 1899 const char *pszFileName; 1900 const char *pszUrl; 1901 } 1902 firmwareDesc[] = 1910 static const VBOXFWDESC s_FwDescX86[] = 1903 1911 { 1904 1912 { FirmwareType_BIOS, true, NULL, NULL }, … … 1914 1922 }; 1915 1923 1916 for (size_t i = 0; i < sizeof(firmwareDesc) / sizeof(firmwareDesc[0]); i++) 1917 { 1918 if (aFirmwareType != firmwareDesc[i].enmType) 1924 static const VBOXFWDESC s_FwDescArm[] = 1925 { 1926 #ifdef VBOX_WITH_EFI_IN_DD2 1927 { FirmwareType_EFI32, true, "VBoxEFIAArch32.fd", NULL }, 1928 { FirmwareType_EFI64, true, "VBoxEFIAArch64.fd", NULL }, 1929 #else 1930 { FirmwareType_EFI32, false, "VBoxEFIAArch32.fd", "http://virtualbox.org/firmware/VBoxEFIAArch32.fd" }, 1931 { FirmwareType_EFI64, false, "VBoxEFIAArch64.fd", "http://virtualbox.org/firmware/VBoxEFIAArch64.fd" }, 1932 #endif 1933 }; 1934 1935 PVBOXFWDESC pFwDesc = NULL; 1936 uint32_t cFwDesc = 0; 1937 if (aPlatformArchitecture == PlatformArchitecture_x86) 1938 { 1939 pFwDesc = &s_FwDescX86[0]; 1940 cFwDesc = RT_ELEMENTS(s_FwDescX86); 1941 } 1942 else if (aPlatformArchitecture == PlatformArchitecture_ARM) 1943 { 1944 pFwDesc = &s_FwDescArm[0]; 1945 cFwDesc = RT_ELEMENTS(s_FwDescArm); 1946 } 1947 else 1948 return E_INVALIDARG; 1949 1950 for (size_t i = 0; i < cFwDesc; i++) 1951 { 1952 if (aFirmwareType != pFwDesc->enmType) 1953 { 1954 pFwDesc++; 1919 1955 continue; 1956 } 1920 1957 1921 1958 /* compiled-in firmware */ 1922 if ( firmwareDesc[i].fBuiltIn)1923 { 1924 aFile = firmwareDesc[i].pszFileName;1959 if (pFwDesc->fBuiltIn) 1960 { 1961 aFile = pFwDesc->pszFileName; 1925 1962 *aResult = TRUE; 1926 1963 break; … … 1928 1965 1929 1966 Utf8Str fullName; 1930 Utf8StrFmt shortName("Firmware%c%s", RTPATH_DELIMITER, firmwareDesc[i].pszFileName);1967 Utf8StrFmt shortName("Firmware%c%s", RTPATH_DELIMITER, pFwDesc->pszFileName); 1931 1968 int vrc = i_calculateFullPath(shortName, fullName); 1932 1969 AssertRCReturn(vrc, VBOX_E_IPRT_ERROR); … … 1941 1978 vrc = RTPathExecDir(szVBoxPath, RTPATH_MAX); 1942 1979 AssertRCReturn(vrc, VBOX_E_IPRT_ERROR); 1943 vrc = RTPathAppend(szVBoxPath, sizeof(szVBoxPath), firmwareDesc[i].pszFileName);1980 vrc = RTPathAppend(szVBoxPath, sizeof(szVBoxPath), pFwDesc->pszFileName); 1944 1981 AssertRCReturn(vrc, VBOX_E_IPRT_ERROR); 1945 1982 if (RTFileExists(szVBoxPath)) … … 1951 1988 1952 1989 /** @todo account for version in the URL */ 1953 aUrl = firmwareDesc[i].pszUrl;1990 aUrl = pFwDesc->pszUrl; 1954 1991 *aResult = FALSE; 1955 1992
Note:
See TracChangeset
for help on using the changeset viewer.