Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F159257694
D56982.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
5 KB
Referenced Files
None
Subscribers
None
D56982.diff
View Options
diff --git a/sys/amd64/linux/linux_vdso_gtod.c b/sys/amd64/linux/linux_vdso_gtod.c
--- a/sys/amd64/linux/linux_vdso_gtod.c
+++ b/sys/amd64/linux/linux_vdso_gtod.c
@@ -27,12 +27,14 @@
#include <sys/elf.h>
#include <sys/errno.h>
-#include <sys/proc.h>
#include <sys/stdarg.h>
#include <sys/stddef.h>
+#include <sys/time.h>
#define _KERNEL
#include <sys/vdso.h>
#undef _KERNEL
+
+#include <limits.h>
#include <stdbool.h>
#include <machine/atomic.h>
diff --git a/sys/amd64/linux32/linux32_vdso_gtod.c b/sys/amd64/linux32/linux32_vdso_gtod.c
--- a/sys/amd64/linux32/linux32_vdso_gtod.c
+++ b/sys/amd64/linux32/linux32_vdso_gtod.c
@@ -27,12 +27,14 @@
#include <sys/elf.h>
#include <sys/errno.h>
-#include <sys/proc.h>
#include <sys/stdarg.h>
#include <sys/stddef.h>
+#include <sys/time.h>
#define _KERNEL
#include <sys/vdso.h>
#undef _KERNEL
+
+#include <limits.h>
#include <stdbool.h>
#include <i386/include/atomic.h>
diff --git a/sys/arm64/linux/linux_vdso_gtod.c b/sys/arm64/linux/linux_vdso_gtod.c
--- a/sys/arm64/linux/linux_vdso_gtod.c
+++ b/sys/arm64/linux/linux_vdso_gtod.c
@@ -28,12 +28,14 @@
#include <sys/elf.h>
#include <sys/errno.h>
-#include <sys/proc.h>
#include <sys/stdarg.h>
#include <sys/stddef.h>
+#include <sys/time.h>
#define _KERNEL
#include <sys/vdso.h>
#undef _KERNEL
+
+#include <limits.h>
#include <stdbool.h>
#include <machine/atomic.h>
diff --git a/sys/compat/linux/linux.h b/sys/compat/linux/linux.h
--- a/sys/compat/linux/linux.h
+++ b/sys/compat/linux/linux.h
@@ -28,58 +28,8 @@
#ifndef _LINUX_MI_H_
#define _LINUX_MI_H_
-/*
- * Machine independent set of types for the Linux types.
- */
typedef uint32_t l_dev_t;
-/*
- * Linux dev_t conversion routines.
- *
- * As of version 2.6.0 of the Linux kernel, dev_t is a 32-bit quantity
- * with 12 bits set asaid for the major number and 20 for the minor number.
- * The in-kernel dev_t encoded as MMMmmmmm, where M is a hex digit of the
- * major number and m is a hex digit of the minor number.
- * The user-space dev_t encoded as mmmM MMmm, where M and m is the major
- * and minor numbers accordingly. This is downward compatible with legacy
- * systems where dev_t is 16 bits wide, encoded as MMmm.
- * In glibc dev_t is a 64-bit quantity, with 32-bit major and minor numbers,
- * encoded as MMMM Mmmm mmmM MMmm. This is downward compatible with the Linux
- * kernel and with legacy systems where dev_t is 16 bits wide.
- *
- * In the FreeBSD dev_t is a 64-bit quantity. The major and minor numbers
- * are encoded as MMMmmmMm, therefore conversion of the device numbers between
- * Linux user-space and FreeBSD kernel required.
- */
-static __inline l_dev_t
-linux_encode_dev(int _major, int _minor)
-{
-
- return ((_minor & 0xff) | ((_major & 0xfff) << 8) |
- (((_minor & ~0xff) << 12) & 0xfff00000));
-}
-
-static __inline l_dev_t
-linux_new_encode_dev(dev_t _dev)
-{
-
- return (_dev == NODEV ? 0 : linux_encode_dev(major(_dev), minor(_dev)));
-}
-
-static __inline int
-linux_encode_major(dev_t _dev)
-{
-
- return (_dev == NODEV ? 0 : major(_dev) & 0xfff);
-}
-
-static __inline int
-linux_encode_minor(dev_t _dev)
-{
-
- return (_dev == NODEV ? 0 : minor(_dev) & 0xfffff);
-}
-
static __inline int
linux_decode_major(l_dev_t _dev)
{
diff --git a/sys/compat/linux/linux_stats.c b/sys/compat/linux/linux_stats.c
--- a/sys/compat/linux/linux_stats.c
+++ b/sys/compat/linux/linux_stats.c
@@ -58,6 +58,52 @@
#include <compat/linux/linux_file.h>
#include <compat/linux/linux_util.h>
+/*
+ * Linux dev_t conversion routines.
+ *
+ * As of version 2.6.0 of the Linux kernel, dev_t is a 32-bit quantity
+ * with 12 bits set asaid for the major number and 20 for the minor number.
+ * The in-kernel dev_t encoded as MMMmmmmm, where M is a hex digit of the
+ * major number and m is a hex digit of the minor number.
+ * The user-space dev_t encoded as mmmM MMmm, where M and m is the major
+ * and minor numbers accordingly. This is downward compatible with legacy
+ * systems where dev_t is 16 bits wide, encoded as MMmm.
+ * In glibc dev_t is a 64-bit quantity, with 32-bit major and minor numbers,
+ * encoded as MMMM Mmmm mmmM MMmm. This is downward compatible with the Linux
+ * kernel and with legacy systems where dev_t is 16 bits wide.
+ *
+ * In the FreeBSD dev_t is a 64-bit quantity. The major and minor numbers
+ * are encoded as MMMmmmMm, therefore conversion of the device numbers between
+ * Linux user-space and FreeBSD kernel required.
+ */
+static l_dev_t
+linux_encode_dev(int _major, int _minor)
+{
+
+ return ((_minor & 0xff) | ((_major & 0xfff) << 8) |
+ (((_minor & ~0xff) << 12) & 0xfff00000));
+}
+
+static l_dev_t
+linux_new_encode_dev(dev_t _dev)
+{
+
+ return (_dev == NODEV ? 0 : linux_encode_dev(major(_dev), minor(_dev)));
+}
+
+static int
+linux_encode_major(dev_t _dev)
+{
+
+ return (_dev == NODEV ? 0 : major(_dev) & 0xfff);
+}
+
+static int
+linux_encode_minor(dev_t _dev)
+{
+
+ return (_dev == NODEV ? 0 : minor(_dev) & 0xfffff);
+}
static int
linux_kern_fstat(struct thread *td, int fd, struct stat *sbp)
diff --git a/sys/i386/linux/linux_vdso_gtod.c b/sys/i386/linux/linux_vdso_gtod.c
--- a/sys/i386/linux/linux_vdso_gtod.c
+++ b/sys/i386/linux/linux_vdso_gtod.c
@@ -27,12 +27,14 @@
#include <sys/elf.h>
#include <sys/errno.h>
-#include <sys/proc.h>
#include <sys/stdarg.h>
#include <sys/stddef.h>
+#include <sys/time.h>
#define _KERNEL
#include <sys/vdso.h>
#undef _KERNEL
+
+#include <limits.h>
#include <stdbool.h>
#include <machine/atomic.h>
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jun 12, 11:42 PM (8 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33917159
Default Alt Text
D56982.diff (5 KB)
Attached To
Mode
D56982: linux: Fix some problems with header pollution
Attached
Detach File
Event Timeline
Log In to Comment