diff --git a/sys/arch/i386/include/acpi_func.h b/sys/arch/i386/include/acpi_func.h index 6008147a63b2..a97362c60ea0 100644 --- a/sys/arch/i386/include/acpi_func.h +++ b/sys/arch/i386/include/acpi_func.h @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_func.h,v 1.3 2003/08/13 12:38:35 yamt Exp $ */ +/* $NetBSD: acpi_func.h,v 1.4 2003/08/13 12:40:31 yamt Exp $ */ #include @@ -9,37 +9,35 @@ #define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \ do { \ - int dummy; \ __asm __volatile( \ - "1: movl (%1),%%eax ;" \ + "1: movl %1,%%eax ;" \ " movl %%eax,%%edx ;" \ - " andl %3,%%edx ;" \ + " andl %2,%%edx ;" \ " btsl $0x1,%%edx ;" \ " adcl $0x0,%%edx ;" \ " lock ;" \ - " cmpxchgl %%edx,(%1) ;" \ + " cmpxchgl %%edx,%1 ;" \ " jnz 1b ;" \ " andb $0x3,%%dl ;" \ " cmpb $0x3,%%dl ;" \ - " sbbl %%eax,%%eax " \ - : "=a" (Acq), "=c" (dummy) \ - : "c" (GLptr), "i" (~1L) \ - : "dx"); \ + " sbbl %%eax,%%eax ;" \ + : "=&a" (Acq), "+m" (*GLptr) \ + : "i" (~1L) \ + : "edx"); \ } while (0) #define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) \ do { \ - int dummy; \ __asm __volatile( \ - "1: movl (%1),%%eax ;" \ - " andl %3,%%edx ;" \ + "1: movl %1,%%eax ;" \ + " andl %2,%%edx ;" \ " lock ;" \ - " cmpxchgl %%edx,(%1) ;" \ + " cmpxchgl %%edx,%1 ;" \ " jnz 1b ;" \ " andl $0x1,%%eax ;" \ - : "=a" (Acq), "=c" (dummy) \ - : "c" (GLptr), "i" (~3L) \ - : "dx"); \ + : "=&a" (Acq), "+m" (*GLptr) \ + : "i" (~3L) \ + : "edx"); \ } while (0) #define ACPI_FLUSH_CPU_CACHE() wbinvd()