2 * Copyright (c) 1998-2019 Apple 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
{
62 IORecursiveLock
* fLock
;
63 uint64_t fRegistryEntryID
;
64 SInt32 fRegistryEntryGenerationCount
;
65 OSObject
**_Atomic fIndexedProperties
;
69 static IORegistryEntry
* gRegistryRoot
;
70 static OSDictionary
* gIORegistryPlanes
;
72 const OSSymbol
* gIONameKey
;
73 const OSSymbol
* gIOLocationKey
;
74 const OSSymbol
* gIORegistryEntryIDKey
;
75 const OSSymbol
* gIORegistryEntryPropertyKeysKey
;
86 enum { kIORegistryIDReserved
= (1ULL << 32) + 255 };
88 static uint64_t gIORegistryLastID
= kIORegistryIDReserved
;
90 class IORegistryPlane
: public OSObject
{
91 friend class IORegistryEntry
;
93 OSDeclareAbstractStructors(IORegistryPlane
);
95 const OSSymbol
* nameKey
;
96 const OSSymbol
* keys
[kNumSetIndex
];
97 const OSSymbol
* pathNameKey
;
98 const OSSymbol
* pathLocationKey
;
102 virtual bool serialize(OSSerialize
*s
) const APPLE_KEXT_OVERRIDE
;
105 OSDefineMetaClassAndStructors(IORegistryPlane
, OSObject
)
108 static IORecursiveLock
* gPropertiesLock
;
109 static SInt32 gIORegistryGenerationCount
;
111 #define UNLOCK lck_rw_done( &gIORegistryLock )
112 #define RLOCK lck_rw_lock_shared( &gIORegistryLock )
113 #define WLOCK lck_rw_lock_exclusive( &gIORegistryLock ); \
114 gIORegistryGenerationCount++
117 #define PUNLOCK IORecursiveLockUnlock( reserved->fLock )
118 #define PLOCK IORecursiveLockLock( reserved->fLock )
120 #define IOREGSPLITTABLES
122 #ifdef IOREGSPLITTABLES
123 #define registryTable() fRegistryTable
125 #define registryTable() fPropertyTable
130 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
132 lck_rw_t gIORegistryLock
;
133 lck_grp_t
*gIORegistryLockGrp
;
134 lck_grp_attr_t
*gIORegistryLockGrpAttr
;
135 lck_attr_t
*gIORegistryLockAttr
;
138 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
141 IORegistryEntry::initialize( void )
145 if (!gRegistryRoot
) {
146 gIORegistryLockGrpAttr
= lck_grp_attr_alloc_init();
147 gIORegistryLockGrp
= lck_grp_alloc_init("IORegistryLock", gIORegistryLockGrpAttr
);
148 gIORegistryLockAttr
= lck_attr_alloc_init();
149 lck_attr_rw_shared_priority(gIORegistryLockAttr
);
150 lck_rw_init( &gIORegistryLock
, gIORegistryLockGrp
, gIORegistryLockAttr
);
152 gRegistryRoot
= new IORegistryEntry
;
153 gPropertiesLock
= IORecursiveLockAlloc();
154 gIORegistryPlanes
= OSDictionary::withCapacity( 1 );
156 assert( gRegistryRoot
&& gPropertiesLock
157 && gIORegistryPlanes
);
158 ok
= gRegistryRoot
->init();
161 gRegistryRoot
->reserved
->fRegistryEntryID
= ++gIORegistryLastID
;
164 gIONameKey
= OSSymbol::withCStringNoCopy( "IOName" );
165 gIOLocationKey
= OSSymbol::withCStringNoCopy( "IOLocation" );
166 gIORegistryEntryIDKey
= OSSymbol::withCStringNoCopy( kIORegistryEntryIDKey
);
167 gIORegistryEntryPropertyKeysKey
= OSSymbol::withCStringNoCopy( kIORegistryEntryPropertyKeysKey
);
169 assert( ok
&& gIONameKey
&& gIOLocationKey
);
171 gRegistryRoot
->setName( "Root" );
172 gRegistryRoot
->setProperty( kIORegistryPlanesKey
, gIORegistryPlanes
);
175 return gRegistryRoot
;
179 IORegistryEntry::getRegistryRoot( void )
181 return gRegistryRoot
;
185 IORegistryEntry::getGenerationCount( void )
187 return gIORegistryGenerationCount
;
191 IORegistryEntry::getRegistryEntryGenerationCount(void) const
193 return reserved
->fRegistryEntryGenerationCount
;
196 const IORegistryPlane
*
197 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
) {
230 plane
->nameKey
= nameKey
;
231 plane
->keys
[kParentSetIndex
] = parentKey
;
232 plane
->keys
[kChildSetIndex
] = childKey
;
233 plane
->pathNameKey
= pathNameKey
;
234 plane
->pathLocationKey
= pathLocationKey
;
237 gIORegistryPlanes
->setObject( nameKey
, plane
);
243 if (pathLocationKey
) {
244 pathLocationKey
->release();
247 pathNameKey
->release();
250 parentKey
->release();
264 const IORegistryPlane
*
265 IORegistryEntry::getPlane( const char * name
)
267 const IORegistryPlane
* plane
;
270 plane
= (const IORegistryPlane
*) gIORegistryPlanes
->getObject( name
);
277 IORegistryPlane::serialize(OSSerialize
*s
) const
279 return nameKey
->serialize(s
);
282 enum { kIORegCapacityIncrement
= 4 };
285 IORegistryEntry::init( OSDictionary
* dict
)
289 if (!super::init()) {
294 reserved
= IONew(ExpansionData
, 1);
298 bzero(reserved
, sizeof(ExpansionData
));
299 reserved
->fLock
= IORecursiveLockAlloc();
300 if (!reserved
->fLock
) {
305 if (OSCollection::kImmutable
& dict
->setOptions(0, 0)) {
306 dict
= (OSDictionary
*) dict
->copyCollection();
313 if (fPropertyTable
) {
314 fPropertyTable
->release();
316 fPropertyTable
= dict
;
317 } else if (!fPropertyTable
) {
318 fPropertyTable
= OSDictionary::withCapacity( kIORegCapacityIncrement
);
319 if (fPropertyTable
) {
320 fPropertyTable
->setCapacityIncrement( kIORegCapacityIncrement
);
324 if (!fPropertyTable
) {
328 #ifdef IOREGSPLITTABLES
329 if (!fRegistryTable
) {
330 fRegistryTable
= OSDictionary::withCapacity( kIORegCapacityIncrement
);
331 if (fRegistryTable
) {
332 fRegistryTable
->setCapacityIncrement( kIORegCapacityIncrement
);
336 if ((prop
= OSDynamicCast( OSString
, getProperty( gIONameKey
)))) {
337 OSSymbol
* sym
= (OSSymbol
*)OSSymbol::withString( prop
);
338 // ok for OSSymbol too
343 #endif /* IOREGSPLITTABLES */
349 IORegistryEntry::init( IORegistryEntry
* old
,
350 const IORegistryPlane
* plane
)
353 IORegistryEntry
* next
;
356 if (!super::init()) {
361 reserved
= IONew(ExpansionData
, 1);
365 bzero(reserved
, sizeof(ExpansionData
));
366 reserved
->fLock
= IORecursiveLockAlloc();
367 if (!reserved
->fLock
) {
374 reserved
->fRegistryEntryID
= old
->reserved
->fRegistryEntryID
;
376 fPropertyTable
= old
->dictionaryWithProperties();
377 #ifdef IOREGSPLITTABLES
378 fRegistryTable
= old
->fRegistryTable
;
379 old
->fRegistryTable
= (OSDictionary
*) fRegistryTable
->copyCollection();
380 #endif /* IOREGSPLITTABLES */
382 old
->registryTable()->removeObject( plane
->keys
[kParentSetIndex
] );
383 old
->registryTable()->removeObject( plane
->keys
[kChildSetIndex
] );
385 all
= getParentSetReference( plane
);
388 (next
= (IORegistryEntry
*) all
->getObject(index
));
390 next
->makeLink( this, kChildSetIndex
, plane
);
391 next
->breakLink( old
, kChildSetIndex
, plane
);
395 all
= getChildSetReference( plane
);
398 (next
= (IORegistryEntry
*) all
->getObject(index
));
400 next
->makeLink( this, kParentSetIndex
, plane
);
401 next
->breakLink( old
, kParentSetIndex
, plane
);
411 IORegistryEntry::free( void )
414 if (registryTable() && gIOServicePlane
) {
415 if (getParentSetReference( gIOServicePlane
)
416 || getChildSetReference( gIOServicePlane
)) {
417 panic("%s: attached at free()", getName());
422 if (getPropertyTable()) {
423 getPropertyTable()->release();
426 #ifdef IOREGSPLITTABLES
427 if (registryTable()) {
428 registryTable()->release();
430 #endif /* IOREGSPLITTABLES */
433 if (reserved
->fIndexedProperties
) {
434 for (int idx
= 0; idx
< kIORegistryEntryIndexedPropertyCount
; idx
++) {
435 if (reserved
->fIndexedProperties
[idx
]) {
436 reserved
->fIndexedProperties
[idx
]->release();
439 IODelete(reserved
->fIndexedProperties
, OSObject
*, kIORegistryEntryIndexedPropertyCount
);
441 if (reserved
->fLock
) {
442 IORecursiveLockFree(reserved
->fLock
);
444 IODelete(reserved
, ExpansionData
, 1);
451 IORegistryEntry::setPropertyTable( OSDictionary
* dict
)
457 if (fPropertyTable
) {
458 fPropertyTable
->release();
461 fPropertyTable
= dict
;
465 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
467 /* Wrappers to synchronize property table */
469 #define wrap2(type, constant) \
471 IORegistryEntry::copyProperty( type * aKey) constant \
476 obj = getProperty( aKey ); \
484 #define wrap4(type, constant) \
486 IORegistryEntry::getProperty( type * aKey, \
487 const IORegistryPlane * plane, \
488 IOOptionBits options ) constant \
490 OSObject * obj = getProperty( aKey ); \
492 if ( (NULL == obj) && plane && (options & kIORegistryIterateRecursively) ) { \
493 IORegistryEntry * entry = (IORegistryEntry *) this; \
494 IORegistryIterator * iter; \
495 iter = IORegistryIterator::iterateOver( entry, plane, options ); \
498 while ( (NULL == obj) && (entry = iter->getNextObject()) ) { \
499 obj = entry->getProperty( aKey ); \
508 #define wrap5(type, constant) \
510 IORegistryEntry::copyProperty( type * aKey, \
511 const IORegistryPlane * plane, \
512 IOOptionBits options ) constant \
514 OSObject * obj = copyProperty( aKey ); \
516 if ( (NULL == obj) && plane && (options & kIORegistryIterateRecursively) ) { \
517 IORegistryEntry * entry = (IORegistryEntry *) this; \
518 IORegistryIterator * iter; \
519 iter = IORegistryIterator::iterateOver( entry, plane, options ); \
522 while ( (NULL == obj) && (entry = iter->getNextObject()) ) { \
523 obj = entry->copyProperty( aKey ); \
533 IORegistryEntry::serializeProperties( OSSerialize
* s
) const
535 // setProperty( getRetainCount(), 32, "__retain" );
538 OSCollection
*snapshotProperties
= getPropertyTable()->copyCollection();
541 if (!snapshotProperties
) {
545 bool ok
= snapshotProperties
->serialize( s
);
546 snapshotProperties
->release();
551 IORegistryEntry::copyPropertyKeys(void) const
554 OSArray
* keys
= getPropertyTable()->copyKeys();
561 IORegistryEntry::dictionaryWithProperties( void ) const
566 dict
= OSDictionary::withDictionary( getPropertyTable(),
567 getPropertyTable()->getCapacity());
574 IORegistryEntry::setProperties( OSObject
* properties
)
576 return kIOReturnUnsupported
;
579 wrap2(const OSSymbol
, const) // copyProperty() definition
580 wrap2(const OSString
, const) // copyProperty() definition
581 wrap2(const char, const) // copyProperty() definition
583 wrap4(const OSSymbol
, const) // getProperty() w/plane definition
584 wrap4(const OSString
, const) // getProperty() w/plane definition
585 wrap4(const char, const) // getProperty() w/plane definition
587 wrap5(const OSSymbol
, const) // copyProperty() w/plane definition
588 wrap5(const OSString
, const) // copyProperty() w/plane definition
589 wrap5(const char, const) // copyProperty() w/plane definition
593 IORegistryEntry::getProperty( const OSSymbol
* aKey
) const
598 obj
= getPropertyTable()->getObject( aKey
);
605 IORegistryEntry::removeProperty( const OSSymbol
* aKey
)
608 getPropertyTable()->removeObject( aKey
);
612 #if KASLR_IOREG_DEBUG
614 bool ScanForAddrInObject(OSObject
* theObject
,
620 IORegistryEntry::setProperty( const OSSymbol
* aKey
, OSObject
* anObject
)
624 // If we are inserting a collection class and the current entry
625 // is attached into the registry (inPlane()) then mark the collection
627 OSCollection
*coll
= OSDynamicCast(OSCollection
, anObject
);
628 bool makeImmutable
= (coll
&& inPlane());
632 coll
->setOptions( OSCollection::kMASK
, OSCollection::kImmutable
);
635 ret
= getPropertyTable()->setObject( aKey
, anObject
);
638 #if KASLR_IOREG_DEBUG
639 if (anObject
&& strcmp(kIOKitDiagnosticsKey
, aKey
->getCStringNoCopy()) != 0) {
640 if (ScanForAddrInObject(anObject
, 0)) {
641 IOLog("%s: IORegistryEntry name %s with key \"%s\" \n",
644 aKey
->getCStringNoCopy());
654 runPropertyAction(Action inAction
, OSObject
*target
,
655 void *arg0
, void *arg1
, void *arg2
, void *arg3
)
659 // closeGate is recursive so don't worry if we already hold the lock.
661 res
= (*inAction
)(target
, arg0
, arg1
, arg2
, arg3
);
668 IORegistryEntryActionToBlock(OSObject
*target
,
669 void *arg0
, void *arg1
,
670 void *arg2
, void *arg3
)
672 IORegistryEntry::ActionBlock block
= (typeof(block
))arg0
;
677 IORegistryEntry::runPropertyActionBlock(ActionBlock block
)
681 res
= runPropertyAction(&IORegistryEntryActionToBlock
, this, block
);
687 IORegistryEntry::getProperty( const OSString
* aKey
) const
689 const OSSymbol
* tmpKey
= OSSymbol::withString( aKey
);
690 OSObject
* obj
= getProperty( tmpKey
);
697 IORegistryEntry::getProperty( const char * aKey
) const
699 const OSSymbol
* tmpKey
= OSSymbol::withCString( aKey
);
700 OSObject
* obj
= getProperty( tmpKey
);
708 IORegistryEntry::removeProperty( const OSString
* aKey
)
710 const OSSymbol
* tmpKey
= OSSymbol::withString( aKey
);
711 removeProperty( tmpKey
);
716 IORegistryEntry::removeProperty( const char * aKey
)
718 const OSSymbol
* tmpKey
= OSSymbol::withCString( aKey
);
719 removeProperty( tmpKey
);
724 IORegistryEntry::setProperty( const OSString
* aKey
, OSObject
* anObject
)
726 const OSSymbol
* tmpKey
= OSSymbol::withString( aKey
);
727 bool ret
= setProperty( tmpKey
, anObject
);
734 IORegistryEntry::setProperty( const char * aKey
, OSObject
* anObject
)
736 const OSSymbol
* tmpKey
= OSSymbol::withCString( aKey
);
737 bool ret
= setProperty( tmpKey
, anObject
);
744 IORegistryEntry::setProperty(const char * aKey
, const char * aString
)
747 OSSymbol
* aSymbol
= (OSSymbol
*) OSSymbol::withCString( aString
);
750 const OSSymbol
* tmpKey
= OSSymbol::withCString( aKey
);
751 ret
= setProperty( tmpKey
, aSymbol
);
760 IORegistryEntry::setProperty(const char * aKey
, bool aBoolean
)
763 OSBoolean
* aBooleanObj
= OSBoolean::withBoolean( aBoolean
);
766 const OSSymbol
* tmpKey
= OSSymbol::withCString( aKey
);
767 ret
= setProperty( tmpKey
, aBooleanObj
);
770 aBooleanObj
->release();
776 IORegistryEntry::setProperty( const char * aKey
,
777 unsigned long long aValue
,
778 unsigned int aNumberOfBits
)
781 OSNumber
* anOffset
= OSNumber::withNumber( aValue
, aNumberOfBits
);
784 const OSSymbol
* tmpKey
= OSSymbol::withCString( aKey
);
785 ret
= setProperty( tmpKey
, anOffset
);
794 IORegistryEntry::setProperty( const char * aKey
,
799 OSData
* data
= OSData::withBytes( bytes
, length
);
802 const OSSymbol
* tmpKey
= OSSymbol::withCString( aKey
);
803 ret
= setProperty( tmpKey
, data
);
811 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
814 IORegistryEntry::setIndexedProperty(uint32_t index
, OSObject
* anObject
)
819 if (index
>= kIORegistryEntryIndexedPropertyCount
) {
823 array
= atomic_load_explicit(&reserved
->fIndexedProperties
, memory_order_acquire
);
825 array
= IONew(OSObject
*, kIORegistryEntryIndexedPropertyCount
);
829 bzero(array
, kIORegistryEntryIndexedPropertyCount
* sizeof(array
[0]));
830 if (!OSCompareAndSwapPtr(NULL
, array
, &reserved
->fIndexedProperties
)) {
831 IODelete(array
, OSObject
*, kIORegistryEntryIndexedPropertyCount
);
834 if (!reserved
->fIndexedProperties
) {
838 prior
= reserved
->fIndexedProperties
[index
];
842 reserved
->fIndexedProperties
[index
] = anObject
;
848 IORegistryEntry::getIndexedProperty(uint32_t index
) const
850 if (index
>= kIORegistryEntryIndexedPropertyCount
) {
853 if (!reserved
->fIndexedProperties
) {
857 return reserved
->fIndexedProperties
[index
];
860 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
862 /* Name, location, paths */
865 IORegistryEntry::getName( const IORegistryPlane
* plane
) const
867 OSSymbol
* sym
= NULL
;
871 sym
= (OSSymbol
*) registryTable()->getObject( plane
->pathNameKey
);
874 sym
= (OSSymbol
*) registryTable()->getObject( gIONameKey
);
879 return sym
->getCStringNoCopy();
881 return (getMetaClass())->getClassName();
886 IORegistryEntry::copyName(
887 const IORegistryPlane
* plane
) const
889 OSSymbol
* sym
= NULL
;
893 sym
= (OSSymbol
*) registryTable()->getObject( plane
->pathNameKey
);
896 sym
= (OSSymbol
*) registryTable()->getObject( gIONameKey
);
906 return OSSymbol::withCString((getMetaClass())->getClassName());
911 IORegistryEntry::copyLocation(
912 const IORegistryPlane
* plane
) const
914 OSSymbol
* sym
= NULL
;
918 sym
= (OSSymbol
*) registryTable()->getObject( plane
->pathLocationKey
);
921 sym
= (OSSymbol
*) registryTable()->getObject( gIOLocationKey
);
932 IORegistryEntry::getLocation( const IORegistryPlane
* plane
) const
934 const OSSymbol
* sym
= copyLocation( plane
);
935 const char * result
= NULL
;
938 result
= sym
->getCStringNoCopy();
946 IORegistryEntry::setName( const OSSymbol
* name
,
947 const IORegistryPlane
* plane
)
949 const OSSymbol
* key
;
953 key
= plane
->pathNameKey
;
958 if (gIOKitTrace
&& reserved
&& reserved
->fRegistryEntryID
) {
960 uint64_t __unused regID
= getRegistryEntryID();
961 kernel_debug_string(IODBG_IOREGISTRY(IOREGISTRYENTRY_NAME_STRING
), &str_id
, name
->getCStringNoCopy());
962 KERNEL_DEBUG_CONSTANT(IODBG_IOREGISTRY(IOREGISTRYENTRY_NAME
),
964 (uintptr_t) (regID
>> 32),
966 (uintptr_t) (str_id
>> 32),
971 registryTable()->setObject( key
, (OSObject
*) name
);
977 IORegistryEntry::setName( const char * name
,
978 const IORegistryPlane
* plane
)
980 OSSymbol
* sym
= (OSSymbol
*)OSSymbol::withCString( name
);
982 setName( sym
, plane
);
988 IORegistryEntry::setName( const OSString
* name
,
989 const IORegistryPlane
* plane
)
991 const OSSymbol
* sym
= OSSymbol::withString( name
);
993 setName( sym
, plane
);
999 IORegistryEntry::setLocation( const OSSymbol
* location
,
1000 const IORegistryPlane
* plane
)
1002 const OSSymbol
* key
;
1006 key
= plane
->pathLocationKey
;
1008 key
= gIOLocationKey
;
1012 registryTable()->setObject( key
, (OSObject
*) location
);
1018 IORegistryEntry::setLocation( const char * location
,
1019 const IORegistryPlane
* plane
)
1021 OSSymbol
* sym
= (OSSymbol
*)OSSymbol::withCString( location
);
1023 setLocation( sym
, plane
);
1029 IORegistryEntry::compareName( OSString
* name
, OSString
** matched
) const
1031 const OSSymbol
* sym
= copyName();
1034 isEqual
= (sym
&& sym
->isEqualTo(name
));
1036 if (isEqual
&& matched
) {
1049 IORegistryEntry::compareNames( OSObject
* names
, OSString
** matched
) const
1052 OSCollection
* collection
;
1053 OSIterator
* iter
= NULL
;
1054 bool result
= false;
1056 if ((collection
= OSDynamicCast( OSCollection
, names
))) {
1057 iter
= OSCollectionIterator::withCollection( collection
);
1060 string
= OSDynamicCast( OSString
, names
);
1065 result
= compareName( string
, matched
);
1067 } while ((false == result
)
1068 && iter
&& (string
= OSDynamicCast( OSString
, iter
->getNextObject())));
1079 IORegistryEntry::getPath( char * path
, int * length
,
1080 const IORegistryPlane
* plane
) const
1083 IORegistryEntry
* root
;
1084 const IORegistryEntry
* entry
;
1085 const IORegistryEntry
* parent
;
1086 const OSSymbol
* alias
;
1088 int len
, maxLength
, compLen
, aliasLen
;
1092 if (!path
|| !length
|| !plane
) {
1097 maxLength
= *length
- 2;
1100 len
= plane
->nameKey
->getLength();
1101 if (len
>= maxLength
) {
1104 strlcpy( nextComp
, plane
->nameKey
->getCStringNoCopy(), len
+ 1);
1105 nextComp
[len
++] = ':';
1108 if ((alias
= hasAlias( plane
))) {
1109 aliasLen
= alias
->getLength();
1111 ok
= (maxLength
> len
);
1114 strlcpy( nextComp
, alias
->getCStringNoCopy(), aliasLen
+ 1);
1119 stack
= OSArray::withCapacity( getDepth( plane
));
1126 parent
= entry
= this;
1127 root
= gRegistryRoot
->getChildEntry( plane
);
1128 while (parent
&& (parent
!= root
)) {
1131 parent
= entry
->getParentEntry( plane
);
1132 stack
->setObject((OSObject
*) entry
);
1135 ok
= (NULL
!= parent
);
1137 index
= stack
->getCount();
1143 while (ok
&& ((--index
) >= 0)) {
1144 entry
= (IORegistryEntry
*) stack
->getObject((unsigned int) index
);
1147 if ((alias
= entry
->hasAlias( plane
))) {
1148 len
= plane
->nameKey
->getLength() + 1;
1149 nextComp
= path
+ len
;
1151 compLen
= alias
->getLength();
1152 ok
= (maxLength
> (len
+ compLen
));
1154 strlcpy( nextComp
, alias
->getCStringNoCopy(), compLen
+ 1);
1157 compLen
= maxLength
- len
;
1158 ok
= entry
->getPathComponent( nextComp
+ 1, &compLen
, plane
);
1160 if (ok
&& compLen
) {
1168 nextComp
+= compLen
;
1181 IORegistryEntry::getPathComponent( char * path
, int * length
,
1182 const IORegistryPlane
* plane
) const
1184 int len
, locLen
, maxLength
;
1185 const char * compName
;
1189 maxLength
= *length
;
1191 compName
= getName( plane
);
1192 len
= strlen( compName
);
1193 if ((loc
= getLocation( plane
))) {
1194 locLen
= 1 + strlen( loc
);
1199 ok
= ((len
+ locLen
+ 1) < maxLength
);
1201 strlcpy( path
, compName
, len
+ 1 );
1206 strlcpy( path
, loc
, locLen
);
1215 IORegistryEntry::matchPathLocation( const char * cmp
,
1216 const IORegistryPlane
* plane
)
1219 const char * result
= NULL
;
1220 u_quad_t num1
, num2
;
1221 char lastPathChar
, lastLocationChar
;
1223 str
= getLocation( plane
);
1225 lastPathChar
= cmp
[0];
1226 lastLocationChar
= str
[0];
1229 num1
= strtouq( cmp
, (char **) &cmp
, 16 );
1230 lastPathChar
= *cmp
++;
1235 if (lastLocationChar
) {
1236 num2
= strtouq( str
, (char **) &str
, 16 );
1237 lastLocationChar
= *str
++;
1246 if (!lastPathChar
&& !lastLocationChar
) {
1251 if ((',' != lastPathChar
) && (':' != lastPathChar
)) {
1255 if (lastPathChar
&& lastLocationChar
&& (lastPathChar
!= lastLocationChar
)) {
1265 IORegistryEntry::getChildFromComponent( const char ** opath
,
1266 const IORegistryPlane
* plane
)
1268 IORegistryEntry
* entry
= NULL
;
1272 const char * cmp
= NULL
;
1277 set
= getChildSetReference( plane
);
1282 (entry
= (IORegistryEntry
*) set
->getObject(index
));
1287 str
= entry
->getName( plane
);
1288 len
= strlen( str
);
1289 if (strncmp( str
, cmp
, len
)) {
1295 if ((c
== 0) || (c
== '/') || (c
== ':')) {
1303 if ((cmp
= entry
->matchPathLocation( cmp
, plane
))) {
1316 IORegistryEntry::hasAlias( const IORegistryPlane
* plane
,
1317 char * opath
, int * length
) const
1319 IORegistryEntry
* entry
;
1320 IORegistryEntry
* entry2
;
1321 const OSSymbol
* key
;
1322 const OSSymbol
* bestKey
= NULL
;
1325 const char * path
= "/aliases";
1327 entry
= IORegistryEntry::fromPath( path
, plane
);
1330 if ((iter
= OSCollectionIterator::withCollection(
1331 entry
->getPropertyTable()))) {
1332 while ((key
= (OSSymbol
*) iter
->getNextObject())) {
1333 data
= (OSData
*) entry
->getProperty( key
);
1334 path
= (const char *) data
->getBytesNoCopy();
1335 if ((entry2
= IORegistryEntry::fromPath( path
, plane
,
1337 if (this == entry2
) {
1339 || (bestKey
->getLength() > key
->getLength())) {
1340 // pick the smallest alias
1356 IORegistryEntry::dealiasPath(
1357 const char ** opath
,
1358 const IORegistryPlane
* plane
)
1360 IORegistryEntry
* entry
;
1362 const char * path
= *opath
;
1363 const char * rpath
= NULL
;
1366 char temp
[kIOMaxPlaneName
+ 1];
1368 if (path
[0] == '/') {
1374 while ((c
= *end
++) && (c
!= '/') && (c
!= ':')) {
1377 if ((end
- path
) < kIOMaxPlaneName
) {
1378 strlcpy( temp
, path
, end
- path
+ 1 );
1381 entry
= IORegistryEntry::fromPath( "/aliases", plane
);
1383 data
= (OSData
*) entry
->getProperty( temp
);
1385 rpath
= (const char *) data
->getBytesNoCopy();
1399 IORegistryEntry::fromPath(
1401 const IORegistryPlane
* plane
,
1404 IORegistryEntry
* fromEntry
)
1406 IORegistryEntry
* where
= NULL
;
1407 IORegistryEntry
* aliasEntry
= NULL
;
1408 IORegistryEntry
* next
;
1414 char temp
[kIOMaxPlaneName
+ 1];
1420 if (NULL
== plane
) {
1422 end
= strchr( path
, ':' );
1423 if (end
&& ((end
- path
) < kIOMaxPlaneName
)) {
1424 strlcpy( temp
, path
, end
- path
+ 1 );
1425 plane
= getPlane( temp
);
1429 if (NULL
== plane
) {
1435 if ((alias
= dealiasPath( &end
, plane
))) {
1439 aliasEntry
= IORegistryEntry::fromPath( alias
, plane
,
1440 opath
, &len
, fromEntry
);
1452 if (NULL
== where
) {
1453 if ((NULL
== fromEntry
) && (*path
++ == '/')) {
1454 fromEntry
= gRegistryRoot
->getChildEntry( plane
);
1457 if (NULL
== where
) {
1463 if (c
&& (c
!= ':')) { // check valid terminator
1469 next
= where
->getChildFromComponent( &path
, plane
);
1476 // check residual path
1477 if (where
!= fromEntry
) {
1481 if (opath
&& length
) {
1482 // copy out residual path
1483 len2
= strlen( path
);
1484 if ((len
+ len2
) < *length
) {
1485 strlcpy( opath
+ len
, path
, len2
+ 1 );
1487 *length
= (len
+ len2
);
1488 } else if (path
[0]) {
1489 // no residual path => must be no tail for success
1498 aliasEntry
->release();
1507 IORegistryEntry::childFromPath(
1509 const IORegistryPlane
* plane
,
1513 return IORegistryEntry::fromPath( path
, plane
, opath
, len
, this );
1516 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1518 #define IOLinkIterator OSCollectionIterator
1521 #define super OSObject
1524 IORegistryEntry::arrayMember( OSArray
* set
,
1525 const IORegistryEntry
* member
,
1526 unsigned int * index
) const
1529 OSObject
* probeObject
;
1531 for (i
= 0; (probeObject
= set
->getObject(i
)); i
++) {
1532 if (probeObject
== (OSObject
*) member
) {
1543 IORegistryEntry::makeLink( IORegistryEntry
* to
,
1544 unsigned int relation
,
1545 const IORegistryPlane
* plane
) const
1548 bool result
= false;
1550 if ((links
= (OSArray
*)
1551 registryTable()->getObject( plane
->keys
[relation
] ))) {
1552 result
= arrayMember( links
, to
);
1554 result
= links
->setObject( to
);
1557 links
= OSArray::withObjects((const OSObject
**) &to
, 1, 1 );
1558 result
= (links
!= NULL
);
1560 result
= registryTable()->setObject( plane
->keys
[relation
],
1565 reserved
->fRegistryEntryGenerationCount
++;
1571 IORegistryEntry::breakLink( IORegistryEntry
* to
,
1572 unsigned int relation
,
1573 const IORegistryPlane
* plane
) const
1578 if ((links
= (OSArray
*)
1579 registryTable()->getObject( plane
->keys
[relation
]))) {
1580 if (arrayMember( links
, to
, &index
)) {
1581 links
->removeObject( index
);
1582 if (0 == links
->getCount()) {
1583 registryTable()->removeObject( plane
->keys
[relation
]);
1587 reserved
->fRegistryEntryGenerationCount
++;
1592 IORegistryEntry::getParentSetReference(
1593 const IORegistryPlane
* plane
) const
1596 return (OSArray
*) registryTable()->getObject(
1597 plane
->keys
[kParentSetIndex
]);
1604 IORegistryEntry::getParentIterator(
1605 const IORegistryPlane
* plane
) const
1615 links
= getParentSetReference( plane
);
1616 if (NULL
== links
) {
1617 links
= OSArray::withCapacity( 1 );
1619 links
= OSArray::withArray( links
, links
->getCount());
1623 iter
= IOLinkIterator::withCollection( links
);
1633 IORegistryEntry::copyParentEntry( const IORegistryPlane
* plane
) const
1635 IORegistryEntry
* entry
= NULL
;
1640 if ((links
= getParentSetReference( plane
))) {
1641 entry
= (IORegistryEntry
*) links
->getObject( 0 );
1651 IORegistryEntry::getParentEntry( const IORegistryPlane
* plane
) const
1653 IORegistryEntry
* entry
;
1655 entry
= copyParentEntry( plane
);
1664 IORegistryEntry::getChildSetReference( const IORegistryPlane
* plane
) const
1667 return (OSArray
*) registryTable()->getObject(
1668 plane
->keys
[kChildSetIndex
]);
1675 IORegistryEntry::getChildIterator( const IORegistryPlane
* plane
) const
1685 links
= getChildSetReference( plane
);
1686 if (NULL
== links
) {
1687 links
= OSArray::withCapacity( 1 );
1689 links
= OSArray::withArray( links
, links
->getCount());
1693 iter
= IOLinkIterator::withCollection( links
);
1703 IORegistryEntry::getChildCount( const IORegistryPlane
* plane
) const
1709 links
= getChildSetReference( plane
);
1711 count
= links
->getCount();
1719 IORegistryEntry::copyChildEntry(
1720 const IORegistryPlane
* plane
) const
1722 IORegistryEntry
* entry
= NULL
;
1727 if ((links
= getChildSetReference( plane
))) {
1728 entry
= (IORegistryEntry
*) links
->getObject( 0 );
1738 IORegistryEntry::getChildEntry(
1739 const IORegistryPlane
* plane
) const
1741 IORegistryEntry
* entry
;
1743 entry
= copyChildEntry( plane
);
1752 IORegistryEntry::applyToChildren( IORegistryEntryApplierFunction applier
,
1754 const IORegistryPlane
* plane
) const
1758 IORegistryEntry
* next
;
1765 array
= OSArray::withArray( getChildSetReference( plane
));
1769 (next
= (IORegistryEntry
*) array
->getObject( index
));
1771 (*applier
)(next
, context
);
1778 IORegistryEntry::applyToParents( IORegistryEntryApplierFunction applier
,
1780 const IORegistryPlane
* plane
) const
1784 IORegistryEntry
* next
;
1791 array
= OSArray::withArray( getParentSetReference( plane
));
1795 (next
= (IORegistryEntry
*) array
->getObject( index
));
1797 (*applier
)(next
, context
);
1804 IORegistryEntry::isChild( IORegistryEntry
* child
,
1805 const IORegistryPlane
* plane
,
1806 bool onlyChild
) const
1813 if ((links
= getChildSetReference( plane
))) {
1814 if ((!onlyChild
) || (1 == links
->getCount())) {
1815 ret
= arrayMember( links
, child
);
1818 if (ret
&& (links
= child
->getParentSetReference( plane
))) {
1819 ret
= arrayMember( links
, this );
1828 IORegistryEntry::isParent( IORegistryEntry
* parent
,
1829 const IORegistryPlane
* plane
,
1830 bool onlyParent
) const
1837 if ((links
= getParentSetReference( plane
))) {
1838 if ((!onlyParent
) || (1 == links
->getCount())) {
1839 ret
= arrayMember( links
, parent
);
1842 if (ret
&& (links
= parent
->getChildSetReference( plane
))) {
1843 ret
= arrayMember( links
, this );
1852 IORegistryEntry::inPlane( const IORegistryPlane
* plane
) const
1859 ret
= (NULL
!= getParentSetReference( plane
));
1861 // Check to see if this is in any plane. If it is in a plane
1862 // then the registryTable will contain a key with the ParentLinks
1863 // suffix. When we iterate over the keys looking for that suffix
1866 OSCollectionIterator
*iter
=
1867 OSCollectionIterator::withCollection( registryTable());
1869 const OSSymbol
*key
;
1871 while ((key
= (OSSymbol
*) iter
->getNextObject())) {
1874 // Get a pointer to this keys suffix
1875 keysuffix
= key
->getLength();
1876 if (keysuffix
<= kIORegPlaneParentSuffixLen
) {
1879 keysuffix
-= kIORegPlaneParentSuffixLen
;
1880 if (!strncmp(key
->getCStringNoCopy() + keysuffix
,
1881 kIORegPlaneParentSuffix
,
1882 kIORegPlaneParentSuffixLen
+ 1)) {
1897 IORegistryEntry::attachToParent( IORegistryEntry
* parent
,
1898 const IORegistryPlane
* plane
)
1903 bool traceName
= false;
1905 if (this == parent
) {
1911 if (!reserved
->fRegistryEntryID
) {
1912 reserved
->fRegistryEntryID
= ++gIORegistryLastID
;
1913 traceName
= (0 != gIOKitTrace
);
1916 ret
= makeLink( parent
, kParentSetIndex
, plane
);
1918 if ((links
= parent
->getChildSetReference( plane
))) {
1919 needParent
= (false == arrayMember( links
, this ));
1927 uint64_t str_id
= 0;
1928 uint64_t __unused regID
= getRegistryEntryID();
1929 kernel_debug_string(IODBG_IOREGISTRY(IOREGISTRYENTRY_NAME_STRING
), &str_id
, getName());
1930 KERNEL_DEBUG_CONSTANT(IODBG_IOREGISTRY(IOREGISTRYENTRY_NAME
),
1932 (uintptr_t) (regID
>> 32),
1934 (uintptr_t) (str_id
>> 32),
1940 // Mark any collections in the property list as immutable
1941 OSDictionary
*ptable
= getPropertyTable();
1942 OSCollectionIterator
*iter
=
1943 OSCollectionIterator::withCollection( ptable
);
1945 const OSSymbol
*key
;
1947 while ((key
= (OSSymbol
*) iter
->getNextObject())) {
1948 // Is object for key a collection?
1949 OSCollection
*coll
=
1950 OSDynamicCast( OSCollection
, ptable
->getObject( key
));
1953 // Yup so mark it as immutable
1954 coll
->setOptions( OSCollection::kMASK
,
1955 OSCollection::kImmutable
);
1964 ret
&= parent
->attachToChild( this, plane
);
1971 IORegistryEntry::getRegistryEntryID( void )
1974 return reserved
->fRegistryEntryID
;
1981 IORegistryEntry::attachToChild( IORegistryEntry
* child
,
1982 const IORegistryPlane
* plane
)
1988 if (this == child
) {
1994 ret
= makeLink( child
, kChildSetIndex
, plane
);
1996 if ((links
= child
->getParentSetReference( plane
))) {
1997 needChild
= (false == arrayMember( links
, this ));
2005 ret
&= child
->attachToParent( this, plane
);
2012 IORegistryEntry::detachFromParent( IORegistryEntry
* parent
,
2013 const IORegistryPlane
* plane
)
2022 breakLink( parent
, kParentSetIndex
, plane
);
2024 if ((links
= parent
->getChildSetReference( plane
))) {
2025 needParent
= arrayMember( links
, this );
2030 // parent->breakLink( this, kChildSetIndex, plane );
2035 parent
->detachFromChild( this, plane
);
2042 IORegistryEntry::detachFromChild( IORegistryEntry
* child
,
2043 const IORegistryPlane
* plane
)
2052 breakLink( child
, kChildSetIndex
, plane
);
2054 if ((links
= child
->getParentSetReference( plane
))) {
2055 needChild
= arrayMember( links
, this );
2063 child
->detachFromParent( this, plane
);
2070 IORegistryEntry::detachAbove( const IORegistryPlane
* plane
)
2072 IORegistryEntry
* parent
;
2075 while ((parent
= copyParentEntry( plane
))) {
2076 detachFromParent( parent
, plane
);
2083 IORegistryEntry::detachAll( const IORegistryPlane
* plane
)
2086 IORegistryEntry
* next
;
2087 IORegistryIterator
* regIter
;
2089 regIter
= IORegistryIterator::iterateOver( this, plane
, true );
2090 if (NULL
== regIter
) {
2093 all
= regIter
->iterateAll();
2096 detachAbove( plane
);
2098 while ((next
= (IORegistryEntry
*) all
->getLastObject())) {
2100 all
->removeObject(next
);
2102 next
->detachAbove( plane
);
2110 IORegistryEntry::getDepth( const IORegistryPlane
* plane
) const
2112 unsigned int depth
= 1;
2114 unsigned int oneDepth
, maxParentDepth
, count
;
2115 IORegistryEntry
* one
;
2116 const IORegistryEntry
* next
;
2122 while ((parents
= next
->getParentSetReference( plane
))) {
2123 count
= parents
->getCount();
2129 next
= (IORegistryEntry
*) parents
->getObject( 0 );
2134 (one
= (IORegistryEntry
*) parents
->getObject( index
));
2136 oneDepth
= one
->getDepth( plane
);
2137 if (oneDepth
> maxParentDepth
) {
2138 maxParentDepth
= oneDepth
;
2141 depth
+= maxParentDepth
;
2151 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2154 #define super OSIterator
2156 OSDefineMetaClassAndStructors(IORegistryIterator
, OSIterator
)
2158 enum { kIORegistryIteratorInvalidFlag
= 0x80000000 };
2160 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2162 IORegistryIterator
*
2163 IORegistryIterator::iterateOver( IORegistryEntry
* root
,
2164 const IORegistryPlane
* plane
,
2165 IOOptionBits options
)
2167 IORegistryIterator
* create
;
2172 if (NULL
== plane
) {
2176 create
= new IORegistryIterator
;
2178 if (create
->init()) {
2180 create
->root
= root
;
2181 create
->where
= &create
->start
;
2182 create
->start
.current
= root
;
2183 create
->plane
= plane
;
2184 create
->options
= options
& ~kIORegistryIteratorInvalidFlag
;
2193 IORegistryIterator
*
2194 IORegistryIterator::iterateOver( const IORegistryPlane
* plane
,
2195 IOOptionBits options
)
2197 return iterateOver( gRegistryRoot
, plane
, options
);
2201 IORegistryIterator::isValid( void )
2210 ok
= (0 == (kIORegistryIteratorInvalidFlag
& options
));
2212 while (ok
&& next
) {
2214 ok
= where
->iter
->isValid();
2224 IORegistryIterator::enterEntry( const IORegistryPlane
* enterPlane
)
2229 where
= (IORegCursor
*) IOMalloc( sizeof(IORegCursor
));
2235 where
->current
= prev
->current
;
2241 IORegistryIterator::enterEntry( void )
2243 enterEntry( plane
);
2247 IORegistryIterator::exitEntry( void )
2252 where
->iter
->release();
2254 if (where
->current
) {// && (where != &start))
2255 where
->current
->release();
2259 if (where
!= &start
) {
2262 IOFree( gone
, sizeof(IORegCursor
));
2270 IORegistryIterator::reset( void )
2272 while (exitEntry()) {
2280 where
->current
= root
;
2281 options
&= ~kIORegistryIteratorInvalidFlag
;
2285 IORegistryIterator::free( void )
2298 IORegistryIterator::getNextObjectFlat( void )
2300 IORegistryEntry
* next
= NULL
;
2301 OSArray
* links
= NULL
;
2305 if ((NULL
== where
->iter
)) {
2306 // just entered - create new iter
2309 && (links
= ((options
& kIORegistryIterateParents
) ?
2310 where
->current
->getParentSetReference( plane
) :
2311 where
->current
->getChildSetReference( plane
)))) {
2312 where
->iter
= OSCollectionIterator::withCollection( links
);
2315 // next sibling - release current
2316 if (where
->current
) {
2317 where
->current
->release();
2321 next
= (IORegistryEntry
*) where
->iter
->getNextObject();
2325 } else if (!where
->iter
->isValid()) {
2326 options
|= kIORegistryIteratorInvalidFlag
;
2330 where
->current
= next
;
2338 IORegistryIterator::getNextObjectRecursive( void )
2340 IORegistryEntry
* next
;
2343 next
= getNextObjectFlat();
2344 } while ((NULL
== next
) && exitEntry());
2348 done
= OSOrderedSet::withCapacity( 10 );
2350 if (done
->setObject((OSObject
*) next
)) {
2351 // done set didn't contain this one, so recurse
2359 IORegistryIterator::getNextObject( void )
2361 if (options
& kIORegistryIterateRecursively
) {
2362 return getNextObjectRecursive();
2364 return getNextObjectFlat();
2369 IORegistryIterator::getCurrentEntry( void )
2372 return where
->current
;
2379 IORegistryIterator::iterateAll( void )
2382 while (getNextObjectRecursive()) {
2391 OSMetaClassDefineReservedUnused(IORegistryEntry
, 0);
2392 OSMetaClassDefineReservedUnused(IORegistryEntry
, 1);
2393 OSMetaClassDefineReservedUnused(IORegistryEntry
, 2);
2394 OSMetaClassDefineReservedUnused(IORegistryEntry
, 3);
2395 OSMetaClassDefineReservedUnused(IORegistryEntry
, 4);
2396 OSMetaClassDefineReservedUnused(IORegistryEntry
, 5);
2398 OSMetaClassDefineReservedUsed(IORegistryEntry
, 0);
2399 OSMetaClassDefineReservedUsed(IORegistryEntry
, 1);
2400 OSMetaClassDefineReservedUsed(IORegistryEntry
, 2);
2401 OSMetaClassDefineReservedUsed(IORegistryEntry
, 3);
2402 OSMetaClassDefineReservedUsed(IORegistryEntry
, 4);
2403 OSMetaClassDefineReservedUsed(IORegistryEntry
, 5);
2405 OSMetaClassDefineReservedUnused(IORegistryEntry
, 6);
2406 OSMetaClassDefineReservedUnused(IORegistryEntry
, 7);
2407 OSMetaClassDefineReservedUnused(IORegistryEntry
, 8);
2408 OSMetaClassDefineReservedUnused(IORegistryEntry
, 9);
2409 OSMetaClassDefineReservedUnused(IORegistryEntry
, 10);
2410 OSMetaClassDefineReservedUnused(IORegistryEntry
, 11);
2411 OSMetaClassDefineReservedUnused(IORegistryEntry
, 12);
2412 OSMetaClassDefineReservedUnused(IORegistryEntry
, 13);
2413 OSMetaClassDefineReservedUnused(IORegistryEntry
, 14);
2414 OSMetaClassDefineReservedUnused(IORegistryEntry
, 15);
2415 OSMetaClassDefineReservedUnused(IORegistryEntry
, 16);
2416 OSMetaClassDefineReservedUnused(IORegistryEntry
, 17);
2417 OSMetaClassDefineReservedUnused(IORegistryEntry
, 18);
2418 OSMetaClassDefineReservedUnused(IORegistryEntry
, 19);
2419 OSMetaClassDefineReservedUnused(IORegistryEntry
, 20);
2420 OSMetaClassDefineReservedUnused(IORegistryEntry
, 21);
2421 OSMetaClassDefineReservedUnused(IORegistryEntry
, 22);
2422 OSMetaClassDefineReservedUnused(IORegistryEntry
, 23);
2423 OSMetaClassDefineReservedUnused(IORegistryEntry
, 24);
2424 OSMetaClassDefineReservedUnused(IORegistryEntry
, 25);
2425 OSMetaClassDefineReservedUnused(IORegistryEntry
, 26);
2426 OSMetaClassDefineReservedUnused(IORegistryEntry
, 27);
2427 OSMetaClassDefineReservedUnused(IORegistryEntry
, 28);
2428 OSMetaClassDefineReservedUnused(IORegistryEntry
, 29);
2429 OSMetaClassDefineReservedUnused(IORegistryEntry
, 30);
2430 OSMetaClassDefineReservedUnused(IORegistryEntry
, 31);
2432 /* inline function implementation */
2434 IORegistryEntry::getPropertyTable( void ) const
2436 return fPropertyTable
;