emlxs_thread.c (d08970de) | emlxs_thread.c (a9800beb) |
---|---|
1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 6 unchanged lines hidden (view full) --- 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 22/* | 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 6 unchanged lines hidden (view full) --- 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 22/* |
23 * Copyright 2009 Emulex. All rights reserved. | 23 * Copyright 2010 Emulex. All rights reserved. |
24 * Use is subject to license terms. 25 */ 26 27 28#include <emlxs.h> 29 30 31/* Required for EMLXS_CONTEXT in EMLXS_MSGF calls */ --- 124 unchanged lines hidden (view full) --- 156 } 157 158 /* Zero the taskq */ 159 bzero(taskq, sizeof (emlxs_taskq_t)); 160 161 (void) sprintf(buf, "%s%d_thread_taskq_get mutex", DRIVER_NAME, 162 hba->ddiinst); 163 mutex_init(&taskq->get_lock, buf, MUTEX_DRIVER, | 24 * Use is subject to license terms. 25 */ 26 27 28#include <emlxs.h> 29 30 31/* Required for EMLXS_CONTEXT in EMLXS_MSGF calls */ --- 124 unchanged lines hidden (view full) --- 156 } 157 158 /* Zero the taskq */ 159 bzero(taskq, sizeof (emlxs_taskq_t)); 160 161 (void) sprintf(buf, "%s%d_thread_taskq_get mutex", DRIVER_NAME, 162 hba->ddiinst); 163 mutex_init(&taskq->get_lock, buf, MUTEX_DRIVER, |
164 (void *)hba->intr_arg); | 164 DDI_INTR_PRI(hba->intr_arg)); |
165 166 mutex_enter(&taskq->get_lock); 167 168 taskq->hba = hba; 169 170 (void) sprintf(buf, "%s%d_thread_taskq_put mutex", DRIVER_NAME, 171 hba->ddiinst); 172 mutex_init(&taskq->put_lock, buf, MUTEX_DRIVER, | 165 166 mutex_enter(&taskq->get_lock); 167 168 taskq->hba = hba; 169 170 (void) sprintf(buf, "%s%d_thread_taskq_put mutex", DRIVER_NAME, 171 hba->ddiinst); 172 mutex_init(&taskq->put_lock, buf, MUTEX_DRIVER, |
173 (void *)hba->intr_arg); | 173 DDI_INTR_PRI(hba->intr_arg)); |
174 175 for (i = 0; i < EMLXS_MAX_TASKQ_THREADS; i++) { 176 tthread = &taskq->thread_list[i]; 177 tthread->taskq = taskq; 178 179 (void) sprintf(buf, "%s%d_thread%d mutex", DRIVER_NAME, 180 hba->ddiinst, i); 181 mutex_init(&tthread->lock, buf, MUTEX_DRIVER, | 174 175 for (i = 0; i < EMLXS_MAX_TASKQ_THREADS; i++) { 176 tthread = &taskq->thread_list[i]; 177 tthread->taskq = taskq; 178 179 (void) sprintf(buf, "%s%d_thread%d mutex", DRIVER_NAME, 180 hba->ddiinst, i); 181 mutex_init(&tthread->lock, buf, MUTEX_DRIVER, |
182 (void *)hba->intr_arg); | 182 DDI_INTR_PRI(hba->intr_arg)); |
183 184 (void) sprintf(buf, "%s%d_thread%d cv", DRIVER_NAME, 185 hba->ddiinst, i); 186 cv_init(&tthread->cv_flag, buf, CV_DRIVER, NULL); 187 188 tthread->flags |= EMLXS_THREAD_INITD; 189 tthread->thread = 190 thread_create(NULL, 0, emlxs_taskq_thread, --- 173 unchanged lines hidden (view full) --- 364 if (ethread->flags & EMLXS_THREAD_INITD) { 365 return; 366 } 367 368 bzero(ethread, sizeof (emlxs_thread_t)); 369 370 (void) sprintf(buf, "%s%d_thread_%08x mutex", DRIVER_NAME, hba->ddiinst, 371 (uint32_t)((uintptr_t)ethread & 0xFFFFFFFF)); | 183 184 (void) sprintf(buf, "%s%d_thread%d cv", DRIVER_NAME, 185 hba->ddiinst, i); 186 cv_init(&tthread->cv_flag, buf, CV_DRIVER, NULL); 187 188 tthread->flags |= EMLXS_THREAD_INITD; 189 tthread->thread = 190 thread_create(NULL, 0, emlxs_taskq_thread, --- 173 unchanged lines hidden (view full) --- 364 if (ethread->flags & EMLXS_THREAD_INITD) { 365 return; 366 } 367 368 bzero(ethread, sizeof (emlxs_thread_t)); 369 370 (void) sprintf(buf, "%s%d_thread_%08x mutex", DRIVER_NAME, hba->ddiinst, 371 (uint32_t)((uintptr_t)ethread & 0xFFFFFFFF)); |
372 mutex_init(ðread->lock, buf, MUTEX_DRIVER, (void *)hba->intr_arg); | 372 mutex_init(ðread->lock, buf, MUTEX_DRIVER, 373 DDI_INTR_PRI(hba->intr_arg)); |
373 374 (void) sprintf(buf, "%s%d_thread_%08x cv", DRIVER_NAME, hba->ddiinst, 375 (uint32_t)((uintptr_t)ethread & 0xFFFFFFFF)); 376 cv_init(ðread->cv_flag, buf, CV_DRIVER, NULL); 377 378 ethread->hba = hba; 379 ethread->flags |= EMLXS_THREAD_INITD; 380 --- 251 unchanged lines hidden --- | 374 375 (void) sprintf(buf, "%s%d_thread_%08x cv", DRIVER_NAME, hba->ddiinst, 376 (uint32_t)((uintptr_t)ethread & 0xFFFFFFFF)); 377 cv_init(ðread->cv_flag, buf, CV_DRIVER, NULL); 378 379 ethread->hba = hba; 380 ethread->flags |= EMLXS_THREAD_INITD; 381 --- 251 unchanged lines hidden --- |