本文整理汇总了C++中OSData::isEqualTo方法的典型用法代码示例。如果您正苦于以下问题:C++ OSData::isEqualTo方法的具体用法?C++ OSData::isEqualTo怎么用?C++ OSData::isEqualTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OSData
的用法示例。
在下文中一共展示了OSData::isEqualTo方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
char *net_habitue_device_SC101::getProductString(void)
{
OSData *partNumber = OSDynamicCast(OSData, getProperty(gSC101DevicePartNumberKey));
char *productString = (char *)"Unknown";
if (partNumber)
{
if (partNumber->isEqualTo(kSC101PartNumber, sizeof(kSC101PartNumber)))
productString = (char *)"SC101";
else if (partNumber->isEqualTo(kSC101TPartNumber, sizeof(kSC101TPartNumber)))
productString = (char *)"SC101T";
}
return productString;
}
示例2: OSDynamicCast
IOService*
OHareATA::probe(IOService* provider, SInt32* score)
{
OSData *compatibleEntry;
DLOG("OHareATA starting probe\n");
compatibleEntry = OSDynamicCast( OSData, provider->getProperty( "compatible" ) );
if ( compatibleEntry == 0 )
{
// error unknown controller type.
DLOG("OHareATA failed getting compatible property\n");
return 0;
}
// test the compatible property for a match to the controller type name.
if ( compatibleEntry->isEqualTo( kCompatibleString, sizeof(kCompatibleString)-1 ) == false )
{
// not our type of controller
DLOG("OHareATA compatible property doesn't match\n");
return 0;
}
// ok, it is the type of cell we control
return this;
}
示例3: getBridgeSpace
IOReturn AppleI386AGP::createAGPSpace( IOAGPDevice * master,
IOOptionBits options,
IOPhysicalAddress * address,
IOPhysicalLength * length )
{
IOReturn err;
IOPCIAddressSpace target = getBridgeSpace();
IOPhysicalLength agpLength;
UInt32 agpCtrl;
enum { agpSpacePerPage = 4 * 1024 * 1024 };
enum { agpBytesPerGartByte = 1024 };
enum { alignLen = 4 * 1024 * 1024 - 1 };
destroyAGPSpace( master );
agpCommandMask = 0xffffffff;
agpCommandMask &= ~kIOAGPFastWrite;
// agpCommandMask &= ~kIOAGPSideBandAddresssing;
{
// There's an nVidia NV11 ROM (revision 1017) that says that it can do fast writes,
// but can't, and can often lock the machine up when fast writes are enabled.
#define kNVIDIANV11EntryName "NVDA,NVMac"
#define kNVROMRevPropertyName "rom-revision"
#define kNVBadRevision '1017'
const UInt32 badRev = kNVBadRevision;
OSData * data;
if( (0 == strcmp( kNVIDIANV11EntryName, master->getName()))
&& (data = OSDynamicCast(OSData, master->getProperty(kNVROMRevPropertyName)))
&& (data->isEqualTo( &badRev, sizeof(badRev) )))
agpCommandMask &= ~kIOAGPFastWrite;
}
agpLength = *length;
if( !agpLength)
agpLength = 32 * 1024 * 1024;
agpLength = (agpLength + alignLen) & ~alignLen;
err = kIOReturnVMError;
do {
gartLength = agpLength / agpBytesPerGartByte;
gartArray = (volatile UInt32 *) IOMallocContiguous(
gartLength, 4096, &gartPhys );
if( !gartArray)
continue;
IOSetProcessorCacheMode(kernel_task, (vm_address_t) gartArray, gartLength, kIOInhibitCache);
bzero( (void *) gartArray, gartLength);
// IOUnmapPages( kernel_map, (vm_address_t) gartArray, gartLength );
// is this std?
systemBase = configRead32( target, kiAPBASE ) & 0xfffffff0;
DEBG("APSIZE: %08lx\n", (UInt32)configRead8(target, kiAPSIZE));
systemLength = (((configRead8( target, kiAPSIZE ) & 0x3f) ^ 0x3f) + 1) << 22;
DEBG("sysB %08lx, sysL %08lx\n", systemBase, systemLength);
if( !systemLength)
continue;
if (systemLength > agpLength)
systemLength = agpLength;
DEBG("sysB %08lx, sysL %08lx\n", systemBase, systemLength);
agpRange = IORangeAllocator::withRange( agpLength, 4096 );
if( !agpRange)
continue;
*address = systemBase;
*length = systemLength;
agpCtrl = configRead32(target, kiAGPCTRL);
agpCtrl &= ~(1 << 7);
configWrite32( target, kiAGPCTRL, agpCtrl ); // b7 gtlb ena
// configWrite32( target, kiAGPCTRL, 0 << 7 ); // b7 gtlb ena
// assert( 0 == (gartPhys & 0xfff));
configWrite32( target, kiATTBASE, gartPhys );
agpCtrl = configRead32(target, kiAGPCTRL);
//agpCtrl |= (1 << 7);
configWrite32( target, kiAGPCTRL, agpCtrl ); // b7 gtlb ena
DEBG("kiAGPCTRL %08lx, kiATTBASE %08lx\n",
configRead32( target, kiAGPCTRL ),
configRead32( target, kiATTBASE ));
err = kIOReturnSuccess;
} while( false );
//.........这里部分代码省略.........
示例4: OSDynamicCast
IOService*
AppleKiwiATA::probe(IOService* provider, SInt32* score)
{
OSData *compatibleEntry;
DLOG("AppleKiwiATA starting probe\n");
compatibleEntry = OSDynamicCast( OSData, provider->getProperty( "compatible" ) );
if ( compatibleEntry == 0 )
{
// error unknown controller type.
DLOG("AppleKiwiATA failed getting compatible property\n");
return 0;
}
// test the compatible property for a match to the controller type name.
if ( compatibleEntry->isEqualTo( kCompatibleString, sizeof(kCompatibleString)-1 ) == false )
{
// not our type of controller
DLOG("AppleKiwiATA compatible property doesn't match\n");
return 0;
}
// do a little initialization here once the probe is succesful so we can start clean.
OSData *registryEntry;
registryEntry = OSDynamicCast( OSData, provider->getProperty( kModelPropertyKey ) );
if( registryEntry == 0)
{
DLOG("AppleKiwiATA unknown model property.\n");
return 0;
}
// test for pci inline.
if ( !provider->getProperty( kPCIInlineKey ) )
{
DLOG("AppleKiwiATA pci_inline enable lock\n");
forcePCIInline = true;
} else {
DLOG("AppleKiwiATA pci_inline disable lock\n");
forcePCIInline = false;
}
// test for mode 6.
if ( !provider->getProperty( kMode6Key ) )
{
DLOG("AppleKiwiATA mode 5\n");
mode6Capable = false;
} else {
DLOG("AppleKiwiATA mode 6\n");
mode6Capable = true;
}
return this;
}
示例5: start
bool AppleMediaBay::start(IOService *provider)
{
OSData *compatibleEntry;
// If the super class failed there is little point in
// going on:
if (!super::start(provider))
return false;
// Find out the controller for the mediabay:
mbControllerType = kMBControllerUndefined;
compatibleEntry = OSDynamicCast( OSData, provider->getProperty( "compatible" ) );
if ( compatibleEntry == 0 ) {
#ifdef APPLEMB_VERBOSE
IOLog("No compatible entry found.\n");
#endif //APPLEMB_VERBOSE
return false;
}
if ( compatibleEntry->isEqualTo( "keylargo-media-bay", sizeof("keylargo-media-bay")-1 ) == true ) {
#ifdef APPLEMB_VERBOSE
IOLog("Found KeyLargo compatible property.\n");
#endif // APPLEMB_VERBOSE
mbControllerType = kMBControllerKeyLargo;
myMacIO = waitForService(serviceMatching("KeyLargo"));
}
if ( compatibleEntry->isEqualTo( "heathrow-media-bay", sizeof("heathrow-media-bay")-1 ) == true ) {
#ifdef APPLEMB_VERBOSE
IOLog("Found Heathrow compatible property.\n");
#endif // APPLEMB_VERBOSE
mbControllerType = kMBControllerHeathrow;
// now the parent could be either Hetrow or Gatwick
// so jump back looking for my MacIO:
myMacIO = OSDynamicCast(AppleMacIO, provider->getProvider());
}
if ( compatibleEntry->isEqualTo( "ohare-media-bay", sizeof("ohare-media-bay")-1 ) == true ) {
#ifdef APPLEMB_VERBOSE
IOLog("Found OHare compatible property.\n");
#endif // APPLEMB_VERBOSE
mbControllerType = kMBControllerOHare;
myMacIO = waitForService(serviceMatching("OHare"));
}
if( (configAddrMap = provider->mapDeviceMemoryWithIndex( 0 )))
{
configAddr = (volatile UInt32 *) configAddrMap->getVirtualAddress();
#ifdef APPLEMB_VERBOSE
IOLog("configAddr = 0x%08lx.\n",(unsigned int)configAddr);
#endif // APPLEMB_VERBOSE
}
else {
#ifdef APPLEMB_VERBOSE
IOLog("configAddrMap failed.\n");
#endif // APPLEMB_VERBOSE
return false;
}
if (myMacIO == NULL) {
#ifdef APPLEMB_VERBOSE
IOLog("myMacIO == NULL.\n");
#endif // APPLEMB_VERBOSE
return false;
}
workloop = IOWorkLoop::workLoop(); // make the workloop
if(!workloop) {
#ifdef APPLEMB_VERBOSE
IOLog("Error creating workloop.\n");
#endif // APPLEMB_VERBOSE
return false;
}
intSource = IOInterruptEventSource::interruptEventSource
(this, (IOInterruptEventAction) &handleInterrupt,
provider);
if ((intSource == NULL) || (workloop->addEventSource(intSource) != kIOReturnSuccess)) {
#ifdef APPLEMB_VERBOSE
IOLog("Problem adding interrupt event source...\n");
#endif // APPLEMB_VERBOSE
return false;
}
else
workloop->enableAllInterrupts();
// Creates the command gate for the events that need to be in the queue
commandGate = IOCommandGate::commandGate(this, commandGateCaller);
// and adds it to the workloop:
if ((commandGate == NULL) ||
//.........这里部分代码省略.........