Merge branches 'd3cold', 'bugzilla-37412' and 'bugzilla-38152' into release

This commit is contained in:
Len Brown
2011-07-14 00:16:38 -04:00
4 changed files with 32 additions and 18 deletions

View File

@@ -98,8 +98,11 @@ acpi_os_table_override(struct acpi_table_header *existing_table,
/*
* Spinlock primitives
*/
#ifndef acpi_os_create_lock
acpi_status
acpi_os_create_lock(acpi_spinlock *out_handle);
#endif
void acpi_os_delete_lock(acpi_spinlock handle);

View File

@@ -159,6 +159,24 @@ static inline void *acpi_os_acquire_object(acpi_cache_t * cache)
} while (0)
#endif
/*
* When lockdep is enabled, the spin_lock_init() macro stringifies it's
* argument and uses that as a name for the lock in debugging.
* By executing spin_lock_init() in a macro the key changes from "lock" for
* all locks to the name of the argument of acpi_os_create_lock(), which
* prevents lockdep from reporting false positives for ACPICA locks.
*/
#define acpi_os_create_lock(__handle) \
({ \
spinlock_t *lock = ACPI_ALLOCATE(sizeof(*lock)); \
\
if (lock) { \
*(__handle) = lock; \
spin_lock_init(*(__handle)); \
} \
lock ? AE_OK : AE_NO_MEMORY; \
})
#endif /* __KERNEL__ */
#endif /* __ACLINUX_H__ */