Changeset 48727 in vbox for trunk/src/VBox
- Timestamp:
- Sep 27, 2013 11:03:53 AM (11 years ago)
- Location:
- trunk/src/VBox/Devices/EFI
- Files:
-
- 6 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/DevEFI.cpp
r48659 r48727 41 41 #include <iprt/mp.h> 42 42 #include <iprt/list.h> 43 #if def DEBUG43 #if defined(DEBUG) && defined(IN_RING3) 44 44 # include <iprt/stream.h> 45 45 # define DEVEFI_WITH_VBOXDBG_SCRIPT … … 130 130 /** Pointer back to the device instance. */ 131 131 PPDMDEVINS pDevIns; 132 132 133 /** EFI message buffer. */ 133 134 char szMsg[VBOX_EFI_DEBUG_BUFFER]; 134 135 /** EFI message buffer index. */ 135 136 uint32_t iMsg; 137 136 138 /** EFI panic message buffer. */ 137 139 char szPanicMsg[2048]; 138 140 /** EFI panic message buffer index. */ 139 141 uint32_t iPanicMsg; 142 143 struct 144 { 145 /** The current/last image event. */ 146 uint8_t uEvt; 147 /** Module path/name offset. */ 148 uint8_t offName; 149 /** The offset of the last component in the module path/name. */ 150 uint8_t offNameLastComponent; 151 /** Alignment padding. */ 152 uint8_t abPadding[5]; 153 /** First address associated with the event (image address). */ 154 uint64_t uAddr0; 155 /** Second address associated with the event (old image address). */ 156 uint64_t uAddr1; 157 /** The size associated with the event (0 if none). */ 158 uint64_t cb0; 159 /** The module name. */ 160 char szName[256]; 161 } ImageEvt; 162 140 163 /** The system EFI ROM data. */ 141 164 uint8_t *pu8EfiRom; … … 477 500 * @param pThis The EFI state. 478 501 * @param pEfiVar The resulting variable. NULL if not found / end. 479 * /480 static void nvramWriteVariableOpQueryCopyResult(PDEVEFI pThis, PEFIVAR pEfiVar) 481 { 482 RT_ZERO(pThis->NVRAM.VarOpBuf.szName); 502 * @param fEnumQuery Set if enumeration query, clear if specific. 503 */ 504 static void nvramWriteVariableOpQueryCopyResult(PDEVEFI pThis, PEFIVAR pEfiVar, bool fEnumQuery) 505 { 483 506 RT_ZERO(pThis->NVRAM.VarOpBuf.abValue); 484 507 if (pEfiVar) 485 508 { 509 RT_ZERO(pThis->NVRAM.VarOpBuf.szName); 486 510 pThis->NVRAM.VarOpBuf.uuid = pEfiVar->uuid; 487 511 pThis->NVRAM.VarOpBuf.cchName = pEfiVar->cchName; … … 498 522 else 499 523 { 524 if (fEnumQuery) 525 LogFlow(("EFI: Variable query -> NOT_FOUND \n")); 526 else 527 LogFlow(("EFI: Variable query %RTuuid::'%s' -> NOT_FOUND \n", 528 &pThis->NVRAM.VarOpBuf.uuid, pThis->NVRAM.VarOpBuf.szName)); 529 RT_ZERO(pThis->NVRAM.VarOpBuf.szName); 500 530 pThis->NVRAM.VarOpBuf.fAttributes = 0; 501 531 pThis->NVRAM.VarOpBuf.cbValue = 0; … … 503 533 pThis->NVRAM.pCurVar = NULL; 504 534 pThis->NVRAM.u32Status = EFI_VARIABLE_OP_STATUS_NOT_FOUND; 505 LogFlow(("EFI: Variable query -> NOT_FOUND\n"));506 535 } 507 536 } … … 522 551 &pThis->NVRAM.VarOpBuf.uuid, 523 552 &pEfiVar); 524 nvramWriteVariableOpQueryCopyResult(pThis, RT_SUCCESS(rc) ? pEfiVar : NULL );553 nvramWriteVariableOpQueryCopyResult(pThis, RT_SUCCESS(rc) ? pEfiVar : NULL, false /*fEnumQuery*/); 525 554 return VINF_SUCCESS; 526 555 } … … 542 571 else 543 572 pEfiVar = RTListGetFirst(&pThis->NVRAM.VarList, EFIVAR, ListNode); 544 nvramWriteVariableOpQueryCopyResult(pThis, pEfiVar );573 nvramWriteVariableOpQueryCopyResult(pThis, pEfiVar, true /* fEnumQuery */); 545 574 return VINF_SUCCESS; 546 575 } … … 554 583 static int nvramWriteVariableOpAdd(PDEVEFI pThis) 555 584 { 556 Log Rel(("EFI_VARIABLE_OP_ADD: %RTuuid::'%s' fAttributes=%#x abValue=%.*Rhxs\n",557 558 585 Log(("EFI_VARIABLE_OP_ADD: %RTuuid::'%s' fAttributes=%#x abValue=%.*Rhxs\n", 586 &pThis->NVRAM.VarOpBuf.uuid, pThis->NVRAM.VarOpBuf.szName, pThis->NVRAM.VarOpBuf.fAttributes, 587 pThis->NVRAM.VarOpBuf.cbValue, pThis->NVRAM.VarOpBuf.abValue)); 559 588 560 589 /* … … 569 598 return VINF_SUCCESS; 570 599 } 571 pThis->NVRAM.VarOpBuf.cchName = RTStrNLen(pThis->NVRAM.VarOpBuf.szName, sizeof(pThis->NVRAM.VarOpBuf.szName));600 pThis->NVRAM.VarOpBuf.cchName = (uint32_t)RTStrNLen(pThis->NVRAM.VarOpBuf.szName, sizeof(pThis->NVRAM.VarOpBuf.szName)); 572 601 573 602 /* … … 755 784 if (pThis->NVRAM.offOpBuffer == 0) 756 785 RT_ZERO(pThis->NVRAM.VarOpBuf.szName); 757 size_t cbUtf8 =RTStrCpSize(u32Value);786 uint32_t cbUtf8 = (uint32_t)RTStrCpSize(u32Value); 758 787 if (pThis->NVRAM.offOpBuffer + cbUtf8 < sizeof(pThis->NVRAM.VarOpBuf.szName)) 759 788 { … … 879 908 case EFI_VM_VARIABLE_OP_NAME_LENGTH_UTF16: 880 909 /* Lazy bird: ASSUME no surrogate pairs. */ 881 *pu32 = RTStrUniLen(pThis->NVRAM.VarOpBuf.szName);910 *pu32 = (uint32_t)RTStrUniLen(pThis->NVRAM.VarOpBuf.szName); 882 911 break; 883 912 … … 1141 1170 } 1142 1171 1172 1173 #ifdef IN_RING3 1174 static void efiVBoxDbgScript(PDEVEFI pThis, const char *pszFormat, ...) 1175 { 1176 # ifdef DEVEFI_WITH_VBOXDBG_SCRIPT 1177 PRTSTREAM pStrm; 1178 int rc2 = RTStrmOpen("./DevEFI.VBoxDbg", "a", &pStrm); 1179 if (RT_SUCCESS(rc2)) 1180 { 1181 va_list va; 1182 va_start(va, pszFormat); 1183 RTStrmPrintfV(pStrm, pszFormat, va); 1184 va_end(va); 1185 RTStrmClose(pStrm); 1186 } 1187 # endif 1188 } 1189 #endif /* IN_RING3 */ 1190 1191 1192 /** 1193 * Handles writes to the image event port. 1194 * 1195 * @returns VBox status suitable for I/O port write handler. 1196 * 1197 * @param pThis The EFI state. 1198 * @param u32 The value being written. 1199 * @param cb The size of the value. 1200 */ 1201 static int efiPortImageEventWrite(PDEVEFI pThis, uint32_t u32, unsigned cb) 1202 { 1203 switch (u32 & EFI_IMAGE_EVT_CMD_MASK) 1204 { 1205 case EFI_IMAGE_EVT_CMD_START_LOAD32: 1206 case EFI_IMAGE_EVT_CMD_START_LOAD64: 1207 case EFI_IMAGE_EVT_CMD_START_UNLOAD32: 1208 case EFI_IMAGE_EVT_CMD_START_UNLOAD64: 1209 AssertBreak(EFI_IMAGE_EVT_GET_PAYLOAD(u32) == 0); 1210 1211 /* Reset the state. */ 1212 RT_ZERO(pThis->ImageEvt); 1213 pThis->ImageEvt.uEvt = (uint8_t)u32; Assert(pThis->ImageEvt.uEvt == u32); 1214 return VINF_SUCCESS; 1215 1216 case EFI_IMAGE_EVT_CMD_COMPLETE: 1217 { 1218 #ifdef IN_RING3 1219 AssertBreak(EFI_IMAGE_EVT_GET_PAYLOAD(u32) == 0); 1220 1221 /* For now, just log it. */ 1222 static uint64_t s_cImageEvtLogged = 0; 1223 if (s_cImageEvtLogged < 2048) 1224 { 1225 s_cImageEvtLogged++; 1226 switch (pThis->ImageEvt.uEvt) 1227 { 1228 /* ASSUMES the name ends with .pdb and the image file ends with .efi! */ 1229 case EFI_IMAGE_EVT_CMD_START_LOAD32: 1230 LogRel(("EFI: VBoxDbg> loadimage32 '%.*s.efi' %#llx LB %#llx\n", 1231 pThis->ImageEvt.offName - 4, pThis->ImageEvt.szName, pThis->ImageEvt.uAddr0, pThis->ImageEvt.cb0)); 1232 if (pThis->ImageEvt.offName > 4) 1233 efiVBoxDbgScript(pThis, "loadimage32 '%.*s.efi' %#llx\n", 1234 pThis->ImageEvt.offName - 4, pThis->ImageEvt.szName, pThis->ImageEvt.uAddr0); 1235 break; 1236 case EFI_IMAGE_EVT_CMD_START_LOAD64: 1237 LogRel(("EFI: VBoxDbg> loadimage64 '%.*s.efi' %#llx LB %#llx\n", 1238 pThis->ImageEvt.offName - 4, pThis->ImageEvt.szName, pThis->ImageEvt.uAddr0, pThis->ImageEvt.cb0)); 1239 if (pThis->ImageEvt.offName > 4) 1240 efiVBoxDbgScript(pThis, "loadimage64 '%.*s.efi' %#llx\n", 1241 pThis->ImageEvt.offName - 4, pThis->ImageEvt.szName, pThis->ImageEvt.uAddr0); 1242 break; 1243 case EFI_IMAGE_EVT_CMD_START_UNLOAD32: 1244 case EFI_IMAGE_EVT_CMD_START_UNLOAD64: 1245 { 1246 LogRel(("EFI: VBoxDbg> unload '%.*s.efi' # %#llx LB %#llx\n", 1247 pThis->ImageEvt.offName - 4 - pThis->ImageEvt.offNameLastComponent, 1248 &pThis->ImageEvt.szName[pThis->ImageEvt.offNameLastComponent], 1249 pThis->ImageEvt.uAddr0, pThis->ImageEvt.cb0)); 1250 if (pThis->ImageEvt.offName > 4) 1251 efiVBoxDbgScript(pThis, "unload '%.*s.efi'\n", 1252 pThis->ImageEvt.offName - 4 - pThis->ImageEvt.offNameLastComponent, 1253 &pThis->ImageEvt.szName[pThis->ImageEvt.offNameLastComponent]); 1254 break; 1255 } 1256 } 1257 } 1258 return VINF_SUCCESS; 1259 #else 1260 return VINF_IOM_R3_IOPORT_WRITE; 1261 #endif 1262 } 1263 1264 case EFI_IMAGE_EVT_CMD_ADDR0: 1265 AssertBreak(EFI_IMAGE_EVT_GET_PAYLOAD(u32) <= UINT16_MAX); 1266 pThis->ImageEvt.uAddr0 <<= 16; 1267 pThis->ImageEvt.uAddr0 |= EFI_IMAGE_EVT_GET_PAYLOAD_U16(u32); 1268 return VINF_SUCCESS; 1269 1270 case EFI_IMAGE_EVT_CMD_ADDR1: 1271 AssertBreak(EFI_IMAGE_EVT_GET_PAYLOAD(u32) <= UINT16_MAX); 1272 pThis->ImageEvt.uAddr0 <<= 16; 1273 pThis->ImageEvt.uAddr0 |= EFI_IMAGE_EVT_GET_PAYLOAD_U16(u32); 1274 return VINF_SUCCESS; 1275 1276 case EFI_IMAGE_EVT_CMD_SIZE0: 1277 AssertBreak(EFI_IMAGE_EVT_GET_PAYLOAD(u32) <= UINT16_MAX); 1278 pThis->ImageEvt.cb0 <<= 16; 1279 pThis->ImageEvt.cb0 |= EFI_IMAGE_EVT_GET_PAYLOAD_U16(u32); 1280 return VINF_SUCCESS; 1281 1282 case EFI_IMAGE_EVT_CMD_NAME: 1283 AssertBreak(EFI_IMAGE_EVT_GET_PAYLOAD(u32) <= 0x7f); 1284 if (pThis->ImageEvt.offName + 1 < sizeof(pThis->ImageEvt.szName)) 1285 { 1286 char ch = EFI_IMAGE_EVT_GET_PAYLOAD_U8(u32); 1287 if (ch == '\\') 1288 ch = '/'; 1289 pThis->ImageEvt.szName[pThis->ImageEvt.offName++] = ch; 1290 if (ch == '/' || ch == ':') 1291 pThis->ImageEvt.offNameLastComponent = pThis->ImageEvt.offName; 1292 } 1293 else 1294 Log(("EFI: Image name overflow\n")); 1295 return VINF_SUCCESS; 1296 } 1297 1298 Log(("EFI: Unknown image event: %#x (cb=%d)\n", u32, cb)); 1299 return VINF_SUCCESS; 1300 } 1301 1302 1143 1303 /** 1144 1304 * Port I/O Handler for IN operations. … … 1187 1347 #endif 1188 1348 1189 case EFI_ VARIABLE_OP:1349 case EFI_PORT_VARIABLE_OP: 1190 1350 return nvramReadVariableOp(pThis, pu32, cb); 1191 1351 1192 case EFI_VARIABLE_PARAM: 1352 case EFI_PORT_VARIABLE_PARAM: 1353 case EFI_PORT_DEBUG_POINT: 1354 case EFI_PORT_IMAGE_EVENT: 1193 1355 *pu32 = UINT32_MAX; 1194 1356 return VINF_SUCCESS; … … 1196 1358 1197 1359 return VERR_IOM_IOPORT_UNUSED; 1360 } 1361 1362 1363 /** 1364 * Translates a debug point value into a string for logging. 1365 * 1366 * @returns read-only string 1367 * @param enmDbgPoint Valid debug point value. 1368 */ 1369 static const char *efiDbgPointName(EFIDBGPOINT enmDbgPoint) 1370 { 1371 switch (enmDbgPoint) 1372 { 1373 case EFIDBGPOINT_SEC_PREMEM: return "SEC_PREMEM"; 1374 case EFIDBGPOINT_SEC_POSTMEM: return "SEC_POSTMEM"; 1375 case EFIDBGPOINT_DXE_CORE: return "DXE_CORE"; 1376 case EFIDBGPOINT_SMM: return "SMM"; 1377 case EFIDBGPOINT_SMI_ENTER: return "SMI_ENTER"; 1378 case EFIDBGPOINT_SMI_EXIT: return "SMI_EXIT"; 1379 case EFIDBGPOINT_GRAPHICS: return "GRAPHICS"; 1380 case EFIDBGPOINT_DXE_AP: return "DXE_AP"; 1381 default: 1382 AssertFailed(); 1383 return "Unknown"; 1384 } 1198 1385 } 1199 1386 … … 1239 1426 pThis->szMsg[pThis->iMsg] = '\0'; 1240 1427 if (pThis->iMsg) 1241 {1242 1428 Log(("efi: %s\n", pThis->szMsg)); 1243 #ifdef DEVEFI_WITH_VBOXDBG_SCRIPT1244 const char *pszVBoxDbg = strstr(pThis->szMsg, "VBoxDbg> ");1245 if (pszVBoxDbg)1246 {1247 pszVBoxDbg += sizeof("VBoxDbg> ") - 1;1248 1249 PRTSTREAM pStrm;1250 int rc2 = RTStrmOpen("./DevEFI.VBoxDbg", "a", &pStrm);1251 if (RT_SUCCESS(rc2))1252 {1253 RTStrmPutStr(pStrm, pszVBoxDbg);1254 RTStrmPutCh(pStrm, '\n');1255 RTStrmClose(pStrm);1256 }1257 }1258 #endif1259 }1260 1429 pThis->iMsg = 0; 1261 1430 } … … 1280 1449 case EFI_PANIC_CMD_BAD_ORG: /* Legacy */ 1281 1450 case EFI_PANIC_CMD_THUNK_TRAP: 1282 LogRel(("EFI Panic: Unexpected trap!!\n")); 1283 #ifdef VBOX_STRICT 1451 #ifdef IN_RING3 1452 LogRel(("EFI: Panic! Unexpected trap!!\n")); 1453 # ifdef VBOX_STRICT 1284 1454 return PDMDevHlpDBGFStop(pDevIns, RT_SRC_POS, "EFI Panic: Unexpected trap during early bootstrap!\n"); 1455 # else 1456 AssertReleaseMsgFailed(("Unexpected trap during early EFI bootstrap!!\n")); 1457 # endif 1458 break; 1285 1459 #else 1286 AssertReleaseMsgFailed(("Unexpected trap during early EFI bootstrap!!\n"));1460 return VINF_IOM_R3_IOPORT_WRITE; 1287 1461 #endif 1288 break;1289 1462 1290 1463 case EFI_PANIC_CMD_START_MSG: 1464 LogRel(("Receiving EFI panic...\n")); 1291 1465 pThis->iPanicMsg = 0; 1292 1466 pThis->szPanicMsg[0] = '\0'; … … 1294 1468 1295 1469 case EFI_PANIC_CMD_END_MSG: 1296 LogRel(("EFI Panic: %s\n", pThis->szPanicMsg)); 1297 #ifdef VBOX_STRICT 1470 #ifdef IN_RING3 1471 LogRel(("EFI: Panic! %s\n", pThis->szPanicMsg)); 1472 # ifdef VBOX_STRICT 1298 1473 return PDMDevHlpDBGFStop(pDevIns, RT_SRC_POS, "EFI Panic: %s\n", pThis->szPanicMsg); 1474 # else 1475 return VERR_INTERNAL_ERROR; 1476 # endif 1299 1477 #else 1300 return V ERR_INTERNAL_ERROR;1478 return VINF_IOM_R3_IOPORT_WRITE; 1301 1479 #endif 1480 1302 1481 1303 1482 default: … … 1326 1505 } 1327 1506 1328 case EFI_ VARIABLE_OP:1507 case EFI_PORT_VARIABLE_OP: 1329 1508 { 1330 1509 /* clear buffer index */ … … 1340 1519 } 1341 1520 1342 case EFI_ VARIABLE_PARAM:1521 case EFI_PORT_VARIABLE_PARAM: 1343 1522 rc = nvramWriteVariableParam(pThis, u32); 1523 break; 1524 1525 case EFI_PORT_DEBUG_POINT: 1526 #ifdef IN_RING3 1527 if (u32 > EFIDBGPOINT_INVALID && u32 < EFIDBGPOINT_END) 1528 { 1529 /* For now, just log it. */ 1530 static uint64_t s_cDbgPointLogged = 0; 1531 if (s_cDbgPointLogged < 1024) 1532 { 1533 s_cDbgPointLogged++; 1534 LogRel(("EFI: debug point %s\n", efiDbgPointName((EFIDBGPOINT)u32))); 1535 } 1536 rc = VINF_SUCCESS; 1537 } 1538 else 1539 rc = PDMDevHlpDBGFStop(pDevIns, RT_SRC_POS, "Invalid debug point %#x\n", u32); 1540 break; 1541 #else 1542 return VINF_IOM_R3_IOPORT_WRITE; 1543 #endif 1544 1545 case EFI_PORT_IMAGE_EVENT: 1546 rc = efiPortImageEventWrite(pThis, u32, cb); 1344 1547 break; 1345 1548 … … 1438 1641 LogRel(("EFI: Loaded invalid variable value length %#x\n", pEfiVar->cbValue)); 1439 1642 } 1440 size_t cchVarName =RTStrNLen(pEfiVar->szName, sizeof(pEfiVar->szName));1643 uint32_t cchVarName = (uint32_t)RTStrNLen(pEfiVar->szName, sizeof(pEfiVar->szName)); 1441 1644 if (cchVarName >= sizeof(pEfiVar->szName)) 1442 1645 { … … 1588 1791 pThis->iPanicMsg = 0; 1589 1792 pThis->szPanicMsg[0] = '\0'; 1793 1794 #ifdef DEVEFI_WITH_VBOXDBG_SCRIPT 1795 /* 1796 * Zap the debugger script 1797 */ 1798 RTFileDelete("./DevEFI.VBoxDbg"); 1799 #endif 1590 1800 } 1591 1801 … … 2000 2210 2001 2211 //strcpy(pThis->szBootArgs, "-v keepsyms=1 io=0xf"); 2002 LogRel(("EFI boot args:%s\n", pThis->szBootArgs));2212 LogRel(("EFI: boot args = %s\n", pThis->szBootArgs)); 2003 2213 2004 2214 /* … … 2012 2222 if (pszDeviceProps) 2013 2223 { 2014 LogRel(("EFI device props:%s\n", pszDeviceProps));2224 LogRel(("EFI: device props = %s\n", pszDeviceProps)); 2015 2225 rc = efiParseDeviceString(pThis, pszDeviceProps); 2016 2226 MMR3HeapFree(pszDeviceProps); … … 2055 2265 pThis->cyUgaResolution = 768; 2056 2266 } 2057 2058 #ifdef DEVEFI_WITH_VBOXDBG_SCRIPT2059 /*2060 * Zap the debugger script2061 */2062 RTFileDelete("./DevEFI.VBoxDbg");2063 #endif2064 2267 2065 2268 /* -
trunk/src/VBox/Devices/EFI/DevEFI.h
r48707 r48727 41 41 #define EFI_PORT_BASE 0xEF10 42 42 /** The number of ports. */ 43 #define EFI_PORT_COUNT 0x000 643 #define EFI_PORT_COUNT 0x0008 44 44 45 45 … … 117 117 #define VBOX_EFI_TOP_OF_STACK 0x300000 118 118 119 #define EFI_ VARIABLE_OP(EFI_PORT_BASE+0x4)120 #define EFI_ VARIABLE_PARAM(EFI_PORT_BASE+0x5)119 #define EFI_PORT_VARIABLE_OP (EFI_PORT_BASE+0x4) 120 #define EFI_PORT_VARIABLE_PARAM (EFI_PORT_BASE+0x5) 121 121 122 122 #define EFI_VARIABLE_OP_QUERY 0xdead0001 … … 156 156 } EFIVAROP; 157 157 158 159 /** Debug point. */ 160 #define EFI_PORT_DEBUG_POINT (EFI_PORT_BASE + 0x6) 161 162 /** 163 * EFI debug points. 164 */ 165 typedef enum EFIDBGPOINT 166 { 167 /** Invalid. */ 168 EFIDBGPOINT_INVALID = 0, 169 /** DEBUG_AGENT_INIT_PREMEM_SEC. */ 170 EFIDBGPOINT_SEC_PREMEM = 1, 171 /** DEBUG_AGENT_INIT_POST_SEC. */ 172 EFIDBGPOINT_SEC_POSTMEM, 173 /** DEBUG_AGENT_INIT_DXE_CORE. */ 174 EFIDBGPOINT_DXE_CORE, 175 /** DEBUG_AGENT_INIT_. */ 176 EFIDBGPOINT_SMM, 177 /** DEBUG_AGENT_INIT_ENTER_SMI. */ 178 EFIDBGPOINT_SMI_ENTER, 179 /** DEBUG_AGENT_INIT_EXIT_SMI. */ 180 EFIDBGPOINT_SMI_EXIT, 181 /** DEBUG_AGENT_INIT_S3. */ 182 EFIDBGPOINT_GRAPHICS, 183 /** DEBUG_AGENT_INIT_DXE_AP. */ 184 EFIDBGPOINT_DXE_AP, 185 /** End of valid points. */ 186 EFIDBGPOINT_END, 187 /** Blow up the type to 32-bits. */ 188 EFIDBGPOINT_32BIT_HACK = 0x7fffffff 189 } EFIDBGPOINT; 190 191 192 /** EFI image load or unload event. All writes are 32-bit writes. */ 193 #define EFI_PORT_IMAGE_EVENT (EFI_PORT_BASE + 0x7) 194 195 /** @defgroup grp_devefi_image_evt EFI Image Events (EFI_PORT_IMAGE_EVENT). 196 * 197 * The lower 8-bit of the values written to EFI_PORT_IMAGE_EVENT can be seen as 198 * the command. The start and complete commands does not have any additional 199 * payload. The other commands uses bit 8 thru 23 or 8 thru 15 to pass a value. 200 * 201 * @{ */ 202 203 /** The command mask. */ 204 #define EFI_IMAGE_EVT_CMD_MASK UINT32_C(0x000000ff) 205 /** Get the payload value. */ 206 #define EFI_IMAGE_EVT_GET_PAYLOAD(a_u32) ((a_u32) >> 8) 207 /** Get the payload value as unsigned 16-bit. */ 208 #define EFI_IMAGE_EVT_GET_PAYLOAD_U16(a_u32) ( EFI_IMAGE_EVT_GET_PAYLOAD(a_u32) & UINT16_MAX ) 209 /** Get the payload value as unsigned 8-bit. */ 210 #define EFI_IMAGE_EVT_GET_PAYLOAD_U8(a_u32) ( EFI_IMAGE_EVT_GET_PAYLOAD(a_u32) & UINT8_MAX ) 211 /** Combines a command and a payload value. */ 212 #define EFI_IMAGE_EVT_MAKE(a_uCmd, a_uPayload) ( ((a_uCmd) & UINT32_C(0xff)) | (uint32_t)((a_uPayload) << 8) ) 213 214 /** Invalid. */ 215 #define EFI_IMAGE_EVT_CMD_INVALID UINT32_C(0x00000000) 216 /** The event is complete. */ 217 #define EFI_IMAGE_EVT_CMD_COMPLETE UINT32_C(0x00000001) 218 /** Starts a 32-bit load event. Requires name and address, size is optional. */ 219 #define EFI_IMAGE_EVT_CMD_START_LOAD32 UINT32_C(0x00000002) 220 /** Starts a 64-bit load event. Requires name and address, size is optional. */ 221 #define EFI_IMAGE_EVT_CMD_START_LOAD64 UINT32_C(0x00000003) 222 /** Starts a 32-bit unload event. Requires name and address. */ 223 #define EFI_IMAGE_EVT_CMD_START_UNLOAD32 UINT32_C(0x00000004) 224 /** Starts a 64-bit unload event. Requires name and address. */ 225 #define EFI_IMAGE_EVT_CMD_START_UNLOAD64 UINT32_C(0x00000005) 226 227 /** The command for writing to the second address register (64-bit). 228 * Takes a 16-bit payload value. The register value is shifted 16-bits 229 * to the left and then the payload is ORed in. */ 230 #define EFI_IMAGE_EVT_CMD_ADDR0 UINT32_C(0x00000006) 231 /** The command for writing to the second address register (64-bit). 232 * Takes a 16-bit payload value. The register value is shifted 16-bits 233 * to the left and then the payload is ORed in. */ 234 #define EFI_IMAGE_EVT_CMD_ADDR1 UINT32_C(0x00000007) 235 /** The command for writing to the first size register (64-bit). 236 * Takes a 16-bit payload value. The register value is shifted 16-bits 237 * to the left and then the payload is ORed in. */ 238 #define EFI_IMAGE_EVT_CMD_SIZE0 UINT32_C(0x00000008) 239 /** The command for appending a character to the module name. 240 * Takes a 7-bit payload value that. The value is appended to the field if 241 * there is room. */ 242 #define EFI_IMAGE_EVT_CMD_NAME UINT32_C(0x00000009) 243 158 244 /** @} */ 159 245 246 247 /** @} */ 248 160 249 #endif -
trunk/src/VBox/Devices/EFI/Firmware/BaseTools/Source/C/Include/X64/ProcessorBind.h
r48674 r48727 122 122 #endif 123 123 124 #if !defined(UINT8_MAX) || !defined(VBOX) /* collides with iprt/stdint.h */ 124 125 #define UINT8_MAX 0xff 126 #endif 125 127 126 128 #else -
trunk/src/VBox/Devices/EFI/Firmware/Makefile.kmk
r48674 r48727 186 186 include $(FILE_KBUILD_SUB_FOOTER) 187 187 188 # 189 # Incomplete list of dependencies relative. 190 # 191 VBOX_EFI_DEPENDENCIES = \ 192 $(VBOX_PATH_EFI_FIRMWARE)/../DevEFI.h \ 193 $(VBOX_PATH_EFI_FIRMWARE)/VBoxPkg/Library/VBoxDebugAgentLib/VBoxDebugAgentLib.c \ 194 $(VBOX_PATH_EFI_FIRMWARE)/VBoxPkg/Library/VBoxDebugAgentLib/VBoxDebugAgentLib.inf \ 195 $(VBOX_PATH_EFI_FIRMWARE)/VBoxPkg/Library/VBoxPeCoffExtraActionLib/VBoxPeCoffExtraActionLib.c \ 196 $(VBOX_PATH_EFI_FIRMWARE)/VBoxPkg/Library/VBoxPeCoffExtraActionLib/VBoxPeCoffExtraActionLib.inf \ 197 $(VBOX_PATH_EFI_FIRMWARE)/VBoxPkg/VBoxPkg.dec \ 198 \ 199 $(VBOX_PATH_EFI_FIRMWARE)/OvmfPkg/OvmfPkg.dec \ 188 200 189 201 # … … 270 282 -e 's,^DEFINE VS2010_BIN[[:space:]]*=.*$(DOLLAR),DEFINE VS2010_BIN = $(PATH_TOOL_$(VBOX_VCC_TOOL))/bin,' \ 271 283 -e 's,^DEFINE VS2010_DLL[[:space:]]*=.*$(DOLLAR),DEFINE VS2010_DLL = DEF(VS2010_BIN),' \ 284 -e 's,^\([^=]*_VS2010[a-zA-Z_0-9]*_CC_FLAGS[[:space:]]*=.*\)$(DOLLAR),\1 /Oy-,' \ 272 285 --output $@ $< 286 # -e 's,^\([^=]*_VS2010[a-zA-Z_0-9]*_CC_FLAGS[[:space:]]*=.*\) /O1ib2 \(.*\)$(DOLLAR),\1 /Osi /GF /Gy \2 /Oy-,' 273 287 else 274 288 $(error Unexpected VBOX_EFI_TOOL_CHAIN value "$(VBOX_EFI_TOOL_CHAIN)") … … 280 294 $(VBoxEfiFirmware_0_OUTDIR)/x86/Conf/target.txt \ 281 295 $(VBoxEfiFirmware_0_OUTDIR)/x86/Conf/tools_def.txt \ 282 $$(VBoxEfiResetVector-x86_1_TARGET) 296 $$(VBoxEfiResetVector-x86_1_TARGET) \ 297 $(VBOX_EFI_DEPENDENCIES) \ 298 $(VBOX_PATH_EFI_FIRMWARE)/OvmfPkg/OvmfPkgIa32.dsc \ 299 $(VBOX_PATH_EFI_FIRMWARE)/OvmfPkg/OvmfPkgIa32.fdf 283 300 + $(VBOX_EFI_BUILD_CMD) \ 284 301 --vbox-target-conf "$(VBoxEfiFirmware_0_OUTDIR)/x86/Conf/target.txt" \ … … 326 343 -e 's,^DEFINE VS2010_BIN[[:space:]]*=.*$(DOLLAR),DEFINE VS2010_BIN = $(PATH_TOOL_$(VBOX_VCC_TOOL))/bin,' \ 327 344 -e 's,^DEFINE VS2010_DLL[[:space:]]*=.*$(DOLLAR),DEFINE VS2010_DLL = DEF(VS2010_BIN),' \ 328 -e 's,^\([^=]*_VS2010[a-zA-Z_0-9]*_CC_FLAGS[[:space:]]*=.*\) /X \(.*\)$(DOLLAR),\1 \2 ,' \345 -e 's,^\([^=]*_VS2010[a-zA-Z_0-9]*_CC_FLAGS[[:space:]]*=.*\) /X \(.*\)$(DOLLAR),\1 \2 /Oy-,' \ 329 346 --output $@ $< 330 347 else … … 336 353 $(VBoxEfiFirmware_0_OUTDIR)/amd64/Conf/target.txt \ 337 354 $(VBoxEfiFirmware_0_OUTDIR)/amd64/Conf/tools_def.txt \ 338 $$(VBoxEfiResetVector-amd64_1_TARGET) 355 $$(VBoxEfiResetVector-amd64_1_TARGET) \ 356 $(VBOX_EFI_DEPENDENCIES) \ 357 $(VBOX_PATH_EFI_FIRMWARE)/OvmfPkg/OvmfPkgX64.dsc \ 358 $(VBOX_PATH_EFI_FIRMWARE)/OvmfPkg/OvmfPkgX64.fdf 339 359 + $(VBOX_EFI_BUILD_CMD) \ 340 360 --vbox-target-conf "$(VBoxEfiFirmware_0_OUTDIR)/amd64/Conf/target.txt" \ -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/BaseLib.inf
r48674 r48727 299 299 X86DisablePaging32.c 300 300 301 # VBox - enable this for non-optimized IA32 builds. 302 # # Compiler helper (C RunTime) functions 303 # ../../../StdLib/LibC/CRT/Ia32/llmul.c | MSFT # __allmul 304 # ../../../StdLib/LibC/CRT/Ia32/llshl.c | MSFT # __allshl 305 # ../../../StdLib/LibC/CRT/Ia32/ulldiv.c | MSFT # __aulldiv 306 # ../../../StdLib/LibC/CRT/Ia32/ullrem.c | MSFT # __aullrem 307 # ../../../StdLib/LibC/CRT/Ia32/ullshr.c | MSFT # __aullshr 308 # ../../../StdLib/LibC/CRT/Ia32/lldiv.c | MSFT # __alldiv 309 # ../../../StdLib/LibC/CRT/Ia32/llrem.c | MSFT # __allrem 310 # ../../../StdLib/LibC/CRT/Ia32/lldvrm.c | MSFT # __alldvrm 311 # ../../../StdLib/LibC/CRT/Ia32/ulldvrm.c | MSFT # __aulldvrm 312 # VBox - end 313 301 314 [Sources.X64] 302 315 X64/Thunk16.asm … … 490 503 gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength 491 504 gEfiMdePkgTokenSpaceGuid.PcdVerifyNodeInList 505 506 # VBox - enable this for non-optimized IA32 builds. 507 #[BuildOptions] 508 # MSFT:*_*_*_CC_FLAGS = /GL- 509 # VBox - end -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/OvmfPkgIa32.dsc
r48674 r48727 114 114 SerializeVariablesLib|OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.inf 115 115 116 !ifdef $(VBOX) 117 PeCoffExtraActionLib|VBoxPkg/Library/VBoxPeCoffExtraActionLib/VBoxPeCoffExtraActionLib.inf 118 DebugAgentLib|VBoxPkg/Library/VBoxDebugAgentLib/VBoxDebugAgentLib.inf 119 !else 116 120 !ifdef $(SOURCE_DEBUG_ENABLE) 117 121 PeCoffExtraActionLib|SourceLevelDebugPkg/Library/PeCoffExtraActionLibDebug/PeCoffExtraActionLibDebug.inf … … 121 125 DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf 122 126 !endif 127 !endif 123 128 124 129 ResetSystemLib|OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf … … 134 139 ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf 135 140 ExtractGuidedSectionLib|MdePkg/Library/BaseExtractGuidedSectionLib/BaseExtractGuidedSectionLib.inf 141 !ifdef $(VBOX) 136 142 !ifdef $(SOURCE_DEBUG_ENABLE) 137 143 DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib.inf 144 !endif 138 145 !endif 139 146 HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf … … 177 184 PeiResourcePublicationLib|MdePkg/Library/PeiResourcePublicationLib/PeiResourcePublicationLib.inf 178 185 ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf 186 !ifdef $(VBOX) 179 187 !ifdef $(SOURCE_DEBUG_ENABLE) 180 188 DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib.inf 189 !endif 181 190 !endif 182 191 … … 193 202 PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf 194 203 ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf 204 !ifdef $(VBOX) 195 205 !ifdef $(SOURCE_DEBUG_ENABLE) 196 206 DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf 207 !endif 197 208 !endif 198 209 -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/OvmfPkgX64.dsc
r48674 r48727 114 114 LockBoxLib|MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.inf 115 115 116 !ifdef $(VBOX) 117 PeCoffExtraActionLib|VBoxPkg/Library/VBoxPeCoffExtraActionLib/VBoxPeCoffExtraActionLib.inf 118 DebugAgentLib|VBoxPkg/Library/VBoxDebugAgentLib/VBoxDebugAgentLib.inf 119 !else 116 120 !ifdef $(SOURCE_DEBUG_ENABLE) 117 121 PeCoffExtraActionLib|SourceLevelDebugPkg/Library/PeCoffExtraActionLibDebug/PeCoffExtraActionLibDebug.inf … … 121 125 DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf 122 126 !endif 127 !endif 123 128 124 129 ResetSystemLib|OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf … … 134 139 ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf 135 140 ExtractGuidedSectionLib|MdePkg/Library/BaseExtractGuidedSectionLib/BaseExtractGuidedSectionLib.inf 141 !ifdef $(VBOX) 136 142 !ifdef $(SOURCE_DEBUG_ENABLE) 137 143 DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib.inf 144 !endif 138 145 !endif 139 146 HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf … … 177 184 PeiResourcePublicationLib|MdePkg/Library/PeiResourcePublicationLib/PeiResourcePublicationLib.inf 178 185 ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf 186 !ifdef $(VBOX) 179 187 !ifdef $(SOURCE_DEBUG_ENABLE) 180 188 DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib.inf 189 !endif 181 190 !endif 182 191 … … 193 202 PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf 194 203 ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf 204 !ifdef $(VBOX) 195 205 !ifdef $(SOURCE_DEBUG_ENABLE) 196 206 DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf 207 !endif 197 208 !endif 198 209 -
trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/Library/VBoxDebugLib/VBoxDebugLib.c
r48674 r48727 79 79 } 80 80 81 /** 82 * Adds a character to the panic message. 83 * 84 * @param ch The ASCII char to add. 85 */ 86 static void 87 VBoxPanicMsgChar(int ch) 88 { 89 ASMOutU16(EFI_PANIC_PORT, EFI_PANIC_CMD_MSG_FROM_CHAR(ch)); 90 } 91 92 /** 93 * Adds a string to the panic message. 94 * 95 * @param pszString The string to add. 96 */ 97 static void 98 VBoxPanicMsgString(const char *pszString) 99 { 100 char ch; 101 while ((ch = *pszString++) != '\0') 102 VBoxPanicMsgChar(ch); 103 } 104 105 /** 106 * Adds a unsigned decimal number to the panic message. 107 * 108 * @param uValue The value. 109 */ 110 static void 111 VBoxPanicMsgDecimalU32(uint32_t uValue) 112 { 113 char szTmp[32]; 114 unsigned off = sizeof(szTmp) - 1; 115 116 szTmp[off] = '\0'; 117 do 118 { 119 char chDigit = uValue % 10; 120 uValue /= 10; 121 szTmp[--off] = chDigit + '0'; 122 } while (uValue != 0 && off > 0); 123 124 VBoxPanicMsgString(&szTmp[off]); 125 } 81 126 82 127 VOID EFIAPI … … 85 130 RTCCUINTREG SavedFlags = ASMIntDisableFlags(); 86 131 87 VBoxPrintString("EFI Assertion failed! File="); 88 VBoxPrintString(FileName ? FileName : "<NULL>"); 89 VBoxPrintString(" line=0x"); 90 VBoxPrintHex(LineNumber, sizeof(LineNumber)); 91 VBoxPrintString("\nDescription: "); 92 VBoxPrintString(Description ? Description : "<NULL>"); 93 94 ASMOutU8(EFI_PANIC_PORT, 2); /** @todo fix this. */ 132 ASMOutU8(EFI_PANIC_PORT, EFI_PANIC_CMD_START_MSG); 133 VBoxPanicMsgString("EFI Assertion failed!" 134 "\nFile: "); 135 VBoxPanicMsgString(FileName ? FileName : "<NULL>"); 136 VBoxPanicMsgString("\nLine: "); 137 VBoxPanicMsgDecimalU32((uint32_t)LineNumber); 138 VBoxPanicMsgString("\nEDescription: "); 139 VBoxPanicMsgString(Description ? Description : "<NULL>"); 140 ASMOutU8(EFI_PANIC_PORT, EFI_PANIC_CMD_END_MSG); 95 141 96 142 ASMSetFlags(SavedFlags); 97 143 } 98 144 99 CHAR16 *VBoxDebugDevicePath2Str(IN EFI_DEVICE_PATH_PROTOCOL *pDevicePath)145 CHAR16 *VBoxDebugDevicePath2Str(IN EFI_DEVICE_PATH_PROTOCOL *pDevicePath) 100 146 { 101 147 #if 0 … … 116 162 } 117 163 118 CHAR16 *VBoxDebugHandleDevicePath2Str(IN EFI_HANDLE hHandle)164 CHAR16 *VBoxDebugHandleDevicePath2Str(IN EFI_HANDLE hHandle) 119 165 { 120 166 #if 0 … … 143 189 #endif 144 190 } 145 CHAR16 *VBoxDebugPrintDevicePath(IN EFI_DEVICE_PATH_PROTOCOL *pDevicePath)191 CHAR16 *VBoxDebugPrintDevicePath(IN EFI_DEVICE_PATH_PROTOCOL *pDevicePath) 146 192 { 147 193 #if 0 -
trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxVariable/InitVariable.c
r48674 r48727 58 58 UINT32 idxBuffer = 0; 59 59 for (idxBuffer = 0; idxBuffer < cbBuffer; ++idxBuffer) 60 pu8Buffer[idxBuffer] = ASMInU8(EFI_ VARIABLE_OP);60 pu8Buffer[idxBuffer] = ASMInU8(EFI_PORT_VARIABLE_OP); 61 61 return idxBuffer; 62 62 } … … 64 64 DECLINLINE(void) VBoxWriteNVRAMU32Param(UINT32 u32CodeParam, UINT32 u32Param) 65 65 { 66 ASMOutU32(EFI_ VARIABLE_OP, u32CodeParam);67 ASMOutU32(EFI_ VARIABLE_PARAM, u32Param);66 ASMOutU32(EFI_PORT_VARIABLE_OP, u32CodeParam); 67 ASMOutU32(EFI_PORT_VARIABLE_PARAM, u32Param); 68 68 } 69 69 … … 72 72 UINT32 idxParam = 0; 73 73 for (idxParam = 0; idxParam < cbParam; ++idxParam) 74 ASMOutU8(EFI_ VARIABLE_PARAM, pbParam[idxParam]);74 ASMOutU8(EFI_PORT_VARIABLE_PARAM, pbParam[idxParam]); 75 75 return idxParam; 76 76 } … … 81 81 UINTN cwcName = StrLen(pwszName); 82 82 83 ASMOutU32(EFI_ VARIABLE_OP, EFI_VM_VARIABLE_OP_NAME_UTF16);83 ASMOutU32(EFI_PORT_VARIABLE_OP, EFI_VM_VARIABLE_OP_NAME_UTF16); 84 84 for (i = 0; i <= cwcName; i++) 85 ASMOutU16(EFI_ VARIABLE_PARAM, pwszName[i]);85 ASMOutU16(EFI_PORT_VARIABLE_PARAM, pwszName[i]); 86 86 } 87 87 88 88 DECLINLINE(UINT32) VBoxWriteNVRAMGuidParam(const EFI_GUID *pGuid) 89 89 { 90 ASMOutU32(EFI_ VARIABLE_OP, EFI_VM_VARIABLE_OP_GUID);90 ASMOutU32(EFI_PORT_VARIABLE_OP, EFI_VM_VARIABLE_OP_GUID); 91 91 return VBoxWriteNVRAMByteArrayParam((UINT8 *)pGuid, sizeof(EFI_GUID)); 92 92 } … … 99 99 VBoxWriteNVRAMU32Param(EFI_VM_VARIABLE_OP_START, u32Operation); 100 100 101 while ((u32Rc = ASMInU32(EFI_ VARIABLE_OP)) == EFI_VARIABLE_OP_STATUS_BSY)101 while ((u32Rc = ASMInU32(EFI_PORT_VARIABLE_OP)) == EFI_VARIABLE_OP_STATUS_BSY) 102 102 { 103 103 #if 0 … … 166 166 */ 167 167 UINT32 VarLen; 168 ASMOutU32(EFI_ VARIABLE_OP, EFI_VM_VARIABLE_OP_VALUE_LENGTH);169 VarLen = ASMInU32(EFI_ VARIABLE_OP);168 ASMOutU32(EFI_PORT_VARIABLE_OP, EFI_VM_VARIABLE_OP_VALUE_LENGTH); 169 VarLen = ASMInU32(EFI_PORT_VARIABLE_OP); 170 170 LogFlowFuncMarkVar(*DataSize, "%d"); 171 171 LogFlowFuncMarkVar(VarLen, "%d"); … … 177 177 */ 178 178 *DataSize = VarLen; 179 ASMOutU32(EFI_ VARIABLE_OP, EFI_VM_VARIABLE_OP_VALUE);179 ASMOutU32(EFI_PORT_VARIABLE_OP, EFI_VM_VARIABLE_OP_VALUE); 180 180 VBoxReadNVRAM((UINT8 *)Data, VarLen); 181 181 182 182 if (Attributes) 183 183 { 184 ASMOutU32(EFI_ VARIABLE_OP, EFI_VM_VARIABLE_OP_ATTRIBUTE);185 *Attributes = ASMInU32(EFI_ VARIABLE_OP);184 ASMOutU32(EFI_PORT_VARIABLE_OP, EFI_VM_VARIABLE_OP_ATTRIBUTE); 185 *Attributes = ASMInU32(EFI_PORT_VARIABLE_OP); 186 186 LogFlowFuncMarkVar(Attributes, "%x"); 187 187 } … … 271 271 */ 272 272 UINT32 cwcName; 273 ASMOutU32(EFI_ VARIABLE_OP, EFI_VM_VARIABLE_OP_NAME_LENGTH_UTF16);274 cwcName = ASMInU32(EFI_ VARIABLE_OP);273 ASMOutU32(EFI_PORT_VARIABLE_OP, EFI_VM_VARIABLE_OP_NAME_LENGTH_UTF16); 274 cwcName = ASMInU32(EFI_PORT_VARIABLE_OP); 275 275 if ((cwcName + 1) * 2 <= *VariableNameSize) /* ASSUMES byte size is specified */ 276 276 { … … 280 280 * Read back the result. 281 281 */ 282 ASMOutU32(EFI_ VARIABLE_OP, EFI_VM_VARIABLE_OP_GUID);282 ASMOutU32(EFI_PORT_VARIABLE_OP, EFI_VM_VARIABLE_OP_GUID); 283 283 VBoxReadNVRAM((UINT8 *)VendorGuid, sizeof(EFI_GUID)); 284 284 285 ASMOutU32(EFI_ VARIABLE_OP, EFI_VM_VARIABLE_OP_NAME_UTF16);285 ASMOutU32(EFI_PORT_VARIABLE_OP, EFI_VM_VARIABLE_OP_NAME_UTF16); 286 286 for (i = 0; i < cwcName; i++) 287 VariableName[i] = ASMInU16(EFI_ VARIABLE_OP);287 VariableName[i] = ASMInU16(EFI_PORT_VARIABLE_OP); 288 288 VariableName[i] = '\0'; 289 289 … … 356 356 VBoxWriteNVRAMU32Param(EFI_VM_VARIABLE_OP_VALUE_LENGTH, (UINT32)DataSize); 357 357 /* fill value bytes */ 358 ASMOutU32(EFI_ VARIABLE_OP, EFI_VM_VARIABLE_OP_VALUE);358 ASMOutU32(EFI_PORT_VARIABLE_OP, EFI_VM_VARIABLE_OP_VALUE); 359 359 VBoxWriteNVRAMByteArrayParam(Data, (UINT32)DataSize); 360 360 /* start fetch operation */
Note:
See TracChangeset
for help on using the changeset viewer.