hpet/rtc: Rework RTC IRQ replacement by HPET
Allow the intercept the RTC IRQ for the HPET legacy mode. Then pushrouting to IRQ8 completely into the HPET. This allows to turnhpet_in_legacy_mode() into a private function. Furthermore, this stopsthe RTC from clearing IRQ8 even if the HPET is in control....
hpet: Drop static state
Instead of keeping a static reference around, pass the state tohpet_enabled and hpet_get_ticks. All callers now have it at hand. Willonce allow to instantiate the HPET more than a single time.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
hpet: Silence warning on write to running main counter
Setting the main counter while the HPET is enabled may not be a goodidea of the guest, but it is supported and should, thus, not spam thehost console with warnings.
hpet: Move static timer field initialization
Properly initialize HPETTimer::tn and HPETTimer::state once duringhpet_init instead of (re-)writing them on every reset.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
hpet: Convert to qdev
Register the HPET as a sysbus device and create it that way. As it canroute 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 vmstateregistration into its hands as well....
hpet: Start/stop timer when HPET_TN_ENABLE is modified
We have to update the qemu timer when the per-timer enable bit istoggled, just like for HPET_CFG_ENABLE changes.
hpet: Catch out-of-bounds timer access
Also prevent out-of-bounds write access to the timers but don't spam thehost console if it triggers.
hpet: Coding style cleanups and some refactorings
This moves the private HPET structures into the C module, simplifiessome helper functions and fixes most coding style issues (biggest chunkwas improper switch-case indention). No functional changes.
esp: lower IRQ on soft reset
42f1ced228c9b616cfa2b69846025271618e4ef5 removed irq loweringduring reset. However, for chip reset command and DMA reset signal,its actually the correct thing to do.
Lower IRQ on soft reset only.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
qbus: fix memory leak in qbus_free()
BusState::name is allocated in qbus_create_inplace().So it should be freed by qbus_free().
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
View revisions
Also available in: Atom