Changeset 85951 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Aug 31, 2020 11:41:01 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Library/MpInitLib/MpLib.c
r85718 r85951 10 10 11 11 #include "MpLib.h" 12 #ifdef VBOX 13 # include <Library/IoLib.h> 14 # include "../../../../DevEFI.h" 15 #endif 12 16 13 17 EFI_GUID mCpuInitMpLibHobGuid = CPU_INIT_MP_LIB_HOB_GUID; … … 476 480 } 477 481 482 #ifdef VBOX 483 /* 484 * @todo move this function to the library. 485 */ 486 UINT32 VBoxGetVmVariable(UINT32 Variable, CHAR8* Buffer, UINT32 Size) 487 { 488 UINT32 VarLen, i; 489 490 IoWrite32(EFI_INFO_PORT, Variable); 491 VarLen = IoRead32(EFI_INFO_PORT); 492 493 for (i = 0; i < VarLen && i < Size; i++) 494 Buffer[i] = IoRead8(EFI_INFO_PORT); 495 496 return VarLen; 497 } 498 #endif 499 478 500 /** 479 501 This function will get CPU count in the system. … … 491 513 CPU_INFO_IN_HOB *CpuInfoInHob; 492 514 BOOLEAN X2Apic; 515 #ifdef VBOX 516 CHAR8 u8ApicMode; 517 #endif 493 518 494 519 // … … 527 552 } 528 553 } 554 #ifdef VBOX 555 /* Force x2APIC mode if the VM config forces it. */ 556 VBoxGetVmVariable(EFI_INFO_INDEX_APIC_MODE, &u8ApicMode, sizeof(u8ApicMode)); 557 if (u8ApicMode == EFI_APIC_MODE_X2APIC) 558 X2Apic = TRUE; 559 #endif 529 560 530 561 if (X2Apic) {
Note:
See TracChangeset
for help on using the changeset viewer.