aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/utilities/utmutex.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/utilities/utmutex.c')
-rw-r--r--drivers/acpi/utilities/utmutex.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/drivers/acpi/utilities/utmutex.c b/drivers/acpi/utilities/utmutex.c
index b851f7be5d58..25eb34369afa 100644
--- a/drivers/acpi/utilities/utmutex.c
+++ b/drivers/acpi/utilities/utmutex.c
@@ -73,14 +73,21 @@ acpi_status acpi_ut_mutex_initialize(void)
73 /* 73 /*
74 * Create each of the predefined mutex objects 74 * Create each of the predefined mutex objects
75 */ 75 */
76 for (i = 0; i < NUM_MUTEX; i++) { 76 for (i = 0; i < ACPI_NUM_MUTEX; i++) {
77 status = acpi_ut_create_mutex(i); 77 status = acpi_ut_create_mutex(i);
78 if (ACPI_FAILURE(status)) { 78 if (ACPI_FAILURE(status)) {
79 return_ACPI_STATUS(status); 79 return_ACPI_STATUS(status);
80 } 80 }
81 } 81 }
82 82
83 /* Create the spinlocks for use at interrupt level */
84
83 status = acpi_os_create_lock(&acpi_gbl_gpe_lock); 85 status = acpi_os_create_lock(&acpi_gbl_gpe_lock);
86 if (ACPI_FAILURE(status)) {
87 return_ACPI_STATUS(status);
88 }
89
90 status = acpi_os_create_lock(&acpi_gbl_hardware_lock);
84 return_ACPI_STATUS(status); 91 return_ACPI_STATUS(status);
85} 92}
86 93
@@ -105,11 +112,14 @@ void acpi_ut_mutex_terminate(void)
105 /* 112 /*
106 * Delete each predefined mutex object 113 * Delete each predefined mutex object
107 */ 114 */
108 for (i = 0; i < NUM_MUTEX; i++) { 115 for (i = 0; i < ACPI_NUM_MUTEX; i++) {
109 (void)acpi_ut_delete_mutex(i); 116 (void)acpi_ut_delete_mutex(i);
110 } 117 }
111 118
119 /* Delete the spinlocks */
120
112 acpi_os_delete_lock(acpi_gbl_gpe_lock); 121 acpi_os_delete_lock(acpi_gbl_gpe_lock);
122 acpi_os_delete_lock(acpi_gbl_hardware_lock);
113 return_VOID; 123 return_VOID;
114} 124}
115 125
@@ -131,7 +141,7 @@ static acpi_status acpi_ut_create_mutex(acpi_mutex_handle mutex_id)
131 141
132 ACPI_FUNCTION_TRACE_U32(ut_create_mutex, mutex_id); 142 ACPI_FUNCTION_TRACE_U32(ut_create_mutex, mutex_id);
133 143
134 if (mutex_id > MAX_MUTEX) { 144 if (mutex_id > ACPI_MAX_MUTEX) {
135 return_ACPI_STATUS(AE_BAD_PARAMETER); 145 return_ACPI_STATUS(AE_BAD_PARAMETER);
136 } 146 }
137 147
@@ -165,7 +175,7 @@ static acpi_status acpi_ut_delete_mutex(acpi_mutex_handle mutex_id)
165 175
166 ACPI_FUNCTION_TRACE_U32(ut_delete_mutex, mutex_id); 176 ACPI_FUNCTION_TRACE_U32(ut_delete_mutex, mutex_id);
167 177
168 if (mutex_id > MAX_MUTEX) { 178 if (mutex_id > ACPI_MAX_MUTEX) {
169 return_ACPI_STATUS(AE_BAD_PARAMETER); 179 return_ACPI_STATUS(AE_BAD_PARAMETER);
170 } 180 }
171 181
@@ -196,7 +206,7 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id)
196 206
197 ACPI_FUNCTION_NAME(ut_acquire_mutex); 207 ACPI_FUNCTION_NAME(ut_acquire_mutex);
198 208
199 if (mutex_id > MAX_MUTEX) { 209 if (mutex_id > ACPI_MAX_MUTEX) {
200 return (AE_BAD_PARAMETER); 210 return (AE_BAD_PARAMETER);
201 } 211 }
202 212
@@ -213,7 +223,7 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id)
213 * the mutex ordering rule. This indicates a coding error somewhere in 223 * the mutex ordering rule. This indicates a coding error somewhere in
214 * the ACPI subsystem code. 224 * the ACPI subsystem code.
215 */ 225 */
216 for (i = mutex_id; i < MAX_MUTEX; i++) { 226 for (i = mutex_id; i < ACPI_MAX_MUTEX; i++) {
217 if (acpi_gbl_mutex_info[i].thread_id == this_thread_id) { 227 if (acpi_gbl_mutex_info[i].thread_id == this_thread_id) {
218 if (i == mutex_id) { 228 if (i == mutex_id) {
219 ACPI_ERROR((AE_INFO, 229 ACPI_ERROR((AE_INFO,
@@ -284,7 +294,7 @@ acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id)
284 "Thread %X releasing Mutex [%s]\n", this_thread_id, 294 "Thread %X releasing Mutex [%s]\n", this_thread_id,
285 acpi_ut_get_mutex_name(mutex_id))); 295 acpi_ut_get_mutex_name(mutex_id)));
286 296
287 if (mutex_id > MAX_MUTEX) { 297 if (mutex_id > ACPI_MAX_MUTEX) {
288 return (AE_BAD_PARAMETER); 298 return (AE_BAD_PARAMETER);
289 } 299 }
290 300
@@ -309,7 +319,7 @@ acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id)
309 * ordering rule. This indicates a coding error somewhere in 319 * ordering rule. This indicates a coding error somewhere in
310 * the ACPI subsystem code. 320 * the ACPI subsystem code.
311 */ 321 */
312 for (i = mutex_id; i < MAX_MUTEX; i++) { 322 for (i = mutex_id; i < ACPI_MAX_MUTEX; i++) {
313 if (acpi_gbl_mutex_info[i].thread_id == this_thread_id) { 323 if (acpi_gbl_mutex_info[i].thread_id == this_thread_id) {
314 if (i == mutex_id) { 324 if (i == mutex_id) {
315 continue; 325 continue;