+OSObject * IORegistryEntry::setIndexedProperty(uint32_t index, OSObject * anObject)
+{
+ OSObject ** array;
+ OSObject * prior;
+
+ if (index >= kIORegistryEntryIndexedPropertyCount) return (0);
+
+ array = atomic_load_explicit(&reserved->fIndexedProperties, memory_order_acquire);
+ if (!array)
+ {
+ array = IONew(OSObject *, kIORegistryEntryIndexedPropertyCount);
+ if (!array) return (0);
+ bzero(array, kIORegistryEntryIndexedPropertyCount * sizeof(array[0]));
+ if (!OSCompareAndSwapPtr(NULL, array, &reserved->fIndexedProperties)) IODelete(array, OSObject *, kIORegistryEntryIndexedPropertyCount);
+ }
+ if (!reserved->fIndexedProperties) return (0);
+
+ prior = reserved->fIndexedProperties[index];
+ if (anObject) anObject->retain();
+ reserved->fIndexedProperties[index] = anObject;
+
+ return (prior);
+}
+
+OSObject * IORegistryEntry::getIndexedProperty(uint32_t index) const
+{
+ if (index >= kIORegistryEntryIndexedPropertyCount) return (0);
+ if (!reserved->fIndexedProperties) return (0);
+
+ return (reserved->fIndexedProperties[index]);
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+