]> git.proxmox.com Git - mirror_edk2.git/commit - OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.c
When SOURCE_DEBUG_ENABLE is set, a TimerLib is linked into the SEC Phase to support...
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 4 Oct 2012 20:58:21 +0000 (20:58 +0000)
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 4 Oct 2012 20:58:21 +0000 (20:58 +0000)
commitd3a24ff5516446e6beeb8cc07e28fd5b24c19405
tree779fc5b690386026bfece223b02e5660b1bbe3a0
parenteaeb45076e569a5b3b159aba0ecd425c4a27a2f3
When SOURCE_DEBUG_ENABLE is set, a TimerLib is linked into the SEC Phase to support the Debug Agent and the TimerLib is mapped into read-only ROM/FLASH.

The TimerLib in the OvmfPkg uses a global variable called mPmba and depends on that global being updated.  This works for modules loaded into memory, but not  XIP modules in ROM/FLASH.

This patch removes the mPmba global variable and instead reads the PIIX4 Power Management Base Address from PCI configuration space when it is needed.  This patch also simplifies the initialization logic in the constructor and introduces #defines to eliminate hard coded values in the function implementations.  According to the PIIX4 documentation, the IO Space enable bit in the PCI Command Register does not have to be set for the Power Management Base Address to be decoded, so that one op has been removed from the constructor.

I have tested this patch with QEMU and verified that the UDK Debugger us functional when SOURCE_DEBUG_ENABLE is set.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
I also tested it with RHEL-6.3 guest boot/shutdown, Fedora 18 Alpha XFCE
guest boot/shutdown, and Windows 8 Consumer Preview guest
boot/reboot/shutdown. (RHEL-6.3 host.) I didn't notice any adverse effects.

Tested-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13783 6f19259b-4bc3-4df7-8a09-765794883524
OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.c