X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/4452a7af2eac33dbad800bcc91f2399d62c18f53..a1c7dba18ef36983396c282fe85292db066e39db:/iokit/IOKit/IOMapper.h diff --git a/iokit/IOKit/IOMapper.h b/iokit/IOKit/IOMapper.h index 7834c7483..784077d9c 100644 --- a/iokit/IOKit/IOMapper.h +++ b/iokit/IOKit/IOMapper.h @@ -55,9 +55,12 @@ __END_DECLS #include #include +#include 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);