Changeset 43146 in vbox for trunk/src/VBox
- Timestamp:
- Sep 3, 2012 1:41:48 AM (12 years ago)
- Location:
- trunk/src/VBox/Devices/EFI
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/DevOVMF.cpp
r43143 r43146 62 62 RTLISTNODE List; 63 63 RTUUID uuid; 64 char szVariableName[ 1024];64 char szVariableName[EFI_VARIABLE_NAME_MAX]; 65 65 uint32_t cbVariableName; 66 uint8_t au8Value[ 1024];66 uint8_t au8Value[EFI_VARIABLE_VALUE_MAX]; 67 67 uint32_t cbValue; 68 68 uint32_t u32Attribute; … … 142 142 uint32_t u32UgaVertical; 143 143 struct { 144 uint32_t idxVariableName;145 144 EFIVAROP enmOp; 146 145 uint32_t u32Status; 147 uint32_t idxOpBuffer;146 uint32_t idxOpBuffer; 148 147 EFIVAR OperationVarOp; 149 RTLISTANCHOR NVRAMVariableList; 148 int cNvramVaraibles; 149 RTLISTANCHOR NvramVariableList; 150 150 PEFIVAR pCurrentVarOp; 151 151 } NVRAM; … … 179 179 PEFIVAR pEfiVar = NULL; 180 180 LogFlowFunc(("pszVariableName:%s, pUuid:%RTuuid\n", pszVariableName, pUuid)); 181 RTListForEach((PRTLISTNODE)&pThis->NVRAM.N VRAMVariableList, pEfiVar, EFIVAR, List)181 RTListForEach((PRTLISTNODE)&pThis->NVRAM.NvramVariableList, pEfiVar, EFIVAR, List) 182 182 { 183 183 LogFlowFunc(("pEfiVar:%p\n", pEfiVar)); … … 208 208 return VERR_NO_MEMORY; 209 209 } 210 pEfiVar->cbVariableName = 512;211 pEfiVar->cbValue = 1024;210 pEfiVar->cbVariableName = EFI_VARIABLE_NAME_MAX; 211 pEfiVar->cbValue = EFI_VARIABLE_VALUE_MAX; 212 212 rc = pThis->Lun0.pNvramDown->pfnLoadNvramValue(pThis->Lun0.pNvramDown, 213 213 idxValue, … … 223 223 break; 224 224 } 225 RTListAppend((PRTLISTNODE)&pThis->NVRAM.N VRAMVariableList, &pEfiVar->List);225 RTListAppend((PRTLISTNODE)&pThis->NVRAM.NvramVariableList, &pEfiVar->List); 226 226 } 227 227 if ( RT_FAILURE(rc) … … 239 239 pThis->Lun0.pNvramDown->pfnFlushNvramStorage(pThis->Lun0.pNvramDown); 240 240 241 RTListForEach((PRTLISTNODE)&pThis->NVRAM.N VRAMVariableList, pEfiVar, EFIVAR, List)241 RTListForEach((PRTLISTNODE)&pThis->NVRAM.NvramVariableList, pEfiVar, EFIVAR, List) 242 242 { 243 243 pThis->Lun0.pNvramDown->pfnStoreNvramValue(pThis->Lun0.pNvramDown, … … 583 583 pThis->NVRAM.u32Status = EFI_VARIABLE_OP_STATUS_BSY; 584 584 PEFIVAR pEfiVar = NULL; 585 memset(pThis->NVRAM.OperationVarOp.au8Value, 0, 1024);585 memset(pThis->NVRAM.OperationVarOp.au8Value, 0, EFI_VARIABLE_NAME_MAX); 586 586 int nvramRc = nvramLookupVariableByUuidAndName( 587 587 pThis, … … 631 631 RTMemFree(pEfiVar); 632 632 pThis->NVRAM.u32Status = EFI_VARIABLE_OP_STATUS_OK; 633 pThis->NVRAM.cNvramVaraibles--; 633 634 } 634 635 else … … 659 660 memcpy(pEfiVar, &pThis->NVRAM.OperationVarOp, sizeof(EFIVAR)); 660 661 RTListInit(&pEfiVar->List); 661 RTListAppend(&pThis->NVRAM.N VRAMVariableList, &pEfiVar->List);662 RTListAppend(&pThis->NVRAM.NvramVariableList, &pEfiVar->List); 662 663 pThis->NVRAM.u32Status = EFI_VARIABLE_OP_STATUS_OK; 664 pThis->NVRAM.cNvramVaraibles++; 663 665 } 664 666 } … … 698 700 case EFI_VM_VARIABLE_OP_NAME_LENGTH: 699 701 pThis->NVRAM.OperationVarOp.cbVariableName = u32; 700 memset(pThis->NVRAM.OperationVarOp.szVariableName, 0, 1024);702 memset(pThis->NVRAM.OperationVarOp.szVariableName, 0, EFI_VARIABLE_NAME_MAX); 701 703 break; 702 704 case EFI_VM_VARIABLE_OP_VALUE: … … 706 708 case EFI_VM_VARIABLE_OP_VALUE_LENGTH: 707 709 pThis->NVRAM.OperationVarOp.cbValue = u32; 708 memset(pThis->NVRAM.OperationVarOp.au8Value, 0, 1024);710 memset(pThis->NVRAM.OperationVarOp.au8Value, 0, EFI_VARIABLE_VALUE_MAX); 709 711 break; 710 712 default: … … 824 826 nvramStore(pThis); 825 827 PEFIVAR pEfiVar = NULL; 826 while (!RTListIsEmpty(&pThis->NVRAM.N VRAMVariableList))827 { 828 pEfiVar = RTListNodeGetNext(&pThis->NVRAM.N VRAMVariableList, EFIVAR, List);828 while (!RTListIsEmpty(&pThis->NVRAM.NvramVariableList)) 829 { 830 pEfiVar = RTListNodeGetNext(&pThis->NVRAM.NvramVariableList, EFIVAR, List); 829 831 RTListNodeRemove(&pEfiVar->List); 830 832 RTMemFree(pEfiVar); … … 1155 1157 uuid.Gen.u16TimeHiAndVersion = RT_H2BE_U16(uuid.Gen.u16TimeHiAndVersion); 1156 1158 memcpy(&pThis->aUuid, &uuid, sizeof pThis->aUuid); 1157 RTListInit((PRTLISTNODE)&pThis->NVRAM.N VRAMVariableList);1159 RTListInit((PRTLISTNODE)&pThis->NVRAM.NvramVariableList); 1158 1160 1159 1161 -
trunk/src/VBox/Devices/EFI/Firmware2/VBoxPkg/Include/DevEFI.h
r43021 r43146 122 122 #define EFI_VARIABLE_OP_STATUS_BSY 0xcafe0010 123 123 124 #define EFI_VARIABLE_NAME_MAX 1024 125 #define EFI_VARIABLE_VALUE_MAX 1024 126 124 127 typedef enum { 125 128 EFI_VM_VARIABLE_OP_START = 0,
Note:
See TracChangeset
for help on using the changeset viewer.