From 0e73a96209a64276238d8a875e70f7e0bb2741f6 Mon Sep 17 00:00:00 2001
From: "Tim J. Robbins" <tjr@FreeBSD.org>
Date: Mon, 16 Aug 2004 07:05:44 +0000
Subject: [PATCH] Add a new type, l_uintptr_t, which is an unsigned integer
 type with the same width as a pointer under Linux. Add two new macros, PTRIN
 and PTROUT, which convert between l_uintptr_t and native pointers.

---
 sys/alpha/linux/linux.h | 4 ++++
 sys/i386/linux/linux.h  | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/sys/alpha/linux/linux.h b/sys/alpha/linux/linux.h
index 0504f27054f7..07753649cfa3 100644
--- a/sys/alpha/linux/linux.h
+++ b/sys/alpha/linux/linux.h
@@ -45,6 +45,9 @@ extern u_char linux_debug_map[];
 MALLOC_DECLARE(M_LINUX);
 #endif
 
+#define	PTRIN(v)	(void *)(v)
+#define	PTROUT(v)	(l_uintptr_t)(v)
+
 typedef int		l_int;
 typedef int64_t		l_long;
 typedef int64_t		l_longlong;
@@ -55,6 +58,7 @@ typedef uint64_t	l_ulonglong;
 typedef unsigned short	l_ushort;
 
 typedef char		*l_caddr_t;
+typedef l_ulong		l_uintptr_t;
 typedef l_long		l_clock_t;
 typedef l_int		l_daddr_t;
 typedef l_uint		l_dev_t;
diff --git a/sys/i386/linux/linux.h b/sys/i386/linux/linux.h
index 3faded57ac26..fa0ab7561054 100644
--- a/sys/i386/linux/linux.h
+++ b/sys/i386/linux/linux.h
@@ -47,6 +47,9 @@ extern u_char linux_debug_map[];
 MALLOC_DECLARE(M_LINUX);
 #endif
 
+#define	PTRIN(v)	(void *)(v)
+#define	PTROUT(v)	(l_uintptr_t)(v)
+
 /*
  * Provide a separate set of types for the Linux types.
  */
@@ -60,6 +63,7 @@ typedef uint64_t	l_ulonglong;
 typedef unsigned short	l_ushort;
 
 typedef char		*l_caddr_t;
+typedef l_ulong		l_uintptr_t;
 typedef l_long		l_clock_t;
 typedef l_int		l_daddr_t;
 typedef l_ushort	l_dev_t;