Changeset 58172 in vbox for trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.c
- Timestamp:
- Oct 12, 2015 10:32:18 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.c
r48674 r58172 25 25 // PIIX4 Power Management Base Address 26 26 // 27 #ifndef VBOX 27 28 UINT32 mPmba = 0x400; 29 #else 30 UINT32 mPmba = 0x4000; 31 #endif 28 32 29 33 #define PCI_BAR_IO 0x1 … … 41 45 42 46 **/ 47 #ifndef VBOX 43 48 RETURN_STATUS 44 49 EFIAPI … … 68 73 return RETURN_SUCCESS; 69 74 } 75 #else 76 RETURN_STATUS 77 EFIAPI 78 AcpiTimerLibConstructor ( 79 VOID 80 ) 81 { 82 UINT8 u8Device = 7; 83 UINT16 u16VendorID = 0; 84 UINT16 u16DeviceID = 0; 85 u16VendorID = PciRead16(PCI_LIB_ADDRESS(0, u8Device, 0, 0)); 86 u16DeviceID = PciRead16(PCI_LIB_ADDRESS(0, u8Device, 0, 2)); 87 if ( u16VendorID != 0x8086 88 || u16DeviceID != 0x7113) 89 return RETURN_ABORTED; 90 91 if (PciRead8 (PCI_LIB_ADDRESS (0,u8Device,0,0x80)) & 1) { 92 mPmba = PciRead32 (PCI_LIB_ADDRESS (0, u8Device, 0, 0x40)); 93 ASSERT (mPmba & PCI_BAR_IO); 94 DEBUG((DEBUG_INFO, "%a:%d mPmba:%x\n", __FUNCTION__, __LINE__, mPmba)); 95 mPmba &= ~PCI_BAR_IO; 96 DEBUG((DEBUG_INFO, "%a:%d mPmba:%x\n", __FUNCTION__, __LINE__, mPmba)); 97 } else { 98 PciAndThenOr32 (PCI_LIB_ADDRESS (0,u8Device,0,0x40), 99 (UINT32) ~0xfc0, mPmba); 100 PciOr8 (PCI_LIB_ADDRESS (0,u8Device,0,0x04), 0x01); 101 DEBUG((DEBUG_INFO, "%a:%d mPmba:%x\n", __FUNCTION__, __LINE__, mPmba)); 102 } 103 104 // 105 // ACPI Timer enable is in Bus 0, Device ?, Function 3 106 // 107 PciOr8 (PCI_LIB_ADDRESS (0,u8Device,0,0x80), 0x01); 108 return RETURN_SUCCESS; 109 } 110 #endif 70 111 71 112 /**
Note:
See TracChangeset
for help on using the changeset viewer.