#ifndef _IOKIT_IOCATALOGUE_H
#define _IOKIT_IOCATALOGUE_H
+#include <libkern/c++/OSPtr.h>
#include <libkern/c++/OSObject.h>
#include <libkern/c++/OSCollectionIterator.h>
#include <libkern/c++/OSArray.h>
class IOService;
-extern const OSSymbol * gIOModuleIdentifierKey;
-extern const OSSymbol * gIOModuleIdentifierKernelKey;
+extern OSPtr<const OSSymbol> gIOModuleIdentifierKey;
+extern OSPtr<const OSSymbol> gIOModuleIdentifierKernelKey;
/*!
private:
IORWLock * lock;
SInt32 generation;
- OSDictionary * personalities;
+ OSPtr<OSDictionary> personalities;
OSArray * arrayForPersonality(OSDictionary * dict);
void addPersonality(OSDictionary * dict);
* @param generationCount Returns a reference to the generation count of the database. The generation count increases only when personalities are added to the database *and* IOService matching has been initiated.
* @result Returns an ordered set of driver personalities ranked on probe-scores. The ordered set must be released by the receiver.
*/
- OSOrderedSet * findDrivers( IOService * service, SInt32 * generationCount );
+ OSPtr<OSOrderedSet> findDrivers( IOService * service, SInt32 * generationCount );
/*!
* @function findDrivers
* @param generationCount Returns a reference to the current generation of the database. The generation count increases only when personalities are added to the database *and* IOService matching has been initiated.
* @result Returns an ordered set of driver personalities ranked on probe-scores. The ordered set must be released by the receiver.
*/
- OSOrderedSet * findDrivers( OSDictionary * matching, SInt32 * generationCount );
+ OSPtr<OSOrderedSet> findDrivers( OSDictionary * matching, SInt32 * generationCount );
/*!
* @function addDrivers
*/
bool removeDrivers( OSDictionary * matching, bool doNubMatching = true );
+#if XNU_KERNEL_PRIVATE
+ bool removeDrivers(bool doNubMatching, bool (^shouldRemove)(OSDictionary *personality));
+#endif /* XNU_KERNEL_PRIVATE */
+
/*!
* @function getGenerationCount
* @abstract Get the current generation count of the database.
*/
bool isModuleLoaded( OSDictionary * driver, OSObject ** kextRef ) const;
+ bool isModuleLoaded( OSDictionary * driver, OSSharedPtr<OSObject>& kextRef ) const;
+
/*!
* @function moduleHasLoaded
* @abstract Callback function called after a IOKit dependent kernel module is loaded.
* @param unload Flag to cause the actual unloading of the module.
*/
IOReturn terminateDriversForModule( const char * moduleName, bool unload = true);
+#if XNU_KERNEL_PRIVATE
+ IOReturn terminateDrivers(OSDictionary * matching, io_name_t className);
+
+ IOReturn terminateDriversForUserspaceReboot();
+
+ IOReturn resetAfterUserspaceReboot();
+#endif /* XNU_KERNEL_PRIVATE */
/*!
* @function startMatching
IOReturn unloadModule( OSString * moduleName ) const;
IOReturn _removeDrivers(OSDictionary * matching);
- IOReturn _terminateDrivers(OSDictionary * matching);
};
-extern const OSSymbol * gIOClassKey;
-extern const OSSymbol * gIOProbeScoreKey;
-extern IOCatalogue * gIOCatalogue;
+extern OSPtr<const OSSymbol> gIOClassKey;
+extern OSPtr<const OSSymbol> gIOProbeScoreKey;
+extern OSPtr<IOCatalogue> gIOCatalogue;
#endif /* ! _IOKIT_IOCATALOGUE_H */