History | View | Annotate | Download (22 kB)
rtc: split out macros into a header file and use in test case
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/mc146818: Drop unneeded #includes
pc.h and apic.h are not needed; apic.h would drag in x86 CPUState andis now included directly for TARGET_I386.
isa.h is already #included from mc146818rtc.h.
Signed-off-by: Andreas Färber <afaerber@suse.de>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
suspend: switch acpi s3 to new infrastructure.
This patch switches pc s3 suspend over to the new infrastructure.The cmos_s3 qemu_irq is killed, the new notifier is used instead.The xen hack goes away with that too, the hypercall can simply bedone in a notifier function now....
suspend: make rtc alarm wakeup the guest.
Make the rtc wake up the guest when the alarm fires.Add acpi windup to property support RTC_EN, so guestscan enable and disable this.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
target-i386: Add infrastructure for reporting TPR MMIO accesses
This will allow the APIC core to file a TPR access report. Depending onthe accelerator and kernel irqchip mode, it will either be deliveredright away or queued for later reporting.
In TCG mode, we can restart the triggering instruction and can therefore...
qom: Unify type registration
Replace device_init() with generalized type_init().
While at it, unify naming convention: type_init([$prefix_]register_types)Also, type_init() is a function, so add preceding blank line wherenecessary and don't put a semicolon after the closing brace....
qom: move properties from qdev to object
This is mostly code movement although not entirely. This makes properties partof the Object base class which means that we can now start using Object in ameaningful way outside of qdev.
qdev: register all types natively through QEMU Object Model
This was done in a mostly automated fashion. I did it in three steps and thenrebased it into a single step which avoids repeatedly touching every file inthe tree.
The first step was a sed-based addition of the parent type to the subclass...
mc146818rtc: Use lost_tick_policy property
Allow to configure the MC146818 RTC via the new lost tick policyproperty and replace rtc_td_hack with this mechanism.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
isa: pic: convert to QEMU Object Model
This converts two devices at once because PIC subclasses ISA and convertingsubclasses independently is extremely hard.
rtc: clear non-PF bits when reinjecting on ack
When an rtc interrupt is reinjected immediately after being acked,other interrupts should not be reinjected, so do clear their bits.
Also, if the periodic interrupts have been disabled before acking,do not reinject, as the guest might get very confused!...
rtc: fix 12-hour mode
Hours in 12-hour mode are in the 1-12 range, not 0-11.
rtc: raise AF bit when the alarm is encountered but AIE=0
rtc: raise PF bit when the periodic timer triggers but PIE=0
isa: give ISABus/ISADevice to isa_create(), isa_bus_irqs() and isa_get_irq() functions
NULL is a valid bus/device, so there is no change in behaviour.
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
rtc: add a dynamic property for retrieving the date
This really shows the power of dynamic object properties compared to qdevstatic properties.
This property represents a complex structure who's format is preserved over thewire. This is enabled by visitors....
rtc: Convert to isa_register_ioport
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Avi Kivity <avi@redhat.com>
mc146818rtc: Handle host clock resets
Make use of the new clock reset notifier to update the RTC wheneverrtc_clock is the host clock and that happens to jump backward. Thisavoids that the RTC stalls for the period the host clock was set back.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
change all other clock references to use nanosecond resolution accessors
This was done with:
sed -i 's/qemu_get_clock\>/qemu_get_clock_ns/' \ $(git grep -l 'qemu_get_clock\>' ) sed -i 's/qemu_new_timer\>/qemu_new_timer_ns/' \ $(git grep -l 'qemu_new_timer\>' )...
mc146818rtc: update registers after a format change
For some unknown reason, the MIPS kernel briefly changes the RTC tobinary mode during boot, switch back to BCD mode and read the time. Asthe registers are updated only every second, they may still be in the...
mc146818rtc: constantify
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Keep track of ISA ports ISA device is using in qdev.
Store all io ports used by device in ISADevice structure.
Signed-off-by: Gleb Natapov <gleb@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
make rtc alatm work
Convert alarm time from BCD if needed before comparing with currenttime.
Signed-off-by: Gleb Natapov <gleb@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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....
mc146818rtc: improve debugging
Add a separate flag for debugging coalesced interrupts.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
mc146818rtc: remove #ifdef DEBUG_CMOS.
remove #ifdef DEBUG_CMOS by using macro.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
rtc: make rtc_xxx accept/return ISADevice instead of RTCState.
To match rtc_xxx with qdev, make rtc_xxx accept and return ISADeviceinstead of RTCState.
mc146818rtc: Register vmstate via qdev
After defining the required alias ID, we can push vmstate registrationof mc146818rtc to qdev.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Move x86 specific PC declarations to a separate file
x86 definitions (especially CPUState uses) prevent many files frombeing compiled within libhw.
Move x86 specific declarations (APIC stuff) to a separate file.
QMP: Introduce RTC_CHANGE event
Emitted whenever the RTC time changes.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
reduce number of reinjects on ACK
Windows 7 BSODs under load with HAL_RTC_IRQF_WILL_NOT_CLEAR error.
It happens here:hal!HalpRtcUnmaskClock:8281b93a 8bff mov edi,edi8281b93c 56 push esi8281b93d 33f6 xor esi,esi...
fix rtc-td-hack on host without high-res timers
On hosts without high-res timers it is impossible to inject rtc interruptfaster then 1kHz. Windows sometimes configures RTC to generate 1kHzinterrupts, so we can't inject missed interrupts when running on such...
BCD cleanup
Combine multiple BCD implementations.
Signed-off-by: Paul Brook <paul@codesourcery.com>
mc145818rtc: fix saving of rtc-td hack properly upgrading the version number
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
mc146818rtc: port rtc to vmstate
mc146818rtc: fix indentation
mc146818rtc: remove rtc_mm_init()
It was used for Acer Pica 61 emulation, removed in 2008Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
TARGET_I386 is always defined if TARGET_X86_64 is defined
Patchworks-ID: 35378Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
New qdev_init_nofail()
Like qdev_init(), but terminate program via hw_error() instead ofreturning an error value.
Use it instead of qdev_init() where terminating the program on failureis okay, either because it's during machine construction, or because...
Enable host-clock-based RTC
Switch RTC emulations to the new host_clock instead of vm_clock bydefault. This has the advantage that the emulated RTC will followautomatically the host time while it might be tuned via NTP. vm_clockcan still be selected by passing '-rtc clock=vm' on the command line....
Revert "Get rid of _t suffix"
In the very least, a change like this requires discussion on the list.
The naming convention is goofy and it causes a massive merge problem. Somethinglike this must be presented on the list first so people can provide input...
Get rid of _t suffix
Some not so obvious bits, slirp and Xen were left alone for the timebeing.
Signed-off-by: malc <av1474@comtv.ru>
Unexport ticks_per_sec variable. Create get_ticks_per_sec() function
qdev/isa: convert real time clock
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
RTC polling mode broken
The RTC emulation does not set the IRQ flags independent of the IRQ enable bits.
The original MC146818A datasheet from 1984 notes: "flag bits in Register C [...] are set independent of the state of the corresponding enable bits in Register B"...
Make CPURead/WriteFunc structure 'const'
Revert "Introduce reset notifier order"
This reverts commit 8217606e6edb49591b4a6fd5a0d1229cebe470a9 (andupdates later added users of qemu_register_reset), we solved theproblem it originally addressed less invasively.
Remove io_index argument from cpu_register_io_memory()
The parameter is always zero except when registering the three internalio regions (ROM, unassigned, notdirty). Remove the parameter to reducethe API's power, thus facilitating future change.
Signed-off-by: Avi Kivity <avi@redhat.com>...
Incorporate changes from v2 of Gleb's RTC reset patch
Add rtc reset function.
On reset:Periodic Interrupt Enable (PIE) bit is cleared to zeroAlarm Interrupt Enable (AIE) bit is cleared to zeroUpdate ended Interrupt Flag (UF) bit is cleared to zeroInterrupt Request status Flag (IRQF) bit is cleared to zero...
Change RTC time drift IRQ re-injection (Gleb Natapov)
Currently IRQ are reinjected as soon as they are acknowledged tothe RTC, but Windows sometimes do acknowledgement in a loop withglobal interrupt disabled waiting for interrupt to be cleared andit does not mask RTC vector in PIC/APIC while doing this. In such...
Fix RTC breakage from r7031.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7062 c046a42c-6fe2-441c-8c8c-71466251a162
mc146818: add square wave output support
This is necessary for es40 as the sqw output is directly connected to thecore chipset.
Signed-off-by: Tristan Gingold <gingold@adacore.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7031 c046a42c-6fe2-441c-8c8c-71466251a162
hw: remove error handling from qemu_malloc() callers (Avi Kivity)
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6529 c046a42c-6fe2-441c-8c8c-71466251a162
Support epoch of 1980 in RTC emulation for MIPS Magnum
On the MIPS Magnum, the time that is held in the RTC's NVRAM should berelative to midnight on 1980-01-01. This patch adds an extra parameterto rtc_init(), allowing different epochs to be used. For the Magnum,...
Add -rtc-td-hack option to fix time drift with RTC on Windows (Gleb Natapov)
After my last patch to fix interrupt coalescing was rejectedon the basis that it is too intrusive we decided to make thefix much more localized and only fix the problem for RTC time...
Fix day of week in mc146818
According to mc146818 specification, Day of Week register (#6) is between 1and 7, 1 representing Sunday. According C specification, tm_wday field instruct tm is between 0 and 6, 0 representing Sunday.
Bit 2 of register B (#11) is named DM (data mode) and specifies if RTC...
Remove trailing spaces introduced by commit 6081
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6085 c046a42c-6fe2-441c-8c8c-71466251a162
Add HPET emulation to qemu (Beth Kon)
This patch adds HPET emulation. It can be disabled with -disable-hpet. An hpetprovides a more finely granular clocksource than otherwise available on PC.This means that latency-dependent applications (e.g. multimedia) will generally...
Change MMIO callbacks to use offsets, not absolute addresses.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5849 c046a42c-6fe2-441c-8c8c-71466251a162
Unify RTCs that use host time, fix M48t59 alarm.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3984 c046a42c-6fe2-441c-8c8c-71466251a162
qemu_put signedness fixes, by Andre Przywara.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3824 c046a42c-6fe2-441c-8c8c-71466251a162
Add statics and missing #includes for prototypes.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3683 c046a42c-6fe2-441c-8c8c-71466251a162
Break up vl.h.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3674 c046a42c-6fe2-441c-8c8c-71466251a162
added -startdate option
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3540 c046a42c-6fe2-441c-8c8c-71466251a162
find -type f | xargs sed -i 's/[\t ]*$//g' # Yes, again. Note the star in the regex.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3177 c046a42c-6fe2-441c-8c8c-71466251a162
find -type f | xargs sed -i 's/[\t ]$//g' # on most files
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3173 c046a42c-6fe2-441c-8c8c-71466251a162
Fix mmapped register alignment and endianness handling.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2694 c046a42c-6fe2-441c-8c8c-71466251a162
Memory-mapped interface for RTC, by Herve Poussineau.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2686 c046a42c-6fe2-441c-8c8c-71466251a162
Unify IRQ handling.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2635 c046a42c-6fe2-441c-8c8c-71466251a162
Move date/time init to the RTC implementation.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2229 c046a42c-6fe2-441c-8c8c-71466251a162
more accurate emulation (do not depend on localtime() or gmtime()
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@872 c046a42c-6fe2-441c-8c8c-71466251a162
UIP update fix
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@699 c046a42c-6fe2-441c-8c8c-71466251a162
win32 port (initial patch by kazu)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@692 c046a42c-6fe2-441c-8c8c-71466251a162
more precise RTC emulation (periodic timers + time updates)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@688 c046a42c-6fe2-441c-8c8c-71466251a162
io port API change
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@664 c046a42c-6fe2-441c-8c8c-71466251a162
separated more devices from emulator
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@656 c046a42c-6fe2-441c-8c8c-71466251a162