예제 #1
0
파일: AppleARMIO.cpp 프로젝트: CptFrazz/xnu
void ARMIO::publishBelow( IORegistryEntry * root )
{
    OSCollectionIterator *	kids;
    IORegistryEntry *		next;
    IOService *			nub;
    
    // infanticide
    kids = IODTFindMatchingEntries( root, kIODTRecursive, deleteList() );
    if( kids) {
        while( (next = (IORegistryEntry *)kids->getNextObject())) {
            next->detachAll( gIODTPlane);
        }
        kids->release();
    }
    
    // publish everything below, minus excludeList
    kids = IODTFindMatchingEntries( root, kIODTRecursive | kIODTExclusive,
                                   excludeList());
    if( kids) {
        while( (next = (IORegistryEntry *)kids->getNextObject())) {
            
            if( 0 == (nub = createNub( next )))
                continue;
            
            nub->attach( this );
            
            processNub(nub);
            
            nub->registerService();
        }
        kids->release();
    }
}
예제 #2
0
void IODTPlatformExpert::processTopLevel( IORegistryEntry * root )
{
    OSIterator * 	kids;
    IORegistryEntry *	next;
    IORegistryEntry *	cpus;
    IORegistryEntry *	options;

    // infanticide
    kids = IODTFindMatchingEntries( root, 0, deleteList() );
    if( kids) {
	while( (next = (IORegistryEntry *)kids->getNextObject())) {
	    next->detachAll( gIODTPlane);
	}
	kids->release();
    }

    // Publish an IODTNVRAM class on /options.
    options = root->childFromPath("options", gIODTPlane);
    if (options) {
      dtNVRAM = new IODTNVRAM;
      if (dtNVRAM) {
        if (!dtNVRAM->init(options, gIODTPlane)) {
	  dtNVRAM->release();
	  dtNVRAM = 0;
        } else {
	  dtNVRAM->attach(this);
	  dtNVRAM->registerService();
	}
      }
    }

    // Publish the cpus.
    cpus = root->childFromPath( "cpus", gIODTPlane);
    if ( cpus)
      createNubs( this, IODTFindMatchingEntries( cpus, kIODTExclusive, 0));

    // publish top level, minus excludeList
    createNubs( this, IODTFindMatchingEntries( root, kIODTExclusive, excludeList()));
}
예제 #3
0
// -----------------------------------------------------------------------------
// CCapInfo::CapabilityDocumentL(CBufFlat* aBuf)
// Creates capability xml document end places it in aBuf
// -----------------------------------------------------------------------------
//
void CCapInfo::CapabilityDocumentL(CBufFlat* aBuf)
    {
    TRACE_FUNC_ENTRY;
    TInt err( KErrNone );
    
    // set buffer where capability document is written
    SetCapabilityBuf( aBuf );
    
    WriteL( KXmlVersion );
    WriteL( KComment1 );
    WriteL( KDocType );
    WriteL( KRootBegin );
    
    
    //
    // general
    //
    TRAP( err, GeneralInfoL() );
    if ( err != KErrNone )
        {
        LOGGER_WRITE_1( "GeneralInfoL failed : %d", err );
        User::Leave( err ); 
        }
    
    
    //
    // services
    //
    // Search service files first from C-drive, and then from Z
    // Do not add same files twice.
    
    RArray<TFileName> excludeList( KDefaultArrayGranularity );
    CleanupClosePushL( excludeList );
    RArray<TFileName> filesAdded( KDefaultArrayGranularity );
    CleanupClosePushL( filesAdded );
    
    //read service files from C Import folder
    TRAP( err, ServiceInfoL( KCapabilityDirCImport, excludeList, filesAdded ) );     
    LOGGER_WRITE_1( "ServiceInfoL(KCapabilityDirCImport) returned : %d", err );
    for ( TInt i=0; i<filesAdded.Count(); i++ )
        {
        excludeList.Append( filesAdded[i] );
        }
    filesAdded.Reset();
    
    // read service files from C Capability folder
    TRAP( err, ServiceInfoL( KCapabilityDirC, excludeList, filesAdded ) ); 
    LOGGER_WRITE_1( "ServiceInfoL(KCapabilityDirC) returned : %d", err );
    for ( TInt i=0; i<filesAdded.Count(); i++ )
        {
        excludeList.Append( filesAdded[i] );
        }
    filesAdded.Reset();
    
    // read service files from Z Capability folder
    TRAP( err, ServiceInfoL( KCapabilityDirZ, excludeList, filesAdded ) );
    LOGGER_WRITE_1( "ServiceInfoL(KCapabilityDirZ) returned : %d", err );
    
    CleanupStack::PopAndDestroy( &filesAdded );
    CleanupStack::PopAndDestroy( &excludeList );
    
        
    // this service does not come from file
    TRAP( err, FolderServiceL() );
    LOGGER_WRITE_1( "FolderServiceL() returned : %d", err );
    
    TRAP( err, SyncSolutionsServiceL() );
    LOGGER_WRITE_1( "SyncSolutionsServiceL() returned: %d", err );

    WriteL( KRootEnd );
    TRACE_FUNC_EXIT;
    }