Class IOKitUtilFFM

java.lang.Object
oshi.util.platform.mac.IOKitUtilFFM

public final class IOKitUtilFFM extends Object
  • Method Details

    • getMasterPort

      public static int getMasterPort()
      Gets a pointer to the Mach Master Port.
      Returns:
      The master port.

      Multiple calls to getMasterPort() will not result in leaking ports but it is considered good programming practice to deallocate the port when you are finished with it, using mach_port_deallocate.

    • getRoot

      public static IOKit.IORegistryEntry getRoot()
      Gets the IO Registry root.
      Returns:
      a handle to the IORoot. Callers should release when finished.
    • getMatchingService

      public static IOKit.IOService getMatchingService(String serviceName)
      Opens a the first IOService matching a service name.
      Parameters:
      serviceName - The service name to match
      Returns:
      a handle to an IOService if successful, null if failed. Callers should release when finished.
    • getMatchingService

      public static IOKit.IOService getMatchingService(MemorySegment matchingDictionary)
      Opens a the first IOService matching a dictionary.
      Parameters:
      matchingDictionary - The dictionary to match. This method will consume a reference to the dictionary.
      Returns:
      a handle to an IOService if successful, null if failed. Callers should release when finished.
    • getMatchingServices

      public static IOKit.IOIterator getMatchingServices(String serviceName)
      Convenience method to get IOService objects matching a service name.
      Parameters:
      serviceName - The service name to match
      Returns:
      a handle to an IOIterator if successful, null if failed. Callers should release when finished.
    • getMatchingServices

      public static IOKit.IOIterator getMatchingServices(MemorySegment matchingDictionary)
      Convenience method to get IOService objects matching a dictionary.
      Parameters:
      matchingDictionary - The dictionary to match. This method will consume a reference to the dictionary.
      Returns:
      a handle to an IOIterator if successful, null if failed. Callers should release when finished.
    • getBSDNameMatchingDict

      public static MemorySegment getBSDNameMatchingDict(String bsdName)
      Convenience method to get the IO dictionary matching a bsd name.
      Parameters:
      bsdName - The bsd name of the registry entry
      Returns:
      The dictionary ref if successful, null if failed. Callers should release when finished.