git: e2cc6a467ffc - stable/13 - LinuxKPI: Add clflush argument type conversion wrapper

From: Vladimir Kondratyev <wulf_at_FreeBSD.org>
Date: Sat, 22 Jan 2022 19:36:18 UTC
The branch stable/13 has been updated by wulf:

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

commit e2cc6a467ffceba665f2a47e698ed840bb5f2ef3
Author:     Vladimir Kondratyev <wulf@FreeBSD.org>
AuthorDate: 2021-11-15 14:48:17 +0000
Commit:     Vladimir Kondratyev <wulf@FreeBSD.org>
CommitDate: 2022-01-22 19:34:35 +0000

    LinuxKPI: Add clflush argument type conversion wrapper
    
    to reduce amount of source patching in drm-kmod.
    
    MFC after:      1 week
    Reviewed by:    manu
    Differential Revision:  https://reviews.freebsd.org/D33288
    
    (cherry picked from commit 9a79e08ae761f1d53c982e1d089b923e25b0092f)
---
 sys/compat/linuxkpi/common/include/linux/page.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/linux/page.h b/sys/compat/linuxkpi/common/include/linux/page.h
index 0c3d456d6ec0..7cdaf01dce03 100644
--- a/sys/compat/linuxkpi/common/include/linux/page.h
+++ b/sys/compat/linuxkpi/common/include/linux/page.h
@@ -105,6 +105,7 @@ pgprot2cachemode(pgprot_t prot)
 #define	trunc_page(x)	((uintptr_t)(x) & ~(PAGE_SIZE - 1))
 
 #if defined(__i386__) || defined(__amd64__)
+#undef clflush
 #undef clflushopt
 static inline void
 lkpi_clflushopt(unsigned long addr)
@@ -116,6 +117,7 @@ lkpi_clflushopt(unsigned long addr)
 	else
 		pmap_invalidate_cache();
 }
+#define	clflush(x)	clflush((unsigned long)(x))
 #define	clflushopt(x)	lkpi_clflushopt((unsigned long)(x))
 #endif