this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at feature/sigprocess 148 lines 5.0 kB view raw
1/* 2 * Copyright (c) 1998-2003 Apple Computer, Inc. All rights reserved. 3 * 4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 * 6 * This file contains Original Code and/or Modifications of Original Code 7 * as defined in and that are subject to the Apple Public Source License 8 * Version 2.0 (the 'License'). You may not use this file except in 9 * compliance with the License. The rights granted to you under the License 10 * may not be used to create, or enable the creation or redistribution of, 11 * unlawful or unlicensed copies of an Apple operating system, or to 12 * circumvent, violate, or enable the circumvention or violation of, any 13 * terms of an Apple operating system software license agreement. 14 * 15 * Please obtain a copy of the License at 16 * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 * 18 * The Original Code and all software distributed under the License are 19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 * Please see the License for the specific language governing rights and 24 * limitations under the License. 25 * 26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 */ 28 29#ifndef __IOKIT_IOMAPPER_H 30#define __IOKIT_IOMAPPER_H 31 32#include <sys/cdefs.h> 33 34__BEGIN_DECLS 35#include <IOKit/IOTypes.h> 36#include <mach/vm_types.h> 37 38// These are C accessors to the system mapper for non-IOKit clients 39ppnum_t IOMapperIOVMAlloc(unsigned pages); 40void IOMapperIOVMFree(ppnum_t addr, unsigned pages); 41ppnum_t IOMapperInsertPage(ppnum_t addr, unsigned offset, ppnum_t page); 42 43__END_DECLS 44 45#if __cplusplus 46 47#include <IOKit/IOService.h> 48#include <IOKit/IOMemoryDescriptor.h> 49#include <IOKit/IODMACommand.h> 50 51class OSData; 52 53extern const OSSymbol * gIOMapperIDKey; 54 55class IOMapper : public IOService 56{ 57 OSDeclareAbstractStructors(IOMapper); 58 59 // Give the platform expert access to setMapperRequired(); 60 friend class IOPlatformExpert; 61 friend class IOMemoryDescriptor; 62 63private: 64 enum SystemMapperState { 65 kNoMapper = 0, 66 kUnknown = 1, 67 kHasMapper = 2, // Any other value is pointer to a live mapper 68 kWaitMask = 3, 69 }; 70protected: 71#ifdef XNU_KERNEL_PRIVATE 72 uint64_t __reservedA[7]; 73 uint32_t __reservedB; 74 uint32_t fPageSize; 75#else 76 uint64_t __reserved[8]; 77#endif 78 bool fIsSystem; 79 80 static void setMapperRequired(bool hasMapper); 81 static void waitForSystemMapper(); 82 83 virtual bool initHardware(IOService *provider) = 0; 84 85public: 86 virtual bool start(IOService *provider) APPLE_KEXT_OVERRIDE; 87 virtual void free() APPLE_KEXT_OVERRIDE; 88 89 // To get access to the system mapper IOMapper::gSystem 90 static IOMapper *gSystem; 91 92 static void checkForSystemMapper() 93 { if ((uintptr_t) gSystem & kWaitMask) waitForSystemMapper(); }; 94 95 static IOMapper * copyMapperForDevice(IOService * device); 96 static IOMapper * copyMapperForDeviceWithIndex(IOService * device, unsigned int index); 97 98 // { subclasses 99 100 virtual uint64_t getPageSize(void) const = 0; 101 102 virtual IOReturn iovmMapMemory(IOMemoryDescriptor * memory, 103 uint64_t descriptorOffset, 104 uint64_t length, 105 uint32_t mapOptions, 106 const IODMAMapSpecification * mapSpecification, 107 IODMACommand * dmaCommand, 108 const IODMAMapPageList * pageList, 109 uint64_t * mapAddress, 110 uint64_t * mapLength) = 0; 111 112 virtual IOReturn iovmUnmapMemory(IOMemoryDescriptor * memory, 113 IODMACommand * dmaCommand, 114 uint64_t mapAddress, 115 uint64_t mapLength) = 0; 116 117 virtual IOReturn iovmInsert(uint32_t options, 118 uint64_t mapAddress, 119 uint64_t offset, 120 uint64_t physicalAddress, 121 uint64_t length) = 0; 122 123 virtual uint64_t mapToPhysicalAddress(uint64_t mappedAddress) = 0; 124 125 // } 126 127private: 128 OSMetaClassDeclareReservedUnused(IOMapper, 0); 129 OSMetaClassDeclareReservedUnused(IOMapper, 1); 130 OSMetaClassDeclareReservedUnused(IOMapper, 2); 131 OSMetaClassDeclareReservedUnused(IOMapper, 3); 132 OSMetaClassDeclareReservedUnused(IOMapper, 4); 133 OSMetaClassDeclareReservedUnused(IOMapper, 5); 134 OSMetaClassDeclareReservedUnused(IOMapper, 6); 135 OSMetaClassDeclareReservedUnused(IOMapper, 7); 136 OSMetaClassDeclareReservedUnused(IOMapper, 8); 137 OSMetaClassDeclareReservedUnused(IOMapper, 9); 138 OSMetaClassDeclareReservedUnused(IOMapper, 10); 139 OSMetaClassDeclareReservedUnused(IOMapper, 11); 140 OSMetaClassDeclareReservedUnused(IOMapper, 12); 141 OSMetaClassDeclareReservedUnused(IOMapper, 13); 142 OSMetaClassDeclareReservedUnused(IOMapper, 14); 143 OSMetaClassDeclareReservedUnused(IOMapper, 15); 144}; 145 146#endif /* __cplusplus */ 147 148#endif /* !__IOKIT_IOMAPPER_H */