git: aa8745df01f6 - stable/13 - LinuxKPI: compiler.h add three more defines

Bjoern A. Zeeb bz at FreeBSD.org
Sun Jul 18 00:36:38 UTC 2021


The branch stable/13 has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=aa8745df01f6cd3712abccb921e42dc3e2493ba1

commit aa8745df01f6cd3712abccb921e42dc3e2493ba1
Author:     Bjoern A. Zeeb <bz at FreeBSD.org>
AuthorDate: 2021-05-24 17:59:13 +0000
Commit:     Bjoern A. Zeeb <bz at FreeBSD.org>
CommitDate: 2021-07-18 00:35:02 +0000

    LinuxKPI: compiler.h add three more defines
    
    Add fallthrough, ____cacheline_aligned_in_smp, and smp_mb() to
    linux/compiler.h.
    
    Sponsored by:   The FreeBSD Foundation
    Reviewed by:    hselasky
    Differential Revision: https://reviews.freebsd.org/D30420
    
    (cherry picked from commit da717031c9fd914343e19ba87f19c7a9a7006721)
---
 sys/compat/linuxkpi/common/include/linux/compiler.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/linux/compiler.h b/sys/compat/linuxkpi/common/include/linux/compiler.h
index 470e1f151413..e641b1b096c3 100644
--- a/sys/compat/linuxkpi/common/include/linux/compiler.h
+++ b/sys/compat/linuxkpi/common/include/linux/compiler.h
@@ -65,6 +65,8 @@
 #define	__always_inline			inline
 #define	noinline			__noinline
 #define	____cacheline_aligned		__aligned(CACHE_LINE_SIZE)
+#define	____cacheline_aligned_in_smp	__aligned(CACHE_LINE_SIZE)
+#define	fallthrough			/* FALLTHROUGH */ do { } while(0)
 
 #define	likely(x)			__builtin_expect(!!(x), 1)
 #define	unlikely(x)			__builtin_expect(!!(x), 0)
@@ -78,6 +80,7 @@
 #define	__printf(a,b)			__printflike(a,b)
 
 #define	barrier()			__asm__ __volatile__("": : :"memory")
+#define	smp_mb()			mb()
 
 #define	lower_32_bits(n)		((u32)(n))
 #define	upper_32_bits(n)		((u32)(((n) >> 16) >> 16))


More information about the dev-commits-src-all mailing list