diff mbox series

[kvm-unit-tests,1/2] x86: Include libcflat.h in atomic.h for u64 typedef

Message ID 20250221204148.2171418-2-seanjc@google.com (mailing list archive)
State New
Headers show
Series x86: Add split/bus lock smoke test | expand

Commit Message

Sean Christopherson Feb. 21, 2025, 8:41 p.m. UTC
Include libcflat.h in x86's atomic.h to pick up the u64 typedef, which is
used to define atomic64_t.  The missing include results in build errors if
a test includes atomic.h without (or before) libcflat.h.

  lib/x86/atomic.h:162:1: error: unknown type name ‘u64’
  162 | u64 atomic64_cmpxchg(atomic64_t *v, u64 old, u64 new);

Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 lib/x86/atomic.h | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/lib/x86/atomic.h b/lib/x86/atomic.h
index 13e734bb..3c7a89eb 100644
--- a/lib/x86/atomic.h
+++ b/lib/x86/atomic.h
@@ -3,6 +3,8 @@ 
 
 #include "asm-generic/atomic.h"
 
+#include "libcflat.h"
+
 typedef struct {
 	volatile int counter;
 } atomic_t;