[email protected]
[Top] [All Lists]

PERFORCE change 114198 for review

Subject: PERFORCE change 114198 for review
From: Roman Divacky
Date: Wed, 7 Feb 2007 18:55:05 GMT
http://perforce.freebsd.org/chv.cgi?CH=114198

Change 114198 by [email protected]_witten on 2007/02/07 18:54:39

        Turn emul_lock into a mutex and emul_shared_lock into a rwlock.

Affected files ...

.. //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_sysvec.c#9 edit
.. //depot/projects/linuxolator/src/sys/compat/linux/linux_emul.c#34 edit
.. //depot/projects/linuxolator/src/sys/compat/linux/linux_emul.h#9 edit
.. //depot/projects/linuxolator/src/sys/compat/linux/linux_misc.c#57 edit
.. //depot/projects/linuxolator/src/sys/i386/linux/linux_sysvec.c#4 edit

Differences ...

==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_sysvec.c#9 
(text+ko) ====

@@ -52,6 +52,7 @@
 #include <sys/mutex.h>
 #include <sys/proc.h>
 #include <sys/resourcevar.h>
+#include <sys/rwlock.h>
 #include <sys/signalvar.h>
 #include <sys/sysctl.h>
 #include <sys/syscallsubr.h>
@@ -1078,8 +1079,8 @@
                                linux_ioctl_register_handler(*lihp);
                        SET_FOREACH(ldhp, linux_device_handler_set)
                                linux_device_register_handler(*ldhp);
-                       sx_init(&emul_lock, "emuldata lock");
-                       sx_init(&emul_shared_lock, "emuldata->shared lock");
+                       mtx_init(&emul_lock, "emuldata lock", NULL, MTX_DEF);
+                       rw_init(&emul_shared_lock, "emuldata->shared lock");
                        LIST_INIT(&futex_list);
                        sx_init(&futex_sx, "futex protection lock");
                        linux_exit_tag = EVENTHANDLER_REGISTER(process_exit, 
linux_proc_exit,
@@ -1109,8 +1110,8 @@
                                linux_ioctl_unregister_handler(*lihp);
                        SET_FOREACH(ldhp, linux_device_handler_set)
                                linux_device_unregister_handler(*ldhp);
-                       sx_destroy(&emul_lock);
-                       sx_destroy(&emul_shared_lock);
+                       mtx_destroy(&emul_lock);
+                       rw_destroy(&emul_shared_lock);
                        sx_destroy(&futex_sx);
                        EVENTHANDLER_DEREGISTER(process_exit, linux_exit_tag);
                        EVENTHANDLER_DEREGISTER(schedtail, linux_schedtail_tag);

==== //depot/projects/linuxolator/src/sys/compat/linux/linux_emul.c#34 
(text+ko) ====

@@ -40,6 +40,7 @@
 #include <sys/mutex.h>
 #include <sys/sx.h>
 #include <sys/proc.h>
+#include <sys/rwlock.h>
 #include <sys/syscallsubr.h>
 #include <sys/sysproto.h>
 #include <sys/unistd.h>
@@ -55,8 +56,8 @@
 #include <machine/../linux/linux_proto.h>
 #endif
 
-struct sx emul_shared_lock;
-struct sx emul_lock;
+struct rwlock emul_shared_lock;
+struct mtx emul_lock;
 
 /* this returns locked reference to the emuldata entry (if found) */
 struct linux_emuldata *

==== //depot/projects/linuxolator/src/sys/compat/linux/linux_emul.h#9 (text+ko) 
====

@@ -57,13 +57,13 @@
 
 struct linux_emuldata *em_find(struct proc *, int locked);
 
-#define EMUL_LOCK(l)   sx_xlock(l)
-#define EMUL_UNLOCK(l) sx_xunlock(l)
+#define EMUL_LOCK(l)   mtx_lock(l)
+#define EMUL_UNLOCK(l) mtx_unlock(l)
 
-#define EMUL_SHARED_RLOCK(l) sx_slock(l)
-#define EMUL_SHARED_RUNLOCK(l) sx_sunlock(l)
-#define EMUL_SHARED_WLOCK(l) sx_xlock(l)
-#define EMUL_SHARED_WUNLOCK(l) sx_xunlock(l)
+#define EMUL_SHARED_RLOCK(l) rw_rlock(l)
+#define EMUL_SHARED_RUNLOCK(l) rw_runlock(l)
+#define EMUL_SHARED_WLOCK(l) rw_wlock(l)
+#define EMUL_SHARED_WUNLOCK(l) rw_wunlock(l)
 
 /* for em_find use */
 #define EMUL_DOLOCK            1
@@ -74,7 +74,7 @@
 void   linux_schedtail(void *, struct proc *);
 void   linux_proc_exec(void *, struct proc *, struct image_params *);
 
-extern struct sx emul_shared_lock;
-extern struct sx emul_lock;
+extern struct rwlock emul_shared_lock;
+extern struct mtx emul_lock;
 
 #endif /* !_LINUX_EMUL_H_ */

==== //depot/projects/linuxolator/src/sys/compat/linux/linux_misc.c#57 
(text+ko) ====

@@ -52,6 +52,7 @@
 #include <sys/proc.h>
 #include <sys/reboot.h>
 #include <sys/resourcevar.h>
+#include <sys/rwlock.h>
 #include <sys/sched.h>
 #include <sys/signalvar.h>
 #include <sys/stat.h>

==== //depot/projects/linuxolator/src/sys/i386/linux/linux_sysvec.c#4 (text+ko) 
====

@@ -41,6 +41,7 @@
 #include <sys/module.h>
 #include <sys/mutex.h>
 #include <sys/proc.h>
+#include <sys/rwlock.h>
 #include <sys/signalvar.h>
 #include <sys/syscallsubr.h>
 #include <sys/sysent.h>
@@ -917,8 +918,8 @@
                                linux_ioctl_register_handler(*lihp);
                        SET_FOREACH(ldhp, linux_device_handler_set)
                                linux_device_register_handler(*ldhp);
-                       sx_init(&emul_lock, "emuldata lock");
-                       sx_init(&emul_shared_lock, "emuldata->shared lock");
+                       mtx_init(&emul_lock, "emuldata lock", NULL, MTX_DEF);
+                       rw_init(&emul_shared_lock, "emuldata->shared lock");
                        LIST_INIT(&futex_list);
                        sx_init(&futex_sx, "futex protection lock");
                        linux_exit_tag = EVENTHANDLER_REGISTER(process_exit, 
linux_proc_exit,
@@ -948,8 +949,8 @@
                                linux_ioctl_unregister_handler(*lihp);
                        SET_FOREACH(ldhp, linux_device_handler_set)
                                linux_device_unregister_handler(*ldhp);
-                       sx_destroy(&emul_lock);
-                       sx_destroy(&emul_shared_lock);
+                       mtx_destroy(&emul_lock);
+                       rw_destroy(&emul_shared_lock);
                        sx_destroy(&futex_sx);
                        EVENTHANDLER_DEREGISTER(process_exit, linux_exit_tag);
                        EVENTHANDLER_DEREGISTER(schedtail, linux_schedtail_tag);
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/p4-projects
To unsubscribe, send any mail to "[email protected]"

<Prev in Thread] Current Thread [Next in Thread>
  • PERFORCE change 114198 for review, Roman Divacky <=