- leave a compiler which register is used for an asm argument.
- use correct asm constraints. - eliminate usage of dummy variables.
This commit is contained in:
parent
fd72624430
commit
e6483a7858
|
@ -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 <machine/cpufunc.h>
|
||||
|
||||
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue