• Alexander Graf's avatar
    Make cpu_get_real_ticks use mfspr · 4a9590f3
    Alexander Graf authored
    PowerPC CPUs have had two ways to read the time base for quite some time now.
    They provide it using the mfspr instruction or - if a special bit is set in
    that opcode - using mftb. For timekeeping we're currently using mftb.
    
    While trying to get Qemu up and running on an e500v2 system, I stumbled over
    the CPU not supporting mftbu. It just throws an illegal instruction trap.
    
    So let's read the SPR values instead. All PPC CPUs should support them anyways.
    
    I tested this patch on an e500v2 system where it makes qemu work and on my 970MP
    system with 32-bit user space where everything still works with this patch
    applied.
    Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
    Signed-off-by: default avatarmalc <av1474@comtv.ru>
    4a9590f3
qemu-timer.h 6.55 KB