pvclock-abi.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * same structure to x86's
  3. * Hopefully asm-x86/pvclock-abi.h would be moved to somewhere more generic.
  4. * For now, define same duplicated definitions.
  5. */
  6. #ifndef _ASM_IA64__PVCLOCK_ABI_H
  7. #define _ASM_IA64__PVCLOCK_ABI_H
  8. #ifndef __ASSEMBLY__
  9. /*
  10. * These structs MUST NOT be changed.
  11. * They are the ABI between hypervisor and guest OS.
  12. * Both Xen and KVM are using this.
  13. *
  14. * pvclock_vcpu_time_info holds the system time and the tsc timestamp
  15. * of the last update. So the guest can use the tsc delta to get a
  16. * more precise system time. There is one per virtual cpu.
  17. *
  18. * pvclock_wall_clock references the point in time when the system
  19. * time was zero (usually boot time), thus the guest calculates the
  20. * current wall clock by adding the system time.
  21. *
  22. * Protocol for the "version" fields is: hypervisor raises it (making
  23. * it uneven) before it starts updating the fields and raises it again
  24. * (making it even) when it is done. Thus the guest can make sure the
  25. * time values it got are consistent by checking the version before
  26. * and after reading them.
  27. */
  28. struct pvclock_vcpu_time_info {
  29. u32 version;
  30. u32 pad0;
  31. u64 tsc_timestamp;
  32. u64 system_time;
  33. u32 tsc_to_system_mul;
  34. s8 tsc_shift;
  35. u8 pad[3];
  36. } __attribute__((__packed__)); /* 32 bytes */
  37. struct pvclock_wall_clock {
  38. u32 version;
  39. u32 sec;
  40. u32 nsec;
  41. } __attribute__((__packed__));
  42. #endif /* __ASSEMBLY__ */
  43. #endif /* _ASM_IA64__PVCLOCK_ABI_H */