class IORegistryPlane : public OSObject {
- friend IORegistryEntry;
+ friend class IORegistryEntry;
OSDeclareAbstractStructors(IORegistryPlane)
if (l->can_sleep && l->want_write) {
l->waiting = TRUE;
thread_sleep_simple_lock((event_t) l,
- simple_lock_addr(l->interlock), FALSE);
- simple_lock(&l->interlock);
+ simple_lock_addr(l->interlock),
+ THREAD_UNINT);
+ /* interlock relocked */
}
}
l->want_write = TRUE;
if (l->can_sleep && (l->read_count != 0 || l->want_upgrade)) {
l->waiting = TRUE;
thread_sleep_simple_lock((event_t) l,
- simple_lock_addr(l->interlock), FALSE);
- simple_lock(&l->interlock);
+ simple_lock_addr(l->interlock),
+ THREAD_UNINT);
+ /* interlock relocked */
}
}
(l->want_upgrade || ((0 == l->read_count) && l->want_write ))) {
l->waiting = TRUE;
thread_sleep_simple_lock((event_t) l,
- simple_lock_addr(l->interlock), FALSE);
- simple_lock(&l->interlock);
+ simple_lock_addr(l->interlock),
+ THREAD_UNINT);
+ /* interlock relocked */
}
}
if( dict) {
dict->retain();
+ if( fPropertyTable)
+ fPropertyTable->release();
fPropertyTable = dict;
- } else {
+ } else if( !fPropertyTable) {
fPropertyTable = OSDictionary::withCapacity( kIORegCapacityIncrement );
if( fPropertyTable)
fPropertyTable->setCapacityIncrement( kIORegCapacityIncrement );
return( false);
#ifdef IOREGSPLITTABLES
- fRegistryTable = OSDictionary::withCapacity( kIORegCapacityIncrement );
- if( fRegistryTable)
- fRegistryTable->setCapacityIncrement( kIORegCapacityIncrement );
+ if( !fRegistryTable) {
+ fRegistryTable = OSDictionary::withCapacity( kIORegCapacityIncrement );
+ if( fRegistryTable)
+ fRegistryTable->setCapacityIncrement( kIORegCapacityIncrement );
+ }
if( (prop = OSDynamicCast( OSString, getProperty( gIONameKey)))) {
OSSymbol * sym = (OSSymbol *)OSSymbol::withString( prop);
/* Wrappers to synchronize property table */
-#define wrap1(func,type,constant) \
+#define wrap1(func, type, constant) \
OSObject * \
IORegistryEntry::func ## Property( type * aKey) constant \
{ \
return( obj ); \
}
-#define wrap2(type,constant) \
+#define wrap2(type, constant) \
OSObject * \
IORegistryEntry::copyProperty( type * aKey) constant \
{ \
OSObject * obj; \
\
PLOCK; \
- obj = getPropertyTable()->getObject( aKey ); \
+ obj = getProperty( aKey ); \
if( obj) \
obj->retain(); \
PUNLOCK; \
IORegistryEntry * fromEntry = 0 )
{
IORegistryEntry * where = 0;
+ IORegistryEntry * aliasEntry = 0;
IORegistryEntry * next;
const char * alias;
const char * end;
if( (alias = dealiasPath( &end, plane))) {
if( length)
len = *length;
- where = IORegistryEntry::fromPath( alias, plane,
+ aliasEntry = IORegistryEntry::fromPath( alias, plane,
opath, &len, fromEntry );
+ where = aliasEntry;
if( where)
path = end;
else
if( where)
where->retain();
+ if( aliasEntry)
+ aliasEntry->release();
UNLOCK;
OSMetaClassDefineReservedUnused(IORegistryEntry, 29);
OSMetaClassDefineReservedUnused(IORegistryEntry, 30);
OSMetaClassDefineReservedUnused(IORegistryEntry, 31);
+
+/* inline function implementation */
+OSDictionary * IORegistryEntry::getPropertyTable( void ) const
+{ return(fPropertyTable); }