summaryrefslogtreecommitdiffstats
path: root/hw/hpet_emul.h
Commit message (Collapse)AuthorAgeFilesLines
* pass info about hpets to seabios.]Gleb Natapov2010-06-141-0/+15
| | | | | | | | | | | | | Currently HPET ACPI table is created regardless of whether qemu actually created hpet device. This may confuse some guests that don't check that hpet is functional before using it. Solve this by passing info about hpets in qemu to seabios via fw config interface. Additional benefit is that seabios no longer uses hard coded hpet configuration. Proposed interface supports up to 8 hpets. This is the number defined by hpet spec. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* hpet: Add MSI supportJan Kiszka2010-06-131-1/+3
| | | | | | | | | | | | | This implements the HPET capability of routing IRQs to the front-side bus, aka MSI support. This feature can be enabled via the qdev property "msi" and is off by default. Note that switching it on can cause guests (at least Linux) to use the HPET as timer instead of the LAPIC. KVM users should recall that only the latter is currently available as fast in-kernel model. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* hpet: Make number of timers configurableJan Kiszka2010-06-131-1/+5
| | | | | | | | | | One HPET block supports up to 32 timers. Allow to instantiate more than the recommended and implemented minimum of 3. The number is configured via the qdev property "timers". It is also saved/restored so that it need not match between migration peers. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* hpet/rtc: Rework RTC IRQ replacement by HPETJan Kiszka2010-06-131-4/+0
| | | | | | | | | | | | | | | | Allow the intercept the RTC IRQ for the HPET legacy mode. Then push routing to IRQ8 completely into the HPET. This allows to turn hpet_in_legacy_mode() into a private function. Furthermore, this stops the RTC from clearing IRQ8 even if the HPET is in control. This patch comes with a side effect: The RTC timers will no longer be stoppend when there is no IRQ consumer, possibly causing a minor performance degration. But as the guest may want to redirect the RTC to the SCI in that mode, it should normally disable unused IRQ source anyway. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* hpet: Convert to qdevJan Kiszka2010-06-131-1/+2
| | | | | | | | | | Register the HPET as a sysbus device and create it that way. As it can route its IRQs to any ISA IRQ, we need to connect it to all 24 of them. Once converted to qdev, we can move reset handler and vmstate registration into its hands as well. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* hpet: Coding style cleanups and some refactoringsJan Kiszka2010-06-131-30/+1
| | | | | | | | | | This moves the private HPET structures into the C module, simplifies some helper functions and fixes most coding style issues (biggest chunk was improper switch-case indention). No functional changes. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* TARGET_I386 is always defined if TARGET_X86_64 is definedJuan Quintela2009-10-121-1/+1
| | | | | | Patchworks-ID: 35378 Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* HPET fixes for reg writesBeth Kon2009-07-271-6/+1
| | | | | | | | | | | | | | | | | | | | | | This patch addresses the problems found by Andriy Gapon: - The code was incorrectly overwriting the high order 32 bits of the timer and hpet config registers. This didn't show up in testing because linux and windows use hpet in legacy mode, where the high order 32 bits (advertising available interrupts) of the timer config register are ignored, and the high order 32 bits of the hpet config register are reserved and unused. - The mask for level-triggered interrupts was off by a bit. (hpet doesn't currently support level-triggered interrupts). In addition, I removed some unused #defines, and corrected the ioapic interrupt values advertised. I'd set this up early in hpet development and never went back to correct it, and no bugs resulted since linux and windows use hpet in legacy mode where available interrupts are ignored. Signed-off-by: Beth Kon <eak@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* hpet config mask fixaurel322009-01-161-0/+2
| | | | | | | | | | I discovered a bug in the hpet code that caused Windows to boot without hpet. The config mask I was using was preventing the guest from placing the hpet into 32 bit mode. (Beth Kon) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6357 c046a42c-6fe2-441c-8c8c-71466251a162
* Remove trailing spaces introduced by commit 6081aurel322008-12-181-2/+2
| | | | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6085 c046a42c-6fe2-441c-8c8c-71466251a162
* Add HPET emulation to qemu (Beth Kon)aliguori2008-12-171-0/+85
This patch adds HPET emulation. It can be disabled with -disable-hpet. An hpet provides a more finely granular clocksource than otherwise available on PC. This means that latency-dependent applications (e.g. multimedia) will generally be smoother when using the HPET. Signed-off-by: Beth Kon <eak@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6081 c046a42c-6fe2-441c-8c8c-71466251a162
OpenPOWER on IntegriCloud