]>
Commit | Line | Data |
---|---|---|
91447636 A |
1 | /* |
2 | * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. | |
3 | * | |
6601e61a | 4 | * @APPLE_LICENSE_HEADER_START@ |
91447636 | 5 | * |
6601e61a A |
6 | * The contents of this file constitute Original Code as defined in and |
7 | * are subject to the Apple Public Source License Version 1.1 (the | |
8 | * "License"). You may not use this file except in compliance with the | |
9 | * License. Please obtain a copy of the License at | |
10 | * http://www.apple.com/publicsource and read it before using this file. | |
8f6c56a5 | 11 | * |
6601e61a A |
12 | * This Original Code and all software distributed under the License are |
13 | * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
8f6c56a5 A |
14 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
15 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
6601e61a A |
16 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the |
17 | * License for the specific language governing rights and limitations | |
18 | * under the License. | |
8f6c56a5 | 19 | * |
6601e61a | 20 | * @APPLE_LICENSE_HEADER_END@ |
91447636 A |
21 | */ |
22 | ||
23 | ||
24 | #ifndef _IOKIT_KERNELINTERNAL_H | |
25 | #define _IOKIT_KERNELINTERNAL_H | |
26 | ||
27 | #include <sys/cdefs.h> | |
28 | ||
29 | __BEGIN_DECLS | |
30 | ||
31 | #include <vm/pmap.h> | |
32 | #include <mach/memory_object_types.h> | |
33 | #include <device/device_port.h> | |
34 | ||
35 | typedef kern_return_t (*IOIteratePageableMapsCallback)(vm_map_t map, void * ref); | |
36 | ||
37 | void IOLibInit(void); | |
38 | kern_return_t IOIteratePageableMaps(vm_size_t size, | |
39 | IOIteratePageableMapsCallback callback, void * ref); | |
40 | vm_map_t IOPageableMapForAddress( vm_address_t address ); | |
41 | SInt32 OSKernelStackRemaining( void ); | |
42 | ||
0c530ab8 A |
43 | mach_vm_address_t |
44 | IOKernelAllocateContiguous(mach_vm_size_t size, mach_vm_size_t alignment); | |
45 | void | |
46 | IOKernelFreeContiguous(mach_vm_address_t address, mach_vm_size_t size); | |
47 | ||
91447636 A |
48 | extern vm_size_t debug_iomallocpageable_size; |
49 | ||
50 | // osfmk/device/iokit_rpc.c | |
51 | // LP64todo - these need to expand | |
0c530ab8 A |
52 | extern kern_return_t IOMapPages(vm_map_t map, mach_vm_address_t va, mach_vm_address_t pa, |
53 | mach_vm_size_t length, unsigned int options); | |
54 | extern kern_return_t IOUnmapPages(vm_map_t map, mach_vm_address_t va, mach_vm_size_t length); | |
55 | ||
56 | extern kern_return_t IOProtectCacheMode(vm_map_t map, mach_vm_address_t va, | |
57 | mach_vm_size_t length, unsigned int mapFlags); | |
58 | ||
59 | extern ppnum_t IOGetLastPageNumber(void); | |
60 | ||
61 | extern ppnum_t gIOLastPage; | |
91447636 A |
62 | |
63 | /* Physical to physical copy (ints must be disabled) */ | |
64 | extern void bcopy_phys(addr64_t from, addr64_t to, int size); | |
65 | ||
66 | __END_DECLS | |
67 | ||
0c530ab8 A |
68 | // Used for dedicated communications for IODMACommand |
69 | enum { | |
70 | kIOMDWalkSegments = 0x00000001, | |
71 | kIOMDFirstSegment = 0x00000002 | kIOMDWalkSegments, | |
72 | kIOMDGetCharacteristics = 0x00000004, | |
73 | kIOMDLastDMACommandOperation | |
74 | }; | |
75 | struct IOMDDMACharacteristics { | |
76 | UInt64 fLength; | |
77 | UInt32 fSGCount; | |
78 | UInt32 fPages; | |
79 | UInt32 fPageAlign; | |
80 | ppnum_t fHighestPage; | |
81 | IODirection fDirection; | |
82 | UInt8 fIsMapped, fIsPrepared; | |
83 | }; | |
84 | struct IOMDDMAWalkSegmentArgs { | |
85 | UInt64 fOffset; // Input/Output offset | |
86 | UInt64 fIOVMAddr, fLength; // Output variables | |
87 | UInt8 fMapped; // Input Variable, Require mapped IOVMA | |
88 | }; | |
89 | typedef UInt8 IOMDDMAWalkSegmentState[128]; | |
90 | ||
91447636 | 91 | #endif /* ! _IOKIT_KERNELINTERNAL_H */ |