summaryrefslogtreecommitdiff
path: root/include/acpi/acpiosxf.h
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2018-04-25 17:28:26 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2018-05-10 18:18:45 +0300
commitc3052594c8ded984ceab3725f63990dfdea1e58f (patch)
tree5971f70a7f1b4109e1c008a6e919b038a186ccb6 /include/acpi/acpiosxf.h
parent75bc37fefc4471e718ba8e651aa74673d4e0a9eb (diff)
downloadlinux-c3052594c8ded984ceab3725f63990dfdea1e58f.tar.xz
ACPICA: provide abstraction for raw_spinlock_t
Provide a new lock type acpi_raw_spinlock which is implemented as raw_spinlock_t on Linux. This type should be used in code which covers small areas of code and disables interrupts only for short time even on a realtime OS. There is a fallback to spinlock_t if an OS does not provide an implementation for acpi_raw_spinlock. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/acpi/acpiosxf.h')
-rw-r--r--include/acpi/acpiosxf.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index 540d35f06ad6..eb1f21af7556 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -98,6 +98,27 @@ void acpi_os_release_lock(acpi_spinlock handle, acpi_cpu_flags flags);
#endif
/*
+ * RAW spinlock primitives. If the OS does not provide them, fallback to
+ * spinlock primitives
+ */
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_create_raw_lock
+# define acpi_os_create_raw_lock(out_handle) acpi_os_create_lock(out_handle)
+#endif
+
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_delete_raw_lock
+# define acpi_os_delete_raw_lock(handle) acpi_os_delete_lock(handle)
+#endif
+
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_acquire_raw_lock
+# define acpi_os_acquire_raw_lock(handle) acpi_os_acquire_lock(handle)
+#endif
+
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_release_raw_lock
+# define acpi_os_release_raw_lock(handle, flags) \
+ acpi_os_release_lock(handle, flags)
+#endif
+
+/*
* Semaphore primitives
*/
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_create_semaphore