#include <IOKit/IOService.h>
#include <IOKit/IOMemoryDescriptor.h>
+#include <IOKit/IODMACommand.h>
class OSData;
+extern const OSSymbol * gIOMapperIDKey;
+
class IOMapper : public IOService
{
OSDeclareAbstractStructors(IOMapper);
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.
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);