mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00

While the GCC and Clang compilers already define __ASSEMBLER__ automatically when compiling assembly code, __ASSEMBLY__ is a macro that only gets defined by the Makefiles in the kernel. This can be very confusing when switching between userspace and kernelspace coding, or when dealing with UAPI headers that rather should use __ASSEMBLER__ instead. So let's standardize on the __ASSEMBLER__ macro that is provided by the compilers now. This is mostly a mechanical patch (done with a simple "sed -i" statement), with some manual tweaks in <asm/frame.h>, <asm/hw_irq.h> and <asm/setup.h> that mentioned this macro in comments with some missing underscores. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Cc: Brian Gerst <brgerst@gmail.com> Cc: Juergen Gross <jgross@suse.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Kees Cook <keescook@chromium.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: https://lore.kernel.org/r/20250314071013.1575167-38-thuth@redhat.com
48 lines
1.5 KiB
C
48 lines
1.5 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _ASM_X86_PVCLOCK_ABI_H
|
|
#define _ASM_X86_PVCLOCK_ABI_H
|
|
#ifndef __ASSEMBLER__
|
|
|
|
/*
|
|
* 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 flags;
|
|
u8 pad[2];
|
|
} __attribute__((__packed__)); /* 32 bytes */
|
|
|
|
struct pvclock_wall_clock {
|
|
u32 version;
|
|
u32 sec;
|
|
u32 nsec;
|
|
} __attribute__((__packed__));
|
|
|
|
#define PVCLOCK_TSC_STABLE_BIT (1 << 0)
|
|
#define PVCLOCK_GUEST_STOPPED (1 << 1)
|
|
/* PVCLOCK_COUNTS_FROM_ZERO broke ABI and can't be used anymore. */
|
|
#define PVCLOCK_COUNTS_FROM_ZERO (1 << 2)
|
|
#endif /* __ASSEMBLER__ */
|
|
#endif /* _ASM_X86_PVCLOCK_ABI_H */
|