diff options
author | njl <njl@FreeBSD.org> | 2004-05-05 20:04:14 +0000 |
---|---|---|
committer | njl <njl@FreeBSD.org> | 2004-05-05 20:04:14 +0000 |
commit | f6bbab06a9c9c5ee8915e070a39d0c0285b9cfa1 (patch) | |
tree | 5200dfd19b49a6bca75c01e2650ddabae2247eee /sys/ia64/include | |
parent | 394d08093f3875935167a6a05f1679f87a1c9189 (diff) | |
download | FreeBSD-src-f6bbab06a9c9c5ee8915e070a39d0c0285b9cfa1.zip FreeBSD-src-f6bbab06a9c9c5ee8915e070a39d0c0285b9cfa1.tar.gz |
Add an MI implementation of the ACPI global lock routines and retire the
individual asm versions. The global lock is shared between the BIOS and
OS and thus cannot use our mutexes. It is defined in section 5.2.9.1 of
the ACPI specification.
Reviewed by: marcel, bde, jhb
Diffstat (limited to 'sys/ia64/include')
-rw-r--r-- | sys/ia64/include/acpica_machdep.h | 47 |
1 files changed, 5 insertions, 42 deletions
diff --git a/sys/ia64/include/acpica_machdep.h b/sys/ia64/include/acpica_machdep.h index f459b6a..315476b 100644 --- a/sys/ia64/include/acpica_machdep.h +++ b/sys/ia64/include/acpica_machdep.h @@ -61,50 +61,13 @@ #define ACPI_FLUSH_CPU_CACHE() /* XXX ia64_fc()? */ -/*! [Begin] no source code translation */ - +/* Section 5.2.9.1: global lock acquire/release functions */ +extern int acpi_acquire_global_lock(uint32_t *lock); +extern int acpi_release_global_lock(uint32_t *lock); #define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \ - do { \ - __asm__ volatile ("1: ld4 r29=[%1]\n" \ - ";;\n" \ - "mov ar.ccv=r29\n" \ - "mov r2=r29\n" \ - "shr.u r30=r29,1\n" \ - "and r29=-4,r29\n" \ - ";;\n" \ - "add r29=2,r29\n" \ - "and r30=1,r30\n" \ - ";;\n" \ - "add r29=r29,r30\n" \ - ";;\n" \ - "cmpxchg4.acq r30=[%1],r29,ar.ccv\n" \ - ";;\n" \ - "cmp.eq p6,p7=r2,r30\n" \ - "(p7) br.dpnt.few 1b\n" \ - "cmp.gt p8,p9=3,r29\n" \ - ";;\n" \ - "(p8) mov %0=-1\n" \ - "(p9) mov %0=r0\n" \ - :"=r"(Acq):"r"(GLptr):"r2","r29","r30","memory"); \ - } while (0) - + ((Acq) = acpi_acquire_global_lock(GLptr)) #define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) \ - do { \ - __asm__ volatile ("1: ld4 r29=[%1]\n" \ - ";;\n" \ - "mov ar.ccv=r29\n" \ - "mov r2=r29\n" \ - "and r29=-4,r29\n" \ - ";;\n" \ - "cmpxchg4.acq r30=[%1],r29,ar.ccv\n" \ - ";;\n" \ - "cmp.eq p6,p7=r2,r30\n" \ - "(p7) br.dpnt.few 1b\n" \ - "and %0=1,r2\n" \ - ";;\n" \ - :"=r"(Acq):"r"(GLptr):"r2","r29","r30","memory"); \ - } while (0) -/*! [End] no source code translation !*/ + ((Acq) = acpi_release_global_lock(GLptr)) #endif /* _KERNEL */ |