Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 May 2003 12:47:17 -0700 (PDT)
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 32113 for review
Message-ID:  <200305301947.h4UJlHPJ066122@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=32113

Change 32113 by peter@peter_hammer on 2003/05/30 12:47:01

	clean up locking code, again thanks to jhb.

Affected files ...

.. //depot/projects/hammer/sys/amd64/include/acpica_machdep.h#4 edit

Differences ...

==== //depot/projects/hammer/sys/amd64/include/acpica_machdep.h#4 (text+ko) ====

@@ -72,27 +72,27 @@
  */
 #define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \
     do { \
-        asm("1:     movl (%1),%%eax;" \
+        asm("1:     movl %1,%%eax;" \
             "movl   %%eax,%%edx;" \
             "andl   %2,%%edx;" \
             "btsl   $0x1,%%edx;" \
             "adcl   $0x0,%%edx;" \
-            "lock;  cmpxchgl %%edx,(%1);" \
+            "lock;  cmpxchgl %%edx,%1;" \
             "jnz    1b;" \
             "cmpb   $0x3,%%dl;" \
             "sbbl   %%eax,%%eax" \
-            : "=a" (Acq), "+c" (GLptr) : "i" (~1L) : "edx"); \
+            : "=a" (Acq), "+m" (GLptr) : "i" (~1L) : "edx"); \
     } while(0)
 
 #define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) \
     do { \
-        asm("1:     movl (%1),%%eax;" \
+        asm("1:     movl %1,%%eax;" \
             "movl   %%eax,%%edx;" \
             "andl   %2,%%edx;" \
-            "lock;  cmpxchgl %%edx,(%1);" \
+            "lock;  cmpxchgl %%edx,%1;" \
             "jnz    1b;" \
             "andl   $0x1,%%eax" \
-            : "=a" (Acq), "+c" (GLptr) : "i" (~3L) : "edx"); \
+            : "=a" (Acq), "+m" (GLptr) : "i" (~3L) : "edx"); \
     } while(0)
 
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200305301947.h4UJlHPJ066122>