]> git.saurik.com Git - apple/xnu.git/blobdiff - iokit/IOKit/IOCatalogue.h
xnu-7195.101.1.tar.gz
[apple/xnu.git] / iokit / IOKit / IOCatalogue.h
index 682625f4302bc35d48da5aaf215b1e4b3fcce366..1dedf566e177f957579f9c0300c710f6aae6c0c0 100644 (file)
@@ -36,6 +36,7 @@
 #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>
@@ -47,8 +48,8 @@
 
 class IOService;
 
-extern const OSSymbol * gIOModuleIdentifierKey;
-extern const OSSymbol * gIOModuleIdentifierKernelKey;
+extern OSPtr<const OSSymbol> gIOModuleIdentifierKey;
+extern OSPtr<const OSSymbol> gIOModuleIdentifierKernelKey;
 
 
 /*!
@@ -63,7 +64,7 @@ class IOCatalogue : public OSObject
 private:
        IORWLock *               lock;
        SInt32                   generation;
-       OSDictionary           * personalities;
+       OSPtr<OSDictionary> personalities;
        OSArray * arrayForPersonality(OSDictionary * dict);
        void addPersonality(OSDictionary * dict);
 
@@ -94,7 +95,7 @@ public:
  *   @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
@@ -103,7 +104,7 @@ public:
  *   @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
@@ -123,6 +124,10 @@ public:
  */
        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.
@@ -138,6 +143,8 @@ public:
  */
        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.
@@ -174,6 +181,13 @@ public:
  *   @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
@@ -227,11 +241,10 @@ private:
        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 */