Esempio n. 1
0
void AttansicL2Ethernet::atSwFree()
{
	if (adapter_.stats_lock)
	{
		IOSimpleLockFree(adapter_.stats_lock);
		adapter_.stats_lock = NULL;
	}

	if (adapter_.tx_lock)
	{
		IOSimpleLockFree(adapter_.tx_lock);
		adapter_.tx_lock = NULL;
	}
}
Esempio n. 2
0
// Free is called twice:
// First when the atomic retainCount transitions from 1 -> 0
// Secondly when the work loop itself is commiting hari kari
// Hence the each leg of the free must be single threaded.
void IOWorkLoop::free()
{
    if (workThread) {
	IOInterruptState is;

	// If we are here then we must be trying to shut down this work loop
	// in this case disable all of the event source, mark the loop
	// as terminating and wakeup the work thread itself and return
	// Note: we hold the gate across the entire operation mainly for the 
	// benefit of our event sources so we can disable them cleanly.
	closeGate();

	disableAllEventSources();

        is = IOSimpleLockLockDisableInterrupt(workToDoLock);
	SETP(&fFlags, kLoopTerminate);
        thread_wakeup_one((void *) &workToDo);
        IOSimpleLockUnlockEnableInterrupt(workToDoLock, is);

	openGate();
    }
    else /* !workThread */ {
        IOEventSource *event, *next;

        for (event = eventChain; event; event = next) {
            next = event->getNext();
            event->setWorkLoop(0);
            event->setNext(0);
            event->release();
        }
        eventChain = 0;

	// Either we have a partial initialization to clean up
	// or the workThread itself is performing hari-kari.
	// Either way clean up all of our resources and return.
	
	if (controlG) {
	    controlG->release();
	    controlG = 0;
	}

	if (workToDoLock) {
	    IOSimpleLockFree(workToDoLock);
	    workToDoLock = 0;
	}

	if (gateLock) {
	    IORecursiveLockFree(gateLock);
	    gateLock = 0;
	}
	if (reserved) {
	    IODelete(reserved, ExpansionData, 1);
	    reserved = 0;
	}

	super::free();
    }
}
void AgereET131x::free()
{
	//IOLog("AgereET131x::free()\n");
    IOSimpleLockFree( adapter.Lock );
    IOSimpleLockFree( adapter.TCBSendQLock );
    IOSimpleLockFree( adapter.TCBReadyQLock );
    IOSimpleLockFree( adapter.SendHWLock );
    IOSimpleLockFree( adapter.RcvLock );
    IOSimpleLockFree( adapter.FbrLock );
    IOSimpleLockFree( adapter.PHYLock );
	
	RELEASE(netif);
	RELEASE(interruptSource);
	RELEASE(watchdogSource);
	
	RELEASE(workLoop);
	RELEASE(pciDevice);
	RELEASE(mediumDict);
	
	int i;
	for (i = 0; i < MEDIUM_INDEX_COUNT; i++) {
		RELEASE(mediumTable[i]);
	}
	
	RELEASE(csrPCIAddress);
	
	RELEASE(rxMbufCursor);
	RELEASE(txMbufCursor);
	
	super::free();
}
void com_reidburke_air_IntelEnhancedSpeedStep::free(void) {
	dbg("Freeing driver resources\n");
	/* Deallocate the previously allocated spinlock */
  

  
	IOSimpleLockFree(Lock);
	super::free();
}
void IOFWSyncer::free()
{
    // just in case a thread is blocked here:
    privateSignal();

    if (guardLock != NULL)
       IOSimpleLockFree(guardLock);

    OSObject::free();
}
Esempio n. 6
0
void driver::free(void) {
 chkpoint("begin");

 RELEASE(perfTimer);
 RELEASE(workLoop);

 IOSimpleLockFree(eist_lock);
 
 super::free();
 chkpoint("end");
}	
void CLASS::free(void)
{
	/*
	 * Note: _wdhLock is not freed in original code
	 */
	if (_isochScheduleLock) {
		IOSimpleLockFree(_isochScheduleLock);
		_isochScheduleLock = 0;
	}
	super::free();
}
// Class stop
void
VoodooPState::stop(IOService * provider)
{
	Request = ColdStart ? (PStateCount-1) : 0;	// hot/cold start
	ProcessorDriver();

	Ready = false;
	
	if (TimerEventSource) {
		TimerEventSource->cancelTimeout();
	}

	if (SimpleLock) {
		IOSimpleLockFree(SimpleLock);
	}
	
	IOService::stop(provider);
}
Esempio n. 9
0
void iTCOWatchdog::free(void)
{    
    DbgPrint(drvid, "free\n");
    
    free_common();
    
    if (GCSMem.map) GCSMem.map->release();
    if (GCSMem.range) GCSMem.range->release();
    
    LPCNub->close(this);
    LPCNub->release();
    
    PMstop();
    
    IOSimpleLockFree(lock);

    super::free();
}
Esempio n. 10
0
void AppleGPIO::stop(IOService *provider)
{
	UInt32 flags, i;
	IOPlatformFunction *func;
	AppleGPIOCallbackInfo *thisClient, *nextClient;

	// Execute any functions flagged as "on termination"
	UInt32 count = fPlatformFuncArray->getCount();
	for (i = 0; i < count; i++)
	{
		if (func = OSDynamicCast(IOPlatformFunction, fPlatformFuncArray->getObject(i)))
		{
			flags = func->getCommandFlags();

			if (flags & kIOPFFlagOnTerm) 
				performFunction(func, (void *)1, (void *)0, (void *)0, (void *)0);
		}
	}

	// Unregister for interrupts
	if (fIntGen && amRegistered())
	{
		disableWithParent();
		unregisterWithParent();
		fIntGen = false;
	}
	
	if (fPFLock) { IOLockFree (fPFLock); fPFLock = NULL; }
	
	IOSimpleLockLock(fClientsLock);
	
	if (fClients)
	{
		thisClient = fClients;
		while (thisClient)
		{
			nextClient = thisClient->next;
			IOFree(thisClient, sizeof(AppleGPIOCallbackInfo));
			thisClient = nextClient;
		}

		fClients = 0;
	}
	
	IOSimpleLockUnlock(fClientsLock);

	IOSimpleLockFree(fClientsLock); fClientsLock = 0;
	IOLockFree(fAmRegisteredLock); fAmRegisteredLock = 0;
	IOSimpleLockFree(fAmEnabledLock); fAmEnabledLock = 0;

	fParent = 0;
	fGPIOID = kGPIOIDInvalid;

	if (fSymIntRegister)	{ fSymIntRegister->release(); fSymIntRegister = 0; }
	if (fSymIntUnRegister)	{ fSymIntUnRegister->release(); fSymIntUnRegister = 0; }
	if (fSymIntEnable)		{ fSymIntEnable->release(); fSymIntEnable = 0; }
	if (fSymIntDisable)		{ fSymIntDisable->release(); fSymIntDisable = 0; }

#ifdef OLD_STYLE_COMPAT

	releaseStrings();
	
#endif

	super::stop(provider);
}