Changeset 108554 in vbox for trunk/src/VBox/Main/src-all/NvramStoreImpl.cpp
- Timestamp:
- Mar 13, 2025 5:47:45 PM (2 months ago)
- svn:sync-xref-src-repo-rev:
- 167951
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-all/NvramStoreImpl.cpp
r107849 r108554 471 471 } 472 472 473 PlatformArchitecture_T const enmArch = m->pParent->i_getPlatform()->i_getArchitecture(); 473 474 if (SUCCEEDED(hrc)) 474 475 { … … 485 486 { 486 487 /** @todo The size is hardcoded to match what the firmware image uses right now which is a gross hack... */ 487 uint64_t cbUefi = m->pParent->i_getPlatform()->i_getArchitecture() == PlatformArchitecture_ARM ? 786432 : 540672;488 uint64_t cbUefi = enmArch == PlatformArchitecture_ARM ? 3 * _256K : 132 * _4K; 488 489 vrc = RTVfsFileSetSize(hVfsUefiVarStore, cbUefi, RTVFSFILE_SIZE_F_NORMAL); 489 490 if (RT_SUCCESS(vrc)) … … 495 496 496 497 if (RT_SUCCESS(vrc)) 497 { 498 vrc = RTEfiVarStoreCreate(hVfsUefiVarStore, 0 /*offStore*/, 0 /*cbStore*/, RTEFIVARSTORE_CREATE_F_DEFAULT, 0 /*cbBlock*/, 498 { /* We want to create NVRAM files matching the default QEMU_VARS.fd for now, see https://github.com/tianocore/edk2/commit/bf57a42a0e2cf1c68e9db2f61c82ce93c806ab07. */ 499 static const RTEFIVARSTORECFG s_EfiNvramCfgArm = { 3 * _256K /*cbFv*/, _256K /*cbBlock*/, _256K /*cbVarStore*/, 0 /*cbNvEventLog*/, 2 * _256K /*cbFtw*/, 0x3ffe0 /*cbWriteQueue*/}; 500 /* We want to create NVRAM files matching the default OVMF_VARS.fd for now, see https://github.com/tianocore/edk2/commit/b24fca05751f8222acf264853709012e0ab7bf49. */ 501 static const RTEFIVARSTORECFG s_EfiNvramCfgX86 = { 132 * _4K /*cbFv*/, _4K /*cbBlock*/, _256K /*cbVarStore*/, _4K /*cbNvEventLog*/, 67 * _4K /*cbFtw*/, 0x00fe0 /*cbWriteQueue*/}; 502 503 vrc = RTEfiVarStoreCreate(hVfsUefiVarStore, 0 /*offStore*/, enmArch == PlatformArchitecture_ARM ? &s_EfiNvramCfgArm : &s_EfiNvramCfgX86, 499 504 NULL /*pErrInfo*/); 500 505 if (RT_FAILURE(vrc))
Note:
See TracChangeset
for help on using the changeset viewer.