2 * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
29 #include <IOKit/IORegistryEntry.h>
30 #include <libkern/c++/OSContainers.h>
31 #include <IOKit/IOService.h>
32 #include <IOKit/IOKitKeys.h>
33 #include <IOKit/IOTimeStamp.h>
35 #include <IOKit/IOLib.h>
36 #include <stdatomic.h>
37 #include <IOKit/assert.h>
39 #include "IOKitKernelInternal.h"
41 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
43 #define super OSObject
45 OSDefineMetaClassAndStructors(IORegistryEntry
, OSObject
)
47 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
49 #define kIORegPlaneParentSuffix "ParentLinks"
50 #define kIORegPlaneChildSuffix "ChildLinks"
51 #define kIORegPlaneNameSuffix "Name"
52 #define kIORegPlaneLocationSuffix "Location"
54 #define kIORegPlaneParentSuffixLen (sizeof(kIORegPlaneParentSuffix) - 1)
55 #define kIORegPlaneChildSuffixLen (sizeof(kIORegPlaneChildSuffix) - 1)
56 #define kIORegPlaneNameSuffixLen (sizeof(kIORegPlaneNameSuffix) - 1)
57 #define kIORegPlaneLocationSuffixLen (sizeof(kIORegPlaneLocationSuffix) - 1)
59 #define KASLR_IOREG_DEBUG 0
61 struct IORegistryEntry::ExpansionData
63 IORecursiveLock
* fLock
;
64 uint64_t fRegistryEntryID
;
65 SInt32 fRegistryEntryGenerationCount
;
66 OSObject
**_Atomic fIndexedProperties
;
70 static IORegistryEntry
* gRegistryRoot
;
71 static OSDictionary
* gIORegistryPlanes
;
73 const OSSymbol
* gIONameKey
;
74 const OSSymbol
* gIOLocationKey
;
75 const OSSymbol
* gIORegistryEntryIDKey
;
76 const OSSymbol
* gIORegistryEntryPropertyKeysKey
;
87 enum { kIORegistryIDReserved
= (1ULL << 32) + 255 };
89 static uint64_t gIORegistryLastID
= kIORegistryIDReserved
;
91 class IORegistryPlane
: public OSObject
{
93 friend class IORegistryEntry
;
95 OSDeclareAbstractStructors(IORegistryPlane
)
97 const OSSymbol
* nameKey
;
98 const OSSymbol
* keys
[ kNumSetIndex
];
99 const OSSymbol
* pathNameKey
;
100 const OSSymbol
* pathLocationKey
;
104 virtual bool serialize(OSSerialize
*s
) const APPLE_KEXT_OVERRIDE
;
107 OSDefineMetaClassAndStructors(IORegistryPlane
, OSObject
)
110 static IORecursiveLock
* gPropertiesLock
;
111 static SInt32 gIORegistryGenerationCount
;
113 #define UNLOCK lck_rw_done( &gIORegistryLock )
114 #define RLOCK lck_rw_lock_shared( &gIORegistryLock )
115 #define WLOCK lck_rw_lock_exclusive( &gIORegistryLock ); \
116 gIORegistryGenerationCount++
119 #define PUNLOCK IORecursiveLockUnlock( reserved->fLock )
120 #define PLOCK IORecursiveLockLock( reserved->fLock )
122 #define IOREGSPLITTABLES
124 #ifdef IOREGSPLITTABLES
125 #define registryTable() fRegistryTable
127 #define registryTable() fPropertyTable
132 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
134 lck_rw_t gIORegistryLock
;
135 lck_grp_t
*gIORegistryLockGrp
;
136 lck_grp_attr_t
*gIORegistryLockGrpAttr
;
137 lck_attr_t
*gIORegistryLockAttr
;
140 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
142 IORegistryEntry
* IORegistryEntry::initialize( void )
146 if( !gRegistryRoot
) {
149 gIORegistryLockGrpAttr
= lck_grp_attr_alloc_init();
150 //lck_grp_attr_setstat(gIORegistryLockGrpAttr);
151 gIORegistryLockGrp
= lck_grp_alloc_init("IORegistryLock", gIORegistryLockGrpAttr
);
152 gIORegistryLockAttr
= lck_attr_alloc_init();
153 lck_attr_rw_shared_priority(gIORegistryLockAttr
);
154 //lck_attr_setdebug(gIORegistryLockAttr);
155 lck_rw_init( &gIORegistryLock
, gIORegistryLockGrp
, gIORegistryLockAttr
);
157 gRegistryRoot
= new IORegistryEntry
;
158 gPropertiesLock
= IORecursiveLockAlloc();
159 gIORegistryPlanes
= OSDictionary::withCapacity( 1 );
161 assert( gRegistryRoot
&& gPropertiesLock
162 && gIORegistryPlanes
);
163 ok
= gRegistryRoot
->init();
166 gRegistryRoot
->reserved
->fRegistryEntryID
= ++gIORegistryLastID
;
168 gIONameKey
= OSSymbol::withCStringNoCopy( "IOName" );
169 gIOLocationKey
= OSSymbol::withCStringNoCopy( "IOLocation" );
170 gIORegistryEntryIDKey
= OSSymbol::withCStringNoCopy( kIORegistryEntryIDKey
);
171 gIORegistryEntryPropertyKeysKey
= OSSymbol::withCStringNoCopy( kIORegistryEntryPropertyKeysKey
);
173 assert( ok
&& gIONameKey
&& gIOLocationKey
);
175 gRegistryRoot
->setName( "Root" );
176 gRegistryRoot
->setProperty( kIORegistryPlanesKey
, gIORegistryPlanes
);
179 return( gRegistryRoot
);
182 IORegistryEntry
* IORegistryEntry::getRegistryRoot( void )
184 return( gRegistryRoot
);
187 SInt32
IORegistryEntry::getGenerationCount( void )
189 return( gIORegistryGenerationCount
);
192 SInt32
IORegistryEntry::getRegistryEntryGenerationCount(void) const
194 return (reserved
->fRegistryEntryGenerationCount
);
197 const IORegistryPlane
* IORegistryEntry::makePlane( const char * name
)
199 IORegistryPlane
* plane
;
200 const OSSymbol
* nameKey
;
201 const OSSymbol
* parentKey
;
202 const OSSymbol
* childKey
;
203 const OSSymbol
* pathNameKey
;
204 const OSSymbol
* pathLocationKey
;
205 char key
[ kIOMaxPlaneName
+ 16 ];
208 strlcpy( key
, name
, kIOMaxPlaneName
+ 1 );
209 end
= key
+ strlen( key
);
211 nameKey
= OSSymbol::withCString( key
);
213 strlcpy( end
, kIORegPlaneParentSuffix
, kIORegPlaneParentSuffixLen
+ 1 );
214 parentKey
= OSSymbol::withCString( key
);
216 strlcpy( end
, kIORegPlaneChildSuffix
, kIORegPlaneChildSuffixLen
+ 1 );
217 childKey
= OSSymbol::withCString( key
);
219 strlcpy( end
, kIORegPlaneNameSuffix
, kIORegPlaneNameSuffixLen
+ 1 );
220 pathNameKey
= OSSymbol::withCString( key
);
222 strlcpy( end
, kIORegPlaneLocationSuffix
, kIORegPlaneLocationSuffixLen
+ 1 );
223 pathLocationKey
= OSSymbol::withCString( key
);
225 plane
= new IORegistryPlane
;
227 if( plane
&& plane
->init()
228 && nameKey
&& parentKey
&& childKey
229 && pathNameKey
&& pathLocationKey
) {
231 plane
->nameKey
= nameKey
;
232 plane
->keys
[ kParentSetIndex
] = parentKey
;
233 plane
->keys
[ kChildSetIndex
] = childKey
;
234 plane
->pathNameKey
= pathNameKey
;
235 plane
->pathLocationKey
= pathLocationKey
;
238 gIORegistryPlanes
->setObject( nameKey
, plane
);
246 pathLocationKey
->release();
248 pathNameKey
->release();
250 parentKey
->release();
261 const IORegistryPlane
* IORegistryEntry::getPlane( const char * name
)
263 const IORegistryPlane
* plane
;
266 plane
= (const IORegistryPlane
*) gIORegistryPlanes
->getObject( name
);
272 bool IORegistryPlane::serialize(OSSerialize
*s
) const
274 return( nameKey
->serialize(s
) );
277 enum { kIORegCapacityIncrement
= 4 };
279 bool IORegistryEntry::init( OSDictionary
* dict
)
288 reserved
= IONew(ExpansionData
, 1);
291 bzero(reserved
, sizeof(ExpansionData
));
292 reserved
->fLock
= IORecursiveLockAlloc();
293 if (!reserved
->fLock
) return (false);
296 if (OSCollection::kImmutable
& dict
->setOptions(0, 0)) {
297 dict
= (OSDictionary
*) dict
->copyCollection();
303 fPropertyTable
->release();
304 fPropertyTable
= dict
;
306 } else if( !fPropertyTable
) {
307 fPropertyTable
= OSDictionary::withCapacity( kIORegCapacityIncrement
);
309 fPropertyTable
->setCapacityIncrement( kIORegCapacityIncrement
);
315 #ifdef IOREGSPLITTABLES
316 if( !fRegistryTable
) {
317 fRegistryTable
= OSDictionary::withCapacity( kIORegCapacityIncrement
);
319 fRegistryTable
->setCapacityIncrement( kIORegCapacityIncrement
);
322 if( (prop
= OSDynamicCast( OSString
, getProperty( gIONameKey
)))) {
323 OSSymbol
* sym
= (OSSymbol
*)OSSymbol::withString( prop
);
324 // ok for OSSymbol too
329 #endif /* IOREGSPLITTABLES */
334 bool IORegistryEntry::init( IORegistryEntry
* old
,
335 const IORegistryPlane
* plane
)
338 IORegistryEntry
* next
;
346 reserved
= IONew(ExpansionData
, 1);
347 if (!reserved
) return (false);
348 bzero(reserved
, sizeof(ExpansionData
));
349 reserved
->fLock
= IORecursiveLockAlloc();
350 if (!reserved
->fLock
) return (false);
355 reserved
->fRegistryEntryID
= old
->reserved
->fRegistryEntryID
;
357 fPropertyTable
= old
->dictionaryWithProperties();
358 #ifdef IOREGSPLITTABLES
359 fRegistryTable
= old
->fRegistryTable
;
360 old
->fRegistryTable
= (OSDictionary
*) fRegistryTable
->copyCollection();
361 #endif /* IOREGSPLITTABLES */
363 old
->registryTable()->removeObject( plane
->keys
[ kParentSetIndex
] );
364 old
->registryTable()->removeObject( plane
->keys
[ kChildSetIndex
] );
366 all
= getParentSetReference( plane
);
367 if( all
) for( index
= 0;
368 (next
= (IORegistryEntry
*) all
->getObject(index
));
370 next
->makeLink( this, kChildSetIndex
, plane
);
371 next
->breakLink( old
, kChildSetIndex
, plane
);
374 all
= getChildSetReference( plane
);
375 if( all
) for( index
= 0;
376 (next
= (IORegistryEntry
*) all
->getObject(index
));
378 next
->makeLink( this, kParentSetIndex
, plane
);
379 next
->breakLink( old
, kParentSetIndex
, plane
);
387 void IORegistryEntry::free( void )
390 if( registryTable() && gIOServicePlane
) {
391 if( getParentSetReference( gIOServicePlane
)
392 || getChildSetReference( gIOServicePlane
)) {
393 panic("%s: attached at free()", getName());
398 if( getPropertyTable())
399 getPropertyTable()->release();
401 #ifdef IOREGSPLITTABLES
403 registryTable()->release();
404 #endif /* IOREGSPLITTABLES */
408 if (reserved
->fIndexedProperties
)
410 for (int idx
= 0; idx
< kIORegistryEntryIndexedPropertyCount
; idx
++)
412 if (reserved
->fIndexedProperties
[idx
]) reserved
->fIndexedProperties
[idx
]->release();
414 IODelete(reserved
->fIndexedProperties
, OSObject
*, kIORegistryEntryIndexedPropertyCount
);
416 if (reserved
->fLock
) IORecursiveLockFree(reserved
->fLock
);
417 IODelete(reserved
, ExpansionData
, 1);
423 void IORegistryEntry::setPropertyTable( OSDictionary
* dict
)
428 fPropertyTable
->release();
430 fPropertyTable
= dict
;
433 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
435 /* Wrappers to synchronize property table */
437 #define wrap2(type, constant) \
439 IORegistryEntry::copyProperty( type * aKey) constant \
444 obj = getProperty( aKey ); \
452 #define wrap4(type,constant) \
454 IORegistryEntry::getProperty( type * aKey, \
455 const IORegistryPlane * plane, \
456 IOOptionBits options ) constant \
458 OSObject * obj = getProperty( aKey ); \
460 if ( (0 == obj) && plane && (options & kIORegistryIterateRecursively) ) { \
461 IORegistryEntry * entry = (IORegistryEntry *) this; \
462 IORegistryIterator * iter; \
463 iter = IORegistryIterator::iterateOver( entry, plane, options ); \
466 while ( (0 == obj) && (entry = iter->getNextObject()) ) { \
467 obj = entry->getProperty( aKey ); \
476 #define wrap5(type,constant) \
478 IORegistryEntry::copyProperty( type * aKey, \
479 const IORegistryPlane * plane, \
480 IOOptionBits options ) constant \
482 OSObject * obj = copyProperty( aKey ); \
484 if ( (0 == obj) && plane && (options & kIORegistryIterateRecursively) ) { \
485 IORegistryEntry * entry = (IORegistryEntry *) this; \
486 IORegistryIterator * iter; \
487 iter = IORegistryIterator::iterateOver( entry, plane, options ); \
490 while ( (0 == obj) && (entry = iter->getNextObject()) ) { \
491 obj = entry->copyProperty( aKey ); \
500 bool IORegistryEntry::serializeProperties( OSSerialize
* s
) const
502 // setProperty( getRetainCount(), 32, "__retain" );
505 OSCollection
*snapshotProperties
= getPropertyTable()->copyCollection();
508 if (!snapshotProperties
) return (false);
510 bool ok
= snapshotProperties
->serialize( s
);
511 snapshotProperties
->release();
515 OSArray
* IORegistryEntry::copyPropertyKeys(void) const
518 OSArray
* keys
= getPropertyTable()->copyKeys();
524 OSDictionary
* IORegistryEntry::dictionaryWithProperties( void ) const
529 dict
= OSDictionary::withDictionary( getPropertyTable(),
530 getPropertyTable()->getCapacity() );
536 IOReturn
IORegistryEntry::setProperties( OSObject
* properties
)
538 return( kIOReturnUnsupported
);
541 wrap2(const OSSymbol
, const) // copyProperty() definition
542 wrap2(const OSString
, const) // copyProperty() definition
543 wrap2(const char, const) // copyProperty() definition
545 wrap4(const OSSymbol
, const) // getProperty() w/plane definition
546 wrap4(const OSString
, const) // getProperty() w/plane definition
547 wrap4(const char, const) // getProperty() w/plane definition
549 wrap5(const OSSymbol
, const) // copyProperty() w/plane definition
550 wrap5(const OSString
, const) // copyProperty() w/plane definition
551 wrap5(const char, const) // copyProperty() w/plane definition
555 IORegistryEntry::getProperty( const OSSymbol
* aKey
) const
560 obj
= getPropertyTable()->getObject( aKey
);
567 IORegistryEntry::removeProperty( const OSSymbol
* aKey
)
570 getPropertyTable()->removeObject( aKey
);
574 #if KASLR_IOREG_DEBUG
577 bool ScanForAddrInObject(OSObject
* theObject
,
584 IORegistryEntry::setProperty( const OSSymbol
* aKey
, OSObject
* anObject
)
588 // If we are inserting a collection class and the current entry
589 // is attached into the registry (inPlane()) then mark the collection
591 OSCollection
*coll
= OSDynamicCast(OSCollection
, anObject
);
592 bool makeImmutable
= (coll
&& inPlane());
596 coll
->setOptions( OSCollection::kMASK
, OSCollection::kImmutable
);
598 ret
= getPropertyTable()->setObject( aKey
, anObject
);
601 #if KASLR_IOREG_DEBUG
602 if ( anObject
&& strcmp(kIOKitDiagnosticsKey
, aKey
->getCStringNoCopy()) != 0 ) {
603 if (ScanForAddrInObject(anObject
, 0)) {
604 IOLog("%s: IORegistryEntry name %s with key \"%s\" \n",
607 aKey
->getCStringNoCopy() );
615 IOReturn
IORegistryEntry::
616 runPropertyAction(Action inAction
, OSObject
*target
,
617 void *arg0
, void *arg1
, void *arg2
, void *arg3
)
621 // closeGate is recursive so don't worry if we already hold the lock.
623 res
= (*inAction
)(target
, arg0
, arg1
, arg2
, arg3
);
630 IORegistryEntry::getProperty( const OSString
* aKey
) const
632 const OSSymbol
* tmpKey
= OSSymbol::withString( aKey
);
633 OSObject
* obj
= getProperty( tmpKey
);
640 IORegistryEntry::getProperty( const char * aKey
) const
642 const OSSymbol
* tmpKey
= OSSymbol::withCString( aKey
);
643 OSObject
* obj
= getProperty( tmpKey
);
651 IORegistryEntry::removeProperty( const OSString
* aKey
)
653 const OSSymbol
* tmpKey
= OSSymbol::withString( aKey
);
654 removeProperty( tmpKey
);
659 IORegistryEntry::removeProperty( const char * aKey
)
661 const OSSymbol
* tmpKey
= OSSymbol::withCString( aKey
);
662 removeProperty( tmpKey
);
667 IORegistryEntry::setProperty( const OSString
* aKey
, OSObject
* anObject
)
669 const OSSymbol
* tmpKey
= OSSymbol::withString( aKey
);
670 bool ret
= setProperty( tmpKey
, anObject
);
677 IORegistryEntry::setProperty( const char * aKey
, OSObject
* anObject
)
679 const OSSymbol
* tmpKey
= OSSymbol::withCString( aKey
);
680 bool ret
= setProperty( tmpKey
, anObject
);
687 IORegistryEntry::setProperty(const char * aKey
, const char * aString
)
690 OSSymbol
* aSymbol
= (OSSymbol
*) OSSymbol::withCString( aString
);
693 const OSSymbol
* tmpKey
= OSSymbol::withCString( aKey
);
694 ret
= setProperty( tmpKey
, aSymbol
);
703 IORegistryEntry::setProperty(const char * aKey
, bool aBoolean
)
706 OSBoolean
* aBooleanObj
= OSBoolean::withBoolean( aBoolean
);
709 const OSSymbol
* tmpKey
= OSSymbol::withCString( aKey
);
710 ret
= setProperty( tmpKey
, aBooleanObj
);
713 aBooleanObj
->release();
719 IORegistryEntry::setProperty( const char * aKey
,
720 unsigned long long aValue
,
721 unsigned int aNumberOfBits
)
724 OSNumber
* anOffset
= OSNumber::withNumber( aValue
, aNumberOfBits
);
727 const OSSymbol
* tmpKey
= OSSymbol::withCString( aKey
);
728 ret
= setProperty( tmpKey
, anOffset
);
737 IORegistryEntry::setProperty( const char * aKey
,
742 OSData
* data
= OSData::withBytes( bytes
, length
);
745 const OSSymbol
* tmpKey
= OSSymbol::withCString( aKey
);
746 ret
= setProperty( tmpKey
, data
);
754 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
756 OSObject
* IORegistryEntry::setIndexedProperty(uint32_t index
, OSObject
* anObject
)
761 if (index
>= kIORegistryEntryIndexedPropertyCount
) return (0);
763 array
= atomic_load_explicit(&reserved
->fIndexedProperties
, memory_order_acquire
);
766 array
= IONew(OSObject
*, kIORegistryEntryIndexedPropertyCount
);
767 if (!array
) return (0);
768 bzero(array
, kIORegistryEntryIndexedPropertyCount
* sizeof(array
[0]));
769 if (!OSCompareAndSwapPtr(NULL
, array
, &reserved
->fIndexedProperties
)) IODelete(array
, OSObject
*, kIORegistryEntryIndexedPropertyCount
);
771 if (!reserved
->fIndexedProperties
) return (0);
773 prior
= reserved
->fIndexedProperties
[index
];
774 if (anObject
) anObject
->retain();
775 reserved
->fIndexedProperties
[index
] = anObject
;
780 OSObject
* IORegistryEntry::getIndexedProperty(uint32_t index
) const
782 if (index
>= kIORegistryEntryIndexedPropertyCount
) return (0);
783 if (!reserved
->fIndexedProperties
) return (0);
785 return (reserved
->fIndexedProperties
[index
]);
788 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
790 /* Name, location, paths */
792 const char * IORegistryEntry::getName( const IORegistryPlane
* plane
) const
798 sym
= (OSSymbol
*) registryTable()->getObject( plane
->pathNameKey
);
800 sym
= (OSSymbol
*) registryTable()->getObject( gIONameKey
);
804 return( sym
->getCStringNoCopy());
806 return( (getMetaClass())->getClassName());
809 const OSSymbol
* IORegistryEntry::copyName(
810 const IORegistryPlane
* plane
) const
816 sym
= (OSSymbol
*) registryTable()->getObject( plane
->pathNameKey
);
818 sym
= (OSSymbol
*) registryTable()->getObject( gIONameKey
);
826 return( OSSymbol::withCString((getMetaClass())->getClassName()) );
829 const OSSymbol
* IORegistryEntry::copyLocation(
830 const IORegistryPlane
* plane
) const
836 sym
= (OSSymbol
*) registryTable()->getObject( plane
->pathLocationKey
);
838 sym
= (OSSymbol
*) registryTable()->getObject( gIOLocationKey
);
846 const char * IORegistryEntry::getLocation( const IORegistryPlane
* plane
) const
848 const OSSymbol
* sym
= copyLocation( plane
);
849 const char * result
= 0;
852 result
= sym
->getCStringNoCopy();
859 void IORegistryEntry::setName( const OSSymbol
* name
,
860 const IORegistryPlane
* plane
)
862 const OSSymbol
* key
;
866 key
= plane
->pathNameKey
;
870 if (gIOKitTrace
&& reserved
&& reserved
->fRegistryEntryID
)
873 uint64_t __unused regID
= getRegistryEntryID();
874 kernel_debug_string(IODBG_IOREGISTRY(IOREGISTRYENTRY_NAME_STRING
), &str_id
, name
->getCStringNoCopy());
875 KERNEL_DEBUG_CONSTANT(IODBG_IOREGISTRY(IOREGISTRYENTRY_NAME
),
877 (uintptr_t) (regID
>> 32),
879 (uintptr_t) (str_id
>> 32),
884 registryTable()->setObject( key
, (OSObject
*) name
);
889 void IORegistryEntry::setName( const char * name
,
890 const IORegistryPlane
* plane
)
892 OSSymbol
* sym
= (OSSymbol
*)OSSymbol::withCString( name
);
894 setName( sym
, plane
);
899 void IORegistryEntry::setLocation( const OSSymbol
* location
,
900 const IORegistryPlane
* plane
)
902 const OSSymbol
* key
;
906 key
= plane
->pathLocationKey
;
908 key
= gIOLocationKey
;
911 registryTable()->setObject( key
, (OSObject
*) location
);
916 void IORegistryEntry::setLocation( const char * location
,
917 const IORegistryPlane
* plane
)
919 OSSymbol
* sym
= (OSSymbol
*)OSSymbol::withCString( location
);
921 setLocation( sym
, plane
);
927 IORegistryEntry::compareName( OSString
* name
, OSString
** matched
) const
929 const OSSymbol
* sym
= copyName();
932 isEqual
= (sym
&& sym
->isEqualTo(name
));
934 if( isEqual
&& matched
) {
946 IORegistryEntry::compareNames( OSObject
* names
, OSString
** matched
) const
949 OSCollection
* collection
;
950 OSIterator
* iter
= 0;
953 if( (collection
= OSDynamicCast( OSCollection
, names
))) {
954 iter
= OSCollectionIterator::withCollection( collection
);
957 string
= OSDynamicCast( OSString
, names
);
961 result
= compareName( string
, matched
);
963 } while( (false == result
)
964 && iter
&& (string
= OSDynamicCast( OSString
, iter
->getNextObject())));
973 bool IORegistryEntry::getPath( char * path
, int * length
,
974 const IORegistryPlane
* plane
) const
977 IORegistryEntry
* root
;
978 const IORegistryEntry
* entry
;
979 const IORegistryEntry
* parent
;
980 const OSSymbol
* alias
;
982 int len
, maxLength
, compLen
, aliasLen
;
986 if( !path
|| !length
|| !plane
)
990 maxLength
= *length
- 2;
993 len
= plane
->nameKey
->getLength();
994 if( len
>= maxLength
)
996 strlcpy( nextComp
, plane
->nameKey
->getCStringNoCopy(), len
+ 1);
997 nextComp
[ len
++ ] = ':';
1000 if( (alias
= hasAlias( plane
))) {
1001 aliasLen
= alias
->getLength();
1003 ok
= (maxLength
> len
);
1006 strlcpy( nextComp
, alias
->getCStringNoCopy(), aliasLen
+ 1);
1010 stack
= OSArray::withCapacity( getDepth( plane
));
1011 if (!stack
) return( false);
1015 parent
= entry
= this;
1016 root
= gRegistryRoot
->getChildEntry( plane
);
1017 while (parent
&& (parent
!= root
))
1021 parent
= entry
->getParentEntry( plane
);
1022 stack
->setObject( (OSObject
*) entry
);
1028 index
= stack
->getCount();
1035 } else while( ok
&& ((--index
) >= 0)) {
1037 entry
= (IORegistryEntry
*) stack
->getObject((unsigned int) index
);
1040 if( (alias
= entry
->hasAlias( plane
))) {
1041 len
= plane
->nameKey
->getLength() + 1;
1042 nextComp
= path
+ len
;
1044 compLen
= alias
->getLength();
1045 ok
= (maxLength
> (len
+ compLen
));
1047 strlcpy( nextComp
, alias
->getCStringNoCopy(), compLen
+ 1);
1049 compLen
= maxLength
- len
;
1050 ok
= entry
->getPathComponent( nextComp
+ 1, &compLen
, plane
);
1052 if( ok
&& compLen
) {
1060 nextComp
+= compLen
;
1071 bool IORegistryEntry::getPathComponent( char * path
, int * length
,
1072 const IORegistryPlane
* plane
) const
1074 int len
, locLen
, maxLength
;
1075 const char * compName
;
1079 maxLength
= *length
;
1081 compName
= getName( plane
);
1082 len
= strlen( compName
);
1083 if( (loc
= getLocation( plane
)))
1084 locLen
= 1 + strlen( loc
);
1088 ok
= ((len
+ locLen
+ 1) < maxLength
);
1090 strlcpy( path
, compName
, len
+ 1 );
1095 strlcpy( path
, loc
, locLen
);
1103 const char * IORegistryEntry::matchPathLocation( const char * cmp
,
1104 const IORegistryPlane
* plane
)
1107 const char * result
= 0;
1108 u_quad_t num1
, num2
;
1109 char lastPathChar
, lastLocationChar
;
1111 str
= getLocation( plane
);
1113 lastPathChar
= cmp
[0];
1114 lastLocationChar
= str
[0];
1117 num1
= strtouq( cmp
, (char **) &cmp
, 16 );
1118 lastPathChar
= *cmp
++;
1122 if( lastLocationChar
) {
1123 num2
= strtouq( str
, (char **) &str
, 16 );
1124 lastLocationChar
= *str
++;
1131 if (!lastPathChar
&& !lastLocationChar
) {
1136 if( (',' != lastPathChar
) && (':' != lastPathChar
))
1139 if (lastPathChar
&& lastLocationChar
&& (lastPathChar
!= lastLocationChar
))
1148 IORegistryEntry
* IORegistryEntry::getChildFromComponent( const char ** opath
,
1149 const IORegistryPlane
* plane
)
1151 IORegistryEntry
* entry
= 0;
1155 const char * cmp
= 0;
1160 set
= getChildSetReference( plane
);
1166 (entry
= (IORegistryEntry
*) set
->getObject(index
));
1172 str
= entry
->getName( plane
);
1173 len
= strlen( str
);
1174 if( strncmp( str
, cmp
, len
))
1179 if( (c
== 0) || (c
== '/') || (c
== ':'))
1185 if( (cmp
= entry
->matchPathLocation( cmp
, plane
)))
1195 const OSSymbol
* IORegistryEntry::hasAlias( const IORegistryPlane
* plane
,
1196 char * opath
, int * length
) const
1198 IORegistryEntry
* entry
;
1199 IORegistryEntry
* entry2
;
1200 const OSSymbol
* key
;
1201 const OSSymbol
* bestKey
= 0;
1204 const char * path
= "/aliases";
1206 entry
= IORegistryEntry::fromPath( path
, plane
);
1209 if( (iter
= OSCollectionIterator::withCollection(
1210 entry
->getPropertyTable() ))) {
1212 while( (key
= (OSSymbol
*) iter
->getNextObject())) {
1214 data
= (OSData
*) entry
->getProperty( key
);
1215 path
= (const char *) data
->getBytesNoCopy();
1216 if( (entry2
= IORegistryEntry::fromPath( path
, plane
,
1218 if( this == entry2
) {
1220 || (bestKey
->getLength() > key
->getLength()))
1221 // pick the smallest alias
1235 const char * IORegistryEntry::dealiasPath(
1236 const char ** opath
,
1237 const IORegistryPlane
* plane
)
1239 IORegistryEntry
* entry
;
1241 const char * path
= *opath
;
1242 const char * rpath
= 0;
1245 char temp
[ kIOMaxPlaneName
+ 1 ];
1252 while( (c
= *end
++) && (c
!= '/') && (c
!= ':'))
1255 if( (end
- path
) < kIOMaxPlaneName
) {
1256 strlcpy( temp
, path
, end
- path
+ 1 );
1259 entry
= IORegistryEntry::fromPath( "/aliases", plane
);
1261 data
= (OSData
*) entry
->getProperty( temp
);
1263 rpath
= (const char *) data
->getBytesNoCopy();
1275 IORegistryEntry
* IORegistryEntry::fromPath(
1277 const IORegistryPlane
* plane
,
1280 IORegistryEntry
* fromEntry
)
1282 IORegistryEntry
* where
= 0;
1283 IORegistryEntry
* aliasEntry
= 0;
1284 IORegistryEntry
* next
;
1290 char temp
[ kIOMaxPlaneName
+ 1 ];
1297 end
= strchr( path
, ':' );
1298 if( end
&& ((end
- path
) < kIOMaxPlaneName
)) {
1299 strlcpy( temp
, path
, end
- path
+ 1 );
1300 plane
= getPlane( temp
);
1309 if( (alias
= dealiasPath( &end
, plane
))) {
1312 aliasEntry
= IORegistryEntry::fromPath( alias
, plane
,
1313 opath
, &len
, fromEntry
);
1325 if( (0 == fromEntry
) && (*path
++ == '/'))
1326 fromEntry
= gRegistryRoot
->getChildEntry( plane
);
1333 if( c
&& (c
!= ':')) // check valid terminator
1338 next
= where
->getChildFromComponent( &path
, plane
);
1344 // check residual path
1345 if( where
!= fromEntry
)
1348 if( opath
&& length
) {
1349 // copy out residual path
1350 len2
= strlen( path
);
1351 if( (len
+ len2
) < *length
)
1352 strlcpy( opath
+ len
, path
, len2
+ 1 );
1353 *length
= (len
+ len2
);
1356 // no residual path => must be no tail for success
1363 aliasEntry
->release();
1370 IORegistryEntry
* IORegistryEntry::childFromPath(
1372 const IORegistryPlane
* plane
,
1376 return( IORegistryEntry::fromPath( path
, plane
, opath
, len
, this ));
1379 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1381 #define IOLinkIterator OSCollectionIterator
1384 #define super OSObject
1386 inline bool IORegistryEntry::arrayMember( OSArray
* set
,
1387 const IORegistryEntry
* member
,
1388 unsigned int * index
) const
1391 OSObject
* probeObject
;
1393 for( i
= 0; (probeObject
= set
->getObject(i
)); i
++) {
1394 if (probeObject
== (OSObject
*) member
) {
1403 bool IORegistryEntry::makeLink( IORegistryEntry
* to
,
1404 unsigned int relation
,
1405 const IORegistryPlane
* plane
) const
1408 bool result
= false;
1410 if( (links
= (OSArray
*)
1411 registryTable()->getObject( plane
->keys
[ relation
] ))) {
1413 result
= arrayMember( links
, to
);
1415 result
= links
->setObject( to
);
1419 links
= OSArray::withObjects( (const OSObject
**) &to
, 1, 1 );
1420 result
= (links
!= 0);
1422 result
= registryTable()->setObject( plane
->keys
[ relation
],
1427 reserved
->fRegistryEntryGenerationCount
++;
1432 void IORegistryEntry::breakLink( IORegistryEntry
* to
,
1433 unsigned int relation
,
1434 const IORegistryPlane
* plane
) const
1439 if( (links
= (OSArray
*)
1440 registryTable()->getObject( plane
->keys
[ relation
]))) {
1442 if( arrayMember( links
, to
, &index
)) {
1443 links
->removeObject( index
);
1444 if( 0 == links
->getCount())
1445 registryTable()->removeObject( plane
->keys
[ relation
]);
1448 reserved
->fRegistryEntryGenerationCount
++;
1452 OSArray
* IORegistryEntry::getParentSetReference(
1453 const IORegistryPlane
* plane
) const
1456 return( (OSArray
*) registryTable()->getObject(
1457 plane
->keys
[ kParentSetIndex
]));
1462 OSIterator
* IORegistryEntry::getParentIterator(
1463 const IORegistryPlane
* plane
) const
1472 links
= getParentSetReference( plane
);
1474 links
= OSArray::withCapacity( 1 );
1476 links
= OSArray::withArray( links
, links
->getCount() );
1479 iter
= IOLinkIterator::withCollection( links
);
1487 IORegistryEntry
* IORegistryEntry::copyParentEntry( const IORegistryPlane
* plane
) const
1489 IORegistryEntry
* entry
= 0;
1494 if( (links
= getParentSetReference( plane
))) {
1495 entry
= (IORegistryEntry
*) links
->getObject( 0 );
1504 IORegistryEntry
* IORegistryEntry::getParentEntry( const IORegistryPlane
* plane
) const
1506 IORegistryEntry
* entry
;
1508 entry
= copyParentEntry( plane
);
1515 OSArray
* IORegistryEntry::getChildSetReference( const IORegistryPlane
* plane
) const
1518 return( (OSArray
*) registryTable()->getObject(
1519 plane
->keys
[ kChildSetIndex
]));
1524 OSIterator
* IORegistryEntry::getChildIterator( const IORegistryPlane
* plane
) const
1533 links
= getChildSetReference( plane
);
1535 links
= OSArray::withCapacity( 1 );
1537 links
= OSArray::withArray( links
, links
->getCount() );
1540 iter
= IOLinkIterator::withCollection( links
);
1548 uint32_t IORegistryEntry::getChildCount( const IORegistryPlane
* plane
) const
1554 links
= getChildSetReference( plane
);
1555 if (links
) count
= links
->getCount();
1561 IORegistryEntry
* IORegistryEntry::copyChildEntry(
1562 const IORegistryPlane
* plane
) const
1564 IORegistryEntry
* entry
= 0;
1569 if( (links
= getChildSetReference( plane
))) {
1570 entry
= (IORegistryEntry
*) links
->getObject( 0 );
1579 IORegistryEntry
* IORegistryEntry::getChildEntry(
1580 const IORegistryPlane
* plane
) const
1582 IORegistryEntry
* entry
;
1584 entry
= copyChildEntry( plane
);
1591 void IORegistryEntry::applyToChildren( IORegistryEntryApplierFunction applier
,
1593 const IORegistryPlane
* plane
) const
1597 IORegistryEntry
* next
;
1603 array
= OSArray::withArray( getChildSetReference( plane
));
1607 (next
= (IORegistryEntry
*) array
->getObject( index
));
1609 (*applier
)(next
, context
);
1614 void IORegistryEntry::applyToParents( IORegistryEntryApplierFunction applier
,
1616 const IORegistryPlane
* plane
) const
1620 IORegistryEntry
* next
;
1626 array
= OSArray::withArray( getParentSetReference( plane
));
1630 (next
= (IORegistryEntry
*) array
->getObject( index
));
1632 (*applier
)(next
, context
);
1637 bool IORegistryEntry::isChild( IORegistryEntry
* child
,
1638 const IORegistryPlane
* plane
,
1639 bool onlyChild
) const
1646 if( (links
= getChildSetReference( plane
))) {
1647 if( (!onlyChild
) || (1 == links
->getCount()))
1648 ret
= arrayMember( links
, child
);
1650 if( ret
&& (links
= child
->getParentSetReference( plane
)))
1651 ret
= arrayMember( links
, this );
1658 bool IORegistryEntry::isParent( IORegistryEntry
* parent
,
1659 const IORegistryPlane
* plane
,
1660 bool onlyParent
) const
1668 if( (links
= getParentSetReference( plane
))) {
1669 if( (!onlyParent
) || (1 == links
->getCount()))
1670 ret
= arrayMember( links
, parent
);
1672 if( ret
&& (links
= parent
->getChildSetReference( plane
)))
1673 ret
= arrayMember( links
, this );
1680 bool IORegistryEntry::inPlane( const IORegistryPlane
* plane
) const
1687 ret
= (0 != getParentSetReference( plane
));
1690 // Check to see if this is in any plane. If it is in a plane
1691 // then the registryTable will contain a key with the ParentLinks
1692 // suffix. When we iterate over the keys looking for that suffix
1695 OSCollectionIterator
*iter
=
1696 OSCollectionIterator::withCollection( registryTable());
1698 const OSSymbol
*key
;
1700 while( (key
= (OSSymbol
*) iter
->getNextObject()) ) {
1703 // Get a pointer to this keys suffix
1704 keysuffix
= key
->getLength();
1705 if (keysuffix
<= kIORegPlaneParentSuffixLen
)
1707 keysuffix
-= kIORegPlaneParentSuffixLen
;
1708 if( !strncmp(key
->getCStringNoCopy() + keysuffix
,
1709 kIORegPlaneParentSuffix
,
1710 kIORegPlaneParentSuffixLen
+ 1) ) {
1724 bool IORegistryEntry::attachToParent( IORegistryEntry
* parent
,
1725 const IORegistryPlane
* plane
)
1730 bool traceName
= false;
1737 if (!reserved
->fRegistryEntryID
)
1739 reserved
->fRegistryEntryID
= ++gIORegistryLastID
;
1740 traceName
= (0 != gIOKitTrace
);
1743 ret
= makeLink( parent
, kParentSetIndex
, plane
);
1745 if( (links
= parent
->getChildSetReference( plane
)))
1746 needParent
= (false == arrayMember( links
, this ));
1754 uint64_t str_id
= 0;
1755 uint64_t __unused regID
= getRegistryEntryID();
1756 kernel_debug_string(IODBG_IOREGISTRY(IOREGISTRYENTRY_NAME_STRING
), &str_id
, getName());
1757 KERNEL_DEBUG_CONSTANT(IODBG_IOREGISTRY(IOREGISTRYENTRY_NAME
),
1759 (uintptr_t) (regID
>> 32),
1761 (uintptr_t) (str_id
>> 32),
1767 // Mark any collections in the property list as immutable
1768 OSDictionary
*ptable
= getPropertyTable();
1769 OSCollectionIterator
*iter
=
1770 OSCollectionIterator::withCollection( ptable
);
1772 const OSSymbol
*key
;
1774 while( (key
= (OSSymbol
*) iter
->getNextObject( ))) {
1775 // Is object for key a collection?
1776 OSCollection
*coll
=
1777 OSDynamicCast( OSCollection
, ptable
->getObject( key
));
1780 // Yup so mark it as immutable
1781 coll
->setOptions( OSCollection::kMASK
,
1782 OSCollection::kImmutable
);
1791 ret
&= parent
->attachToChild( this, plane
);
1796 uint64_t IORegistryEntry::getRegistryEntryID( void )
1799 return (reserved
->fRegistryEntryID
);
1804 bool IORegistryEntry::attachToChild( IORegistryEntry
* child
,
1805 const IORegistryPlane
* plane
)
1816 ret
= makeLink( child
, kChildSetIndex
, plane
);
1818 if( (links
= child
->getParentSetReference( plane
)))
1819 needChild
= (false == arrayMember( links
, this ));
1826 ret
&= child
->attachToParent( this, plane
);
1831 void IORegistryEntry::detachFromParent( IORegistryEntry
* parent
,
1832 const IORegistryPlane
* plane
)
1841 breakLink( parent
, kParentSetIndex
, plane
);
1843 if( (links
= parent
->getChildSetReference( plane
)))
1844 needParent
= arrayMember( links
, this );
1848 // parent->breakLink( this, kChildSetIndex, plane );
1853 parent
->detachFromChild( this, plane
);
1858 void IORegistryEntry::detachFromChild( IORegistryEntry
* child
,
1859 const IORegistryPlane
* plane
)
1868 breakLink( child
, kChildSetIndex
, plane
);
1870 if( (links
= child
->getParentSetReference( plane
)))
1871 needChild
= arrayMember( links
, this );
1878 child
->detachFromParent( this, plane
);
1883 void IORegistryEntry::detachAbove( const IORegistryPlane
* plane
)
1885 IORegistryEntry
* parent
;
1888 while( (parent
= copyParentEntry( plane
)))
1890 detachFromParent( parent
, plane
);
1896 void IORegistryEntry::detachAll( const IORegistryPlane
* plane
)
1899 IORegistryEntry
* next
;
1900 IORegistryIterator
* regIter
;
1902 regIter
= IORegistryIterator::iterateOver( this, plane
, true );
1905 all
= regIter
->iterateAll();
1908 detachAbove( plane
);
1910 while( (next
= (IORegistryEntry
*) all
->getLastObject())) {
1913 all
->removeObject(next
);
1915 next
->detachAbove( plane
);
1922 unsigned int IORegistryEntry::getDepth( const IORegistryPlane
* plane
) const
1924 unsigned int depth
= 1;
1926 unsigned int oneDepth
, maxParentDepth
, count
;
1927 IORegistryEntry
* one
;
1928 const IORegistryEntry
* next
;
1934 while( (parents
= next
->getParentSetReference( plane
))) {
1936 count
= parents
->getCount();
1941 next
= (IORegistryEntry
*) parents
->getObject( 0 );
1946 (one
= (IORegistryEntry
*) parents
->getObject( index
));
1948 oneDepth
= one
->getDepth( plane
);
1949 if( oneDepth
> maxParentDepth
)
1950 maxParentDepth
= oneDepth
;
1952 depth
+= maxParentDepth
;
1962 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1965 #define super OSIterator
1967 OSDefineMetaClassAndStructors(IORegistryIterator
, OSIterator
)
1969 enum { kIORegistryIteratorInvalidFlag
= 0x80000000 };
1971 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1973 IORegistryIterator
*
1974 IORegistryIterator::iterateOver( IORegistryEntry
* root
,
1975 const IORegistryPlane
* plane
,
1976 IOOptionBits options
)
1978 IORegistryIterator
* create
;
1985 create
= new IORegistryIterator
;
1987 if( create
->init()) {
1990 create
->root
= root
;
1991 create
->where
= &create
->start
;
1992 create
->start
.current
= root
;
1993 create
->plane
= plane
;
1994 create
->options
= options
& ~kIORegistryIteratorInvalidFlag
;
2004 IORegistryIterator
*
2005 IORegistryIterator::iterateOver( const IORegistryPlane
* plane
,
2006 IOOptionBits options
)
2008 return( iterateOver( gRegistryRoot
, plane
, options
));
2011 bool IORegistryIterator::isValid( void )
2020 ok
= (0 == (kIORegistryIteratorInvalidFlag
& options
));
2022 while( ok
&& next
) {
2024 ok
= where
->iter
->isValid();
2032 void IORegistryIterator::enterEntry( const IORegistryPlane
* enterPlane
)
2037 where
= (IORegCursor
*) IOMalloc( sizeof(IORegCursor
));
2043 where
->current
= prev
->current
;
2048 void IORegistryIterator::enterEntry( void )
2050 enterEntry( plane
);
2053 bool IORegistryIterator::exitEntry( void )
2058 where
->iter
->release();
2060 if( where
->current
)// && (where != &start))
2061 where
->current
->release();
2064 if( where
!= &start
) {
2067 IOFree( gone
, sizeof(IORegCursor
));
2074 void IORegistryIterator::reset( void )
2084 where
->current
= root
;
2085 options
&= ~kIORegistryIteratorInvalidFlag
;
2088 void IORegistryIterator::free( void )
2099 IORegistryEntry
* IORegistryIterator::getNextObjectFlat( void )
2101 IORegistryEntry
* next
= 0;
2102 OSArray
* links
= 0;
2106 if( (0 == where
->iter
)) {
2107 // just entered - create new iter
2110 && (links
= ( (options
& kIORegistryIterateParents
) ?
2111 where
->current
->getParentSetReference( plane
) :
2112 where
->current
->getChildSetReference( plane
) )) )
2114 where
->iter
= OSCollectionIterator::withCollection( links
);
2117 // next sibling - release current
2119 where
->current
->release();
2123 next
= (IORegistryEntry
*) where
->iter
->getNextObject();
2127 else if( !where
->iter
->isValid())
2128 options
|= kIORegistryIteratorInvalidFlag
;
2131 where
->current
= next
;
2138 IORegistryEntry
* IORegistryIterator::getNextObjectRecursive( void )
2140 IORegistryEntry
* next
;
2143 next
= getNextObjectFlat();
2144 while( (0 == next
) && exitEntry());
2148 done
= OSOrderedSet::withCapacity( 10 );
2149 if( done
->setObject((OSObject
*) next
)) {
2150 // done set didn't contain this one, so recurse
2157 IORegistryEntry
* IORegistryIterator::getNextObject( void )
2159 if( options
& kIORegistryIterateRecursively
)
2160 return( getNextObjectRecursive());
2162 return( getNextObjectFlat());
2165 IORegistryEntry
* IORegistryIterator::getCurrentEntry( void )
2168 return( where
->current
);
2173 OSOrderedSet
* IORegistryIterator::iterateAll( void )
2176 while( getNextObjectRecursive())
2184 OSMetaClassDefineReservedUnused(IORegistryEntry
, 0);
2185 OSMetaClassDefineReservedUnused(IORegistryEntry
, 1);
2186 OSMetaClassDefineReservedUnused(IORegistryEntry
, 2);
2187 OSMetaClassDefineReservedUnused(IORegistryEntry
, 3);
2188 OSMetaClassDefineReservedUnused(IORegistryEntry
, 4);
2189 OSMetaClassDefineReservedUnused(IORegistryEntry
, 5);
2191 OSMetaClassDefineReservedUsed(IORegistryEntry
, 0);
2192 OSMetaClassDefineReservedUsed(IORegistryEntry
, 1);
2193 OSMetaClassDefineReservedUsed(IORegistryEntry
, 2);
2194 OSMetaClassDefineReservedUsed(IORegistryEntry
, 3);
2195 OSMetaClassDefineReservedUsed(IORegistryEntry
, 4);
2196 OSMetaClassDefineReservedUsed(IORegistryEntry
, 5);
2198 OSMetaClassDefineReservedUnused(IORegistryEntry
, 6);
2199 OSMetaClassDefineReservedUnused(IORegistryEntry
, 7);
2200 OSMetaClassDefineReservedUnused(IORegistryEntry
, 8);
2201 OSMetaClassDefineReservedUnused(IORegistryEntry
, 9);
2202 OSMetaClassDefineReservedUnused(IORegistryEntry
, 10);
2203 OSMetaClassDefineReservedUnused(IORegistryEntry
, 11);
2204 OSMetaClassDefineReservedUnused(IORegistryEntry
, 12);
2205 OSMetaClassDefineReservedUnused(IORegistryEntry
, 13);
2206 OSMetaClassDefineReservedUnused(IORegistryEntry
, 14);
2207 OSMetaClassDefineReservedUnused(IORegistryEntry
, 15);
2208 OSMetaClassDefineReservedUnused(IORegistryEntry
, 16);
2209 OSMetaClassDefineReservedUnused(IORegistryEntry
, 17);
2210 OSMetaClassDefineReservedUnused(IORegistryEntry
, 18);
2211 OSMetaClassDefineReservedUnused(IORegistryEntry
, 19);
2212 OSMetaClassDefineReservedUnused(IORegistryEntry
, 20);
2213 OSMetaClassDefineReservedUnused(IORegistryEntry
, 21);
2214 OSMetaClassDefineReservedUnused(IORegistryEntry
, 22);
2215 OSMetaClassDefineReservedUnused(IORegistryEntry
, 23);
2216 OSMetaClassDefineReservedUnused(IORegistryEntry
, 24);
2217 OSMetaClassDefineReservedUnused(IORegistryEntry
, 25);
2218 OSMetaClassDefineReservedUnused(IORegistryEntry
, 26);
2219 OSMetaClassDefineReservedUnused(IORegistryEntry
, 27);
2220 OSMetaClassDefineReservedUnused(IORegistryEntry
, 28);
2221 OSMetaClassDefineReservedUnused(IORegistryEntry
, 29);
2222 OSMetaClassDefineReservedUnused(IORegistryEntry
, 30);
2223 OSMetaClassDefineReservedUnused(IORegistryEntry
, 31);
2225 /* inline function implementation */
2226 OSDictionary
* IORegistryEntry::getPropertyTable( void ) const
2227 { return(fPropertyTable
); }