[kvm-unit-tests PATCH v8 03/12] lib: Define unlikely()/likely() macros in compiler.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Vasant Karasulli <vkarasulli@xxxxxxx>

So that they can be shared across testcases and lib/.
Linux's x86 instruction decoder refrences them.

Signed-off-by: Vasant Karasulli <vkarasulli@xxxxxxx>
---
 lib/linux/compiler.h | 3 +++
 x86/kvmclock.c       | 4 ----
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/lib/linux/compiler.h b/lib/linux/compiler.h
index bf3313bd..9f4ef162 100644
--- a/lib/linux/compiler.h
+++ b/lib/linux/compiler.h
@@ -121,5 +121,8 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
 	__u.__val;					\
 })

+#define unlikely(x)	__builtin_expect(!!(x), 0)
+#define likely(x)	__builtin_expect(!!(x), 1)
+
 #endif /* !__ASSEMBLY__ */
 #endif /* !__LINUX_COMPILER_H */
diff --git a/x86/kvmclock.c b/x86/kvmclock.c
index f9f21032..487c12af 100644
--- a/x86/kvmclock.c
+++ b/x86/kvmclock.c
@@ -5,10 +5,6 @@
 #include "kvmclock.h"
 #include "asm/barrier.h"

-#define unlikely(x)	__builtin_expect(!!(x), 0)
-#define likely(x)	__builtin_expect(!!(x), 1)
-
-
 struct pvclock_vcpu_time_info __attribute__((aligned(4))) hv_clock[MAX_CPU];
 struct pvclock_wall_clock wall_clock;
 static unsigned char valid_flags = 0;
--
2.34.1





[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux