[Vm-dev] [commit][2725] Fix typos in -help on unix.

commits at squeakvm.org commits at squeakvm.org
Thu Apr 25 18:34:42 UTC 2013


Revision: 2725
Author:   eliot
Date:     2013-04-25 11:34:40 -0700 (Thu, 25 Apr 2013)
Log Message:
-----------
Fix typos in -help on unix.
Fix use of sqCompareAndSwap in !defined(SA_NODEFER) regime in ticker heartbeats.
Comment and better define iPhone imp of sqCompareAndSwapRes.

Modified Paths:
--------------
    branches/Cog/platforms/Cross/vm/sqAtomicOps.h
    branches/Cog/platforms/unix/vm/sqUnixITimerHeartbeat.c
    branches/Cog/platforms/unix/vm/sqUnixITimerTickerHeartbeat.c
    branches/Cog/platforms/unix/vm/sqUnixMain.c

Modified: branches/Cog/platforms/Cross/vm/sqAtomicOps.h
===================================================================
--- branches/Cog/platforms/Cross/vm/sqAtomicOps.h	2013-04-19 21:24:17 UTC (rev 2724)
+++ branches/Cog/platforms/Cross/vm/sqAtomicOps.h	2013-04-25 18:34:40 UTC (rev 2725)
@@ -188,7 +188,8 @@
 
 #ifdef TARGET_OS_IS_IPHONE
 # define sqCompareAndSwap(var,old,new) OSAtomicCompareAndSwap32(old, new, &var) 
-# define sqCompareAndSwapRes(var,old,new,res) res = var; OSAtomicCompareAndSwap32(old, new, &var) 
+/* N.B.  This is not atomic in fetching var's old value :( */
+# define sqCompareAndSwapRes(var,old,new,res) do { res = var; if (OSAtomicCompareAndSwap32(old, new, &var)) res = new; } while (0)
 #else
 # define sqCompareAndSwap(var,old,new) \
 	asm volatile ("movl %1, %%eax; lock cmpxchg %2, %0" \

Modified: branches/Cog/platforms/unix/vm/sqUnixITimerHeartbeat.c
===================================================================
--- branches/Cog/platforms/unix/vm/sqUnixITimerHeartbeat.c	2013-04-19 21:24:17 UTC (rev 2724)
+++ branches/Cog/platforms/unix/vm/sqUnixITimerHeartbeat.c	2013-04-25 18:34:40 UTC (rev 2725)
@@ -351,7 +351,8 @@
 {
 #if !defined(SA_NODEFER)
   {	int zeroAndPreviousHandlingHeartbeat = 0;
-    sqCompareAndSwap(handling_heartbeat,zeroAndPreviousHandlingHeartbeat,1);
+    sqCompareAndSwapRes(handling_heartbeat,zeroAndPreviousHandlingHeartbeat,
+						1,zeroAndPreviousHandlingHeartbeat);
 	if (zeroAndPreviousHandlingHeartbeat)
 		return;
   }

Modified: branches/Cog/platforms/unix/vm/sqUnixITimerTickerHeartbeat.c
===================================================================
--- branches/Cog/platforms/unix/vm/sqUnixITimerTickerHeartbeat.c	2013-04-19 21:24:17 UTC (rev 2724)
+++ branches/Cog/platforms/unix/vm/sqUnixITimerTickerHeartbeat.c	2013-04-25 18:34:40 UTC (rev 2725)
@@ -481,7 +481,8 @@
 
 #if !defined(SA_NODEFER)
   {	int zeroAndPreviousHandlingHeartbeat = 0;
-    sqCompareAndSwap(handling_heartbeat,zeroAndPreviousHandlingHeartbeat,1);
+    sqCompareAndSwapRes(handling_heartbeat,zeroAndPreviousHandlingHeartbeat,
+						1,zeroAndPreviousHandlingHeartbeat);
 	if (zeroAndPreviousHandlingHeartbeat)
 		return;
   }

Modified: branches/Cog/platforms/unix/vm/sqUnixMain.c
===================================================================
--- branches/Cog/platforms/unix/vm/sqUnixMain.c	2013-04-19 21:24:17 UTC (rev 2724)
+++ branches/Cog/platforms/unix/vm/sqUnixMain.c	2013-04-25 18:34:40 UTC (rev 2725)
@@ -1477,12 +1477,12 @@
   printf("  -jit                  enable the dynamic compiler (if available)\n");
 # endif
   printf("  -notimer              disable interval timer for low-res clock\n");
-  printf("  -display <dpy>        quivalent to '-vm-display-X11 -display <dpy>'\n");
-  printf("  -headless             quivalent to '-vm-display-X11 -headless'\n");
-  printf("  -nodisplay            quivalent to '-vm-display-null'\n");
+  printf("  -display <dpy>        equivalent to '-vm-display-X11 -display <dpy>'\n");
+  printf("  -headless             equivalent to '-vm-display-X11 -headless'\n");
+  printf("  -nodisplay            equivalent to '-vm-display-null'\n");
   printf("  -nomixer              disable modification of mixer settings\n");
-  printf("  -nosound              quivalent to '-vm-sound-null'\n");
-  printf("  -quartz               quivalent to '-vm-display-Quartz'\n");
+  printf("  -nosound              equivalent to '-vm-sound-null'\n");
+  printf("  -quartz               equivalent to '-vm-display-Quartz'\n");
 #endif
 }
 



More information about the Vm-dev mailing list