]> git.saurik.com Git - apple/xnu.git/blobdiff - iokit/IOKit/IOMapper.h
xnu-2782.10.72.tar.gz
[apple/xnu.git] / iokit / IOKit / IOMapper.h
index 7834c74838c93c59bf16487cb9e1d67cb2bb9fac..784077d9c740109733ece69fb5b1b3b2aec5cf32 100644 (file)
@@ -55,9 +55,12 @@ __END_DECLS
 
 #include <IOKit/IOService.h>
 #include <IOKit/IOMemoryDescriptor.h>
+#include <IOKit/IODMACommand.h>
 
 class OSData;
 
+extern const OSSymbol * gIOMapperIDKey;
+
 class IOMapper : public IOService
 {
     OSDeclareAbstractStructors(IOMapper);
@@ -88,10 +91,8 @@ protected:
     virtual bool allocTable(IOByteCount size);
 
 public:
-#if !(defined(__ppc__) && defined(KPI_10_4_0_PPC_COMPAT))
     virtual bool start(IOService *provider);
     virtual void free();
-#endif
 
     // Static routines capable of allocating tables that are physically
     // contiguous in real memory space.
@@ -111,26 +112,38 @@ public:
                             ppnum_t *pageList, IOItemCount pageCount);
     virtual void iovmInsert(ppnum_t addr, IOItemCount offset,
                             upl_page_info_t *pageList, IOItemCount pageCount);
+
     static void checkForSystemMapper()
-        { if ((vm_address_t) gSystem & kWaitMask) waitForSystemMapper(); };
+        { if ((uintptr_t) gSystem & kWaitMask) waitForSystemMapper(); };
 
+    static IOMapper * copyMapperForDevice(IOService * device);
+    static IOMapper * copyMapperForDeviceWithIndex(IOService * device, unsigned int index);
+
+       
     // Function will panic if the given address is not found in a valid
     // iovm mapping.
     virtual addr64_t mapAddr(IOPhysicalAddress addr) = 0;
 
-#if !(defined(__ppc__) && defined(KPI_10_4_0_PPC_COMPAT))
     // Get the address mask to or into an address to bypass this mapper
-    virtual bool getBypassMask(addr64_t *maskP) const
+    virtual bool getBypassMask(addr64_t *maskP) const;
+
+    virtual ppnum_t iovmAllocDMACommand(IODMACommand * command, IOItemCount pageCount);
+    virtual void iovmFreeDMACommand(IODMACommand * command, ppnum_t addr, IOItemCount pageCount);
+    
+    virtual ppnum_t iovmMapMemory(
+                         OSObject                    * memory,   // dma command or iomd
+                         ppnum_t                       offsetPage,
+                         ppnum_t                       pageCount,
+                         uint32_t                      options,
+                         upl_page_info_t             * pageList,
+                         const IODMAMapSpecification * mapSpecification);
+
     OSMetaClassDeclareReservedUsed(IOMapper, 0);
-#endif
+    OSMetaClassDeclareReservedUsed(IOMapper, 1);
+    OSMetaClassDeclareReservedUsed(IOMapper, 2);
+    OSMetaClassDeclareReservedUsed(IOMapper, 3);
 
 private:
-#if (defined(__ppc__) && defined(KPI_10_4_0_PPC_COMPAT))
-    OSMetaClassDeclareReservedUnused(IOMapper, 0);
-#endif
-    OSMetaClassDeclareReservedUnused(IOMapper, 1);
-    OSMetaClassDeclareReservedUnused(IOMapper, 2);
-    OSMetaClassDeclareReservedUnused(IOMapper, 3);
     OSMetaClassDeclareReservedUnused(IOMapper, 4);
     OSMetaClassDeclareReservedUnused(IOMapper, 5);
     OSMetaClassDeclareReservedUnused(IOMapper, 6);