summaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorLin Ming <ming.m.lin@intel.com>2011-03-23 17:26:34 +0800
committerLen Brown <len.brown@intel.com>2011-03-25 04:32:33 -0400
commit9f63b88bd7a1ac1afbb4358772a39abaeddbdd13 (patch)
tree1b95ed2997b6a02305add78f20805fee5b3fb269 /drivers/acpi
parentd8d75b0ee6dbd65c8a2189aef50a03667d81c937 (diff)
downloadop-kernel-dev-9f63b88bd7a1ac1afbb4358772a39abaeddbdd13.zip
op-kernel-dev-9f63b88bd7a1ac1afbb4358772a39abaeddbdd13.tar.gz
ACPI: osl, add acpi_os_create_lock interface
Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/osl.c33
1 files changed, 25 insertions, 8 deletions
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index c90c76a..cf750a7 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -883,14 +883,6 @@ void acpi_os_wait_events_complete(void *context)
EXPORT_SYMBOL(acpi_os_wait_events_complete);
-/*
- * Deallocate the memory for a spinlock.
- */
-void acpi_os_delete_lock(acpi_spinlock handle)
-{
- return;
-}
-
acpi_status
acpi_os_create_semaphore(u32 max_units, u32 initial_units, acpi_handle * handle)
{
@@ -1322,6 +1314,31 @@ int acpi_resources_are_enforced(void)
EXPORT_SYMBOL(acpi_resources_are_enforced);
/*
+ * Create and initialize a spinlock.
+ */
+acpi_status
+acpi_os_create_lock(acpi_spinlock *out_handle)
+{
+ spinlock_t *lock;
+
+ lock = ACPI_ALLOCATE(sizeof(spinlock_t));
+ if (!lock)
+ return AE_NO_MEMORY;
+ spin_lock_init(lock);
+ *out_handle = lock;
+
+ return AE_OK;
+}
+
+/*
+ * Deallocate the memory for a spinlock.
+ */
+void acpi_os_delete_lock(acpi_spinlock handle)
+{
+ ACPI_FREE(handle);
+}
+
+/*
* Acquire a spinlock.
*
* handle is a pointer to the spinlock_t.
OpenPOWER on IntegriCloud