VirtualBox

Changeset 58172 in vbox for trunk


Ignore:
Timestamp:
Oct 12, 2015 10:32:18 AM (9 years ago)
Author:
vboxsync
Message:

EFI: Remove AcpiTimerLib from VBoxPkg and merge changes with OvmfPkg AcpiTimerLib

Location:
trunk/src/VBox/Devices/EFI/Firmware
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.c

    r48674 r58172  
    2525// PIIX4 Power Management Base Address
    2626//
     27#ifndef VBOX
    2728UINT32 mPmba = 0x400;
     29#else
     30UINT32 mPmba = 0x4000;
     31#endif
    2832
    2933#define PCI_BAR_IO             0x1
     
    4145
    4246**/
     47#ifndef VBOX
    4348RETURN_STATUS
    4449EFIAPI
     
    6873  return RETURN_SUCCESS;
    6974}
     75#else
     76RETURN_STATUS
     77EFIAPI
     78AcpiTimerLibConstructor (
     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
    70111
    71112/**
  • trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/OvmfPkgIa32.dsc

    r48727 r58172  
    6767[LibraryClasses]
    6868  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
    69 !ifndef $(VBOX)
    7069  TimerLib|OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.inf
    71 !else
    72   TimerLib|VBoxPkg/Library/AcpiTimerLib/AcpiTimerLib.inf
    73 !endif
    7470  PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
    7571  BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf
     
    389385  MdeModulePkg/Universal/Metronome/Metronome.inf {
    390386    <LibraryClasses>
    391 !ifndef $(VBOX)
    392387      TimerLib|OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.inf
    393 !else
    394       TimerLib|VBoxPkg/Library/AcpiTimerLib/AcpiTimerLib.inf
    395 !endif
    396388  }
    397389
    398390  PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe.inf {
    399391    <LibraryClasses>
    400 !ifndef $(VBOX)
    401392      TimerLib|OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.inf
    402 !else
    403       TimerLib|VBoxPkg/Library/AcpiTimerLib/AcpiTimerLib.inf
    404 !endif
    405393  }
    406394
    407395  IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf {
    408396    <LibraryClasses>
    409 !ifndef $(VBOX)
    410397      TimerLib|OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.inf
    411 !else
    412       TimerLib|VBoxPkg/Library/AcpiTimerLib/AcpiTimerLib.inf
    413 !endif
    414398!ifdef $(CSM_ENABLE)
    415399      NULL|OvmfPkg/Csm/CsmSupportLib/CsmSupportLib.inf
  • trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/OvmfPkgX64.dsc

    r48727 r58172  
    6666[LibraryClasses]
    6767  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
    68 !ifndef $(VBOX)
    6968  TimerLib|OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.inf
    70 !else
    71   TimerLib|VBoxPkg/Library/AcpiTimerLib/AcpiTimerLib.inf
    72 !endif
    7369  PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
    7470  BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf
     
    389385  MdeModulePkg/Universal/Metronome/Metronome.inf {
    390386    <LibraryClasses>
    391 !ifndef $(VBOX)
    392387      TimerLib|OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.inf
    393 !else
    394       TimerLib|VBoxPkg/Library/AcpiTimerLib/AcpiTimerLib.inf
    395 !endif
    396388  }
    397389
    398390  PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe.inf {
    399391    <LibraryClasses>
    400 !ifndef $(VBOX)
    401392      TimerLib|OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.inf
    402 !else
    403       TimerLib|VBoxPkg/Library/AcpiTimerLib/AcpiTimerLib.inf
    404 !endif
    405393  }
    406394
    407395  IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf {
    408396    <LibraryClasses>
    409 !ifndef $(VBOX)
    410397      TimerLib|OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.inf
    411 !else
    412       TimerLib|VBoxPkg/Library/AcpiTimerLib/AcpiTimerLib.inf
    413 !endif
    414398!ifdef $(CSM_ENABLE)
    415399      NULL|OvmfPkg/Csm/CsmSupportLib/CsmSupportLib.inf
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette