summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2003-06-03 14:46:16 +0000
committerjhb <jhb@FreeBSD.org>2003-06-03 14:46:16 +0000
commit46b16c85d0ffddbbada4fb846b6abfb0ea5ac0af (patch)
tree8e8d28d30d819bb76ff8a7bf7d845e5bfc3c1d98 /sys
parent4225bd621fc49a9b4ae835a0e0d2cd1c091c6bcd (diff)
downloadFreeBSD-src-46b16c85d0ffddbbada4fb846b6abfb0ea5ac0af.zip
FreeBSD-src-46b16c85d0ffddbbada4fb846b6abfb0ea5ac0af.tar.gz
Fix the asm constraints so that we use the correct constants when acquiring
and releasing ACPI global locks instead of (ab)using the pointers to those locks as the constants. Also, rather than require that the address of the lock be stored in a register, use a memory constraint allowing the memory address to be used directly. Noticed by: peter
Diffstat (limited to 'sys')
-rw-r--r--sys/i386/include/acpica_machdep.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/sys/i386/include/acpica_machdep.h b/sys/i386/include/acpica_machdep.h
index 2624e63..a59cfe1 100644
--- a/sys/i386/include/acpica_machdep.h
+++ b/sys/i386/include/acpica_machdep.h
@@ -72,29 +72,27 @@
*/
#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \
do { \
- int dummy; \
- 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"(dummy):"c"(GLptr),"i"(~1L):"dx"); \
+ : "=a" (Acq), "+m" (GLptr) : "i" (~1L) : "edx"); \
} while(0)
#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) \
do { \
- int dummy; \
- 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"(dummy):"c"(GLptr),"i"(~3L):"dx"); \
+ : "=a" (Acq), "+m" (GLptr) : "i" (~3L) : "edx"); \
} while(0)
OpenPOWER on IntegriCloud