Lines Matching refs:shared

32 	shared = atomic_load_explicit(&gIOPerfControlClientShared, memory_order_acquire);  in init()
33 if (shared == nullptr) { in init()
34 IOPerfControlClient::IOPerfControlClientShared *expected = shared; in init()
35 shared = kalloc_type(IOPerfControlClientShared, Z_WAITOK); in init()
36 if (!shared) { in init()
40 atomic_init(&shared->maxDriverIndex, 0); in init()
42 shared->interface = PerfControllerInterface{ in init()
70 shared->interfaceLock = IOLockAlloc(); in init()
71 if (!shared->interfaceLock) { in init()
75 shared->deviceRegistrationList = OSSet::withCapacity(4); in init()
76 if (!shared->deviceRegistrationList) { in init()
80 …if (!atomic_compare_exchange_strong_explicit(&gIOPerfControlClientShared, &expected, shared, memor… in init()
82 IOLockFree(shared->interfaceLock); in init()
83 shared->deviceRegistrationList->release(); in init()
84 kfree_type(IOPerfControlClientShared, shared); in init()
85 shared = expected; in init()
92 driverIndex = atomic_fetch_add_explicit(&shared->maxDriverIndex, 1, memory_order_relaxed) + 1; in init()
125 if (shared) { in init()
126 if (shared->interfaceLock) { in init()
127 IOLockFree(shared->interfaceLock); in init()
129 if (shared->deviceRegistrationList) { in init()
130 shared->deviceRegistrationList->release(); in init()
132 kfree_type(IOPerfControlClientShared, shared); in init()
133 shared = nullptr; in init()
332 IOLockLock(shared->interfaceLock); in registerDevice()
351 if (shared->interface.version >= PERFCONTROL_INTERFACE_VERSION_3) { in registerDevice()
352 ret = shared->interface.registerDriverDevice(driver, device, &clientData.driverState); in registerDevice()
353 } else if (shared->interface.version >= PERFCONTROL_INTERFACE_VERSION_1) { in registerDevice()
354 ret = shared->interface.registerDevice(device); in registerDevice()
356 shared->deviceRegistrationList->setObject(this); in registerDevice()
359 IOLockUnlock(shared->interfaceLock); in registerDevice()
368 IOLockLock(shared->interfaceLock); in unregisterDevice()
370 if (shared->interface.version >= PERFCONTROL_INTERFACE_VERSION_3) { in unregisterDevice()
371 shared->interface.unregisterDriverDevice(driver, device, &clientData.driverState); in unregisterDevice()
372 } else if (shared->interface.version >= PERFCONTROL_INTERFACE_VERSION_1) { in unregisterDevice()
373 shared->interface.unregisterDevice(device); in unregisterDevice()
375 shared->deviceRegistrationList->removeObject(this); in unregisterDevice()
389 IOLockUnlock(shared->interfaceLock); in unregisterDevice()
410 if (!shared->interface.workCanSubmit(device, &state, args)) { in workSubmit()
418 shared->interface.workSubmit(device, tokenToGlobalUniqueToken(token), &state, args); in workSubmit()
443 if (!shared->interface.workCanSubmit(device, &state, submitArgs)) { in workSubmitAndBegin()
452 shared->interface.workSubmit(device, tokenToGlobalUniqueToken(token), &state, submitArgs); in workSubmitAndBegin()
454 shared->interface.workBegin(device, tokenToGlobalUniqueToken(token), &state, beginArgs); in workSubmitAndBegin()
482 shared->interface.workBegin(device, tokenToGlobalUniqueToken(token), &state, args); in workBegin()
505 if (shared->interface.version >= PERFCONTROL_INTERFACE_VERSION_4) { in workEnd()
507shared->interface.workEndWithResources(device, tokenToGlobalUniqueToken(token), &state, args, &res… in workEnd()
512 shared->interface.workEnd(device, tokenToGlobalUniqueToken(token), &state, args, done); in workEnd()
608 shared->interface.workBegin(device, work_context->id, &state, beginArgs); in workSubmitAndBeginWithContext()
642 if (!shared->interface.workCanSubmit(device, &state, args)) { in workSubmitWithContext()
657 shared->interface.workSubmit(device, work_context->id, &state, args); in workSubmitWithContext()
687 shared->interface.workUpdate(device, work_context->id, &state, args); in workUpdateWithContext()
716 shared->interface.workBegin(device, work_context->id, &state, args); in workBeginWithContext()
745 if (shared->interface.version >= PERFCONTROL_INTERFACE_VERSION_4) { in workEndWithContext()
747 shared->interface.workEndWithResources(device, work_context->id, &state, args, &resources, done); in workEndWithContext()
752 shared->interface.workEnd(device, work_context->id, &state, args, done); in workEndWithContext()
776 IOLockLock(shared->interfaceLock); in registerPerformanceController()
778 if (shared->interface.version == PERFCONTROL_INTERFACE_VERSION_NONE) { in registerPerformanceController()
779 shared->interface.version = pci->version; in registerPerformanceController()
783 shared->interface.registerDevice = pci->registerDevice; in registerPerformanceController()
784 shared->interface.unregisterDevice = pci->unregisterDevice; in registerPerformanceController()
785 shared->interface.workCanSubmit = pci->workCanSubmit; in registerPerformanceController()
786 shared->interface.workSubmit = pci->workSubmit; in registerPerformanceController()
787 shared->interface.workBegin = pci->workBegin; in registerPerformanceController()
788 shared->interface.workEnd = pci->workEnd; in registerPerformanceController()
793 shared->interface.workUpdate = pci->workUpdate; in registerPerformanceController()
799 shared->interface.registerDriverDevice = pci->registerDriverDevice; in registerPerformanceController()
800 shared->interface.unregisterDriverDevice = pci->unregisterDriverDevice; in registerPerformanceController()
805 shared->interface.workEndWithResources = pci->workEndWithResources; in registerPerformanceController()
811 while ((obj = shared->deviceRegistrationList->getAnyObject())) { in registerPerformanceController()
821 shared->deviceRegistrationList->removeObject(obj); in registerPerformanceController()
825 IOLockUnlock(shared->interfaceLock); in registerPerformanceController()