aboutsummaryrefslogtreecommitdiff
path: root/include/acpi/platform/aclinuxex.h
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2018-06-04 10:43:12 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2018-06-04 10:43:12 +0200
commitba609f7f21e45fc1170aa6beffae922a82c1b2d8 (patch)
tree97b42633119e578009070d1dade033c5318b8630 /include/acpi/platform/aclinuxex.h
parent5a802a7a285c8877ca872e44eeb0f06afcb5212f (diff)
parent087ec15606b4a2ffef6fa3e2da4070e297f8b8f8 (diff)
downloadlinux-ba609f7f21e45fc1170aa6beffae922a82c1b2d8.tar.gz
linux-ba609f7f21e45fc1170aa6beffae922a82c1b2d8.tar.bz2
linux-ba609f7f21e45fc1170aa6beffae922a82c1b2d8.zip
Merge branch 'acpica'
* acpica: ACPICA: Mark acpi_ut_create_internal_object_dbg() memory allocations as non-leaks ACPICA: Update version to 20180508 ACPICA: acpidump/acpixtract: Support for tables larger than 1MB ACPICA: Update version to 20180427 ACPICA: Debugger: Removed direct support for EC address space in "Test Objects" ACPICA: Debugger: Add Package support for "test objects" command ACPICA: Improve error messages for the namespace root node ACPICA: Fix potential infinite loop in acpi_rs_dump_byte_list ACPICA: vsnprintf: this statement may fall through ACPICA: Tables: Fix spelling mistake in comment ACPICA: iASL: Enhance the -tc option (create AML hex file in C) ACPICA: Convert acpi_gbl_hardware lock back to an acpi_raw_spinlock ACPICA: provide abstraction for raw_spinlock_t
Diffstat (limited to 'include/acpi/platform/aclinuxex.h')
-rw-r--r--include/acpi/platform/aclinuxex.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/include/acpi/platform/aclinuxex.h b/include/acpi/platform/aclinuxex.h
index 7e81475fe034..d754a1b12721 100644
--- a/include/acpi/platform/aclinuxex.h
+++ b/include/acpi/platform/aclinuxex.h
@@ -90,6 +90,36 @@ static inline acpi_thread_id acpi_os_get_thread_id(void)
lock ? AE_OK : AE_NO_MEMORY; \
})
+
+#define acpi_os_create_raw_lock(__handle) \
+ ({ \
+ raw_spinlock_t *lock = ACPI_ALLOCATE(sizeof(*lock)); \
+ if (lock) { \
+ *(__handle) = lock; \
+ raw_spin_lock_init(*(__handle)); \
+ } \
+ lock ? AE_OK : AE_NO_MEMORY; \
+ })
+
+static inline acpi_cpu_flags acpi_os_acquire_raw_lock(acpi_raw_spinlock lockp)
+{
+ acpi_cpu_flags flags;
+
+ raw_spin_lock_irqsave(lockp, flags);
+ return flags;
+}
+
+static inline void acpi_os_release_raw_lock(acpi_raw_spinlock lockp,
+ acpi_cpu_flags flags)
+{
+ raw_spin_unlock_irqrestore(lockp, flags);
+}
+
+static inline void acpi_os_delete_raw_lock(acpi_raw_spinlock handle)
+{
+ ACPI_FREE(handle);
+}
+
static inline u8 acpi_os_readable(void *pointer, acpi_size length)
{
return TRUE;