You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.3 KiB
43 lines
1.3 KiB
17 years ago
|
#ifndef ASM_X86__PVCLOCK_ABI_H
|
||
|
#define ASM_X86__PVCLOCK_ABI_H
|
||
17 years ago
|
#ifndef __ASSEMBLY__
|
||
|
|
||
|
/*
|
||
|
* These structs MUST NOT be changed.
|
||
|
* They are the ABI between hypervisor and guest OS.
|
||
|
* Both Xen and KVM are using this.
|
||
|
*
|
||
|
* pvclock_vcpu_time_info holds the system time and the tsc timestamp
|
||
|
* of the last update. So the guest can use the tsc delta to get a
|
||
|
* more precise system time. There is one per virtual cpu.
|
||
|
*
|
||
|
* pvclock_wall_clock references the point in time when the system
|
||
|
* time was zero (usually boot time), thus the guest calculates the
|
||
|
* current wall clock by adding the system time.
|
||
|
*
|
||
|
* Protocol for the "version" fields is: hypervisor raises it (making
|
||
|
* it uneven) before it starts updating the fields and raises it again
|
||
|
* (making it even) when it is done. Thus the guest can make sure the
|
||
|
* time values it got are consistent by checking the version before
|
||
|
* and after reading them.
|
||
|
*/
|
||
|
|
||
|
struct pvclock_vcpu_time_info {
|
||
|
u32 version;
|
||
|
u32 pad0;
|
||
|
u64 tsc_timestamp;
|
||
|
u64 system_time;
|
||
|
u32 tsc_to_system_mul;
|
||
|
s8 tsc_shift;
|
||
|
u8 pad[3];
|
||
|
} __attribute__((__packed__)); /* 32 bytes */
|
||
|
|
||
|
struct pvclock_wall_clock {
|
||
|
u32 version;
|
||
|
u32 sec;
|
||
|
u32 nsec;
|
||
|
} __attribute__((__packed__));
|
||
|
|
||
|
#endif /* __ASSEMBLY__ */
|
||
17 years ago
|
#endif /* ASM_X86__PVCLOCK_ABI_H */
|