[rtems commit] Add rtems_filesystem_make_dev_t_from_pointer()

Sebastian Huber sebh at rtems.org
Wed Feb 4 18:33:11 UTC 2015


Module:    rtems
Branch:    master
Commit:    4c14ace6dd8988696481e484575dcbad06f4a158
Changeset: http://git.rtems.org/rtems/commit/?id=4c14ace6dd8988696481e484575dcbad06f4a158

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Sat Jan 31 21:23:26 2015 +0100

Add rtems_filesystem_make_dev_t_from_pointer()

---

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

diff --git a/cpukit/libcsupport/include/rtems/libio.h b/cpukit/libcsupport/include/rtems/libio.h
index a4607de..a959cfe 100644
--- a/cpukit/libcsupport/include/rtems/libio.h
+++ b/cpukit/libcsupport/include/rtems/libio.h
@@ -1442,6 +1442,15 @@ 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 temp = (((uint64_t) 1) << 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
 )



More information about the vc mailing list