aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/events/evxface.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/events/evxface.c')
-rw-r--r--drivers/acpi/events/evxface.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/drivers/acpi/events/evxface.c b/drivers/acpi/events/evxface.c
index 6d866a01f5f4..94a6efe020be 100644
--- a/drivers/acpi/events/evxface.c
+++ b/drivers/acpi/events/evxface.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2007, R. Byron Moore 8 * Copyright (C) 2000 - 2008, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -758,6 +758,12 @@ ACPI_EXPORT_SYMBOL(acpi_remove_gpe_handler)
758 * 758 *
759 * DESCRIPTION: Acquire the ACPI Global Lock 759 * DESCRIPTION: Acquire the ACPI Global Lock
760 * 760 *
761 * Note: Allows callers with the same thread ID to acquire the global lock
762 * multiple times. In other words, externally, the behavior of the global lock
763 * is identical to an AML mutex. On the first acquire, a new handle is
764 * returned. On any subsequent calls to acquire by the same thread, the same
765 * handle is returned.
766 *
761 ******************************************************************************/ 767 ******************************************************************************/
762acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle) 768acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle)
763{ 769{
@@ -770,14 +776,19 @@ acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle)
770 /* Must lock interpreter to prevent race conditions */ 776 /* Must lock interpreter to prevent race conditions */
771 777
772 acpi_ex_enter_interpreter(); 778 acpi_ex_enter_interpreter();
773 status = acpi_ev_acquire_global_lock(timeout); 779
774 acpi_ex_exit_interpreter(); 780 status = acpi_ex_acquire_mutex_object(timeout,
781 acpi_gbl_global_lock_mutex,
782 acpi_os_get_thread_id());
775 783
776 if (ACPI_SUCCESS(status)) { 784 if (ACPI_SUCCESS(status)) {
777 acpi_gbl_global_lock_handle++; 785
786 /* Return the global lock handle (updated in acpi_ev_acquire_global_lock) */
787
778 *handle = acpi_gbl_global_lock_handle; 788 *handle = acpi_gbl_global_lock_handle;
779 } 789 }
780 790
791 acpi_ex_exit_interpreter();
781 return (status); 792 return (status);
782} 793}
783 794
@@ -798,11 +809,11 @@ acpi_status acpi_release_global_lock(u32 handle)
798{ 809{
799 acpi_status status; 810 acpi_status status;
800 811
801 if (handle != acpi_gbl_global_lock_handle) { 812 if (!handle || (handle != acpi_gbl_global_lock_handle)) {
802 return (AE_NOT_ACQUIRED); 813 return (AE_NOT_ACQUIRED);
803 } 814 }
804 815
805 status = acpi_ev_release_global_lock(); 816 status = acpi_ex_release_mutex_object(acpi_gbl_global_lock_mutex);
806 return (status); 817 return (status);
807} 818}
808 819