[rtems commit] filesystem: Add SMP support

Sebastian Huber sebh at rtems.org
Wed Aug 14 09:05:15 UTC 2013


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Aug 13 16:32:09 2013 +0200

filesystem: Add SMP support

---

 cpukit/libcsupport/include/rtems/libio_.h |    8 ++++++--
 cpukit/libcsupport/src/sup_fs_location.c  |    3 +++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/cpukit/libcsupport/include/rtems/libio_.h b/cpukit/libcsupport/include/rtems/libio_.h
index 1f7f654..55156c0 100644
--- a/cpukit/libcsupport/include/rtems/libio_.h
+++ b/cpukit/libcsupport/include/rtems/libio_.h
@@ -249,12 +249,16 @@ static inline void rtems_filesystem_mt_unlock( void )
   rtems_libio_unlock();
 }
 
+extern rtems_interrupt_lock rtems_filesystem_mt_entry_lock_control;
+
 #define rtems_filesystem_mt_entry_declare_lock_context( ctx ) \
   rtems_interrupt_level ctx
 
-#define rtems_filesystem_mt_entry_lock( ctx ) rtems_interrupt_disable( ctx )
+#define rtems_filesystem_mt_entry_lock( ctx ) \
+  rtems_interrupt_lock_acquire( &rtems_filesystem_mt_entry_lock_control, ctx )
 
-#define rtems_filesystem_mt_entry_unlock( ctx ) rtems_interrupt_enable( ctx )
+#define rtems_filesystem_mt_entry_unlock( ctx ) \
+  rtems_interrupt_lock_release( &rtems_filesystem_mt_entry_lock_control, ctx )
 
 static inline void rtems_filesystem_instance_lock(
   const rtems_filesystem_location_info_t *loc
diff --git a/cpukit/libcsupport/src/sup_fs_location.c b/cpukit/libcsupport/src/sup_fs_location.c
index dc4b665..040f8c2 100644
--- a/cpukit/libcsupport/src/sup_fs_location.c
+++ b/cpukit/libcsupport/src/sup_fs_location.c
@@ -28,6 +28,9 @@
 #include <rtems/libio_.h>
 #include <rtems/score/threaddispatch.h>
 
+rtems_interrupt_lock rtems_filesystem_mt_entry_lock_control =
+  RTEMS_INTERRUPT_LOCK_INITIALIZER;
+
 static rtems_filesystem_global_location_t *deferred_released_global_locations;
 
 rtems_filesystem_location_info_t *rtems_filesystem_location_copy(




More information about the vc mailing list