git: 37cda2837c00 - main - linuxkpi: Add compat_ptr and ptr_to_compat

From: Emmanuel Vadot <manu_at_FreeBSD.org>
Date: Mon, 08 Aug 2022 14:04:21 UTC
The branch main has been updated by manu:

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

commit 37cda2837c004e743e9262e2e0ea409766df2a09
Author:     Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2022-07-27 07:48:32 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2022-08-08 13:22:35 +0000

    linuxkpi: Add compat_ptr and ptr_to_compat
    
    Needed by drm-kmod.
    
    Obtained from:  drm-kmod
    Sponsored by:   Beckhoff Automation GmbH & Co. KG
    Differential Revision:  https://reviews.freebsd.org/D36016
---
 sys/compat/linuxkpi/common/include/linux/compat.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/linux/compat.h b/sys/compat/linuxkpi/common/include/linux/compat.h
index 5e4dd1daf67d..b6bb5e8ed24b 100644
--- a/sys/compat/linuxkpi/common/include/linux/compat.h
+++ b/sys/compat/linuxkpi/common/include/linux/compat.h
@@ -58,4 +58,7 @@ linux_set_current_flags(struct thread *td, int flags)
 	return (0);
 }
 
+#define	compat_ptr(x)		((void *)(uintptr_t)x)
+#define	ptr_to_compat(x)	((uintptr_t)x)
+
 #endif	/* _LINUXKPI_LINUX_COMPAT_H_ */