diff options
| author | Lin Ming <ming.m.lin@intel.com> | 2011-03-23 05:26:34 -0400 |
|---|---|---|
| committer | Len Brown <len.brown@intel.com> | 2011-03-25 04:32:33 -0400 |
| commit | 9f63b88bd7a1ac1afbb4358772a39abaeddbdd13 (patch) | |
| tree | 1b95ed2997b6a02305add78f20805fee5b3fb269 | |
| parent | d8d75b0ee6dbd65c8a2189aef50a03667d81c937 (diff) | |
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>
| -rw-r--r-- | drivers/acpi/osl.c | 33 | ||||
| -rw-r--r-- | include/acpi/acpiosxf.h | 3 |
2 files changed, 28 insertions, 8 deletions
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index c90c76aa7f8b..cf750a7a9523 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c | |||
| @@ -883,14 +883,6 @@ void acpi_os_wait_events_complete(void *context) | |||
| 883 | 883 | ||
| 884 | EXPORT_SYMBOL(acpi_os_wait_events_complete); | 884 | EXPORT_SYMBOL(acpi_os_wait_events_complete); |
| 885 | 885 | ||
| 886 | /* | ||
| 887 | * Deallocate the memory for a spinlock. | ||
| 888 | */ | ||
| 889 | void acpi_os_delete_lock(acpi_spinlock handle) | ||
| 890 | { | ||
| 891 | return; | ||
| 892 | } | ||
| 893 | |||
| 894 | acpi_status | 886 | acpi_status |
| 895 | acpi_os_create_semaphore(u32 max_units, u32 initial_units, acpi_handle * handle) | 887 | acpi_os_create_semaphore(u32 max_units, u32 initial_units, acpi_handle * handle) |
| 896 | { | 888 | { |
| @@ -1322,6 +1314,31 @@ int acpi_resources_are_enforced(void) | |||
| 1322 | EXPORT_SYMBOL(acpi_resources_are_enforced); | 1314 | EXPORT_SYMBOL(acpi_resources_are_enforced); |
| 1323 | 1315 | ||
| 1324 | /* | 1316 | /* |
| 1317 | * Create and initialize a spinlock. | ||
| 1318 | */ | ||
| 1319 | acpi_status | ||
| 1320 | acpi_os_create_lock(acpi_spinlock *out_handle) | ||
| 1321 | { | ||
| 1322 | spinlock_t *lock; | ||
| 1323 | |||
| 1324 | lock = ACPI_ALLOCATE(sizeof(spinlock_t)); | ||
| 1325 | if (!lock) | ||
| 1326 | return AE_NO_MEMORY; | ||
| 1327 | spin_lock_init(lock); | ||
| 1328 | *out_handle = lock; | ||
| 1329 | |||
| 1330 | return AE_OK; | ||
| 1331 | } | ||
| 1332 | |||
| 1333 | /* | ||
| 1334 | * Deallocate the memory for a spinlock. | ||
| 1335 | */ | ||
| 1336 | void acpi_os_delete_lock(acpi_spinlock handle) | ||
| 1337 | { | ||
| 1338 | ACPI_FREE(handle); | ||
| 1339 | } | ||
| 1340 | |||
| 1341 | /* | ||
| 1325 | * Acquire a spinlock. | 1342 | * Acquire a spinlock. |
| 1326 | * | 1343 | * |
| 1327 | * handle is a pointer to the spinlock_t. | 1344 | * handle is a pointer to the spinlock_t. |
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index a3252a5ead66..a756bc8d866d 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h | |||
| @@ -98,6 +98,9 @@ acpi_os_table_override(struct acpi_table_header *existing_table, | |||
| 98 | /* | 98 | /* |
| 99 | * Spinlock primitives | 99 | * Spinlock primitives |
| 100 | */ | 100 | */ |
| 101 | acpi_status | ||
| 102 | acpi_os_create_lock(acpi_spinlock *out_handle); | ||
| 103 | |||
| 101 | void acpi_os_delete_lock(acpi_spinlock handle); | 104 | void acpi_os_delete_lock(acpi_spinlock handle); |
| 102 | 105 | ||
| 103 | acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock handle); | 106 | acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock handle); |
