aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/types.h
diff options
context:
space:
mode:
authorBrooks Davis <brooks@FreeBSD.org>2018-07-05 13:13:48 +0000
committerBrooks Davis <brooks@FreeBSD.org>2018-07-05 13:13:48 +0000
commitf38b68ae8aadd1e3fc55f9627b41651eab2f767e (patch)
tree2532422476e51289aa873aa68c5e7b030eed8460 /sys/sys/types.h
parent4a7ec940e45555ef9e0398fccd83d5780857d927 (diff)
downloadsrc-f38b68ae8aadd1e3fc55f9627b41651eab2f767e.tar.gz
src-f38b68ae8aadd1e3fc55f9627b41651eab2f767e.zip
Make struct xinpcb and friends word-size independent.
Replace size_t members with ksize_t (uint64_t) and pointer members (never used as pointers in userspace, but instead as unique idenitifiers) with kvaddr_t (uint64_t). This makes the structs identical between 32-bit and 64-bit ABIs. On 64-bit bit systems, the ABI is maintained. On 32-bit systems, this is an ABI breaking change. The ABI of most of these structs was previously broken in r315662. This also imposes a small API change on userspace consumers who must handle kernel pointers becoming virtual addresses. PR: 228301 (exp-run by antoine) Reviewed by: jtl, kib, rwatson (various versions) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D15386
Notes
Notes: svn path=/head/; revision=335979
Diffstat (limited to 'sys/sys/types.h')
-rw-r--r--sys/sys/types.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/sys/types.h b/sys/sys/types.h
index b90f88e292d5..021a3cbe24f4 100644
--- a/sys/sys/types.h
+++ b/sys/sys/types.h
@@ -251,6 +251,15 @@ struct cap_rights;
typedef struct cap_rights cap_rights_t;
#endif
+/*
+ * Types suitable for exporting size and pointers (as virtual addresses)
+ * from the kernel independent of native word size. These should be
+ * used in place of size_t and (u)intptr_t in structs which contain such
+ * types that are shared with userspace.
+ */
+typedef __uint64_t kvaddr_t;
+typedef __uint64_t ksize_t;
+
typedef __vm_offset_t vm_offset_t;
typedef __int64_t vm_ooffset_t;
typedef __vm_paddr_t vm_paddr_t;