]> 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 f59b9b0533a80ae1a811254f93533ccba2bfc6a8..784077d9c740109733ece69fb5b1b3b2aec5cf32 100644 (file)
@@ -44,15 +44,23 @@ void IOMapperInsertPPNPages(ppnum_t addr, unsigned offset,
                             ppnum_t *pageList, unsigned pageCount);
 void IOMapperInsertUPLPages(ppnum_t addr, unsigned offset,
                             upl_page_info_t *pageList, unsigned pageCount);
+
+mach_vm_address_t IOMallocPhysical(mach_vm_size_t size, mach_vm_address_t mask);
+
+void IOFreePhysical(mach_vm_address_t address, mach_vm_size_t size);
+
 __END_DECLS
 
 #if __cplusplus
 
 #include <IOKit/IOService.h>
 #include <IOKit/IOMemoryDescriptor.h>
+#include <IOKit/IODMACommand.h>
 
 class OSData;
 
+extern const OSSymbol * gIOMapperIDKey;
+
 class IOMapper : public IOService
 {
     OSDeclareAbstractStructors(IOMapper);
@@ -74,8 +82,6 @@ protected:
     OSData *fTableHandle;
     bool fIsSystem;
 
-    virtual bool start(IOService *provider);
-    virtual void free();
 
     static void setMapperRequired(bool hasMapper);
     static void waitForSystemMapper();
@@ -85,6 +91,9 @@ protected:
     virtual bool allocTable(IOByteCount size);
 
 public:
+    virtual bool start(IOService *provider);
+    virtual void free();
+
     // Static routines capable of allocating tables that are physically
     // contiguous in real memory space.
     static OSData * NewARTTable(IOByteCount size,
@@ -103,18 +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;
 
+    // Get the address mask to or into an address to bypass this mapper
+    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);
+    OSMetaClassDeclareReservedUsed(IOMapper, 1);
+    OSMetaClassDeclareReservedUsed(IOMapper, 2);
+    OSMetaClassDeclareReservedUsed(IOMapper, 3);
+
 private:
-    OSMetaClassDeclareReservedUnused(IOMapper, 0);
-    OSMetaClassDeclareReservedUnused(IOMapper, 1);
-    OSMetaClassDeclareReservedUnused(IOMapper, 2);
-    OSMetaClassDeclareReservedUnused(IOMapper, 3);
     OSMetaClassDeclareReservedUnused(IOMapper, 4);
     OSMetaClassDeclareReservedUnused(IOMapper, 5);
     OSMetaClassDeclareReservedUnused(IOMapper, 6);