acpica_machdep.h (100969) | acpica_machdep.h (115426) |
---|---|
1/*- 2 * Copyright (c) 2002 Mitsuru IWASAKI 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 2002 Mitsuru IWASAKI 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/amd64/include/acpica_machdep.h 100969 2002-07-30 19:35:32Z iwasaki $ | 26 * $FreeBSD: head/sys/amd64/include/acpica_machdep.h 115426 2003-05-31 06:43:55Z peter $ |
27 */ 28 29/****************************************************************************** 30 * 31 * Name: acpica_machdep.h - arch-specific defines, etc. 32 * $Revision$ 33 * 34 *****************************************************************************/ --- 32 unchanged lines hidden (view full) --- 67 * %1 and %2 are the input parameters in ECX ("c") 68 * and an immediate value ("i") respectively 69 * All actual register references are preceded with "%%" as in "%%edx" 70 * Immediate values in the assembly are preceded by "$" as in "$0x1" 71 * The final asm parameter are the operation altered non-output registers. 72 */ 73#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \ 74 do { \ | 27 */ 28 29/****************************************************************************** 30 * 31 * Name: acpica_machdep.h - arch-specific defines, etc. 32 * $Revision$ 33 * 34 *****************************************************************************/ --- 32 unchanged lines hidden (view full) --- 67 * %1 and %2 are the input parameters in ECX ("c") 68 * and an immediate value ("i") respectively 69 * All actual register references are preceded with "%%" as in "%%edx" 70 * Immediate values in the assembly are preceded by "$" as in "$0x1" 71 * The final asm parameter are the operation altered non-output registers. 72 */ 73#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \ 74 do { \ |
75 int dummy; \ 76 asm("1: movl (%1),%%eax;" \ | 75 asm("1: movl %1,%%eax;" \ |
77 "movl %%eax,%%edx;" \ 78 "andl %2,%%edx;" \ 79 "btsl $0x1,%%edx;" \ 80 "adcl $0x0,%%edx;" \ | 76 "movl %%eax,%%edx;" \ 77 "andl %2,%%edx;" \ 78 "btsl $0x1,%%edx;" \ 79 "adcl $0x0,%%edx;" \ |
81 "lock; cmpxchgl %%edx,(%1);" \ | 80 "lock; cmpxchgl %%edx,%1;" \ |
82 "jnz 1b;" \ 83 "cmpb $0x3,%%dl;" \ 84 "sbbl %%eax,%%eax" \ | 81 "jnz 1b;" \ 82 "cmpb $0x3,%%dl;" \ 83 "sbbl %%eax,%%eax" \ |
85 :"=a"(Acq),"=c"(dummy):"c"(GLptr),"i"(~1L):"dx"); \ | 84 : "=a" (Acq), "+m" (GLptr) : "i" (~1L) : "edx"); \ |
86 } while(0) 87 88#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) \ 89 do { \ | 85 } while(0) 86 87#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) \ 88 do { \ |
90 int dummy; \ 91 asm("1: movl (%1),%%eax;" \ | 89 asm("1: movl %1,%%eax;" \ |
92 "movl %%eax,%%edx;" \ 93 "andl %2,%%edx;" \ | 90 "movl %%eax,%%edx;" \ 91 "andl %2,%%edx;" \ |
94 "lock; cmpxchgl %%edx,(%1);" \ | 92 "lock; cmpxchgl %%edx,%1;" \ |
95 "jnz 1b;" \ 96 "andl $0x1,%%eax" \ | 93 "jnz 1b;" \ 94 "andl $0x1,%%eax" \ |
97 :"=a"(Acq),"=c"(dummy):"c"(GLptr),"i"(~3L):"dx"); \ | 95 : "=a" (Acq), "+m" (GLptr) : "i" (~3L) : "edx"); \ |
98 } while(0) 99 100 | 96 } while(0) 97 98 |
101/* 102 * Math helper asm macros 103 */ 104#define ACPI_DIV_64_BY_32(n_hi, n_lo, d32, q32, r32) \ 105 asm("divl %2;" \ 106 :"=a"(q32), "=d"(r32) \ 107 :"r"(d32), \ 108 "0"(n_lo), "1"(n_hi)) 109 110 111#define ACPI_SHIFT_RIGHT_64(n_hi, n_lo) \ 112 asm("shrl $1,%2;" \ 113 "rcrl $1,%3;" \ 114 :"=r"(n_hi), "=r"(n_lo) \ 115 :"0"(n_hi), "1"(n_lo)) 116 | |
117/*! [End] no source code translation !*/ 118#endif /* _KERNEL */ 119 | 99/*! [End] no source code translation !*/ 100#endif /* _KERNEL */ 101 |
120#define ACPI_MACHINE_WIDTH 32 121#define COMPILER_DEPENDENT_INT64 long long 122#define COMPILER_DEPENDENT_UINT64 unsigned long long 123#define ACPI_USE_NATIVE_DIVIDE | 102#define ACPI_MACHINE_WIDTH 64 103#define COMPILER_DEPENDENT_INT64 long 104#define COMPILER_DEPENDENT_UINT64 unsigned long |
124 125#endif /* __ACPICA_MACHDEP_H__ */ | 105 106#endif /* __ACPICA_MACHDEP_H__ */ |