[PATCH 1/3] Add rtems_filesystem_make_dev_t_from_pointer()

Sebastian Huber sebastian.huber at embedded-brains.de
Wed Feb 4 13:46:24 UTC 2015


---
 cpukit/libcsupport/include/rtems/libio.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/cpukit/libcsupport/include/rtems/libio.h b/cpukit/libcsupport/include/rtems/libio.h
index a4607de..998cd30 100644
--- a/cpukit/libcsupport/include/rtems/libio.h
+++ b/cpukit/libcsupport/include/rtems/libio.h
@@ -1442,6 +1442,16 @@ static inline dev_t rtems_filesystem_make_dev_t(
   return temp.device;
 }
 
+static inline dev_t rtems_filesystem_make_dev_t_from_pointer(
+  const void *pointer
+)
+{
+  uint64_t one = 1;
+  uint64_t temp = (one << 63) | (((uintptr_t) pointer) >> 1);
+
+  return rtems_filesystem_make_dev_t((uint32_t) (temp >> 32), (uint32_t) temp);
+}
+
 static inline rtems_device_major_number rtems_filesystem_dev_major_t(
   dev_t device
 )
-- 
1.8.1.4



More information about the devel mailing list