The branch main has been updated by wulf:

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

commit b59ffedae8f3707bf0079b4fd0cbf8190eed0c5e
Author:     Vladimir Kondratyev <[email protected]>
AuthorDate: 2021-09-29 20:14:23 +0000
Commit:     Vladimir Kondratyev <[email protected]>
CommitDate: 2021-09-29 20:14:23 +0000

    LinuxKPI: Add helper functions to store integers to linux/xarray.h
    
    Required by drm-kmod.
    
    Reviewed by:    hselasky
    MFC after:      2 weeks
    Differential revision:  https://reviews.freebsd.org/D32091
---
 sys/compat/linuxkpi/common/include/linux/xarray.h | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/linux/xarray.h 
b/sys/compat/linuxkpi/common/include/linux/xarray.h
index afe66c1f2b5f..7427f6e4f9f9 100644
--- a/sys/compat/linuxkpi/common/include/linux/xarray.h
+++ b/sys/compat/linuxkpi/common/include/linux/xarray.h
@@ -97,4 +97,27 @@ xa_init(struct xarray *xa)
        xa_init_flags(xa, 0);
 }
 
+static inline void *
+xa_mk_value(unsigned long v)
+{
+       unsigned long r = (v << 1) | 1;
+
+       return ((void *)r);
+}
+
+static inline bool
+xa_is_value(const void *e)
+{
+       unsigned long v = (unsigned long)e;
+
+       return (v & 1);
+}
+
+static inline unsigned long
+xa_to_value(const void *e)
+{
+       unsigned long v = (unsigned long)e;
+
+       return (v >> 1);
+}
 #endif         /* _LINUX_XARRAY_H_ */
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to